@halix/action-sdk 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/lib/cjs/content.js +257 -0
  2. package/lib/cjs/data-crud.js +296 -0
  3. package/lib/cjs/index.js +53 -678
  4. package/lib/cjs/lists.js +175 -0
  5. package/lib/cjs/sdk-general.js +92 -0
  6. package/lib/cjs/types/content.d.ts +119 -0
  7. package/lib/cjs/types/content.d.ts.map +1 -0
  8. package/lib/cjs/types/data-crud.d.ts +156 -0
  9. package/lib/cjs/types/data-crud.d.ts.map +1 -0
  10. package/lib/cjs/types/index.d.ts +8 -578
  11. package/lib/cjs/types/index.d.ts.map +1 -1
  12. package/lib/cjs/types/lists.d.ts +212 -0
  13. package/lib/cjs/types/lists.d.ts.map +1 -0
  14. package/lib/cjs/types/sdk-general.d.ts +263 -0
  15. package/lib/cjs/types/sdk-general.d.ts.map +1 -0
  16. package/lib/cjs/types/utilities.d.ts +73 -0
  17. package/lib/cjs/types/utilities.d.ts.map +1 -0
  18. package/lib/cjs/utilities.js +131 -0
  19. package/lib/esm/content.js +228 -0
  20. package/lib/esm/content.js.map +1 -0
  21. package/lib/esm/data-crud.js +263 -0
  22. package/lib/esm/data-crud.js.map +1 -0
  23. package/lib/esm/index.js.map +1 -1
  24. package/lib/esm/index.mjs +26 -673
  25. package/lib/esm/lists.js +157 -0
  26. package/lib/esm/lists.js.map +1 -0
  27. package/lib/esm/sdk-general.js +138 -0
  28. package/lib/esm/sdk-general.js.map +1 -0
  29. package/lib/esm/types/content.d.ts +118 -0
  30. package/lib/esm/types/data-crud.d.ts +155 -0
  31. package/lib/esm/types/index.d.ts +8 -578
  32. package/lib/esm/types/lists.d.ts +211 -0
  33. package/lib/esm/types/sdk-general.d.ts +262 -0
  34. package/lib/esm/types/utilities.d.ts +72 -0
  35. package/lib/esm/utilities.js +126 -0
  36. package/lib/esm/utilities.js.map +1 -0
  37. package/package.json +12 -1
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ // Halix SDK License v1.0
3
+ // Copyright (c) 2025 halix.io LLC.
4
+ //
5
+ // This source code is licensed for use **only** within applications
6
+ // running on the Halix platform, in accordance with Halix SDK guidelines.
7
+ //
8
+ // Unauthorized use outside the Halix platform is prohibited.
9
+ // Full license terms available in the LICENSE file.
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.sortObjectArray = sortObjectArray;
12
+ exports.compareValues = compareValues;
13
+ exports.getValueFromObject = getValueFromObject;
14
+ exports.debounceFn = debounceFn;
15
+ // ================================================================================
16
+ // UTILITY FUNCTIONS
17
+ // ================================================================================
18
+ /**
19
+ * sortObjectArray is a helper function that sorts the passed array in place by the given
20
+ * attributes. Sorting by nested attributes in the form of a delimited attribute string are
21
+ * supported (e.g., "attribute.nestedAttribute").
22
+ *
23
+ * @param array - The array to sort
24
+ * @param sort - Array of sort field specifications
25
+ * @returns The sorted array
26
+ */
27
+ function sortObjectArray(array, sort) {
28
+ return array.sort((a, b) => {
29
+ let comparison = 0;
30
+ for (let s of sort) {
31
+ let valueA = getValueFromObject(a, s.attributeId);
32
+ let valueB = getValueFromObject(b, s.attributeId);
33
+ comparison = compareValues(valueA, valueB, !!s.descending, !!s.caseInsensitive);
34
+ if (comparison !== 0) {
35
+ break;
36
+ }
37
+ }
38
+ return comparison;
39
+ });
40
+ }
41
+ /**
42
+ * compareValues is a helper function that compares two values for sorting purposes. If the values
43
+ * are strings, the comparison is case-insensitive. If the values are numbers, the comparison is
44
+ * performed numerically.
45
+ *
46
+ * @param valueA - First value to compare
47
+ * @param valueB - Second value to compare
48
+ * @param descending - Whether to sort in descending order
49
+ * @param caseInsensitive - Whether to perform case-insensitive comparison for strings
50
+ *
51
+ * @returns Comparison result (-1, 0, or 1)
52
+ */
53
+ function compareValues(valueA, valueB, descending, caseInsensitive) {
54
+ if (caseInsensitive && (typeof valueA === 'string' || valueA instanceof String)) {
55
+ if (valueA && valueB) {
56
+ let comp = valueA.toLowerCase().localeCompare(valueB.toLowerCase());
57
+ if (descending) {
58
+ comp = comp * -1;
59
+ }
60
+ return comp;
61
+ }
62
+ else if (valueA && !valueB) {
63
+ return -1;
64
+ }
65
+ else if (!valueA && valueB) {
66
+ return 1;
67
+ }
68
+ else {
69
+ return 0;
70
+ }
71
+ }
72
+ else {
73
+ if (valueA < valueB) {
74
+ return (descending ? 1 : -1);
75
+ }
76
+ if (valueA > valueB) {
77
+ return (descending ? -1 : 1);
78
+ }
79
+ }
80
+ return 0;
81
+ }
82
+ /**
83
+ * getValueFromObject is a helper function that extracts a value from an object using a dot-notation
84
+ * path. The path can include relationships. Relationship IDs may include a colon delimiter (e.g.,
85
+ * "accountMember:ownerAccountMemberKey") to specify the key of the related object. This is useful
86
+ * when an element has more than one relationship to the same object type. Otherwise, if only one
87
+ * relationship to the same object type exists, the key may be specified without the relationship ID
88
+ * (e.g., simply, "accountMember").
89
+ *
90
+ * @param object - The object to extract value from
91
+ * @param attribute - The attribute path (e.g., "user.address.city")
92
+ *
93
+ * @returns The extracted value
94
+ */
95
+ function getValueFromObject(object, attribute) {
96
+ let components = attribute.split(".");
97
+ let value = object;
98
+ for (let component of components) {
99
+ if (value) {
100
+ // If a relationship specifies a key, it will be in the format [datatype]:[key]. Otherwise the colon
101
+ // delimiter will not be present.
102
+ // The related value will be in a field named after the key. For example: accountMember:ownerAccountMemberKey
103
+ // the related owner account member will be in a field called "ownerAccountMember".
104
+ let compSplit = component.split(":");
105
+ if (compSplit.length > 1) {
106
+ let keyField = compSplit[1];
107
+ value = value[keyField.replace("Key", "")];
108
+ }
109
+ else {
110
+ value = value[component];
111
+ }
112
+ }
113
+ }
114
+ return value;
115
+ }
116
+ /**
117
+ * debounceFn is a utility function that debounces a function call. It is used to prevent multiple
118
+ * calls to the same function within a short period of time.
119
+ *
120
+ * @param fn - The function to debounce
121
+ * @param wait - The number of milliseconds to wait before calling the function
122
+ *
123
+ * @returns The debounced function
124
+ */
125
+ function debounceFn(fn, wait = 200) {
126
+ let timeout;
127
+ return (...args) => {
128
+ clearTimeout(timeout);
129
+ timeout = setTimeout(() => fn(...args), wait);
130
+ };
131
+ }
@@ -0,0 +1,228 @@
1
+ // Halix SDK License v1.0
2
+ // Copyright (c) 2025 halix.io LLC.
3
+ //
4
+ // This source code is licensed for use **only** within applications
5
+ // running on the Halix platform, in accordance with Halix SDK guidelines.
6
+ //
7
+ // Unauthorized use outside the Halix platform is prohibited.
8
+ // Full license terms available in the LICENSE file.
9
+ /**
10
+ * @module @halix/action-sdk/content
11
+ * @description Content resource management functions for the Halix Platform action SDK. This module
12
+ * handles file uploads, content resources, and file storage operations.
13
+ *
14
+ * Key features:
15
+ * - Retrieve content resources (images, documents, etc.)
16
+ * - Upload/save content resources (images, documents, etc.)
17
+ */
18
+ import axios from 'axios';
19
+ import { from, lastValueFrom } from 'rxjs';
20
+ import { sandboxKey, serviceAddress, getAuthToken, userContext } from './sdk-general';
21
+ // ================================================================================
22
+ // CONTENT RESOURCE FUNCTIONS
23
+ // ================================================================================
24
+ /**
25
+ * getOrCreateResource retrieves an existing content resource by its key, or creates a new one
26
+ * if the key is not provided. If a resource key is provided, it attempts to fetch the existing
27
+ * resource from the server. If no key is provided, it creates a new resource with the specified
28
+ * properties.
29
+ *
30
+ * @param resourceKey - Optional key of the existing resource to retrieve
31
+ * @param fileToUpload - Optional file or blob to upload
32
+ * @param publicFlag - Whether the resource should be public
33
+ * @param resourceType - The type of resource
34
+ * @param tags - Array of tags for the resource
35
+ *
36
+ * @returns Promise resolving to a ContentResource
37
+ */
38
+ export async function getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
39
+ if (!userContext) {
40
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
41
+ }
42
+ if (resourceKey) {
43
+ let url = `${serviceAddress}/sandboxes/${sandboxKey}/contentResource/${resourceKey}`;
44
+ let authToken = await lastValueFrom(getAuthToken());
45
+ console.log("Sending GET request to " + url + " with token " + authToken);
46
+ let response = await axios.get(url, {
47
+ headers: { "Authorization": `Bearer ${authToken}` },
48
+ });
49
+ let resource = response.data;
50
+ if (fileToUpload) {
51
+ resource.contentType = fileToUpload.type;
52
+ // Null out the name and extension; the server will set these if they are blank
53
+ resource.name = null;
54
+ resource.extension = null;
55
+ }
56
+ return resource;
57
+ }
58
+ let newResource = {
59
+ isPublic: publicFlag,
60
+ resourceType: resourceType,
61
+ tags: tags,
62
+ organizationKey: userContext.orgKey,
63
+ sandboxKey: sandboxKey,
64
+ userKey: userContext.user.objKey
65
+ };
66
+ if (fileToUpload) {
67
+ newResource.contentType = fileToUpload.type;
68
+ // Null out the name and extension; the server will set these if they are blank
69
+ newResource.name = null;
70
+ newResource.extension = null;
71
+ }
72
+ return newResource;
73
+ }
74
+ /**
75
+ * getOrCreateResourceAsObservable retrieves an existing content resource by its key, or creates a new one
76
+ * if the key is not provided. If a resource key is provided, it attempts to fetch the existing
77
+ * resource from the server. If no key is provided, it creates a new resource with the specified
78
+ * properties.
79
+ *
80
+ * @param resourceKey - Optional key of the existing resource to retrieve
81
+ * @param fileToUpload - Optional file or blob to upload
82
+ * @param publicFlag - Whether the resource should be public
83
+ * @param resourceType - The type of resource
84
+ * @param tags - Array of tags for the resource
85
+ *
86
+ * @returns Observable resolving to a ContentResource
87
+ */
88
+ export function getOrCreateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
89
+ return from(getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
90
+ }
91
+ /**
92
+ * saveResource saves a content resource to the server. The resource is saved with appropriate
93
+ * ownership parameters based on the current context (solution builder vs regular organization view).
94
+ *
95
+ * @param resource - The ContentResource to save
96
+ *
97
+ * @returns Promise resolving to the saved ContentResource
98
+ */
99
+ export async function saveResource(resource) {
100
+ if (!userContext) {
101
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
102
+ }
103
+ let params = {};
104
+ if (userContext.orgProxy.objType === "Solution") {
105
+ // When in the solution builder view, content is owned by the solution. The solution key is the org proxy key in
106
+ // the builder view.
107
+ params.solutionKey = userContext.orgProxyKey;
108
+ }
109
+ else {
110
+ params.organizationKey = userContext.orgKey;
111
+ params.userKey = userContext.user.objKey;
112
+ }
113
+ let url = `${serviceAddress}/sandboxes/${sandboxKey}/contentResource`;
114
+ let authToken = await lastValueFrom(getAuthToken());
115
+ console.log("Sending POST request to " + url + " with token " + authToken);
116
+ let response = await axios.post(url, JSON.stringify(resource), {
117
+ headers: { "Authorization": `Bearer ${authToken}` },
118
+ params: params,
119
+ });
120
+ return response.data;
121
+ }
122
+ /**
123
+ * saveResourceAsObservable saves a content resource to the server. The resource is saved with appropriate
124
+ * ownership parameters based on the current context (solution builder vs regular organization view).
125
+ *
126
+ * @param resource - The ContentResource to save
127
+ *
128
+ * @returns Observable resolving to the saved ContentResource
129
+ */
130
+ export function saveResourceAsObservable(resource) {
131
+ return from(saveResource(resource));
132
+ }
133
+ /**
134
+ * sendFileContents uploads file contents to the server for a specific resource. The file is uploaded
135
+ * via FormData with the appropriate scope and public flag settings.
136
+ *
137
+ * @param resourceKey - The key of the resource to upload file contents for
138
+ * @param fileToUpload - The file or blob to upload
139
+ * @param publicFlag - Whether the file should be public
140
+ *
141
+ * @returns Promise resolving to true if upload was successful
142
+ */
143
+ export async function sendFileContents(resourceKey, fileToUpload, publicFlag) {
144
+ if (!userContext) {
145
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
146
+ }
147
+ let url = `${serviceAddress}/filecontent/${sandboxKey}/${resourceKey}`;
148
+ let authToken = await lastValueFrom(getAuthToken());
149
+ console.log("Sending file upload request to " + url + " with token " + authToken);
150
+ let formData = new FormData();
151
+ formData.append("fileUpload", fileToUpload);
152
+ formData.append("scopeKeyPath", userContext.orgProxyKey);
153
+ formData.append("public", String(publicFlag));
154
+ let response = await axios.post(url, formData, {
155
+ headers: {
156
+ "Authorization": `Bearer ${authToken}`,
157
+ "Content-Type": "multipart/form-data"
158
+ },
159
+ });
160
+ return response.status === 204;
161
+ }
162
+ /**
163
+ * sendFileContentsAsObservable uploads file contents to the server for a specific resource. The file is uploaded
164
+ * via FormData with the appropriate scope and public flag settings.
165
+ *
166
+ * @param resourceKey - The key of the resource to upload file contents for
167
+ * @param fileToUpload - The file or blob to upload
168
+ * @param publicFlag - Whether the file should be public
169
+ *
170
+ * @returns Observable resolving to true if upload was successful
171
+ */
172
+ export function sendFileContentsAsObservable(resourceKey, fileToUpload, publicFlag) {
173
+ return from(sendFileContents(resourceKey, fileToUpload, publicFlag));
174
+ }
175
+ /**
176
+ * createOrUpdateResource creates a new content resource or updates an existing one, then uploads
177
+ * the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
178
+ * otherwise, it creates a new resource and uploads the file to the newly created resource.
179
+ *
180
+ * @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
181
+ * @param fileToUpload - The file or blob to upload
182
+ * @param publicFlag - Whether the resource should be public
183
+ * @param resourceType - The type of resource
184
+ * @param tags - Array of tags for the resource
185
+ *
186
+ * @returns Promise resolving to the ContentResource with uploaded file
187
+ */
188
+ export async function createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
189
+ if (!userContext) {
190
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
191
+ }
192
+ // Get or create the resource
193
+ let resource = await getOrCreateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags);
194
+ // Save the resource to get the objKey if it's new
195
+ let savedResource = await saveResource(resource);
196
+ // Upload the file contents
197
+ if (!savedResource.objKey) {
198
+ throw new Error("Resource was saved but no objKey was returned");
199
+ }
200
+ let uploadSuccess = await sendFileContents(savedResource.objKey, fileToUpload, publicFlag);
201
+ if (!uploadSuccess) {
202
+ throw new Error("Failed to upload file contents");
203
+ }
204
+ // Get the updated resource with file metadata
205
+ let updatedResource = await getOrCreateResource(savedResource.objKey, fileToUpload, publicFlag, resourceType, []);
206
+ // Set the name if it's not set and we have a File with a name
207
+ if (updatedResource && !updatedResource.name && fileToUpload instanceof File) {
208
+ updatedResource.name = fileToUpload.name;
209
+ }
210
+ return updatedResource;
211
+ }
212
+ /**
213
+ * createOrUpdateResourceAsObservable creates a new content resource or updates an existing one, then uploads
214
+ * the file contents to that resource. If a resourceKey is provided, it updates the existing resource;
215
+ * otherwise, it creates a new resource and uploads the file to the newly created resource.
216
+ *
217
+ * @param resourceKey - Optional key of the existing resource to update; if not provided, a new resource is created
218
+ * @param fileToUpload - The file or blob to upload
219
+ * @param publicFlag - Whether the resource should be public
220
+ * @param resourceType - The type of resource
221
+ * @param tags - Array of tags for the resource
222
+ *
223
+ * @returns Observable resolving to the ContentResource with uploaded file
224
+ */
225
+ export function createOrUpdateResourceAsObservable(resourceKey, fileToUpload, publicFlag, resourceType, tags) {
226
+ return from(createOrUpdateResource(resourceKey, fileToUpload, publicFlag, resourceType, tags));
227
+ }
228
+ //# sourceMappingURL=content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/content.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,mCAAmC;AACnC,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,EAAE;AACF,6DAA6D;AAC7D,oDAAoD;AAEpD;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAc,aAAa,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA0BtF,mFAAmF;AACnF,6BAA6B;AAC7B,mFAAmF;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,WAA0B,EAAE,YAAgC,EAAE,UAAmB,EAAE,YAAoB,EAAE,IAAc;IAE7J,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAC;IACrH,CAAC;IAED,IAAI,WAAW,EAAE,CA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CAAC"}
@@ -0,0 +1,263 @@
1
+ // Halix SDK License v1.0
2
+ // Copyright (c) 2025 halix.io LLC.
3
+ //
4
+ // This source code is licensed for use **only** within applications
5
+ // running on the Halix platform, in accordance with Halix SDK guidelines.
6
+ //
7
+ // Unauthorized use outside the Halix platform is prohibited.
8
+ // Full license terms available in the LICENSE file.
9
+ /**
10
+ * @module @halix/action-sdk/data-crud
11
+ * @description Data CRUD operations for the Halix Platform action SDK. This module provides functions
12
+ * for creating, reading, updating, and deleting data objects through the Halix data service API.
13
+ *
14
+ * Key features:
15
+ * - Retrieve one object a time
16
+ * - Retrieve all objects related to a parent object
17
+ * - Save a single object
18
+ * - Delete a single or multiple objects
19
+ */
20
+ import axios from 'axios';
21
+ import { from, lastValueFrom } from 'rxjs';
22
+ import { sandboxKey, serviceAddress, getAuthToken, userContext } from './sdk-general';
23
+ // ================================================================================
24
+ // DATA RETRIEVAL FUNCTIONS
25
+ // ================================================================================
26
+ /**
27
+ * getObject retrieves a single object from the database by its data element ID and key.
28
+ *
29
+ * @param dataElementId - The ID of the data element
30
+ * @param key - The key of the object
31
+ * @param fetchedRelationships - Optional array of relationships to fetch; if provided, the returned
32
+ * object will include the specified related objects as nested objects
33
+ * @returns Promise resolving to the object data
34
+ */
35
+ export async function getObject(dataElementId, key, fetchedRelationships) {
36
+ let params;
37
+ if (fetchedRelationships) {
38
+ let p = {};
39
+ if (fetchedRelationships) {
40
+ p.fetchedRelationships = fetchedRelationships.join(",");
41
+ }
42
+ params = new URLSearchParams(p);
43
+ }
44
+ let url = `${serviceAddress}/schema/sandboxes/${sandboxKey}/${dataElementId}/${key}`;
45
+ let authToken = await lastValueFrom(getAuthToken());
46
+ console.log("Sending GET request to " + url + " with token " + authToken);
47
+ let response = await axios.get(url, {
48
+ headers: { "Authorization": `Bearer ${authToken}` },
49
+ params: params,
50
+ });
51
+ return response.data;
52
+ }
53
+ /**
54
+ * getObjectAsObservable retrieves a single object from the database by its data element ID and key.
55
+ *
56
+ * @param dataElementId - The ID of the data element
57
+ * @param key - The key of the object
58
+ * @param fetchedRelationships - Optional array of relationships to fetch; if provided, the returned
59
+ * object will include the specified related objects as nested objects
60
+ *
61
+ * @returns Observable resolving to the object data
62
+ */
63
+ export function getObjectAsObservable(dataElementId, key, fetchedRelationships) {
64
+ return from(getObject(dataElementId, key, fetchedRelationships));
65
+ }
66
+ /**
67
+ * getRelatedObjects retrieves an array of objects from the the database. The objects returned are
68
+ * related to a parent through a defined relationship in the schema. In a typical setup, action's
69
+ * auth token must have scope access to the parent object in order to access all of its related
70
+ * objects.
71
+ *
72
+ * It is common to use getRelatedObjects to retrieve all objects belonging to the current user proxy
73
+ * or organization proxy. For example, in a user context where the current user proxy element is
74
+ * "customer," an action might want to retrieve all "purchase" objects related to the current
75
+ * customer. Similarly, in an organization context where the current organization proxy is
76
+ * "business," an action might want to retrieve all "employee" objects related to the current
77
+ * business.
78
+ *
79
+ * @param parentElementId - The ID of the parent element
80
+ * @param parentKey - The key of the parent object
81
+ * @param elementId - The ID of the element
82
+ * @param filter - Optional filter criteria for the query; if not provided, all related objects will
83
+ * be returned
84
+ * @param fetchedRelationships - Optional array of relationships to fetch; if provided, the returned
85
+ * objects will include the specified related objects as nested objects
86
+ *
87
+ * @returns Promise resolving to an array of objects
88
+ */
89
+ export async function getRelatedObjects(parentElementId, parentKey, elementId, filter, fetchedRelationships) {
90
+ let params;
91
+ if (filter || fetchedRelationships) {
92
+ let p = {};
93
+ if (filter) {
94
+ p.filter = filter;
95
+ }
96
+ if (fetchedRelationships) {
97
+ p.fetchedRelationships = fetchedRelationships.join(",");
98
+ }
99
+ params = new URLSearchParams(p);
100
+ }
101
+ let url = `${serviceAddress}/schema/sandboxes/${sandboxKey}/${parentElementId}/${parentKey}/${elementId}`;
102
+ let authToken = await lastValueFrom(getAuthToken());
103
+ console.log("Sending GET request to " + url + " with token " + authToken);
104
+ let response = await axios.get(url, {
105
+ headers: { "Authorization": `Bearer ${authToken}` },
106
+ params: params,
107
+ });
108
+ return response.data;
109
+ }
110
+ /**
111
+ * getRelatedObjectsAsObservable retrieves an array of objects from the the database. The objects
112
+ * returned are related to a parent through a defined relationship in the schema. In a typical
113
+ * setup, action's auth token must have scope access to the parent object in order to access all of
114
+ * its related objects.
115
+ *
116
+ * It is common to use getRelatedObjects to retrieve all objects belonging to the current user proxy
117
+ * or organization proxy. For example, in a user context where the current user proxy element is
118
+ * "customer," an action might want to retrieve all "purchase" objects related to the current
119
+ * customer. Similarly, in an organization context where the current organization proxy is
120
+ * "business," an action might want to retrieve all "employee" objects related to the current
121
+ * business.
122
+ *
123
+ * @param parentElementId - The ID of the parent element
124
+ * @param parentKey - The key of the parent element
125
+ * @param elementId - The ID of the element
126
+ * @param filter - Optional filter criteria for the query; if not provided, all related objects will
127
+ * be returned
128
+ * @param fetchedRelationships - Optional array of relationships to fetch; if provided, the returned
129
+ * objects will include the specified related objects as nested objects
130
+ *
131
+ * @returns Observable resolving to an array of objects
132
+ */
133
+ export function getRelatedObjectsAsObservable(parentElementId, parentKey, elementId, filter, fetchedRelationships) {
134
+ return from(getRelatedObjects(parentElementId, parentKey, elementId, filter, fetchedRelationships));
135
+ }
136
+ // ================================================================================
137
+ // DATA SAVE FUNCTIONS
138
+ // ================================================================================
139
+ /**
140
+ * saveRelatedObject saves a related object to the database. The objectToSave is saved, and its
141
+ * relationship to the parent object is established based on the relationship specified in the
142
+ * schema. The objectToSave must have a relationship to the parent object and the user must have
143
+ * scope access to the parent object.
144
+ *
145
+ * @param parentElementId - The ID of the parent element
146
+ * @param parentKey - The key of the parent object
147
+ * @param elementId - The element ID of the object to save
148
+ * @param objectToSave - The object data to save (as a JSON string)
149
+ * @param opts - Optional save options
150
+ *
151
+ * @returns Promise resolving to saved object, including any updates made to the object during the
152
+ * save operation (such as assigning an objKey if the object is new), or the assignment of
153
+ * calculated values
154
+ */
155
+ export async function saveRelatedObject(parentElementId, parentKey, elementId, objectToSave, opts) {
156
+ let url = `${serviceAddress}/schema/sandboxes/${sandboxKey}/${parentElementId}/${parentKey}/${elementId}`;
157
+ if (opts?.bypassValidation === false) {
158
+ url += "?bypassValidation=false";
159
+ }
160
+ else {
161
+ url += "?bypassValidation=true";
162
+ }
163
+ let authToken = await lastValueFrom(getAuthToken());
164
+ console.log("Sending POST request to " + url + " with token " + authToken);
165
+ let response = await axios.post(url, objectToSave, {
166
+ headers: { "Authorization": `Bearer ${authToken}` },
167
+ });
168
+ return response.data;
169
+ }
170
+ /**
171
+ * saveRelatedObjectAsObservable saves a related object to the database. The objectToSave is saved,
172
+ * and its relationship to the parent object is established based on the relationship specified in
173
+ * the schema. The objectToSave must have a relationship to the parent object and the user must have
174
+ * scope access to the parent object.
175
+ *
176
+ * @param parentElementId - The ID of the parent element
177
+ * @param parentKey - The key of the parent object
178
+ * @param elementId - The element ID of the object to save
179
+ * @param objectToSave - The object data to save (as a JSON string)
180
+ * @param opts - Optional save options
181
+ *
182
+ * @returns Observable resolving to saved object, including any updates made to the object during
183
+ * the save operation (such as assigning an objKey if the object is new), or the assignment of
184
+ * calculated values
185
+ */
186
+ export function saveRelatedObjectAsObservable(parentElementId, parentKey, elementId, objectToSave, opts) {
187
+ return from(saveRelatedObject(parentElementId, parentKey, elementId, objectToSave, opts));
188
+ }
189
+ // ================================================================================
190
+ // DATA DELETE FUNCTIONS
191
+ // ================================================================================
192
+ /**
193
+ * deleteRelatedObject deletes a single object related to a specific parent.
194
+ *
195
+ * @param parentElementId - The ID of the parent element
196
+ * @param parentKey - The key of the parent object
197
+ * @param childElementId - The ID of the child element to delete
198
+ * @param childKey - The key of the child object to delete
199
+ *
200
+ * @returns Promise resolving to true if deletion was successful
201
+ */
202
+ export async function deleteRelatedObject(parentElementId, parentKey, childElementId, childKey) {
203
+ if (!userContext) {
204
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
205
+ }
206
+ let url = `${serviceAddress}/schema/sandboxes/${sandboxKey}/${parentElementId}/${parentKey}/${childElementId}/${childKey}`;
207
+ let authToken = await lastValueFrom(getAuthToken());
208
+ console.log("Sending DELETE request to " + url + " with token " + authToken);
209
+ let response = await axios.delete(url, {
210
+ headers: { "Authorization": `Bearer ${authToken}` },
211
+ });
212
+ return response.status === 204;
213
+ }
214
+ /**
215
+ * deleteRelatedObjectAsObservable deletes a single object related to a specific parent.
216
+ *
217
+ * @param parentElementId - The ID of the parent element
218
+ * @param parentKey - The key of the parent object
219
+ * @param childElementId - The ID of the child element to delete
220
+ * @param childKey - The key of the child object to delete
221
+ *
222
+ * @returns Observable resolving to true if deletion was successful
223
+ */
224
+ export function deleteRelatedObjectAsObservable(parentElementId, parentKey, childElementId, childKey) {
225
+ return from(deleteRelatedObject(parentElementId, parentKey, childElementId, childKey));
226
+ }
227
+ /**
228
+ * deleteRelatedObjects deletes multiple objects related to a specific parent.
229
+ *
230
+ * @param parentElementId - The ID of the parent element
231
+ * @param parentKey - The key of the parent object
232
+ * @param childElementId - The ID of the child element to delete
233
+ * @param childKeys - Array of keys of the child objects to delete
234
+ *
235
+ * @returns Promise resolving to true if deletion was successful
236
+ */
237
+ export async function deleteRelatedObjects(parentElementId, parentKey, childElementId, childKeys) {
238
+ if (!userContext) {
239
+ throw new Error("userContext is required but not available; check that the initialize function has been called");
240
+ }
241
+ let url = `${serviceAddress}/schema/sandboxes/${sandboxKey}/${parentElementId}/${parentKey}/${childElementId}`;
242
+ let authToken = await lastValueFrom(getAuthToken());
243
+ console.log("Sending DELETE request to " + url + " with token " + authToken);
244
+ let response = await axios.delete(url, {
245
+ headers: { "Authorization": `Bearer ${authToken}` },
246
+ params: { keys: childKeys.join(",") },
247
+ });
248
+ return response.status === 204;
249
+ }
250
+ /**
251
+ * deleteRelatedObjectsAsObservable deletes multiple objects related to a specific parent.
252
+ *
253
+ * @param parentElementId - The ID of the parent element
254
+ * @param parentKey - The key of the parent object
255
+ * @param childElementId - The ID of the child element to delete
256
+ * @param childKeys - Array of keys of the child objects to delete
257
+ *
258
+ * @returns Observable resolving to true if deletion was successful
259
+ */
260
+ export function deleteRelatedObjectsAsObservable(parentElementId, parentKey, childElementId, childKeys) {
261
+ return from(deleteRelatedObjects(parentElementId, parentKey, childElementId, childKeys));
262
+ }
263
+ //# sourceMappingURL=data-crud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-crud.js","sourceRoot":"","sources":["../../src/data-crud.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,mCAAmC;AACnC,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,EAAE;AACF,6DAA6D;AAC7D,oDAAoD;AAEpD;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAc,aAAa,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AActF,mFAAmF;AACnF,2BAA2B;AAC3B,mFAAmF;AAEnF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,aAAqB,EAAE,GAAW,EAAE,oBAA+B;IAE/F,IAAI,MAAM,CAAC;IACX,IAAI,oBAAoB,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,oBAAoB,EAAE,CAAC;YACjB,CAAE,CAAC,oBAAoB,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnE,CAAC;QAED,MAAM,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,GAAG,GAAG,GAAG,cAAc,qBAAqB,UAAU,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;IAErF,IAAI,SAAS,GAAG,MAAM,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,GAAG,GAAG,cAAc,GAAG,SAAS,CAAC,CAAC;IAE1E,IAAI,QAAQ,GAAG,MAAM,KAAK,CAA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