@kissflow/lowcode-client-sdk 1.0.52 → 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.
@@ -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;
@@ -255,65 +253,8 @@ declare class Page {
255
253
  declare class DecisionTable {
256
254
  evaluate(payload?: object): any;
257
255
  }
258
- declare class Agent {
259
- /**
260
- * Read the Agent's published contract: its inputs, outputs and readiness.
261
- *
262
- * @example
263
- * const { Definition } = await kf.app.getAgent("AgXXXXXXXXXX").getContract();
264
- */
265
- getContract(): Promise<AgentContract>;
266
- /**
267
- * Start a run. Resolves once the run is accepted (`ExecutionId`, `Status`), not when it finishes;
268
- * use {@link onExecutionComplete} or {@link getExecution} for the result.
269
- *
270
- * Never retried: if the call fails with `AGENT_EXECUTE_OUTCOME_UNKNOWN`, a run may still have
271
- * started, and app code cannot list runs to find it: tell the user the request may still be in
272
- * progress instead of starting another. `AGENT_EXECUTE_NOT_SENT` means it was not sent (for
273
- * example, the user is offline).
274
- *
275
- * @example
276
- * const { ExecutionId } = await agent.execute({ inputData: { request: "Two desks", amount: 54000 } });
277
- */
278
- execute(options: AgentExecuteOptions): Promise<AgentExecutionAccepted>;
279
- /**
280
- * Read a run's current state, with its `Output` once `Completed` or its `Error` once `Failed`.
281
- * Callers who are not the App's authors can read only their own runs.
282
- */
283
- getExecution(executionId: string): Promise<AgentExecution>;
284
- /**
285
- * Be told once when a run finishes. `onComplete` gets the run on `Completed` or `Failed` (read
286
- * `Status`: a failed run is a result, not an error). `onWatchError` gets what stopped the
287
- * observation instead: an unsupported host, an access or network failure, or the observation limit
288
- * (`AGENT_OBSERVATION_STOPPED`, after about six minutes; the run may still finish, so read it later
289
- * with {@link getExecution}). At most one of the two is called, at most once.
290
- *
291
- * Neither is called if the script that registered them stops first: form, field, gallery and
292
- * table scripts stop after one minute, and they and page event scripts stop when the next script
293
- * starts on the same form, component or page. In those scripts, keep the `ExecutionId` and read
294
- * it later with {@link getExecution}.
295
- *
296
- * Returns a function that stops observing. It never cancels the run.
297
- *
298
- * @example
299
- * const stop = agent.onExecutionComplete(ExecutionId, (run) => show(run), (err) => warn(err));
300
- * // later, e.g. on unmount
301
- * stop();
302
- */
303
- onExecutionComplete(executionId: string, onComplete: (execution: AgentExecution) => void, onWatchError?: (error: AgentError) => void): () => void;
304
- }
305
- declare class Report {
306
- /**
307
- * The report's calculated rows: groups and their values for a chart, the aggregate for a card.
308
- * @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")
309
- */
310
- getData(options?: ReportQueryOptions): Promise<ReportDataResponse>;
311
- /** The number of rows a tabular report would return. Chart and card reports have no row count; use getData(). */
312
- getCount(options?: ReportCountOptions): Promise<number>;
313
- /** The fields of a tabular report. Empty for chart and card reports; use getData(). */
314
- getFields(): Promise<ReportField[]>;
315
- }
316
256
  declare class Dataform {
257
+ _id: string
317
258
  /**
318
259
  * Get all items from this dataform with optional filtering, sorting, and pagination
319
260
  * @param options - Query options (searchValue, pageNumber, pageSize, payload)
@@ -379,32 +320,10 @@ declare class Dataform {
379
320
  getFields(options?: {
380
321
  viewId?: string;
381
322
  }): Promise<any>;
382
- /**
383
- * Initialize a form with all necessary data (schema, item data, form store)
384
- * This is the recommended way to create a custom form for dataform records
385
- * It automatically handles fetching schema, item data, and initializing the form store
386
- *
387
- * @param instanceId - Optional instance ID of the dataform record. If omitted, creates a new record
388
- * @param viewId - Optional view ID to scope the form's schema/permissions to a specific view
389
- * @returns Promise with Form instance ready to use
390
- *
391
- * @example
392
- * // Load existing record
393
- * const dataform = kf.app.getDataform("EmpMaster");
394
- * const form = await dataform.initForm("emp_123");
395
- * const data = await form.toJSON();
396
- *
397
- * // Load existing record scoped to a view
398
- * const form = await dataform.initForm("emp_123", "EmpMaster_View");
399
- *
400
- * // Create new record
401
- * const form = await dataform.initForm();
402
- * await form.updateField({ firstName: "John" });
403
- */
404
- initForm(instanceId?: string, viewId?: string): Promise<Form>;
405
- getFieldOptions(options?: DataformFieldOptions): Promise<DataformQueryResponse>;
323
+ getFieldOptions(options: DataformFieldOptions): Promise<DataformQueryResponse>;
406
324
  }
407
325
  declare class Board {
326
+ _id: string
408
327
  /**
409
328
  * Import data from CSV file
410
329
  * @param defaultValues - Optional default values to apply to imported items
@@ -427,7 +346,7 @@ declare class Board {
427
346
  getItems(options?: BoardGetItemsOptions): Promise<BoardQueryResponse>;
428
347
  /**
429
348
  * Get a single board/case item by instance ID
430
- * @param options - instanceId (required)
349
+ * @param options - instanceId (required), optional viewId
431
350
  * @returns Promise containing the item data
432
351
  */
433
352
  getItem(options: BoardGetItemOptions): Promise<BoardItem>;
@@ -438,7 +357,7 @@ declare class Board {
438
357
  *
439
358
  * @example
440
359
  * const board = kf.app.getBoard("Inventory");
441
- * const item = await board.createItem({ data: { Name: "New Item" } });
360
+ * const item = await board.createItem({ data: { itemType: "New Item" } });
442
361
  */
443
362
  createItem(options?: BoardCreateItemOptions): Promise<BoardItem>;
444
363
  /**
@@ -450,7 +369,7 @@ declare class Board {
450
369
  * const board = kf.app.getBoard("Inventory");
451
370
  * await board.updateItem({
452
371
  * instanceId: "item_123",
453
- * data: { Name: "Updated Item" }
372
+ * data: { itemType: "Updated Item" }
454
373
  * });
455
374
  */
456
375
  updateItem(options: BoardUpdateItemOptions): Promise<BoardItem>;
@@ -481,28 +400,6 @@ declare class Board {
481
400
  getFields(options?: {
482
401
  viewId?: string;
483
402
  }): Promise<any>;
484
- /**
485
- * Initialize a form for a board item with all necessary setup
486
- * Fetches schema, item data, creates and initializes the form store
487
- *
488
- * @param instanceId - Optional instance ID. If omitted, creates a new board item
489
- * @param viewId - Optional view ID to scope the form's schema/permissions to a specific view
490
- * @returns Promise with Form instance ready to use
491
- *
492
- * @example
493
- * // Create new board item
494
- * const board = kf.app.getBoard("Inventory");
495
- * const form = await board.initForm();
496
- * await form.updateField({ Name: "New Item" });
497
- *
498
- * // Edit existing board item
499
- * const form = await board.initForm("item_123");
500
- * const data = await form.toJSON();
501
- *
502
- * // Edit existing board item scoped to a view
503
- * const form = await board.initForm("item_123", "Inventory_View");
504
- */
505
- initForm(instanceId?: string, viewId?: string): Promise<Form>;
506
403
  /**
507
404
  * Get field options for dropdown/lookup fields
508
405
  * @param options - Field options (instanceId, fieldId)
@@ -518,6 +415,7 @@ declare class Board {
518
415
  getFieldOptions(options: BoardFieldOptions): Promise<any>;
519
416
  }
520
417
  declare class Process {
418
+ _id: string
521
419
  /**
522
420
  * Get my items from this process (items I initiated)
523
421
  * @param options - Query options (status, searchValue, pageNumber, pageSize, payload)
@@ -722,26 +620,7 @@ declare class Process {
722
620
  getProgress(options: {
723
621
  instanceId: string;
724
622
  }): Promise<any>;
725
- /**
726
- * Initialize a form with all necessary data (schema, item data, form store)
727
- * This is the recommended way to create a custom form for dataform records
728
- * It automatically handles fetching schema, item data, and initializing the form store
729
- *
730
- * @param instanceId - Optional instance ID of the dataform record. If omitted, creates a new record
731
- * @returns Promise with Form instance ready to use
732
- *
733
- * @example
734
- * // Load existing record
735
- * const dataform = kf.app.getDataform("EmpMaster");
736
- * const form = await dataform.initForm("emp_123");
737
- * const data = await form.toJSON();
738
- *
739
- * // Create new record
740
- * const form = await dataform.initForm();
741
- * await form.updateField({ firstName: "John" });
742
- */
743
- initForm(instanceId?: string, activityInstanceId?: string): Promise<Form>;
744
- getFieldOptions(options?: ProcessFieldOptions): Promise<ProcessQueryResponse>;
623
+ getFieldOptions(options: ProcessFieldOptions): Promise<ProcessQueryResponse>;
745
624
  /**
746
625
  * Trigger AI document parsing on an uploaded file for a Smart Attachment field.
747
626
  * Matches native platform behavior: matching empty fields are auto-filled directly
@@ -757,6 +636,64 @@ declare class Process {
757
636
  */
758
637
  parseAttachment(options: ProcessParseAttachmentOptions): Promise<ProcessAttachmentParseResult>;
759
638
  }
639
+ declare class Agent {
640
+ /**
641
+ * Read the Agent's published contract: its inputs, outputs and readiness.
642
+ *
643
+ * @example
644
+ * const { Definition } = await kf.app.getAgent("AgXXXXXXXXXX").getContract();
645
+ */
646
+ getContract(): Promise<AgentContract>;
647
+ /**
648
+ * Start a run. Resolves once the run is accepted (`ExecutionId`, `Status`), not when it finishes;
649
+ * use {@link onExecutionComplete} or {@link getExecution} for the result.
650
+ *
651
+ * Never retried: if the call fails with `AGENT_EXECUTE_OUTCOME_UNKNOWN`, a run may still have
652
+ * started, and app code cannot list runs to find it: tell the user the request may still be in
653
+ * progress instead of starting another. `AGENT_EXECUTE_NOT_SENT` means it was not sent (for
654
+ * example, the user is offline).
655
+ *
656
+ * @example
657
+ * const { ExecutionId } = await agent.execute({ inputData: { request: "Two desks", amount: 54000 } });
658
+ */
659
+ execute(options: AgentExecuteOptions): Promise<AgentExecutionAccepted>;
660
+ /**
661
+ * Read a run's current state, with its `Output` once `Completed` or its `Error` once `Failed`.
662
+ * Callers who are not the App's authors can read only their own runs.
663
+ */
664
+ getExecution(executionId: string): Promise<AgentExecution>;
665
+ /**
666
+ * Be told once when a run finishes. `onComplete` gets the run on `Completed` or `Failed` (read
667
+ * `Status`: a failed run is a result, not an error). `onWatchError` gets what stopped the
668
+ * observation instead: an unsupported host, an access or network failure, or the observation limit
669
+ * (`AGENT_OBSERVATION_STOPPED`, after about six minutes; the run may still finish, so read it later
670
+ * with {@link getExecution}). At most one of the two is called, at most once.
671
+ *
672
+ * Neither is called if the script that registered them stops first: form, field, gallery and
673
+ * table scripts stop after one minute, and they and page event scripts stop when the next script
674
+ * starts on the same form, component or page. In those scripts, keep the `ExecutionId` and read
675
+ * it later with {@link getExecution}.
676
+ *
677
+ * Returns a function that stops observing. It never cancels the run.
678
+ *
679
+ * @example
680
+ * const stop = agent.onExecutionComplete(ExecutionId, (run) => show(run), (err) => warn(err));
681
+ * // later, e.g. on unmount
682
+ * stop();
683
+ */
684
+ onExecutionComplete(executionId: string, onComplete: (execution: AgentExecution) => void, onWatchError?: (error: AgentError) => void): () => void;
685
+ }
686
+ declare class Report {
687
+ /**
688
+ * The report's calculated rows: groups and their values for a chart, the aggregate for a card.
689
+ * @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")
690
+ */
691
+ getData(options?: ReportQueryOptions): Promise<ReportDataResponse>;
692
+ /** The number of rows a tabular report would return. Chart and card reports have no row count; use getData(). */
693
+ getCount(options?: ReportCountOptions): Promise<number>;
694
+ /** The fields of a tabular report. Empty for chart and card reports; use getData(). */
695
+ getFields(): Promise<ReportField[]>;
696
+ }
760
697
  declare class Application {
761
698
  page: Page
762
699
  _id: string
@@ -910,14 +847,14 @@ declare type PayloadSortItem = {
910
847
 
911
848
  declare type PayloadOptions = {
912
849
  Columns?: any[];
913
- Filters?: any;
850
+ Filter?: any;
914
851
  Sort?: PayloadSortItem[];
915
852
  FilterParam?: any;
916
853
  };
917
854
 
918
855
  declare type ProcessPayloadOptions = {
919
856
  Columns?: any[];
920
- Filters?: any;
857
+ Filter?: any;
921
858
  Sort?: PayloadSortItem[];
922
859
  };
923
860
 
@@ -1090,7 +1027,7 @@ declare type ProcessDiscardItemOptions = {
1090
1027
  instanceId: string;
1091
1028
  };
1092
1029
 
1093
- declare type ProcessFieldOptions = {
1030
+ declare type ProcessFieldOptions = BaseQueryOptions & {
1094
1031
  instanceId: string;
1095
1032
  activityInstanceId: string;
1096
1033
  fieldId: string;
@@ -1213,7 +1150,7 @@ declare type DataformSubmitItemOptions = {
1213
1150
  viewId?: string;
1214
1151
  };
1215
1152
 
1216
- declare type DataformFieldOptions = {
1153
+ declare type DataformFieldOptions = BaseQueryOptions & {
1217
1154
  instanceId: string;
1218
1155
  fieldId: string;
1219
1156
  /** Skip the server-side model lookup by supplying the field's type directly. */
@@ -1235,6 +1172,7 @@ declare type BoardQueryResponse = QueryResponse;
1235
1172
 
1236
1173
  declare type BoardGetItemOptions = {
1237
1174
  instanceId: string;
1175
+ viewId?: string;
1238
1176
  };
1239
1177
 
1240
1178
  declare type BoardCreateItemOptions = {
@@ -1259,7 +1197,7 @@ declare type BoardDiscardItemOptions = {
1259
1197
  instanceId: string;
1260
1198
  };
1261
1199
 
1262
- declare type BoardFieldOptions = {
1200
+ declare type BoardFieldOptions = BaseQueryOptions & {
1263
1201
  instanceId: string;
1264
1202
  fieldId: string;
1265
1203
  /** Skip the server-side model lookup by supplying the field's type directly. */