first commit

This commit is contained in:
2026-06-09 18:35:55 -03:00
commit 3581e221d0
448 changed files with 519709 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
export function entityObjectPath(typeName, id) {
const type = encodeURIComponent(typeName);
if (id) {
const entityId = id.includes("/") ? id.split("/").pop() : id;
return `/V2.0/services/data/objects/${type}/${encodeURIComponent(entityId)}`;
}
return `/V2.0/services/data/objects/${type}`;
}
export class EntityObjectsService {
http;
constructor(http) {
this.http = http;
}
get(typeName, id, options) {
const query = {};
if (options?.fields?.length) {
query.fields = options.fields.join(",");
}
return this.http.request(entityObjectPath(typeName, id), {
method: "GET",
query,
});
}
create(typeName, fields) {
return this.http.request(entityObjectPath(typeName), {
method: "PUT",
body: fields,
});
}
update(typeName, id, fields) {
return this.http.request(entityObjectPath(typeName, id), {
method: "POST",
body: fields,
});
}
delete(typeName, id) {
return this.http.request(entityObjectPath(typeName, id), {
method: "DELETE",
});
}
}
//# sourceMappingURL=objects.js.map