@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
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,14 @@ 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 are building a paged list UI or list-management workflow:
|
|
227
|
+
* pagination, explicit totals, server-side sort for the visible list, field projection, search, selection,
|
|
228
|
+
* or bulk operations.
|
|
229
|
+
* - Do not choose `getListData` only because the task is a report. Prefer `getAccessibleObjects`
|
|
230
|
+
* for bounded accessible-record reads without list behavior, `getRelatedObjects` when a
|
|
231
|
+
* concrete parent key is already known, or `getAggregateData` for grouped counts/sums.
|
|
213
232
|
* - For most custom-element list UIs, start with only `dataElementId`, pagination fields,
|
|
214
|
-
* and `
|
|
233
|
+
* and `fields`.
|
|
215
234
|
* - Omit `parentDataElementId` and `parentKey` when you want the records the current user
|
|
216
235
|
* can already access.
|
|
217
236
|
* - Add `parentDataElementId` and `parentKey` only when the list must be anchored to a
|
|
@@ -219,48 +238,80 @@ export interface MassChangeResponse {
|
|
|
219
238
|
* - Most callers should omit `options`. Use `options.search` only for binary-search
|
|
220
239
|
* navigation scenarios, and use `options.bypassTotal` only when you explicitly do not
|
|
221
240
|
* need the total count.
|
|
241
|
+
* - Do not use `getListData` as a generic bulk-data loader for reports. Use filtered
|
|
242
|
+
* `getAccessibleObjects`, `getRelatedObjects` with a concrete parent key, or `getAggregateData`
|
|
243
|
+
* whenever those can answer the data need directly.
|
|
244
|
+
* - Do not choose `getListData` only because you need a filter. For non-list report/search reads,
|
|
245
|
+
* use filtered `getAccessibleObjects`, `getRelatedObjects` with a concrete parent key,
|
|
246
|
+
* `getObjects` for explicit key lists, or `getAggregateData`.
|
|
247
|
+
*
|
|
248
|
+
* Response shape:
|
|
249
|
+
* - `response.data` is the row array.
|
|
250
|
+
* - `response.total` is the total matching record count across all pages when
|
|
251
|
+
* requested. If `response.total > response.data.length`, this response is
|
|
252
|
+
* a page slice, not the full result set.
|
|
253
|
+
* - Do not read `response.objects`, `response.items`, or the response object itself as
|
|
254
|
+
* the row array.
|
|
255
|
+
*
|
|
256
|
+
* Pagination guidance:
|
|
257
|
+
* - Use `response.total` to decide whether the current page covers the full
|
|
258
|
+
* query. For page 1 with pageSize 100 and total 5,000, local aggregation over
|
|
259
|
+
* `response.data` covers only the first 100 rows.
|
|
260
|
+
* - Do not treat a first page or large page as complete report data just because
|
|
261
|
+
* it contains rows.
|
|
222
262
|
*
|
|
223
263
|
* Request shape:
|
|
224
264
|
* - `dataElementId` (required): root data element to retrieve
|
|
225
265
|
* - `pageNumber` / `pageSize` (optional): pagination
|
|
226
|
-
* - `
|
|
266
|
+
* - `fields` (optional): fields to populate in returned objects
|
|
227
267
|
* - `sort` (optional): sort fields such as `[{ attributeId: 'name' }]`
|
|
228
268
|
* - `filter` (optional): filter expression
|
|
229
269
|
* - `parentDataElementId` / `parentKey` (optional): explicit parent scope
|
|
230
270
|
*
|
|
231
271
|
* @param request - List configuration including dataElementId, parentDataElementId, parentKey, pagination, sort, filter
|
|
232
272
|
* @param options - Optional: isPublic, bypassTotal, search
|
|
233
|
-
* @returns Promise<ListDataResponse
|
|
273
|
+
* @returns Promise<ListDataResponse<TRecord>> with data array, total count, pageNumber
|
|
234
274
|
*
|
|
235
275
|
* @example
|
|
236
276
|
* // Most common case: one page of records the current user can access.
|
|
237
|
-
*
|
|
277
|
+
* type StudentRow = {
|
|
278
|
+
* name: string;
|
|
279
|
+
* studentNumber: string;
|
|
280
|
+
* email: string;
|
|
281
|
+
* grade: string;
|
|
282
|
+
* };
|
|
283
|
+
* const response = await getListData<StudentRow>({
|
|
238
284
|
* dataElementId: 'student',
|
|
239
285
|
* pageNumber: 1,
|
|
240
286
|
* pageSize: 10,
|
|
241
|
-
*
|
|
287
|
+
* fields: ['name', 'studentNumber', 'email', 'grade']
|
|
242
288
|
* });
|
|
289
|
+
* const rows = response.data;
|
|
243
290
|
*
|
|
244
291
|
* @example
|
|
245
292
|
* // Custom element pagination with an optional sort.
|
|
246
|
-
*
|
|
293
|
+
* type StudentListRow = { name: string; studentNumber: string; email: string; grade: string };
|
|
294
|
+
* const response = await getListData<StudentListRow>({
|
|
247
295
|
* dataElementId: 'student',
|
|
248
296
|
* pageNumber: currentPage,
|
|
249
297
|
* pageSize: 10,
|
|
250
|
-
*
|
|
298
|
+
* fields: ['name', 'studentNumber', 'email', 'grade'],
|
|
251
299
|
* sort: [{ attributeId: 'name' }]
|
|
252
300
|
* });
|
|
301
|
+
* const rows = response.data;
|
|
253
302
|
*
|
|
254
303
|
* @example
|
|
255
304
|
* // Explicit parent scoping when the list must be anchored to a specific parent.
|
|
256
|
-
*
|
|
305
|
+
* type CustomerRow = { firstName: string; lastName: string; email: string };
|
|
306
|
+
* const listData = await getListData<CustomerRow>({
|
|
257
307
|
* dataElementId: 'customer',
|
|
258
308
|
* parentDataElementId: 'company',
|
|
259
309
|
* parentKey: orgProxyKey,
|
|
260
310
|
* pageNumber: 1,
|
|
261
311
|
* pageSize: 50,
|
|
262
|
-
*
|
|
312
|
+
* fields: ['firstName', 'lastName', 'email']
|
|
263
313
|
* });
|
|
314
|
+
* const rows = listData.data;
|
|
264
315
|
*
|
|
265
316
|
* @example
|
|
266
317
|
* // options is rarely needed; omit it unless you need one of these behaviors.
|
|
@@ -269,7 +320,7 @@ export interface MassChangeResponse {
|
|
|
269
320
|
* dataElementId: 'student',
|
|
270
321
|
* pageNumber: 1,
|
|
271
322
|
* pageSize: 10,
|
|
272
|
-
*
|
|
323
|
+
* fields: ['name']
|
|
273
324
|
* },
|
|
274
325
|
* {
|
|
275
326
|
* search: {
|
|
@@ -280,7 +331,7 @@ export interface MassChangeResponse {
|
|
|
280
331
|
* }
|
|
281
332
|
* );
|
|
282
333
|
*/
|
|
283
|
-
export declare function getListData(request: PagedListDataRequest, options?: ListDataOptions): Promise<ListDataResponse
|
|
334
|
+
export declare function getListData<TRecord extends Record<string, unknown> = Record<string, unknown>>(request: PagedListDataRequest, options?: ListDataOptions): Promise<ListDataResponse<TRecord>>;
|
|
284
335
|
/**
|
|
285
336
|
* Observable version of getListData. See getListData for details.
|
|
286
337
|
*
|
|
@@ -288,7 +339,7 @@ export declare function getListData(request: PagedListDataRequest, options?: Lis
|
|
|
288
339
|
* getListDataAsObservable({ dataElementId: 'customer', parentDataElementId: 'company', parentKey: orgProxyKey })
|
|
289
340
|
* .subscribe(response => console.log(response.data));
|
|
290
341
|
*/
|
|
291
|
-
export declare function getListDataAsObservable(request: PagedListDataRequest, options?: ListDataOptions): Observable<ListDataResponse
|
|
342
|
+
export declare function getListDataAsObservable<TRecord extends Record<string, unknown> = Record<string, unknown>>(request: PagedListDataRequest, options?: ListDataOptions): Observable<ListDataResponse<TRecord>>;
|
|
292
343
|
/**
|
|
293
344
|
* Bulk update multiple records. The dataRequest defines security scope; only records within that scope can be updated.
|
|
294
345
|
* 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 */
|