@kissflow/lowcode-client-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/dist/index.d.ts +244 -127
- package/dist/kf.lowcodeworkersdk.es.js +1856 -0
- package/dist/kf.nocodeworkersdk.es.js +761 -0
- package/dist/kfsdk.es.js +301 -205
- package/dist/kfsdk.umd.js +1 -1
- package/dist/lowcode.d.ts +242 -125
- package/dist/lowcode.types.d.ts +127 -125
- package/dist/nocode.d.ts +181 -64
- package/dist/nocode.types.d.ts +53 -9
- package/dist/snippets.json +5 -0
- package/package.json +1 -1
package/dist/nocode.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ declare module "core/constants" {
|
|
|
70
70
|
CUSTOM_FUNCTION_ON_RUN_COMPLETE: string;
|
|
71
71
|
CUSTOM_FUNCTION_STOP_WATCH: string;
|
|
72
72
|
DECISION_TABLE_EXECUTE: string;
|
|
73
|
+
REPORT_GET_DATA: string;
|
|
74
|
+
REPORT_GET_COUNT: string;
|
|
75
|
+
REPORT_GET_FIELDS: string;
|
|
73
76
|
DATAFORM_IMPORT_CSV: string;
|
|
74
77
|
DATAFORM_OPEN_FORM: string;
|
|
75
78
|
DATAFORM_GET_FIELDS: string;
|
|
@@ -169,7 +172,7 @@ declare module "core/index" {
|
|
|
169
172
|
declare module "form/index" {
|
|
170
173
|
import { BaseSDK } from "core/index";
|
|
171
174
|
export class Form extends BaseSDK {
|
|
172
|
-
|
|
175
|
+
protected storeId: string;
|
|
173
176
|
private flowId;
|
|
174
177
|
type: string;
|
|
175
178
|
instanceId: string;
|
|
@@ -178,37 +181,49 @@ declare module "form/index" {
|
|
|
178
181
|
toJSON(): any;
|
|
179
182
|
getField(fieldId: string): any;
|
|
180
183
|
updateField(args: object): any;
|
|
184
|
+
getTable(tableId: string): Table<this>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Form with custom-component-only capabilities.
|
|
188
|
+
*
|
|
189
|
+
* Returned by `initForm()` on the custom-component Board/Dataform/Process
|
|
190
|
+
* accessors. Adds the form-state readers (`getValidationErrors`,
|
|
191
|
+
* `getFormConfiguration`, `getFieldState`), which are not available on the
|
|
192
|
+
* base `Form` exposed via `kf.context` in the Low/No-code (Run Script) SDKs.
|
|
193
|
+
*/
|
|
194
|
+
export class CustomComponentForm extends Form {
|
|
181
195
|
getValidationErrors(): any;
|
|
182
196
|
getFormConfiguration(): any;
|
|
183
197
|
getFieldState(): any;
|
|
184
|
-
getTable(tableId: string): Table;
|
|
185
198
|
}
|
|
186
|
-
class Table extends BaseSDK {
|
|
199
|
+
class Table<F extends Form = Form> extends BaseSDK {
|
|
187
200
|
private storeId;
|
|
188
201
|
private flowId;
|
|
189
202
|
private instanceId;
|
|
190
203
|
private tableId;
|
|
191
204
|
private activityInstanceId?;
|
|
192
|
-
|
|
205
|
+
private parent?;
|
|
206
|
+
constructor(storeId: string, flowId: string, instanceId: string, tableId: string, activityInstanceId?: string, parent?: F);
|
|
193
207
|
toJSON(): any;
|
|
194
208
|
getSelectedRows(): any;
|
|
195
|
-
getRows(): TableForm[]
|
|
196
|
-
getRow(rowId: string): TableForm
|
|
209
|
+
getRows(): Promise<TableForm<F>[]>;
|
|
210
|
+
getRow(rowId: string): TableForm<F>;
|
|
197
211
|
addRow(rowObject: object): any;
|
|
198
212
|
addRows(rows: object[]): any;
|
|
199
213
|
deleteRow(rowId: string): any;
|
|
200
214
|
deleteRows(rows: string[]): any;
|
|
201
215
|
}
|
|
202
|
-
export class TableForm extends BaseSDK {
|
|
216
|
+
export class TableForm<F extends Form = Form> extends BaseSDK {
|
|
203
217
|
private storeId;
|
|
204
218
|
private flowId;
|
|
205
219
|
private instanceId;
|
|
206
220
|
private tableId;
|
|
207
221
|
private rowId;
|
|
208
222
|
private activityInstanceId?;
|
|
223
|
+
private parent?;
|
|
209
224
|
type: string;
|
|
210
|
-
constructor(storeId: string, flowId: string, instanceId: string, tableId: string, rowId: string, activityInstanceId?: string);
|
|
211
|
-
getParent():
|
|
225
|
+
constructor(storeId: string, flowId: string, instanceId: string, tableId: string, rowId: string, activityInstanceId?: string, parent?: F);
|
|
226
|
+
getParent(): F;
|
|
212
227
|
toJSON(): any;
|
|
213
228
|
getField(fieldId: string): any;
|
|
214
229
|
updateField(args: object): any;
|
|
@@ -232,13 +247,13 @@ declare module "types/external" {
|
|
|
232
247
|
};
|
|
233
248
|
export type PayloadOptions = {
|
|
234
249
|
Columns?: any[];
|
|
235
|
-
|
|
250
|
+
Filter?: any;
|
|
236
251
|
Sort?: PayloadSortItem[];
|
|
237
252
|
FilterParam?: any;
|
|
238
253
|
};
|
|
239
254
|
export type ProcessPayloadOptions = {
|
|
240
255
|
Columns?: any[];
|
|
241
|
-
|
|
256
|
+
Filter?: any;
|
|
242
257
|
Sort?: PayloadSortItem[];
|
|
243
258
|
};
|
|
244
259
|
export type userObject = {
|
|
@@ -362,7 +377,7 @@ declare module "types/external" {
|
|
|
362
377
|
export type ProcessDiscardItemOptions = {
|
|
363
378
|
instanceId: string;
|
|
364
379
|
};
|
|
365
|
-
export type ProcessFieldOptions = {
|
|
380
|
+
export type ProcessFieldOptions = BaseQueryOptions & {
|
|
366
381
|
instanceId: string;
|
|
367
382
|
activityInstanceId: string;
|
|
368
383
|
fieldId: string;
|
|
@@ -398,6 +413,34 @@ declare module "types/external" {
|
|
|
398
413
|
payload?: PayloadOptions;
|
|
399
414
|
};
|
|
400
415
|
export type DataformQueryResponse = QueryResponse;
|
|
416
|
+
export type ReportFlowType = "Form" | "Process" | "Case";
|
|
417
|
+
export type ReportPayload = {
|
|
418
|
+
FilterParam?: Record<string, string | string[] | object>;
|
|
419
|
+
};
|
|
420
|
+
export type ReportQueryOptions = {
|
|
421
|
+
pageNumber?: number;
|
|
422
|
+
pageSize?: number;
|
|
423
|
+
payload?: ReportPayload;
|
|
424
|
+
};
|
|
425
|
+
export type ReportCountOptions = {
|
|
426
|
+
payload?: ReportPayload;
|
|
427
|
+
};
|
|
428
|
+
export type ReportField = {
|
|
429
|
+
Id: string;
|
|
430
|
+
Name: string;
|
|
431
|
+
[key: string]: any;
|
|
432
|
+
};
|
|
433
|
+
export type ReportDataResponse = {
|
|
434
|
+
Data: any[];
|
|
435
|
+
Columns?: any[];
|
|
436
|
+
Rows?: any[];
|
|
437
|
+
Values?: any[];
|
|
438
|
+
FieldMapping?: any[];
|
|
439
|
+
Formatting?: any[];
|
|
440
|
+
Id?: string;
|
|
441
|
+
Name?: string;
|
|
442
|
+
[key: string]: any;
|
|
443
|
+
};
|
|
401
444
|
export type DataformCreateItemOptions = {
|
|
402
445
|
data?: object;
|
|
403
446
|
viewId?: string;
|
|
@@ -423,7 +466,7 @@ declare module "types/external" {
|
|
|
423
466
|
data?: object;
|
|
424
467
|
viewId?: string;
|
|
425
468
|
};
|
|
426
|
-
export type DataformFieldOptions = {
|
|
469
|
+
export type DataformFieldOptions = BaseQueryOptions & {
|
|
427
470
|
instanceId: string;
|
|
428
471
|
fieldId: string;
|
|
429
472
|
/** Skip the server-side model lookup by supplying the field's type directly. */
|
|
@@ -438,6 +481,7 @@ declare module "types/external" {
|
|
|
438
481
|
export type BoardQueryResponse = QueryResponse;
|
|
439
482
|
export type BoardGetItemOptions = {
|
|
440
483
|
instanceId: string;
|
|
484
|
+
viewId?: string;
|
|
441
485
|
};
|
|
442
486
|
export type BoardCreateItemOptions = {
|
|
443
487
|
data?: object;
|
|
@@ -456,7 +500,7 @@ declare module "types/external" {
|
|
|
456
500
|
export type BoardDiscardItemOptions = {
|
|
457
501
|
instanceId: string;
|
|
458
502
|
};
|
|
459
|
-
export type BoardFieldOptions = {
|
|
503
|
+
export type BoardFieldOptions = BaseQueryOptions & {
|
|
460
504
|
instanceId: string;
|
|
461
505
|
fieldId: string;
|
|
462
506
|
/** Skip the server-side model lookup by supplying the field's type directly. */
|
|
@@ -1062,10 +1106,10 @@ declare module "app/page" {
|
|
|
1062
1106
|
}
|
|
1063
1107
|
declare module "dataform/index" {
|
|
1064
1108
|
import { BaseSDK } from "core/index";
|
|
1065
|
-
import {
|
|
1109
|
+
import { CustomComponentForm } from "form/index";
|
|
1066
1110
|
import { DataformItem, DataformQueryOptions, DataformQueryResponse, DataformCreateItemOptions, DataformUpdateItemOptions, DataformGetItemOptions, DataformDeleteItemOptions, DataformDiscardItemOptions, DataformSubmitItemOptions, DataformFieldOptions } from "types/external";
|
|
1067
1111
|
export class Dataform extends BaseSDK {
|
|
1068
|
-
|
|
1112
|
+
protected _id: string;
|
|
1069
1113
|
constructor(flowId: string);
|
|
1070
1114
|
/**
|
|
1071
1115
|
* Get all items from this dataform with optional filtering, sorting, and pagination
|
|
@@ -1132,6 +1176,15 @@ declare module "dataform/index" {
|
|
|
1132
1176
|
getFields(options?: {
|
|
1133
1177
|
viewId?: string;
|
|
1134
1178
|
}): Promise<any>;
|
|
1179
|
+
getFieldOptions(options: DataformFieldOptions): Promise<DataformQueryResponse>;
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Dataform with custom-component-only capabilities.
|
|
1183
|
+
*
|
|
1184
|
+
* Returned by `kf.app.getDataform()` inside a custom component. Adds `initForm`,
|
|
1185
|
+
* which is not available in the Low/No-code (Run Script) SDKs.
|
|
1186
|
+
*/
|
|
1187
|
+
export class CustomComponentDataform extends Dataform {
|
|
1135
1188
|
/**
|
|
1136
1189
|
* Initialize a form with all necessary data (schema, item data, form store)
|
|
1137
1190
|
* This is the recommended way to create a custom form for dataform records
|
|
@@ -1154,16 +1207,15 @@ declare module "dataform/index" {
|
|
|
1154
1207
|
* const form = await dataform.initForm();
|
|
1155
1208
|
* await form.updateField({ firstName: "John" });
|
|
1156
1209
|
*/
|
|
1157
|
-
initForm(instanceId?: string, viewId?: string): Promise<
|
|
1158
|
-
getFieldOptions(options?: DataformFieldOptions): Promise<DataformQueryResponse>;
|
|
1210
|
+
initForm(instanceId?: string, viewId?: string): Promise<CustomComponentForm>;
|
|
1159
1211
|
}
|
|
1160
1212
|
}
|
|
1161
1213
|
declare module "board/index" {
|
|
1162
1214
|
import { BaseSDK } from "core/index";
|
|
1163
|
-
import {
|
|
1215
|
+
import { CustomComponentForm } from "form/index";
|
|
1164
1216
|
import { BoardItem, BoardGetItemOptions, BoardGetItemsOptions, BoardQueryResponse, BoardCreateItemOptions, BoardUpdateItemOptions, BoardDeleteItemOptions, BoardSubmitItemOptions, BoardDiscardItemOptions, BoardFieldOptions } from "types/external";
|
|
1165
1217
|
export class Board extends BaseSDK {
|
|
1166
|
-
|
|
1218
|
+
protected _id: string;
|
|
1167
1219
|
constructor(flowId: string);
|
|
1168
1220
|
/**
|
|
1169
1221
|
* Import data from CSV file
|
|
@@ -1187,7 +1239,7 @@ declare module "board/index" {
|
|
|
1187
1239
|
getItems(options?: BoardGetItemsOptions): Promise<BoardQueryResponse>;
|
|
1188
1240
|
/**
|
|
1189
1241
|
* Get a single board/case item by instance ID
|
|
1190
|
-
* @param options - instanceId (required)
|
|
1242
|
+
* @param options - instanceId (required), optional viewId
|
|
1191
1243
|
* @returns Promise containing the item data
|
|
1192
1244
|
*/
|
|
1193
1245
|
getItem(options: BoardGetItemOptions): Promise<BoardItem>;
|
|
@@ -1198,7 +1250,7 @@ declare module "board/index" {
|
|
|
1198
1250
|
*
|
|
1199
1251
|
* @example
|
|
1200
1252
|
* const board = kf.app.getBoard("Inventory");
|
|
1201
|
-
* const item = await board.createItem({ data: {
|
|
1253
|
+
* const item = await board.createItem({ data: { itemType: "New Item" } });
|
|
1202
1254
|
*/
|
|
1203
1255
|
createItem(options?: BoardCreateItemOptions): Promise<BoardItem>;
|
|
1204
1256
|
/**
|
|
@@ -1210,7 +1262,7 @@ declare module "board/index" {
|
|
|
1210
1262
|
* const board = kf.app.getBoard("Inventory");
|
|
1211
1263
|
* await board.updateItem({
|
|
1212
1264
|
* instanceId: "item_123",
|
|
1213
|
-
* data: {
|
|
1265
|
+
* data: { itemType: "Updated Item" }
|
|
1214
1266
|
* });
|
|
1215
1267
|
*/
|
|
1216
1268
|
updateItem(options: BoardUpdateItemOptions): Promise<BoardItem>;
|
|
@@ -1241,6 +1293,27 @@ declare module "board/index" {
|
|
|
1241
1293
|
getFields(options?: {
|
|
1242
1294
|
viewId?: string;
|
|
1243
1295
|
}): Promise<any>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Get field options for dropdown/lookup fields
|
|
1298
|
+
* @param options - Field options (instanceId, fieldId)
|
|
1299
|
+
* @returns Promise containing the field options
|
|
1300
|
+
*
|
|
1301
|
+
* @example
|
|
1302
|
+
* const board = kf.app.getBoard("Inventory");
|
|
1303
|
+
* const options = await board.getFieldOptions({
|
|
1304
|
+
* instanceId: "item_123",
|
|
1305
|
+
* fieldId: "Category"
|
|
1306
|
+
* });
|
|
1307
|
+
*/
|
|
1308
|
+
getFieldOptions(options: BoardFieldOptions): Promise<any>;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Board with custom-component-only capabilities.
|
|
1312
|
+
*
|
|
1313
|
+
* Returned by `kf.app.getBoard()` inside a custom component. Adds `initForm`,
|
|
1314
|
+
* which is not available in the Low/No-code (Run Script) SDKs.
|
|
1315
|
+
*/
|
|
1316
|
+
export class CustomComponentBoard extends Board {
|
|
1244
1317
|
/**
|
|
1245
1318
|
* Initialize a form for a board item with all necessary setup
|
|
1246
1319
|
* Fetches schema, item data, creates and initializes the form store
|
|
@@ -1253,7 +1326,7 @@ declare module "board/index" {
|
|
|
1253
1326
|
* // Create new board item
|
|
1254
1327
|
* const board = kf.app.getBoard("Inventory");
|
|
1255
1328
|
* const form = await board.initForm();
|
|
1256
|
-
* await form.updateField({
|
|
1329
|
+
* await form.updateField({ itemType: "New Item" });
|
|
1257
1330
|
*
|
|
1258
1331
|
* // Edit existing board item
|
|
1259
1332
|
* const form = await board.initForm("item_123");
|
|
@@ -1262,28 +1335,15 @@ declare module "board/index" {
|
|
|
1262
1335
|
* // Edit existing board item scoped to a view
|
|
1263
1336
|
* const form = await board.initForm("item_123", "Inventory_View");
|
|
1264
1337
|
*/
|
|
1265
|
-
initForm(instanceId?: string, viewId?: string): Promise<
|
|
1266
|
-
/**
|
|
1267
|
-
* Get field options for dropdown/lookup fields
|
|
1268
|
-
* @param options - Field options (instanceId, fieldId)
|
|
1269
|
-
* @returns Promise containing the field options
|
|
1270
|
-
*
|
|
1271
|
-
* @example
|
|
1272
|
-
* const board = kf.app.getBoard("Inventory");
|
|
1273
|
-
* const options = await board.getFieldOptions({
|
|
1274
|
-
* instanceId: "item_123",
|
|
1275
|
-
* fieldId: "Category"
|
|
1276
|
-
* });
|
|
1277
|
-
*/
|
|
1278
|
-
getFieldOptions(options: BoardFieldOptions): Promise<any>;
|
|
1338
|
+
initForm(instanceId?: string, viewId?: string): Promise<CustomComponentForm>;
|
|
1279
1339
|
}
|
|
1280
1340
|
}
|
|
1281
1341
|
declare module "process/index" {
|
|
1282
1342
|
import { BaseSDK } from "core/index";
|
|
1283
|
-
import {
|
|
1343
|
+
import { CustomComponentForm } from "form/index";
|
|
1284
1344
|
import { ProcessItem, ProcessGetItemOptions, ProcessMyItemsOptions, ProcessMyTasksOptions, ProcessParticipatedOptions, ProcessAdminOptions, ProcessQueryResponse, ProcessCreateItemOptions, ProcessUpdateItemOptions, ProcessDeleteItemOptions, ProcessGetAdminItemOptions, ProcessUpdateAdminItemOptions, ProcessSubmitItemOptions, ProcessRejectItemOptions, ProcessWithdrawItemOptions, ProcessSendbackItemOptions, ProcessReassignItemOptions, ProcessGetReassigneesOptions, ProcessRestartItemOptions, ProcessDiscardItemOptions, ProcessFieldOptions, ProcessParseAttachmentOptions, ProcessAttachmentParseResult } from "types/external";
|
|
1285
1345
|
export class Process extends BaseSDK {
|
|
1286
|
-
|
|
1346
|
+
protected _id: string;
|
|
1287
1347
|
constructor(flowId: string);
|
|
1288
1348
|
/**
|
|
1289
1349
|
* Get my items from this process (items I initiated)
|
|
@@ -1489,26 +1549,7 @@ declare module "process/index" {
|
|
|
1489
1549
|
getProgress(options: {
|
|
1490
1550
|
instanceId: string;
|
|
1491
1551
|
}): Promise<any>;
|
|
1492
|
-
|
|
1493
|
-
* Initialize a form with all necessary data (schema, item data, form store)
|
|
1494
|
-
* This is the recommended way to create a custom form for dataform records
|
|
1495
|
-
* It automatically handles fetching schema, item data, and initializing the form store
|
|
1496
|
-
*
|
|
1497
|
-
* @param instanceId - Optional instance ID of the dataform record. If omitted, creates a new record
|
|
1498
|
-
* @returns Promise with Form instance ready to use
|
|
1499
|
-
*
|
|
1500
|
-
* @example
|
|
1501
|
-
* // Load existing record
|
|
1502
|
-
* const dataform = kf.app.getDataform("EmpMaster");
|
|
1503
|
-
* const form = await dataform.initForm("emp_123");
|
|
1504
|
-
* const data = await form.toJSON();
|
|
1505
|
-
*
|
|
1506
|
-
* // Create new record
|
|
1507
|
-
* const form = await dataform.initForm();
|
|
1508
|
-
* await form.updateField({ firstName: "John" });
|
|
1509
|
-
*/
|
|
1510
|
-
initForm(instanceId?: string, activityInstanceId?: string): Promise<Form>;
|
|
1511
|
-
getFieldOptions(options?: ProcessFieldOptions): Promise<ProcessQueryResponse>;
|
|
1552
|
+
getFieldOptions(options: ProcessFieldOptions): Promise<ProcessQueryResponse>;
|
|
1512
1553
|
/**
|
|
1513
1554
|
* Trigger AI document parsing on an uploaded file for a Smart Attachment field.
|
|
1514
1555
|
* Matches native platform behavior: matching empty fields are auto-filled directly
|
|
@@ -1524,17 +1565,72 @@ declare module "process/index" {
|
|
|
1524
1565
|
*/
|
|
1525
1566
|
parseAttachment(options: ProcessParseAttachmentOptions): Promise<ProcessAttachmentParseResult>;
|
|
1526
1567
|
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Process with custom-component-only capabilities.
|
|
1570
|
+
*
|
|
1571
|
+
* Returned by `kf.app.getProcess()` inside a custom component. Adds `initForm`,
|
|
1572
|
+
* which is not available in the Low/No-code (Run Script) SDKs.
|
|
1573
|
+
*/
|
|
1574
|
+
export class CustomComponentProcess extends Process {
|
|
1575
|
+
/**
|
|
1576
|
+
* Initialize a form with all necessary data (schema, item data, form store)
|
|
1577
|
+
* This is the recommended way to create a custom form for process instances
|
|
1578
|
+
* It automatically handles fetching schema, item data, and initializing the form store
|
|
1579
|
+
*
|
|
1580
|
+
* @param instanceId - Optional instance ID of the process record. If omitted, creates a new instance
|
|
1581
|
+
* @param activityInstanceId - Optional activity (task) instance the form is being filled for
|
|
1582
|
+
* @returns Promise with Form instance ready to use
|
|
1583
|
+
*
|
|
1584
|
+
* @example
|
|
1585
|
+
* // Start a new process instance
|
|
1586
|
+
* const form = await process.initForm();
|
|
1587
|
+
* await form.updateField({ LeaveType: "Annual" });
|
|
1588
|
+
*
|
|
1589
|
+
* // Continue an in-progress task
|
|
1590
|
+
* const form = await process.initForm("item_123", "act_456");
|
|
1591
|
+
* const data = await form.toJSON();
|
|
1592
|
+
*/
|
|
1593
|
+
initForm(instanceId?: string, activityInstanceId?: string): Promise<CustomComponentForm>;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
declare module "app/report" {
|
|
1597
|
+
import { BaseSDK } from "core/index";
|
|
1598
|
+
import { ReportFlowType, ReportQueryOptions, ReportCountOptions, ReportField, ReportDataResponse } from "types/external";
|
|
1599
|
+
/**
|
|
1600
|
+
* A flow report of the current app. The handle sends no request until you call one of its methods.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* const report = kf.app.getReport("Process", "Leave_Request_A00", "Requests_by_status_x1Yz");
|
|
1604
|
+
* const { Data } = await report.getData();
|
|
1605
|
+
*/
|
|
1606
|
+
export class Report extends BaseSDK {
|
|
1607
|
+
private _flowType;
|
|
1608
|
+
private _flowId;
|
|
1609
|
+
private _id;
|
|
1610
|
+
constructor(flowType: ReportFlowType, flowId: string, reportId: string);
|
|
1611
|
+
/**
|
|
1612
|
+
* The report's calculated rows: groups and their values for a chart, the aggregate for a card.
|
|
1613
|
+
* @param options - pageNumber (a whole number from 1, default 1), pageSize (a whole number from 1 to 100, default 50), payload (sent as the request body; filter at read time with the report's parameters, { FilterParam: { "$name": "text" } }; a falsy value is skipped, so send 0 as "0")
|
|
1614
|
+
*/
|
|
1615
|
+
getData(options?: ReportQueryOptions): Promise<ReportDataResponse>;
|
|
1616
|
+
/** The number of rows a tabular report would return. Chart and card reports have no row count; use getData(). */
|
|
1617
|
+
getCount(options?: ReportCountOptions): Promise<number>;
|
|
1618
|
+
/** The fields of a tabular report. Empty for chart and card reports; use getData(). */
|
|
1619
|
+
getFields(): Promise<ReportField[]>;
|
|
1620
|
+
private _send;
|
|
1621
|
+
}
|
|
1527
1622
|
}
|
|
1528
1623
|
declare module "app/index" {
|
|
1529
1624
|
import { BaseSDK } from "core/index";
|
|
1530
1625
|
import { Page } from "app/page";
|
|
1531
1626
|
import { AppContext } from "types/internal";
|
|
1532
|
-
import { rolesObject, RunEnvelope, RunWatchError } from "types/external";
|
|
1627
|
+
import { rolesObject, ReportFlowType, RunEnvelope, RunWatchError } from "types/external";
|
|
1533
1628
|
import { DecisionTable } from "app/decisiontable";
|
|
1629
|
+
import { Dataform, CustomComponentDataform } from "dataform/index";
|
|
1630
|
+
import { Board, CustomComponentBoard } from "board/index";
|
|
1631
|
+
import { Process, CustomComponentProcess } from "process/index";
|
|
1534
1632
|
import { Agent } from "app/agent";
|
|
1535
|
-
import {
|
|
1536
|
-
import { Board } from "board/index";
|
|
1537
|
-
import { Process } from "process/index";
|
|
1633
|
+
import { Report } from "app/report";
|
|
1538
1634
|
export class Application extends BaseSDK {
|
|
1539
1635
|
page: Page;
|
|
1540
1636
|
_id: string;
|
|
@@ -1606,6 +1702,14 @@ declare module "app/index" {
|
|
|
1606
1702
|
* const { ExecutionId } = await agent.execute({ inputData: { request: "Two desks" } });
|
|
1607
1703
|
*/
|
|
1608
1704
|
getAgent(agentId: string): Agent;
|
|
1705
|
+
/**
|
|
1706
|
+
* Get a flow report of this app: one call returns the report's calculated data instead of every record.
|
|
1707
|
+
*
|
|
1708
|
+
* @example
|
|
1709
|
+
* const report = kf.app.getReport("Process", "Leave_Request_A00", "Requests_by_status_x1Yz");
|
|
1710
|
+
* const { Data } = await report.getData();
|
|
1711
|
+
*/
|
|
1712
|
+
getReport(flowType: ReportFlowType, flowId: string, reportId: string): Report;
|
|
1609
1713
|
getDataform(flowId: string): Dataform;
|
|
1610
1714
|
getBoard(flowId: string): Board;
|
|
1611
1715
|
getProcess(flowId: string): Process;
|
|
@@ -1647,8 +1751,21 @@ declare module "app/index" {
|
|
|
1647
1751
|
roleName?: string;
|
|
1648
1752
|
}): Promise<rolesObject>;
|
|
1649
1753
|
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Application with custom-component-only capabilities.
|
|
1756
|
+
*
|
|
1757
|
+
* Used by the custom-component SDK (`kf.app`). Its flow accessors return the
|
|
1758
|
+
* `CustomComponent*` variants, which expose `initForm` — a method that the
|
|
1759
|
+
* Low/No-code (Run Script) SDKs deliberately do not have.
|
|
1760
|
+
*/
|
|
1761
|
+
export class CustomComponentApplication extends Application {
|
|
1762
|
+
getDataform(flowId: string): CustomComponentDataform;
|
|
1763
|
+
getBoard(flowId: string): CustomComponentBoard;
|
|
1764
|
+
getProcess(flowId: string): CustomComponentProcess;
|
|
1765
|
+
}
|
|
1650
1766
|
export * from "app/component";
|
|
1651
1767
|
export { Agent };
|
|
1768
|
+
export { Report };
|
|
1652
1769
|
export { Page };
|
|
1653
1770
|
export * from "app/popup";
|
|
1654
1771
|
}
|
package/dist/nocode.types.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
declare class Form {
|
|
3
|
+
storeId: string
|
|
3
4
|
type: string
|
|
4
5
|
instanceId: string
|
|
5
6
|
activityInstanceId: string
|
|
6
7
|
toJSON(): any;
|
|
7
8
|
getField(fieldId: string): any;
|
|
8
9
|
updateField(args: object): any;
|
|
9
|
-
getValidationErrors(): any;
|
|
10
|
-
getFormConfiguration(): any;
|
|
11
|
-
getFieldState(): any;
|
|
12
10
|
getTable(tableId: string): Table;
|
|
13
11
|
}
|
|
14
12
|
declare class Table {
|
|
15
13
|
toJSON(): any;
|
|
16
14
|
getSelectedRows(): any;
|
|
17
|
-
getRows(): TableForm[]
|
|
15
|
+
getRows(): Promise<TableForm[]>;
|
|
18
16
|
getRow(rowId: string): TableForm;
|
|
19
17
|
addRow(rowObject: object): any;
|
|
20
18
|
addRows(rows: object[]): any;
|
|
@@ -248,14 +246,14 @@ declare type PayloadSortItem = {
|
|
|
248
246
|
|
|
249
247
|
declare type PayloadOptions = {
|
|
250
248
|
Columns?: any[];
|
|
251
|
-
|
|
249
|
+
Filter?: any;
|
|
252
250
|
Sort?: PayloadSortItem[];
|
|
253
251
|
FilterParam?: any;
|
|
254
252
|
};
|
|
255
253
|
|
|
256
254
|
declare type ProcessPayloadOptions = {
|
|
257
255
|
Columns?: any[];
|
|
258
|
-
|
|
256
|
+
Filter?: any;
|
|
259
257
|
Sort?: PayloadSortItem[];
|
|
260
258
|
};
|
|
261
259
|
|
|
@@ -428,7 +426,7 @@ declare type ProcessDiscardItemOptions = {
|
|
|
428
426
|
instanceId: string;
|
|
429
427
|
};
|
|
430
428
|
|
|
431
|
-
declare type ProcessFieldOptions = {
|
|
429
|
+
declare type ProcessFieldOptions = BaseQueryOptions & {
|
|
432
430
|
instanceId: string;
|
|
433
431
|
activityInstanceId: string;
|
|
434
432
|
fieldId: string;
|
|
@@ -475,6 +473,51 @@ declare type DataformQueryOptions = BaseQueryOptions & {
|
|
|
475
473
|
|
|
476
474
|
declare type DataformQueryResponse = QueryResponse;
|
|
477
475
|
|
|
476
|
+
// ============================================
|
|
477
|
+
// Report Types
|
|
478
|
+
// ============================================
|
|
479
|
+
|
|
480
|
+
declare type ReportFlowType = "Form" | "Process" | "Case";
|
|
481
|
+
|
|
482
|
+
// The request body of a report read. Only FilterParam is read: it sets the report's open parameters, each named with
|
|
483
|
+
// a leading $ and sent as text ({ "$status": "Completed" }). Any other key is ignored.
|
|
484
|
+
declare type ReportPayload = {
|
|
485
|
+
FilterParam?: Record<string, string | string[] | object>;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
declare type ReportQueryOptions = {
|
|
489
|
+
pageNumber?: number;
|
|
490
|
+
pageSize?: number;
|
|
491
|
+
payload?: ReportPayload;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
declare type ReportCountOptions = {
|
|
495
|
+
payload?: ReportPayload;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
// A field of a tabular report. The report service may add keys such as Type.
|
|
499
|
+
declare type ReportField = {
|
|
500
|
+
Id: string;
|
|
501
|
+
Name: string;
|
|
502
|
+
[key: string]: any;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
// Which of these keys come back depends on the report's type: a chart has Columns and Values (and Rows with a
|
|
506
|
+
// series), a card has FieldMapping and Values (its Data is empty when nothing matches), a tabular report has
|
|
507
|
+
// Columns, Id and Name, a pivot has Columns, Rows, Values and Formatting. Each Data row is keyed by the Id of its
|
|
508
|
+
// Columns, Rows or Values entry.
|
|
509
|
+
declare type ReportDataResponse = {
|
|
510
|
+
Data: any[];
|
|
511
|
+
Columns?: any[];
|
|
512
|
+
Rows?: any[];
|
|
513
|
+
Values?: any[];
|
|
514
|
+
FieldMapping?: any[];
|
|
515
|
+
Formatting?: any[];
|
|
516
|
+
Id?: string;
|
|
517
|
+
Name?: string;
|
|
518
|
+
[key: string]: any;
|
|
519
|
+
};
|
|
520
|
+
|
|
478
521
|
declare type DataformCreateItemOptions = {
|
|
479
522
|
data?: object;
|
|
480
523
|
viewId?: string;
|
|
@@ -506,7 +549,7 @@ declare type DataformSubmitItemOptions = {
|
|
|
506
549
|
viewId?: string;
|
|
507
550
|
};
|
|
508
551
|
|
|
509
|
-
declare type DataformFieldOptions = {
|
|
552
|
+
declare type DataformFieldOptions = BaseQueryOptions & {
|
|
510
553
|
instanceId: string;
|
|
511
554
|
fieldId: string;
|
|
512
555
|
/** Skip the server-side model lookup by supplying the field's type directly. */
|
|
@@ -528,6 +571,7 @@ declare type BoardQueryResponse = QueryResponse;
|
|
|
528
571
|
|
|
529
572
|
declare type BoardGetItemOptions = {
|
|
530
573
|
instanceId: string;
|
|
574
|
+
viewId?: string;
|
|
531
575
|
};
|
|
532
576
|
|
|
533
577
|
declare type BoardCreateItemOptions = {
|
|
@@ -552,7 +596,7 @@ declare type BoardDiscardItemOptions = {
|
|
|
552
596
|
instanceId: string;
|
|
553
597
|
};
|
|
554
598
|
|
|
555
|
-
declare type BoardFieldOptions = {
|
|
599
|
+
declare type BoardFieldOptions = BaseQueryOptions & {
|
|
556
600
|
instanceId: string;
|
|
557
601
|
fieldId: string;
|
|
558
602
|
/** Skip the server-side model lookup by supplying the field's type directly. */
|
package/dist/snippets.json
CHANGED
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"documentation": "Runs a published Custom Agent of this app and handles its result when it finishes",
|
|
41
41
|
"insertText": "let agentInstance = kf.app.getAgent(\"${1:agentId}\");\n let { ExecutionId } = await agentInstance.execute({ inputData: { ${2:inputKey}: ${3:value} } });\n let stopWatching = agentInstance.onExecutionComplete(ExecutionId, (execution) => { let items = execution.Output?.items; }, (error) => console.warn(error.errorCode));"
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
"label": "read report",
|
|
45
|
+
"documentation": "Reads a flow report's calculated data in one call",
|
|
46
|
+
"insertText": "const report = kf.app.getReport(\"${1|Process,Form,Case|}\", \"${2:flowId}\", \"${3:reportId}\");\nconst { Data } = await report.getData();"
|
|
47
|
+
},
|
|
43
48
|
{
|
|
44
49
|
"label": "get local variable",
|
|
45
50
|
"documentation": "Get value of the local variable",
|