@halix/action-sdk 1.0.51 → 1.0.53
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.
- package/lib/cjs/data-aggregate.js +27 -2
- package/lib/cjs/data-crud.js +30 -12
- package/lib/cjs/filter-expression.js +10 -0
- package/lib/cjs/index.js +10 -1
- package/lib/cjs/invoices.js +70 -0
- package/lib/cjs/lists.js +74 -15
- package/lib/cjs/types/data-aggregate.d.ts +20 -10
- package/lib/cjs/types/data-aggregate.d.ts.map +1 -1
- package/lib/cjs/types/data-crud.d.ts +10 -9
- package/lib/cjs/types/data-crud.d.ts.map +1 -1
- package/lib/cjs/types/filter-expression.d.ts +22 -0
- package/lib/cjs/types/filter-expression.d.ts.map +1 -0
- package/lib/cjs/types/index.d.ts +2 -0
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/invoices.d.ts +72 -0
- package/lib/cjs/types/invoices.d.ts.map +1 -0
- package/lib/cjs/types/lists.d.ts +80 -29
- package/lib/cjs/types/lists.d.ts.map +1 -1
- package/lib/cjs/types/sdk-general.d.ts +25 -0
- package/lib/cjs/types/sdk-general.d.ts.map +1 -1
- package/lib/esm/data-aggregate.js +23 -2
- package/lib/esm/data-aggregate.js.map +1 -1
- package/lib/esm/data-crud.js +30 -12
- package/lib/esm/data-crud.js.map +1 -1
- package/lib/esm/filter-expression.js +10 -0
- package/lib/esm/filter-expression.js.map +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.mjs +4 -0
- package/lib/esm/invoices.js +43 -0
- package/lib/esm/invoices.js.map +1 -0
- package/lib/esm/lists.js +72 -15
- package/lib/esm/lists.js.map +1 -1
- package/lib/esm/sdk-general.js.map +1 -1
- package/lib/esm/types/data-aggregate.d.ts +20 -10
- package/lib/esm/types/data-crud.d.ts +10 -9
- package/lib/esm/types/filter-expression.d.ts +21 -0
- package/lib/esm/types/index.d.ts +2 -0
- package/lib/esm/types/invoices.d.ts +71 -0
- package/lib/esm/types/lists.d.ts +80 -29
- package/lib/esm/types/sdk-general.d.ts +25 -0
- package/package.json +1 -1
|
@@ -16,6 +16,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
20
|
+
var t = {};
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
24
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
26
|
+
t[p[i]] = s[p[i]];
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
19
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
32
|
};
|
|
@@ -223,6 +234,11 @@ exports.AggregationResponse = AggregationResponse;
|
|
|
223
234
|
* }, {
|
|
224
235
|
* aggregation: 'Sum',
|
|
225
236
|
* aggregationField: 'totalAmount'
|
|
237
|
+
* }],
|
|
238
|
+
* sort: [{
|
|
239
|
+
* attributeId: 'totalAmount',
|
|
240
|
+
* descending: true,
|
|
241
|
+
* sortAggregation: 'Sum'
|
|
226
242
|
* }]
|
|
227
243
|
* });
|
|
228
244
|
*
|
|
@@ -248,11 +264,20 @@ function getAggregateData(request) {
|
|
|
248
264
|
Authorization: `Bearer ${authToken}`
|
|
249
265
|
};
|
|
250
266
|
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
251
|
-
// Make the API request
|
|
252
|
-
|
|
267
|
+
// Make the API request. The public SDK sort shape is
|
|
268
|
+
// { attributeId, descending }; the aggregate endpoint still expects
|
|
269
|
+
// { sortField, sortDirection }, so translate at the boundary.
|
|
270
|
+
let response = yield axios_1.default.post(url, toAggregateDataServiceRequest(request), { headers });
|
|
253
271
|
return new AggregationResponse(response.data.data);
|
|
254
272
|
});
|
|
255
273
|
}
|
|
274
|
+
function toAggregateDataServiceRequest(request) {
|
|
275
|
+
const { sort } = request, rest = __rest(request, ["sort"]);
|
|
276
|
+
if (!sort) {
|
|
277
|
+
return rest;
|
|
278
|
+
}
|
|
279
|
+
return Object.assign(Object.assign({}, rest), { sort: sort.map((sortItem) => (Object.assign({ sortField: sortItem.attributeId, sortDirection: sortItem.descending ? 'desc' : 'asc' }, (sortItem.sortAggregation ? { sortAggregation: sortItem.sortAggregation } : {})))) });
|
|
280
|
+
}
|
|
256
281
|
/**
|
|
257
282
|
* Observable version of getAggregateData. See getAggregateData for details.
|
|
258
283
|
*
|
package/lib/cjs/data-crud.js
CHANGED
|
@@ -42,7 +42,6 @@ exports.deleteRelatedObjectsAsObservable = deleteRelatedObjectsAsObservable;
|
|
|
42
42
|
* @module @halix/action-sdk/data-crud
|
|
43
43
|
* @description Data CRUD operations for the Halix Platform action SDK. This module provides functions
|
|
44
44
|
* for creating, reading, updating, and deleting data objects through the Halix data service API.
|
|
45
|
-
* Note: for list-like displays, the `lists` module is preferred.
|
|
46
45
|
*
|
|
47
46
|
* Key features:
|
|
48
47
|
* - Retrieve one object a time
|
|
@@ -52,44 +51,63 @@ exports.deleteRelatedObjectsAsObservable = deleteRelatedObjectsAsObservable;
|
|
|
52
51
|
*
|
|
53
52
|
* @usage
|
|
54
53
|
* ## When to Use
|
|
55
|
-
* - **
|
|
54
|
+
* - **Filtered accessible-record reads without list behavior** → `getAccessibleObjects`
|
|
55
|
+
* - **Naturally small reference/dimension sets** → unfiltered `getAccessibleObjects`
|
|
56
56
|
* - **Read specific accessible objects by key list** → `getObjects`
|
|
57
57
|
* - **Get single object by key** → `getObject`
|
|
58
|
-
* - **
|
|
58
|
+
* - **Fetch a known parent's child records** → `getRelatedObjects`
|
|
59
59
|
* - **Create/update single object** → `saveObject`
|
|
60
60
|
* - **Delete single object** → `deleteObject`
|
|
61
61
|
*
|
|
62
|
+
* ## Record Retrieval Decision
|
|
63
|
+
* - Use `getAggregateData` from the data-aggregate module for counts, sums, rankings, and grouped metrics.
|
|
64
|
+
* - Use filtered `getAccessibleObjects` for bounded record reads that do not need list pagination,
|
|
65
|
+
* totals, sort, or projection.
|
|
66
|
+
* - Use unfiltered `getAccessibleObjects` only for naturally small reference/dimension sets.
|
|
67
|
+
* - Use `getRelatedObjects` when the component already has a concrete parent key and is fetching
|
|
68
|
+
* that parent's children.
|
|
69
|
+
* - Use `getListData` from the lists module for paged list UIs and list-management workflows.
|
|
70
|
+
*
|
|
62
71
|
* ## When NOT to Use
|
|
63
|
-
* - **
|
|
72
|
+
* - **High-cardinality report reads without a narrowing filter**
|
|
73
|
+
* - **Paged list UI pagination, explicit totals, server sort, or list field projection** → use lists skill with `getListData`
|
|
64
74
|
* - **Bulk updates** → use lists skill with `massEdit`
|
|
65
75
|
* - **Aggregations** → use data-aggregate skill
|
|
66
76
|
*
|
|
67
77
|
* ## Key Functions
|
|
68
78
|
* | Function | Use For |
|
|
69
79
|
* |----------|---------|
|
|
70
|
-
* | `getAccessibleObjects` |
|
|
80
|
+
* | `getAccessibleObjects` | Filtered accessible reads; unfiltered only for small reference/dimension sets |
|
|
71
81
|
* | `getObjects` | Read accessible objects from a specific key list |
|
|
72
82
|
* | `getObject` | Single object by key |
|
|
73
|
-
* | `getRelatedObjects` | Children of a parent
|
|
83
|
+
* | `getRelatedObjects` | Children of a known parent record |
|
|
74
84
|
* | `saveObject` | Create or update one object |
|
|
75
85
|
* | `saveRelatedObject` | Create or update one object and establish relationship to a parent |
|
|
76
86
|
* | `deleteObject` | Delete one object without parent scope |
|
|
77
87
|
* | `deleteRelatedObject` | Delete one related object |
|
|
78
88
|
*
|
|
79
89
|
* @example
|
|
80
|
-
* // Get
|
|
81
|
-
*
|
|
90
|
+
* // Get accessible class enrollments for a bounded date window
|
|
91
|
+
* // Create the filter expression with build_filter_expression before coding it here.
|
|
92
|
+
* const recentEnrollments = await hx.getAccessibleObjects(
|
|
93
|
+
* 'classEnrollment',
|
|
94
|
+
* "startDate>=date:'2025-01-01'"
|
|
95
|
+
* );
|
|
82
96
|
*
|
|
83
97
|
* @example
|
|
84
98
|
* // Get accessible recipes from a known key list
|
|
85
99
|
* const recipes = await hx.getObjects('recipe', recipeKeys);
|
|
86
100
|
*
|
|
87
101
|
* @example
|
|
102
|
+
* // Unfiltered accessible reads are for naturally small reference/dimension sets
|
|
103
|
+
* const categories = await hx.getAccessibleObjects('category');
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
88
106
|
* // Get single recipe
|
|
89
107
|
* const recipe = await hx.getObject('recipe', recipeKey);
|
|
90
108
|
*
|
|
91
109
|
* @example
|
|
92
|
-
* // Get ingredients
|
|
110
|
+
* // Get ingredients for a known recipe
|
|
93
111
|
* const ingredients = await hx.getRelatedObjects(
|
|
94
112
|
* 'recipe', recipeKey, 'ingredient'
|
|
95
113
|
* );
|
|
@@ -160,7 +178,7 @@ function getObjectAsObservable(dataElementId, key, fetchedRelationships) {
|
|
|
160
178
|
* @param parentElementId - Parent element ID
|
|
161
179
|
* @param parentKey - Parent object key; important: this establishes the scope of the query; use an appropriate scope key
|
|
162
180
|
* @param elementId - Child element ID
|
|
163
|
-
* @param filter - Optional filter
|
|
181
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
164
182
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
165
183
|
* @returns Promise<any[]>
|
|
166
184
|
*/
|
|
@@ -202,7 +220,7 @@ function getRelatedObjectsAsObservable(parentElementId, parentKey, elementId, fi
|
|
|
202
220
|
* Retrieves all objects for a data element that the current user has access to.
|
|
203
221
|
*
|
|
204
222
|
* @param dataElementId - Data element ID
|
|
205
|
-
* @param filter - Optional filter
|
|
223
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
206
224
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
207
225
|
* @param applyContext - Optional flag to apply navigation context scoping. When true, navigation context is read from UserContext.navigationContext and results are limited by the navigation context org proxy.
|
|
208
226
|
* @returns Promise<any[]>
|
|
@@ -237,7 +255,7 @@ function getAccessibleObjectsAsObservable(dataElementId, filter, fetchedRelation
|
|
|
237
255
|
*
|
|
238
256
|
* @param dataElementId - Data element ID
|
|
239
257
|
* @param keys - Object keys to retrieve
|
|
240
|
-
* @param filter - Optional filter
|
|
258
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
241
259
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
242
260
|
* @param applyContext - Optional flag to apply navigation context scoping. When true, navigation context is read from UserContext.navigationContext and results are limited by the navigation context org proxy.
|
|
243
261
|
* @returns Promise<any[]>
|
|
@@ -0,0 +1,10 @@
|
|
|
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 });
|
package/lib/cjs/index.js
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
// Full license terms available in the LICENSE file.
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.removeUserAccessAsObservable = exports.removeUserAccess = exports.updateUserAccessAsObservable = exports.updateUserAccess = exports.removeUserProxyRosterAccessAsObservable = exports.removeUserProxyRosterAccess = exports.setUserProxyRosterRolesAsObservable = exports.setUserProxyRosterRoles = exports.inviteOrLinkUserProxyByEmailAsObservable = exports.inviteOrLinkUserProxyByEmail = exports.listUserProxyAccessRosterAsObservable = exports.listUserProxyAccessRoster = exports.linkUserProxyAsObservable = exports.linkUserProxy = exports.getUserAccessAsObservable = exports.getUserAccess = exports.listSandboxUsersAsObservable = exports.listSandboxUsers = exports.listBusinessPrivilegesAsObservable = exports.listBusinessPrivileges = exports.listRolesAsObservable = exports.listRoles = exports.deleteRelatedObjectsAsObservable = exports.deleteRelatedObjects = exports.deleteRelatedObjectAsObservable = exports.deleteRelatedObject = exports.deleteObjectAsObservable = exports.deleteObject = exports.saveRelatedObjectAsObservable = exports.saveRelatedObject = exports.saveObjectAsObservable = exports.saveObject = exports.getObjectsAsObservable = exports.getObjects = exports.getAccessibleObjectsAsObservable = exports.getAccessibleObjects = exports.getRelatedObjectsAsObservable = exports.getRelatedObjects = exports.getObjectAsObservable = exports.getObject = exports.prepareErrorResponse = exports.prepareSuccessResponse = exports.initialize = exports.useBody = exports.params = exports.userContext = exports.actionSubject = exports.serviceAddress = exports.sandboxKey = exports.getAuthToken = void 0;
|
|
12
|
-
exports.
|
|
12
|
+
exports.compareValues = exports.sortObjectArray = exports.sendAIMessageAsObservable = exports.sendAIMessage = exports.getReminderDeliveryCoverage = exports.listEnrolledOrganizations = exports.getInvoicesMatchingReminder = exports.getEnabledPaymentReminders = exports.submitStandalonePaymentAsObservable = exports.submitStandalonePayment = exports.getAggregateDataAsObservable = exports.getAggregateData = exports.AggregationResponse = exports.massDeleteAsObservable = exports.massDelete = exports.massEditAsObservable = exports.massEdit = exports.getListDataAsObservable = exports.getListData = exports.getOrganizationPreferenceAsObservable = exports.getUserPreferenceAsObservable = exports.getOrganizationPreference = exports.getUserPreference = exports.sendMessageAsObservable = exports.sendMessage = exports.MessageMethod = exports.downloadResourceAsObservable = exports.downloadResource = exports.createOrUpdateResourceAsObservable = exports.createOrUpdateResource = exports.sendFileContentsAsObservable = exports.sendFileContents = exports.saveResourceAsObservable = exports.saveResource = exports.getOrCreateResourceAsObservable = exports.getOrCreateResource = exports.canDeleteDataElementAsObservable = exports.canDeleteDataElement = exports.canWriteDataElementAsObservable = exports.canWriteDataElement = exports.canReadDataElementAsObservable = exports.canReadDataElement = exports.hasDataElementAccessAsObservable = exports.hasDataElementAccess = exports.dataElementAccessAsObservable = exports.dataElementAccess = exports.userPrivilegesAsObservable = exports.userPrivileges = exports.hasBusinessPrivilegeAsObservable = exports.hasBusinessPrivilege = void 0;
|
|
13
|
+
exports.debounceFn = exports.getValueFromObject = void 0;
|
|
13
14
|
/**
|
|
14
15
|
* @module @halix/action-sdk
|
|
15
16
|
* @description Halix Platform action SDK for developing NodeJS Lambda-based actions on the Halix
|
|
@@ -158,6 +159,14 @@ var payments_1 = require("./payments");
|
|
|
158
159
|
Object.defineProperty(exports, "submitStandalonePayment", { enumerable: true, get: function () { return payments_1.submitStandalonePayment; } });
|
|
159
160
|
Object.defineProperty(exports, "submitStandalonePaymentAsObservable", { enumerable: true, get: function () { return payments_1.submitStandalonePaymentAsObservable; } });
|
|
160
161
|
// ================================================================================
|
|
162
|
+
// INVOICE FUNCTIONS
|
|
163
|
+
// ================================================================================
|
|
164
|
+
var invoices_1 = require("./invoices");
|
|
165
|
+
Object.defineProperty(exports, "getEnabledPaymentReminders", { enumerable: true, get: function () { return invoices_1.getEnabledPaymentReminders; } });
|
|
166
|
+
Object.defineProperty(exports, "getInvoicesMatchingReminder", { enumerable: true, get: function () { return invoices_1.getInvoicesMatchingReminder; } });
|
|
167
|
+
Object.defineProperty(exports, "listEnrolledOrganizations", { enumerable: true, get: function () { return invoices_1.listEnrolledOrganizations; } });
|
|
168
|
+
Object.defineProperty(exports, "getReminderDeliveryCoverage", { enumerable: true, get: function () { return invoices_1.getReminderDeliveryCoverage; } });
|
|
169
|
+
// ================================================================================
|
|
161
170
|
// AI FUNCTIONS
|
|
162
171
|
// ================================================================================
|
|
163
172
|
var ai_1 = require("./ai");
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.getEnabledPaymentReminders = getEnabledPaymentReminders;
|
|
24
|
+
exports.getInvoicesMatchingReminder = getInvoicesMatchingReminder;
|
|
25
|
+
exports.listEnrolledOrganizations = listEnrolledOrganizations;
|
|
26
|
+
exports.getReminderDeliveryCoverage = getReminderDeliveryCoverage;
|
|
27
|
+
/**
|
|
28
|
+
* @module @halix/action-sdk/invoices
|
|
29
|
+
* @description Invoice and payment-reminder helpers for Halix action lambdas.
|
|
30
|
+
*/
|
|
31
|
+
const axios_1 = __importDefault(require("axios"));
|
|
32
|
+
const rxjs_1 = require("rxjs");
|
|
33
|
+
const sdk_general_1 = require("./sdk-general");
|
|
34
|
+
const data_crud_1 = require("./data-crud");
|
|
35
|
+
function authHeaders() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (!sdk_general_1.getAuthToken) {
|
|
38
|
+
throw new Error('SDK not initialized.');
|
|
39
|
+
}
|
|
40
|
+
const authToken = yield (0, rxjs_1.lastValueFrom)((0, sdk_general_1.getAuthToken)());
|
|
41
|
+
return { Authorization: `Bearer ${authToken}` };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function getEnabledPaymentReminders(orgKey) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const filter = `(enabled=boolean:true) AND (organizationKey=string:${orgKey})`;
|
|
47
|
+
return (0, data_crud_1.getAccessibleObjects)('paymentReminder', filter);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function getInvoicesMatchingReminder(orgKey, criteria, today) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const url = `${sdk_general_1.serviceAddress}/billing/sandboxes/${sdk_general_1.sandboxKey}/invoices/matchingReminder`;
|
|
53
|
+
const response = yield axios_1.default.post(url, { orgKey, criteria, today }, { headers: yield authHeaders() });
|
|
54
|
+
return response.data;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function listEnrolledOrganizations(solutionKey) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const url = `${sdk_general_1.serviceAddress}/billing/sandboxes/${sdk_general_1.sandboxKey}/solutions/${solutionKey}/enrolledOrganizations`;
|
|
60
|
+
const response = yield axios_1.default.get(url, { headers: yield authHeaders() });
|
|
61
|
+
return response.data;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function getReminderDeliveryCoverage(args) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const url = `${sdk_general_1.serviceAddress}/billing/sandboxes/${sdk_general_1.sandboxKey}/reminders/coverage`;
|
|
67
|
+
const response = yield axios_1.default.post(url, args, { headers: yield authHeaders() });
|
|
68
|
+
return response.data;
|
|
69
|
+
});
|
|
70
|
+
}
|
package/lib/cjs/lists.js
CHANGED
|
@@ -16,6 +16,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
16
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
20
|
+
var t = {};
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
24
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
25
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
26
|
+
t[p[i]] = s[p[i]];
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
19
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
32
|
};
|
|
@@ -37,8 +48,8 @@ exports.massDeleteAsObservable = massDeleteAsObservable;
|
|
|
37
48
|
* - Supports related object retrieval
|
|
38
49
|
* - Pagination
|
|
39
50
|
* - Sorting
|
|
40
|
-
* - Filtering
|
|
41
|
-
* - Search
|
|
51
|
+
* - Filtering within a paged list UI
|
|
52
|
+
* - Search within a paged list UI
|
|
42
53
|
* - Mass edit operations (bulk update multiple records)
|
|
43
54
|
* - Mass delete operations (bulk delete multiple records)
|
|
44
55
|
*/
|
|
@@ -52,8 +63,14 @@ const sdk_general_1 = require("./sdk-general");
|
|
|
52
63
|
* Retrieves paginated list data. Supports authenticated/public access, filtering, sorting, and binary search.
|
|
53
64
|
*
|
|
54
65
|
* Common usage:
|
|
66
|
+
* - Use `getListData` when you are building a paged list UI or list-management workflow:
|
|
67
|
+
* pagination, explicit totals, server-side sort for the visible list, field projection, search, selection,
|
|
68
|
+
* or bulk operations.
|
|
69
|
+
* - Do not choose `getListData` only because the task is a report. Prefer `getAccessibleObjects`
|
|
70
|
+
* for bounded accessible-record reads without list behavior, `getRelatedObjects` when a
|
|
71
|
+
* concrete parent key is already known, or `getAggregateData` for grouped counts/sums.
|
|
55
72
|
* - For most custom-element list UIs, start with only `dataElementId`, pagination fields,
|
|
56
|
-
* and `
|
|
73
|
+
* and `fields`.
|
|
57
74
|
* - Omit `parentDataElementId` and `parentKey` when you want the records the current user
|
|
58
75
|
* can already access.
|
|
59
76
|
* - Add `parentDataElementId` and `parentKey` only when the list must be anchored to a
|
|
@@ -61,48 +78,80 @@ const sdk_general_1 = require("./sdk-general");
|
|
|
61
78
|
* - Most callers should omit `options`. Use `options.search` only for binary-search
|
|
62
79
|
* navigation scenarios, and use `options.bypassTotal` only when you explicitly do not
|
|
63
80
|
* need the total count.
|
|
81
|
+
* - Do not use `getListData` as a generic bulk-data loader for reports. Use filtered
|
|
82
|
+
* `getAccessibleObjects`, `getRelatedObjects` with a concrete parent key, or `getAggregateData`
|
|
83
|
+
* whenever those can answer the data need directly.
|
|
84
|
+
* - Do not choose `getListData` only because you need a filter. For non-list report/search reads,
|
|
85
|
+
* use filtered `getAccessibleObjects`, `getRelatedObjects` with a concrete parent key,
|
|
86
|
+
* `getObjects` for explicit key lists, or `getAggregateData`.
|
|
87
|
+
*
|
|
88
|
+
* Response shape:
|
|
89
|
+
* - `response.data` is the row array.
|
|
90
|
+
* - `response.total` is the total matching record count across all pages when
|
|
91
|
+
* requested. If `response.total > response.data.length`, this response is
|
|
92
|
+
* a page slice, not the full result set.
|
|
93
|
+
* - Do not read `response.objects`, `response.items`, or the response object itself as
|
|
94
|
+
* the row array.
|
|
95
|
+
*
|
|
96
|
+
* Pagination guidance:
|
|
97
|
+
* - Use `response.total` to decide whether the current page covers the full
|
|
98
|
+
* query. For page 1 with pageSize 100 and total 5,000, local aggregation over
|
|
99
|
+
* `response.data` covers only the first 100 rows.
|
|
100
|
+
* - Do not treat a first page or large page as complete report data just because
|
|
101
|
+
* it contains rows.
|
|
64
102
|
*
|
|
65
103
|
* Request shape:
|
|
66
104
|
* - `dataElementId` (required): root data element to retrieve
|
|
67
105
|
* - `pageNumber` / `pageSize` (optional): pagination
|
|
68
|
-
* - `
|
|
106
|
+
* - `fields` (optional): fields to populate in returned objects
|
|
69
107
|
* - `sort` (optional): sort fields such as `[{ attributeId: 'name' }]`
|
|
70
108
|
* - `filter` (optional): filter expression
|
|
71
109
|
* - `parentDataElementId` / `parentKey` (optional): explicit parent scope
|
|
72
110
|
*
|
|
73
111
|
* @param request - List configuration including dataElementId, parentDataElementId, parentKey, pagination, sort, filter
|
|
74
112
|
* @param options - Optional: isPublic, bypassTotal, search
|
|
75
|
-
* @returns Promise<ListDataResponse
|
|
113
|
+
* @returns Promise<ListDataResponse<TRecord>> with data array, total count, pageNumber
|
|
76
114
|
*
|
|
77
115
|
* @example
|
|
78
116
|
* // Most common case: one page of records the current user can access.
|
|
79
|
-
*
|
|
117
|
+
* type StudentRow = {
|
|
118
|
+
* name: string;
|
|
119
|
+
* studentNumber: string;
|
|
120
|
+
* email: string;
|
|
121
|
+
* grade: string;
|
|
122
|
+
* };
|
|
123
|
+
* const response = await getListData<StudentRow>({
|
|
80
124
|
* dataElementId: 'student',
|
|
81
125
|
* pageNumber: 1,
|
|
82
126
|
* pageSize: 10,
|
|
83
|
-
*
|
|
127
|
+
* fields: ['name', 'studentNumber', 'email', 'grade']
|
|
84
128
|
* });
|
|
129
|
+
* const rows = response.data;
|
|
85
130
|
*
|
|
86
131
|
* @example
|
|
87
132
|
* // Custom element pagination with an optional sort.
|
|
88
|
-
*
|
|
133
|
+
* type StudentListRow = { name: string; studentNumber: string; email: string; grade: string };
|
|
134
|
+
* const response = await getListData<StudentListRow>({
|
|
89
135
|
* dataElementId: 'student',
|
|
90
136
|
* pageNumber: currentPage,
|
|
91
137
|
* pageSize: 10,
|
|
92
|
-
*
|
|
138
|
+
* fields: ['name', 'studentNumber', 'email', 'grade'],
|
|
93
139
|
* sort: [{ attributeId: 'name' }]
|
|
94
140
|
* });
|
|
141
|
+
* const rows = response.data;
|
|
95
142
|
*
|
|
96
143
|
* @example
|
|
97
144
|
* // Explicit parent scoping when the list must be anchored to a specific parent.
|
|
98
|
-
*
|
|
145
|
+
* type CustomerRow = { firstName: string; lastName: string; email: string };
|
|
146
|
+
* const listData = await getListData<CustomerRow>({
|
|
99
147
|
* dataElementId: 'customer',
|
|
100
148
|
* parentDataElementId: 'company',
|
|
101
149
|
* parentKey: orgProxyKey,
|
|
102
150
|
* pageNumber: 1,
|
|
103
151
|
* pageSize: 50,
|
|
104
|
-
*
|
|
152
|
+
* fields: ['firstName', 'lastName', 'email']
|
|
105
153
|
* });
|
|
154
|
+
* const rows = listData.data;
|
|
106
155
|
*
|
|
107
156
|
* @example
|
|
108
157
|
* // options is rarely needed; omit it unless you need one of these behaviors.
|
|
@@ -111,7 +160,7 @@ const sdk_general_1 = require("./sdk-general");
|
|
|
111
160
|
* dataElementId: 'student',
|
|
112
161
|
* pageNumber: 1,
|
|
113
162
|
* pageSize: 10,
|
|
114
|
-
*
|
|
163
|
+
* fields: ['name']
|
|
115
164
|
* },
|
|
116
165
|
* {
|
|
117
166
|
* search: {
|
|
@@ -169,7 +218,7 @@ function getListData(request, options) {
|
|
|
169
218
|
console.log("Sending POST request to " + url + " (public endpoint)");
|
|
170
219
|
}
|
|
171
220
|
// Make the API request
|
|
172
|
-
let response = yield axios_1.default.post(url, request, {
|
|
221
|
+
let response = yield axios_1.default.post(url, _toServerListDataRequest(request), {
|
|
173
222
|
headers,
|
|
174
223
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
175
224
|
});
|
|
@@ -186,6 +235,16 @@ function getListData(request, options) {
|
|
|
186
235
|
function getListDataAsObservable(request, options) {
|
|
187
236
|
return (0, rxjs_1.from)(getListData(request, options));
|
|
188
237
|
}
|
|
238
|
+
function _toServerListDataRequest(request) {
|
|
239
|
+
const { fields } = request, rest = __rest(request, ["fields"]);
|
|
240
|
+
return Object.assign(Object.assign({}, rest), (fields ? { displayFields: fields } : {}));
|
|
241
|
+
}
|
|
242
|
+
function _toServerMassEditRequest(request) {
|
|
243
|
+
return Object.assign(Object.assign({}, request), { dataRequest: _toServerListDataRequest(request.dataRequest) });
|
|
244
|
+
}
|
|
245
|
+
function _toServerMassDeleteRequest(request) {
|
|
246
|
+
return Object.assign(Object.assign({}, request), { dataRequest: _toServerListDataRequest(request.dataRequest) });
|
|
247
|
+
}
|
|
189
248
|
// ================================================================================
|
|
190
249
|
// MASS EDIT AND DELETE FUNCTIONS
|
|
191
250
|
// ================================================================================
|
|
@@ -221,7 +280,7 @@ function massEdit(request) {
|
|
|
221
280
|
};
|
|
222
281
|
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
223
282
|
// Make the API request
|
|
224
|
-
let response = yield axios_1.default.post(url, request, { headers });
|
|
283
|
+
let response = yield axios_1.default.post(url, _toServerMassEditRequest(request), { headers });
|
|
225
284
|
return response.data;
|
|
226
285
|
});
|
|
227
286
|
}
|
|
@@ -260,7 +319,7 @@ function massDelete(request) {
|
|
|
260
319
|
};
|
|
261
320
|
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
262
321
|
// Make the API request
|
|
263
|
-
let response = yield axios_1.default.post(url, request, { headers });
|
|
322
|
+
let response = yield axios_1.default.post(url, _toServerMassDeleteRequest(request), { headers });
|
|
264
323
|
return response.data;
|
|
265
324
|
});
|
|
266
325
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import type { FilterExpression } from './filter-expression';
|
|
2
3
|
/**
|
|
3
4
|
* TransformType specifies the type of transformation to apply to a group field.
|
|
4
5
|
*/
|
|
@@ -33,12 +34,15 @@ export interface AggregationGroup {
|
|
|
33
34
|
* AggregationSort defines a secondary sort field for aggregated results.
|
|
34
35
|
*/
|
|
35
36
|
export interface AggregationSort {
|
|
36
|
-
/** The
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
|
|
37
|
+
/** The attribute or relationship path to sort by, e.g. "totalAmount" or "customer.lastName" */
|
|
38
|
+
attributeId: string;
|
|
39
|
+
/** Whether to sort in descending order (true) or ascending order (false, default) */
|
|
40
|
+
descending?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The aggregation type to sort by when `attributeId` refers to an aggregated measure.
|
|
43
|
+
* Omit this when sorting by a group field.
|
|
44
|
+
*/
|
|
45
|
+
sortAggregation?: AggregationType;
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* Aggregation defines an aggregation operation to perform on a field.
|
|
@@ -74,10 +78,10 @@ export interface AggregationRequest {
|
|
|
74
78
|
*/
|
|
75
79
|
parentKeyField?: string;
|
|
76
80
|
/**
|
|
77
|
-
*
|
|
78
|
-
* filter expression.
|
|
81
|
+
* Halix filter expression to limit records before aggregation. This is not SQL or
|
|
82
|
+
* JavaScript syntax. Call `build_filter_expression` to generate the filter expression.
|
|
79
83
|
*/
|
|
80
|
-
filter?:
|
|
84
|
+
filter?: FilterExpression;
|
|
81
85
|
/**
|
|
82
86
|
* List of grouping specifications. Groups are formed by field values with optional transforms.
|
|
83
87
|
* Results will be grouped by these fields in the order specified.
|
|
@@ -85,7 +89,8 @@ export interface AggregationRequest {
|
|
|
85
89
|
groups?: AggregationGroup[];
|
|
86
90
|
/**
|
|
87
91
|
* List of secondary sort specifications for the aggregated results.
|
|
88
|
-
*
|
|
92
|
+
* Use [{ attributeId, descending }] for sorted aggregate results.
|
|
93
|
+
* Add sortAggregation when sorting by an aggregated measure.
|
|
89
94
|
*/
|
|
90
95
|
sort?: AggregationSort[];
|
|
91
96
|
/**
|
|
@@ -239,6 +244,11 @@ export declare class AggregationResponse {
|
|
|
239
244
|
* }, {
|
|
240
245
|
* aggregation: 'Sum',
|
|
241
246
|
* aggregationField: 'totalAmount'
|
|
247
|
+
* }],
|
|
248
|
+
* sort: [{
|
|
249
|
+
* attributeId: 'totalAmount',
|
|
250
|
+
* descending: true,
|
|
251
|
+
* sortAggregation: 'Sum'
|
|
242
252
|
* }]
|
|
243
253
|
* });
|
|
244
254
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-aggregate.d.ts","sourceRoot":"","sources":["../../../src/data-aggregate.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"data-aggregate.d.ts","sourceRoot":"","sources":["../../../src/data-aggregate.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D;;GAEG;AACH,MAAM,MAAM,aAAa,GACnB,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GACrD,WAAW,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,eAAe,GACrB,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,2CAA2C;IAC3C,SAAS,EAAE,aAAa,CAAC;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,yDAAyD;IACzD,UAAU,CAAC,EAAE,yBAAyB,EAAE,C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,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAuBhG;AA4BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAEzG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import type { FilterExpression } from './filter-expression';
|
|
2
3
|
/**
|
|
3
4
|
* SaveOptions is an interface for specifying save operation options.
|
|
4
5
|
*/
|
|
@@ -25,45 +26,45 @@ export declare function getObjectAsObservable(dataElementId: string, key: string
|
|
|
25
26
|
* @param parentElementId - Parent element ID
|
|
26
27
|
* @param parentKey - Parent object key; important: this establishes the scope of the query; use an appropriate scope key
|
|
27
28
|
* @param elementId - Child element ID
|
|
28
|
-
* @param filter - Optional filter
|
|
29
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
29
30
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
30
31
|
* @returns Promise<any[]>
|
|
31
32
|
*/
|
|
32
|
-
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter?:
|
|
33
|
+
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter?: FilterExpression, fetchedRelationships?: string[]): Promise<any[]>;
|
|
33
34
|
/**
|
|
34
35
|
* Observable version of getRelatedObjects. See getRelatedObjects for details.
|
|
35
36
|
*/
|
|
36
|
-
export declare function getRelatedObjectsAsObservable(parentElementId: string, parentKey: string, elementId: string, filter?:
|
|
37
|
+
export declare function getRelatedObjectsAsObservable(parentElementId: string, parentKey: string, elementId: string, filter?: FilterExpression, fetchedRelationships?: string[]): Observable<any[]>;
|
|
37
38
|
/**
|
|
38
39
|
* Retrieves all objects for a data element that the current user has access to.
|
|
39
40
|
*
|
|
40
41
|
* @param dataElementId - Data element ID
|
|
41
|
-
* @param filter - Optional filter
|
|
42
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
42
43
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
43
44
|
* @param applyContext - Optional flag to apply navigation context scoping. When true, navigation context is read from UserContext.navigationContext and results are limited by the navigation context org proxy.
|
|
44
45
|
* @returns Promise<any[]>
|
|
45
46
|
*/
|
|
46
|
-
export declare function getAccessibleObjects(dataElementId: string, filter?:
|
|
47
|
+
export declare function getAccessibleObjects(dataElementId: string, filter?: FilterExpression, fetchedRelationships?: string[], applyContext?: boolean): Promise<any[]>;
|
|
47
48
|
/**
|
|
48
49
|
* Observable version of getAccessibleObjects. See getAccessibleObjects for details.
|
|
49
50
|
*/
|
|
50
|
-
export declare function getAccessibleObjectsAsObservable(dataElementId: string, filter?:
|
|
51
|
+
export declare function getAccessibleObjectsAsObservable(dataElementId: string, filter?: FilterExpression, fetchedRelationships?: string[], applyContext?: boolean): Observable<any[]>;
|
|
51
52
|
/**
|
|
52
53
|
* Retrieves accessible objects for a data element from a specific key list.
|
|
53
54
|
* Only objects that are accessible to the current user are returned. If applyContext is true, keyed objects outside the current navigation context are also omitted.
|
|
54
55
|
*
|
|
55
56
|
* @param dataElementId - Data element ID
|
|
56
57
|
* @param keys - Object keys to retrieve
|
|
57
|
-
* @param filter - Optional filter
|
|
58
|
+
* @param filter - Optional Halix filter expression. This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate it. Must be less than 200 characters.
|
|
58
59
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
59
60
|
* @param applyContext - Optional flag to apply navigation context scoping. When true, navigation context is read from UserContext.navigationContext and results are limited by the navigation context org proxy.
|
|
60
61
|
* @returns Promise<any[]>
|
|
61
62
|
*/
|
|
62
|
-
export declare function getObjects(dataElementId: string, keys: string[], filter?:
|
|
63
|
+
export declare function getObjects(dataElementId: string, keys: string[], filter?: FilterExpression, fetchedRelationships?: string[], applyContext?: boolean): Promise<any[]>;
|
|
63
64
|
/**
|
|
64
65
|
* Observable version of getObjects. See getObjects for details.
|
|
65
66
|
*/
|
|
66
|
-
export declare function getObjectsAsObservable(dataElementId: string, keys: string[], filter?:
|
|
67
|
+
export declare function getObjectsAsObservable(dataElementId: string, keys: string[], filter?: FilterExpression, fetchedRelationships?: string[], applyContext?: boolean): Observable<any[]>;
|
|
67
68
|
/**
|
|
68
69
|
* Saves an object without establishing a parent relationship. Returns saved object with any server-assigned values (objKey, calculated fields).
|
|
69
70
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-crud.d.ts","sourceRoot":"","sources":["../../../src/data-crud.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-crud.d.ts","sourceRoot":"","sources":["../../../src/data-crud.ts"],"names":[],"mappings":"AAuGA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gFAAgF;IAChF,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAMhC;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,gBA6BlG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAE1H;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MA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