@halix/action-sdk 1.0.51 → 1.0.52
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-crud.js +30 -11
- 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 +68 -13
- package/lib/cjs/types/data-aggregate.d.ts +4 -3
- 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 +76 -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.map +1 -1
- package/lib/esm/data-crud.js +30 -11
- 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 +66 -13
- 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 +4 -3
- 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 +76 -29
- package/lib/esm/types/sdk-general.d.ts +25 -0
- package/package.json +1 -1
package/lib/esm/lists.js
CHANGED
|
@@ -32,8 +32,13 @@ import { sandboxKey, serviceAddress, getAuthToken } from './sdk-general';
|
|
|
32
32
|
* Retrieves paginated list data. Supports authenticated/public access, filtering, sorting, and binary search.
|
|
33
33
|
*
|
|
34
34
|
* Common usage:
|
|
35
|
+
* - Use `getListData` when you need list-specific behavior: pagination, explicit totals,
|
|
36
|
+
* server-side sort/filter, field projection, search, selection, or bulk operations.
|
|
37
|
+
* - Do not choose `getListData` only because the task is a report. Prefer `getAccessibleObjects`
|
|
38
|
+
* for bounded accessible-record reads without list behavior, `getRelatedObjects` when a
|
|
39
|
+
* concrete parent key is already known, or `getAggregateData` for grouped counts/sums.
|
|
35
40
|
* - For most custom-element list UIs, start with only `dataElementId`, pagination fields,
|
|
36
|
-
* and `
|
|
41
|
+
* and `fields`.
|
|
37
42
|
* - Omit `parentDataElementId` and `parentKey` when you want the records the current user
|
|
38
43
|
* can already access.
|
|
39
44
|
* - Add `parentDataElementId` and `parentKey` only when the list must be anchored to a
|
|
@@ -41,48 +46,77 @@ import { sandboxKey, serviceAddress, getAuthToken } from './sdk-general';
|
|
|
41
46
|
* - Most callers should omit `options`. Use `options.search` only for binary-search
|
|
42
47
|
* navigation scenarios, and use `options.bypassTotal` only when you explicitly do not
|
|
43
48
|
* need the total count.
|
|
49
|
+
* - For bounded report reads that genuinely need list behavior, set `pageNumber`, an explicit
|
|
50
|
+
* `pageSize`, and `fields` for every field used in filtering, grouping, sorting,
|
|
51
|
+
* aggregation, or rendering.
|
|
52
|
+
*
|
|
53
|
+
* Response shape:
|
|
54
|
+
* - `response.data` is the row array.
|
|
55
|
+
* - `response.total` is the total matching record count across all pages when
|
|
56
|
+
* requested. If `response.total > response.data.length`, this response is
|
|
57
|
+
* a page slice, not the full result set.
|
|
58
|
+
* - Do not read `response.objects`, `response.items`, or the response object itself as
|
|
59
|
+
* the row array.
|
|
60
|
+
*
|
|
61
|
+
* Pagination guidance:
|
|
62
|
+
* - Use `response.total` to decide whether the current page covers the full
|
|
63
|
+
* query. For page 1 with pageSize 100 and total 5,000, local aggregation over
|
|
64
|
+
* `response.data` covers only the first 100 rows.
|
|
65
|
+
* - Do not treat a first page or large page as complete report data just because
|
|
66
|
+
* it contains rows.
|
|
44
67
|
*
|
|
45
68
|
* Request shape:
|
|
46
69
|
* - `dataElementId` (required): root data element to retrieve
|
|
47
70
|
* - `pageNumber` / `pageSize` (optional): pagination
|
|
48
|
-
* - `
|
|
71
|
+
* - `fields` (optional): fields to populate in returned objects
|
|
49
72
|
* - `sort` (optional): sort fields such as `[{ attributeId: 'name' }]`
|
|
50
73
|
* - `filter` (optional): filter expression
|
|
51
74
|
* - `parentDataElementId` / `parentKey` (optional): explicit parent scope
|
|
52
75
|
*
|
|
53
76
|
* @param request - List configuration including dataElementId, parentDataElementId, parentKey, pagination, sort, filter
|
|
54
77
|
* @param options - Optional: isPublic, bypassTotal, search
|
|
55
|
-
* @returns Promise<ListDataResponse
|
|
78
|
+
* @returns Promise<ListDataResponse<TRecord>> with data array, total count, pageNumber
|
|
56
79
|
*
|
|
57
80
|
* @example
|
|
58
81
|
* // Most common case: one page of records the current user can access.
|
|
59
|
-
*
|
|
82
|
+
* type StudentRow = {
|
|
83
|
+
* name: string;
|
|
84
|
+
* studentNumber: string;
|
|
85
|
+
* email: string;
|
|
86
|
+
* grade: string;
|
|
87
|
+
* };
|
|
88
|
+
* const response = await getListData<StudentRow>({
|
|
60
89
|
* dataElementId: 'student',
|
|
61
90
|
* pageNumber: 1,
|
|
62
91
|
* pageSize: 10,
|
|
63
|
-
*
|
|
92
|
+
* fields: ['name', 'studentNumber', 'email', 'grade']
|
|
64
93
|
* });
|
|
94
|
+
* const rows = response.data;
|
|
65
95
|
*
|
|
66
96
|
* @example
|
|
67
97
|
* // Custom element pagination with an optional sort.
|
|
68
|
-
*
|
|
98
|
+
* type StudentListRow = { name: string; studentNumber: string; email: string; grade: string };
|
|
99
|
+
* const response = await getListData<StudentListRow>({
|
|
69
100
|
* dataElementId: 'student',
|
|
70
101
|
* pageNumber: currentPage,
|
|
71
102
|
* pageSize: 10,
|
|
72
|
-
*
|
|
103
|
+
* fields: ['name', 'studentNumber', 'email', 'grade'],
|
|
73
104
|
* sort: [{ attributeId: 'name' }]
|
|
74
105
|
* });
|
|
106
|
+
* const rows = response.data;
|
|
75
107
|
*
|
|
76
108
|
* @example
|
|
77
109
|
* // Explicit parent scoping when the list must be anchored to a specific parent.
|
|
78
|
-
*
|
|
110
|
+
* type CustomerRow = { firstName: string; lastName: string; email: string };
|
|
111
|
+
* const listData = await getListData<CustomerRow>({
|
|
79
112
|
* dataElementId: 'customer',
|
|
80
113
|
* parentDataElementId: 'company',
|
|
81
114
|
* parentKey: orgProxyKey,
|
|
82
115
|
* pageNumber: 1,
|
|
83
116
|
* pageSize: 50,
|
|
84
|
-
*
|
|
117
|
+
* fields: ['firstName', 'lastName', 'email']
|
|
85
118
|
* });
|
|
119
|
+
* const rows = listData.data;
|
|
86
120
|
*
|
|
87
121
|
* @example
|
|
88
122
|
* // options is rarely needed; omit it unless you need one of these behaviors.
|
|
@@ -91,7 +125,7 @@ import { sandboxKey, serviceAddress, getAuthToken } from './sdk-general';
|
|
|
91
125
|
* dataElementId: 'student',
|
|
92
126
|
* pageNumber: 1,
|
|
93
127
|
* pageSize: 10,
|
|
94
|
-
*
|
|
128
|
+
* fields: ['name']
|
|
95
129
|
* },
|
|
96
130
|
* {
|
|
97
131
|
* search: {
|
|
@@ -147,7 +181,7 @@ export async function getListData(request, options) {
|
|
|
147
181
|
console.log("Sending POST request to " + url + " (public endpoint)");
|
|
148
182
|
}
|
|
149
183
|
// Make the API request
|
|
150
|
-
let response = await axios.post(url, request, {
|
|
184
|
+
let response = await axios.post(url, _toServerListDataRequest(request), {
|
|
151
185
|
headers,
|
|
152
186
|
params: Object.keys(params).length > 0 ? params : undefined,
|
|
153
187
|
});
|
|
@@ -163,6 +197,25 @@ export async function getListData(request, options) {
|
|
|
163
197
|
export function getListDataAsObservable(request, options) {
|
|
164
198
|
return from(getListData(request, options));
|
|
165
199
|
}
|
|
200
|
+
function _toServerListDataRequest(request) {
|
|
201
|
+
const { fields, ...rest } = request;
|
|
202
|
+
return {
|
|
203
|
+
...rest,
|
|
204
|
+
...(fields ? { displayFields: fields } : {}),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function _toServerMassEditRequest(request) {
|
|
208
|
+
return {
|
|
209
|
+
...request,
|
|
210
|
+
dataRequest: _toServerListDataRequest(request.dataRequest),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function _toServerMassDeleteRequest(request) {
|
|
214
|
+
return {
|
|
215
|
+
...request,
|
|
216
|
+
dataRequest: _toServerListDataRequest(request.dataRequest),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
166
219
|
// ================================================================================
|
|
167
220
|
// MASS EDIT AND DELETE FUNCTIONS
|
|
168
221
|
// ================================================================================
|
|
@@ -197,7 +250,7 @@ export async function massEdit(request) {
|
|
|
197
250
|
};
|
|
198
251
|
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
199
252
|
// Make the API request
|
|
200
|
-
let response = await axios.post(url, request, { headers });
|
|
253
|
+
let response = await axios.post(url, _toServerMassEditRequest(request), { headers });
|
|
201
254
|
return response.data;
|
|
202
255
|
}
|
|
203
256
|
/**
|
|
@@ -234,7 +287,7 @@ export async function massDelete(request) {
|
|
|
234
287
|
};
|
|
235
288
|
console.log("Sending POST request to " + url + " with token " + authToken);
|
|
236
289
|
// Make the API request
|
|
237
|
-
let response = await axios.post(url, request, { headers });
|
|
290
|
+
let response = await axios.post(url, _toServerMassDeleteRequest(request), { headers });
|
|
238
291
|
return response.data;
|
|
239
292
|
}
|
|
240
293
|
/**
|
package/lib/esm/lists.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/lists.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,mCAAmC;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ression';
|
|
2
3
|
/**
|
|
3
4
|
* TransformType specifies the type of transformation to apply to a group field.
|
|
4
5
|
*/
|
|
@@ -74,10 +75,10 @@ export interface AggregationRequest {
|
|
|
74
75
|
*/
|
|
75
76
|
parentKeyField?: string;
|
|
76
77
|
/**
|
|
77
|
-
*
|
|
78
|
-
* filter expression.
|
|
78
|
+
* Halix filter expression to limit records before aggregation. This is not SQL or
|
|
79
|
+
* JavaScript syntax. Call `build_filter_expression` to generate the filter expression.
|
|
79
80
|
*/
|
|
80
|
-
filter?:
|
|
81
|
+
filter?: FilterExpression;
|
|
81
82
|
/**
|
|
82
83
|
* List of grouping specifications. Groups are formed by field values with optional transforms.
|
|
83
84
|
* Results will be grouped by these fields in the order specified.
|
|
@@ -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
|
*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Halix data filter expression language string.
|
|
3
|
+
*
|
|
4
|
+
* This is not SQL, JavaScript, or an arbitrary query-string syntax. Use the
|
|
5
|
+
* `build_filter_expression` agent tool to generate filter expressions for SDK
|
|
6
|
+
* calls, list reads, aggregate queries, choosers, and generated TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* Filter expressions are evaluated by Halix services within the request's
|
|
9
|
+
* normal data-access scope. Most filter parameters must be less than 200
|
|
10
|
+
* characters.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Boolean comparison
|
|
14
|
+
* const filter: FilterExpression = "archive!=boolean:true";
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Date and key comparisons
|
|
18
|
+
* const filter: FilterExpression =
|
|
19
|
+
* "(endDate >= date:2025-06-12) AND (courseKey=string:crs~00~abc)";
|
|
20
|
+
*/
|
|
21
|
+
export type FilterExpression = string;
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* platform. This is the main entry point that provides a unified interface for all SDK functionality.
|
|
5
5
|
*/
|
|
6
6
|
export { getAuthToken, sandboxKey, serviceAddress, actionSubject, userContext, params, useBody, initialize, type UserContext, type IncomingEventBody, type BaseActionResponse, type ActionResponse, type NotificationConfig, type ListActionResponse, type FormTemplateActionResponse, type PageTemplateActionResponse, type ObjectSaveActionResponse, type CalculatedFieldActionResponse, type SingleValueActionResponse, type ErrorResponse, prepareSuccessResponse, prepareErrorResponse } from './sdk-general';
|
|
7
|
+
export { type FilterExpression } from './filter-expression';
|
|
7
8
|
export { type SaveOptions, getObject, getObjectAsObservable, getRelatedObjects, getRelatedObjectsAsObservable, getAccessibleObjects, getAccessibleObjectsAsObservable, getObjects, getObjectsAsObservable, saveObject, saveObjectAsObservable, saveRelatedObject, saveRelatedObjectAsObservable, deleteObject, deleteObjectAsObservable, deleteRelatedObject, deleteRelatedObjectAsObservable, deleteRelatedObjects, deleteRelatedObjectsAsObservable } from './data-crud';
|
|
8
9
|
export { type ScopeKeyItem, type Role, type BusinessPrivilege, type SandboxUser, type UserAccessWrapper, type LinkUserProxyRequest, type UserProxyAccessRosterRow, type ListUserProxyAccessRosterOptions, type InviteOrLinkUserProxyByEmailRequest, type InviteOrLinkUserProxyAction, type InviteOrLinkUserProxyResult, type SetUserProxyRosterRolesRequest, type UpdateAccessRequest, type BusinessPrivilegeCheckResult, type CurrentBusinessPrivilegesResult, type DataElementAccessMode, type DataElementAccessResult, listRoles, listRolesAsObservable, listBusinessPrivileges, listBusinessPrivilegesAsObservable, listSandboxUsers, listSandboxUsersAsObservable, getUserAccess, getUserAccessAsObservable, linkUserProxy, linkUserProxyAsObservable, listUserProxyAccessRoster, listUserProxyAccessRosterAsObservable, inviteOrLinkUserProxyByEmail, inviteOrLinkUserProxyByEmailAsObservable, setUserProxyRosterRoles, setUserProxyRosterRolesAsObservable, removeUserProxyRosterAccess, removeUserProxyRosterAccessAsObservable, updateUserAccess, updateUserAccessAsObservable, removeUserAccess, removeUserAccessAsObservable, hasBusinessPrivilege, hasBusinessPrivilegeAsObservable, userPrivileges, userPrivilegesAsObservable, dataElementAccess, dataElementAccessAsObservable, hasDataElementAccess, hasDataElementAccessAsObservable, canReadDataElement, canReadDataElementAsObservable, canWriteDataElement, canWriteDataElementAsObservable, canDeleteDataElement, canDeleteDataElementAsObservable, } from './access';
|
|
9
10
|
export { type ContentResource, getOrCreateResource, getOrCreateResourceAsObservable, saveResource, saveResourceAsObservable, sendFileContents, sendFileContentsAsObservable, createOrUpdateResource, createOrUpdateResourceAsObservable, downloadResource, downloadResourceAsObservable } from './content';
|
|
@@ -12,5 +13,6 @@ export { getUserPreference, getOrganizationPreference, getUserPreferenceAsObserv
|
|
|
12
13
|
export { type SortField, type DataSortField, type BaseListDataRequest, type PagedListDataRequest, type ListDataResponse, type ListDataOptions, type ListDataSearchOptions, type MassEditValueType, type MassEditRequest, type MassDeleteRequest, type MassChangeResponse, getListData, getListDataAsObservable, massEdit, massEditAsObservable, massDelete, massDeleteAsObservable } from './lists';
|
|
13
14
|
export { AggregationResponse, type AggregationRequest, type AggregationRow, type AggregationGroup, type AggregationSort, type Aggregation, type AggregationGroupTransform, type TransformType, type AggregationType, getAggregateData, getAggregateDataAsObservable } from './data-aggregate';
|
|
14
15
|
export { type GatewayPaymentPreauthResult, type StandalonePaymentRequest, type StandalonePaymentResult, submitStandalonePayment, submitStandalonePaymentAsObservable } from './payments';
|
|
16
|
+
export { type InvoiceDueItem, type PayerInvoiceGroup, type ReminderMatchCriteria, type PaymentReminderRecord, type ChannelCoverage, getEnabledPaymentReminders, getInvoicesMatchingReminder, listEnrolledOrganizations, getReminderDeliveryCoverage } from './invoices';
|
|
15
17
|
export { type AIRequestOptions, sendAIMessage, sendAIMessageAsObservable } from './ai';
|
|
16
18
|
export { sortObjectArray, compareValues, getValueFromObject, debounceFn } from './utilities';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export interface InvoiceDueItem {
|
|
2
|
+
/** Invoice (sales transaction) key. */
|
|
3
|
+
invoiceKey: string;
|
|
4
|
+
/** User-facing invoice ID from the SalesTransaction id field. */
|
|
5
|
+
invoiceId: string;
|
|
6
|
+
/** Backwards-compatible alias for invoiceId. */
|
|
7
|
+
invoiceNumber: string;
|
|
8
|
+
/** User-facing description, e.g. "Down payment on Tuition Kindergarten SY26-27". */
|
|
9
|
+
description: string;
|
|
10
|
+
/** Due date — either the invoice's top-level dueDate or an installment's dueDate. */
|
|
11
|
+
dueDate: string;
|
|
12
|
+
/** Due date formatted for message display as M/d/yyyy. */
|
|
13
|
+
dueDateDisplay: string;
|
|
14
|
+
/** When the matching due date came from an installment, the 0-based index in installmentItems. */
|
|
15
|
+
installmentIndex?: number;
|
|
16
|
+
/** Amount remaining for this invoice/installment. */
|
|
17
|
+
amountDue: number;
|
|
18
|
+
/** Line-item summaries suitable for inclusion in a reminder message. */
|
|
19
|
+
lineItems: Array<{
|
|
20
|
+
description: string;
|
|
21
|
+
quantity: number;
|
|
22
|
+
amount: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface PayerInvoiceGroup {
|
|
26
|
+
payerKey: string;
|
|
27
|
+
payerType: string;
|
|
28
|
+
payerName: string;
|
|
29
|
+
items: InvoiceDueItem[];
|
|
30
|
+
totalBalance: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ReminderMatchCriteria {
|
|
33
|
+
sendType: 'specificDates' | 'dueDateRelative';
|
|
34
|
+
specificDates?: string[];
|
|
35
|
+
dueDateOffsets?: number[];
|
|
36
|
+
}
|
|
37
|
+
export interface PaymentReminderRecord {
|
|
38
|
+
objKey: string;
|
|
39
|
+
organizationKey: string;
|
|
40
|
+
sandboxKey: string;
|
|
41
|
+
name: string;
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
previewMode?: boolean;
|
|
44
|
+
channel: 'email' | 'sms' | 'both';
|
|
45
|
+
emailSubject?: string;
|
|
46
|
+
emailBody?: string;
|
|
47
|
+
smsBody?: string;
|
|
48
|
+
sendType: 'specificDates' | 'dueDateRelative';
|
|
49
|
+
specificDates?: string[];
|
|
50
|
+
dueDateOffsets?: number[];
|
|
51
|
+
bccEmail?: string;
|
|
52
|
+
}
|
|
53
|
+
export type ChannelCoverage = 'covered' | 'retryable' | 'unsent';
|
|
54
|
+
export declare function getEnabledPaymentReminders(orgKey: string): Promise<PaymentReminderRecord[]>;
|
|
55
|
+
export declare function getInvoicesMatchingReminder(orgKey: string, criteria: ReminderMatchCriteria, today: string): Promise<PayerInvoiceGroup[]>;
|
|
56
|
+
export declare function listEnrolledOrganizations(solutionKey: string): Promise<{
|
|
57
|
+
orgKey: string;
|
|
58
|
+
orgProxyKey: string;
|
|
59
|
+
orgProxyType: string;
|
|
60
|
+
orgName: string;
|
|
61
|
+
timezone?: string;
|
|
62
|
+
}[]>;
|
|
63
|
+
export declare function getReminderDeliveryCoverage(args: {
|
|
64
|
+
reminderKey: string;
|
|
65
|
+
payerKey: string;
|
|
66
|
+
organizationProxyKey: string;
|
|
67
|
+
organizationProxyType?: string;
|
|
68
|
+
dayStart: string;
|
|
69
|
+
nextDayStart: string;
|
|
70
|
+
channels: ('email' | 'sms')[];
|
|
71
|
+
}): Promise<Record<'email' | 'sms', ChannelCoverage>>;
|
package/lib/esm/types/lists.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import type { FilterExpression } from './filter-expression';
|
|
2
3
|
/**
|
|
3
4
|
* SortField is an interface for specifying sort fields.
|
|
4
5
|
*/
|
|
@@ -64,21 +65,21 @@ export interface BaseListDataRequest {
|
|
|
64
65
|
*/
|
|
65
66
|
childKeysField?: string;
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
-
* Call `
|
|
69
|
-
* Must be less than 200 characters.
|
|
68
|
+
* Halix filter expression to limit results. Evaluated within the parent key scope.
|
|
69
|
+
* This is not SQL or JavaScript syntax. Call `build_filter_expression` to generate
|
|
70
|
+
* the filter expression. Must be less than 200 characters.
|
|
70
71
|
*/
|
|
71
|
-
filter?:
|
|
72
|
+
filter?: FilterExpression;
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
74
|
+
* Fields to populate in returned rows. If omitted, rows may contain only `objKey`
|
|
75
|
+
* plus server defaults; every field read from `response.data` should be requested
|
|
76
|
+
* here. Use this same array for visible fields and fields needed by local
|
|
77
|
+
* calculations, joins, grouping, charting, sorting, or conditional rendering.
|
|
78
|
+
*
|
|
79
|
+
* If fields include relationship paths, those relationships are automatically retrieved.
|
|
80
|
+
* The SDK sends this to the list service as `displayFields`.
|
|
80
81
|
*/
|
|
81
|
-
|
|
82
|
+
fields?: string[];
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
84
85
|
* PagedListDataRequest extends BaseListDataRequest with pagination properties.
|
|
@@ -96,14 +97,26 @@ export interface PagedListDataRequest extends BaseListDataRequest {
|
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
99
|
* ListDataResponse wraps a data provider response to a list data request.
|
|
100
|
+
*
|
|
101
|
+
* Rows are returned in the `data` array. Do not read `objects`, `items`, or
|
|
102
|
+
* the response object itself as the row array. `total` is the total matching
|
|
103
|
+
* record count across all pages for this request. When `total > data.length`,
|
|
104
|
+
* the current response is only one page of a larger result set.
|
|
99
105
|
*/
|
|
100
|
-
export interface ListDataResponse {
|
|
106
|
+
export interface ListDataResponse<TRecord extends Record<string, unknown> = Record<string, unknown>> {
|
|
101
107
|
/**
|
|
102
|
-
* A
|
|
103
|
-
*
|
|
108
|
+
* A single page of rows for the requested data element. This is the only row array
|
|
109
|
+
* returned by getListData. Properties such as `objects`, `items`, or `list` are not
|
|
110
|
+
* part of the SDK response.
|
|
111
|
+
*/
|
|
112
|
+
data: TRecord[];
|
|
113
|
+
/**
|
|
114
|
+
* The total number of matching entries across all pages for this request.
|
|
115
|
+
* If total is greater than data.length, more pages exist. A caller that is
|
|
116
|
+
* building a complete report/chart must request additional pages, use an
|
|
117
|
+
* aggregate endpoint, narrow the query with filters/key lists, or present
|
|
118
|
+
* the result as a capped/partial view.
|
|
104
119
|
*/
|
|
105
|
-
data: any[];
|
|
106
|
-
/** The total number of entries across all pages */
|
|
107
120
|
total: number;
|
|
108
121
|
/**
|
|
109
122
|
* The index within the data array of the selected row.
|
|
@@ -210,8 +223,13 @@ export interface MassChangeResponse {
|
|
|
210
223
|
* Retrieves paginated list data. Supports authenticated/public access, filtering, sorting, and binary search.
|
|
211
224
|
*
|
|
212
225
|
* Common usage:
|
|
226
|
+
* - Use `getListData` when you need list-specific behavior: pagination, explicit totals,
|
|
227
|
+
* server-side sort/filter, field projection, search, selection, or bulk operations.
|
|
228
|
+
* - Do not choose `getListData` only because the task is a report. Prefer `getAccessibleObjects`
|
|
229
|
+
* for bounded accessible-record reads without list behavior, `getRelatedObjects` when a
|
|
230
|
+
* concrete parent key is already known, or `getAggregateData` for grouped counts/sums.
|
|
213
231
|
* - For most custom-element list UIs, start with only `dataElementId`, pagination fields,
|
|
214
|
-
* and `
|
|
232
|
+
* and `fields`.
|
|
215
233
|
* - Omit `parentDataElementId` and `parentKey` when you want the records the current user
|
|
216
234
|
* can already access.
|
|
217
235
|
* - Add `parentDataElementId` and `parentKey` only when the list must be anchored to a
|
|
@@ -219,48 +237,77 @@ export interface MassChangeResponse {
|
|
|
219
237
|
* - Most callers should omit `options`. Use `options.search` only for binary-search
|
|
220
238
|
* navigation scenarios, and use `options.bypassTotal` only when you explicitly do not
|
|
221
239
|
* need the total count.
|
|
240
|
+
* - For bounded report reads that genuinely need list behavior, set `pageNumber`, an explicit
|
|
241
|
+
* `pageSize`, and `fields` for every field used in filtering, grouping, sorting,
|
|
242
|
+
* aggregation, or rendering.
|
|
243
|
+
*
|
|
244
|
+
* Response shape:
|
|
245
|
+
* - `response.data` is the row array.
|
|
246
|
+
* - `response.total` is the total matching record count across all pages when
|
|
247
|
+
* requested. If `response.total > response.data.length`, this response is
|
|
248
|
+
* a page slice, not the full result set.
|
|
249
|
+
* - Do not read `response.objects`, `response.items`, or the response object itself as
|
|
250
|
+
* the row array.
|
|
251
|
+
*
|
|
252
|
+
* Pagination guidance:
|
|
253
|
+
* - Use `response.total` to decide whether the current page covers the full
|
|
254
|
+
* query. For page 1 with pageSize 100 and total 5,000, local aggregation over
|
|
255
|
+
* `response.data` covers only the first 100 rows.
|
|
256
|
+
* - Do not treat a first page or large page as complete report data just because
|
|
257
|
+
* it contains rows.
|
|
222
258
|
*
|
|
223
259
|
* Request shape:
|
|
224
260
|
* - `dataElementId` (required): root data element to retrieve
|
|
225
261
|
* - `pageNumber` / `pageSize` (optional): pagination
|
|
226
|
-
* - `
|
|
262
|
+
* - `fields` (optional): fields to populate in returned objects
|
|
227
263
|
* - `sort` (optional): sort fields such as `[{ attributeId: 'name' }]`
|
|
228
264
|
* - `filter` (optional): filter expression
|
|
229
265
|
* - `parentDataElementId` / `parentKey` (optional): explicit parent scope
|
|
230
266
|
*
|
|
231
267
|
* @param request - List configuration including dataElementId, parentDataElementId, parentKey, pagination, sort, filter
|
|
232
268
|
* @param options - Optional: isPublic, bypassTotal, search
|
|
233
|
-
* @returns Promise<ListDataResponse
|
|
269
|
+
* @returns Promise<ListDataResponse<TRecord>> with data array, total count, pageNumber
|
|
234
270
|
*
|
|
235
271
|
* @example
|
|
236
272
|
* // Most common case: one page of records the current user can access.
|
|
237
|
-
*
|
|
273
|
+
* type StudentRow = {
|
|
274
|
+
* name: string;
|
|
275
|
+
* studentNumber: string;
|
|
276
|
+
* email: string;
|
|
277
|
+
* grade: string;
|
|
278
|
+
* };
|
|
279
|
+
* const response = await getListData<StudentRow>({
|
|
238
280
|
* dataElementId: 'student',
|
|
239
281
|
* pageNumber: 1,
|
|
240
282
|
* pageSize: 10,
|
|
241
|
-
*
|
|
283
|
+
* fields: ['name', 'studentNumber', 'email', 'grade']
|
|
242
284
|
* });
|
|
285
|
+
* const rows = response.data;
|
|
243
286
|
*
|
|
244
287
|
* @example
|
|
245
288
|
* // Custom element pagination with an optional sort.
|
|
246
|
-
*
|
|
289
|
+
* type StudentListRow = { name: string; studentNumber: string; email: string; grade: string };
|
|
290
|
+
* const response = await getListData<StudentListRow>({
|
|
247
291
|
* dataElementId: 'student',
|
|
248
292
|
* pageNumber: currentPage,
|
|
249
293
|
* pageSize: 10,
|
|
250
|
-
*
|
|
294
|
+
* fields: ['name', 'studentNumber', 'email', 'grade'],
|
|
251
295
|
* sort: [{ attributeId: 'name' }]
|
|
252
296
|
* });
|
|
297
|
+
* const rows = response.data;
|
|
253
298
|
*
|
|
254
299
|
* @example
|
|
255
300
|
* // Explicit parent scoping when the list must be anchored to a specific parent.
|
|
256
|
-
*
|
|
301
|
+
* type CustomerRow = { firstName: string; lastName: string; email: string };
|
|
302
|
+
* const listData = await getListData<CustomerRow>({
|
|
257
303
|
* dataElementId: 'customer',
|
|
258
304
|
* parentDataElementId: 'company',
|
|
259
305
|
* parentKey: orgProxyKey,
|
|
260
306
|
* pageNumber: 1,
|
|
261
307
|
* pageSize: 50,
|
|
262
|
-
*
|
|
308
|
+
* fields: ['firstName', 'lastName', 'email']
|
|
263
309
|
* });
|
|
310
|
+
* const rows = listData.data;
|
|
264
311
|
*
|
|
265
312
|
* @example
|
|
266
313
|
* // options is rarely needed; omit it unless you need one of these behaviors.
|
|
@@ -269,7 +316,7 @@ export interface MassChangeResponse {
|
|
|
269
316
|
* dataElementId: 'student',
|
|
270
317
|
* pageNumber: 1,
|
|
271
318
|
* pageSize: 10,
|
|
272
|
-
*
|
|
319
|
+
* fields: ['name']
|
|
273
320
|
* },
|
|
274
321
|
* {
|
|
275
322
|
* search: {
|
|
@@ -280,7 +327,7 @@ export interface MassChangeResponse {
|
|
|
280
327
|
* }
|
|
281
328
|
* );
|
|
282
329
|
*/
|
|
283
|
-
export declare function getListData(request: PagedListDataRequest, options?: ListDataOptions): Promise<ListDataResponse
|
|
330
|
+
export declare function getListData<TRecord extends Record<string, unknown> = Record<string, unknown>>(request: PagedListDataRequest, options?: ListDataOptions): Promise<ListDataResponse<TRecord>>;
|
|
284
331
|
/**
|
|
285
332
|
* Observable version of getListData. See getListData for details.
|
|
286
333
|
*
|
|
@@ -288,7 +335,7 @@ export declare function getListData(request: PagedListDataRequest, options?: Lis
|
|
|
288
335
|
* getListDataAsObservable({ dataElementId: 'customer', parentDataElementId: 'company', parentKey: orgProxyKey })
|
|
289
336
|
* .subscribe(response => console.log(response.data));
|
|
290
337
|
*/
|
|
291
|
-
export declare function getListDataAsObservable(request: PagedListDataRequest, options?: ListDataOptions): Observable<ListDataResponse
|
|
338
|
+
export declare function getListDataAsObservable<TRecord extends Record<string, unknown> = Record<string, unknown>>(request: PagedListDataRequest, options?: ListDataOptions): Observable<ListDataResponse<TRecord>>;
|
|
292
339
|
/**
|
|
293
340
|
* Bulk update multiple records. The dataRequest defines security scope; only records within that scope can be updated.
|
|
294
341
|
* Use valueType 'literal' to set a value, or 'property' to copy from another field.
|
|
@@ -103,12 +103,35 @@ export interface NotificationConfig {
|
|
|
103
103
|
notificationDefinitionId: string;
|
|
104
104
|
/** The key of the organization proxy */
|
|
105
105
|
organizationProxyKey: string;
|
|
106
|
+
/** The object type of the organization proxy; allows notification dispatch to resolve the owning organization efficiently. */
|
|
107
|
+
organizationProxyType?: string;
|
|
106
108
|
/** The object type of the data associated with the notification */
|
|
107
109
|
dataObjectType: string;
|
|
108
110
|
/** The key of the data object associated with the notification */
|
|
109
111
|
dataObjectKey: string;
|
|
110
112
|
/** The parameters to pass to the notification */
|
|
111
113
|
params: Record<string, any>;
|
|
114
|
+
/** Correlates generated notification history with a payment reminder or other producer-owned source. */
|
|
115
|
+
reminderKey?: string;
|
|
116
|
+
/** When true, render/log recipients but skip actual channel dispatch and quota tracking. */
|
|
117
|
+
previewMode?: boolean;
|
|
118
|
+
/** Outstanding balance copied to generated recipient history rows. */
|
|
119
|
+
totalOutstandingAmount?: number;
|
|
120
|
+
/** Per-send email content override. `summary` is used as the email subject. */
|
|
121
|
+
emailContentOverride?: {
|
|
122
|
+
summary?: string;
|
|
123
|
+
content?: string;
|
|
124
|
+
html?: string;
|
|
125
|
+
};
|
|
126
|
+
/** Per-send SMS content override. */
|
|
127
|
+
smsContentOverride?: {
|
|
128
|
+
content?: string;
|
|
129
|
+
};
|
|
130
|
+
/** Per-send push content override. `summary` is used as the push title. */
|
|
131
|
+
pushContentOverride?: {
|
|
132
|
+
summary?: string;
|
|
133
|
+
content?: string;
|
|
134
|
+
};
|
|
112
135
|
emailConfig?: {
|
|
113
136
|
/** The type of user proxy to send the email to */
|
|
114
137
|
recipientUserProxyType: string;
|
|
@@ -122,6 +145,8 @@ export interface NotificationConfig {
|
|
|
122
145
|
replyEmailAddress?: string;
|
|
123
146
|
/** The email address to send the email to; use when sending emails to non-user proxies/free-form email addresses; can contain a comma-separated list of email addresses */
|
|
124
147
|
recipientEmail?: string;
|
|
148
|
+
/** Optional BCC address(es); comma-separated list allowed. Envelope-only. */
|
|
149
|
+
bccEmail?: string;
|
|
125
150
|
};
|
|
126
151
|
smsConfig?: {
|
|
127
152
|
/** The type of user proxy to send the SMS to */
|