@kissflow/lowcode-client-sdk 1.0.39 → 1.0.40
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 +538 -5
- package/dist/kf.lowcodeworkersdk.es.js +429 -16
- package/dist/kf.nocodeworkersdk.es.js +39 -1
- package/dist/kfsdk.es.js +428 -16
- package/dist/kfsdk.umd.js +1 -1
- package/dist/lowcode.d.ts +538 -5
- package/dist/lowcode.types.d.ts +540 -5
- package/dist/nocode.d.ts +546 -13
- package/dist/nocode.types.d.ts +215 -0
- package/package.json +1 -1
package/dist/lowcode.d.ts
CHANGED
|
@@ -50,9 +50,46 @@ declare module "core/constants" {
|
|
|
50
50
|
DECISION_TABLE_EXECUTE: string;
|
|
51
51
|
DATAFORM_IMPORT_CSV: string;
|
|
52
52
|
DATAFORM_OPEN_FORM: string;
|
|
53
|
+
DATAFORM_GET_FIELDS: string;
|
|
54
|
+
DATAFORM_GET_ITEMS: string;
|
|
55
|
+
DATAFORM_CREATE_ITEM: string;
|
|
56
|
+
DATAFORM_UPDATE_ITEM: string;
|
|
57
|
+
DATAFORM_GET_ITEM: string;
|
|
58
|
+
DATAFORM_DELETE_ITEM: string;
|
|
59
|
+
DATAFORM_DISCARD_ITEM: string;
|
|
60
|
+
DATAFORM_SUBMIT_ITEM: string;
|
|
53
61
|
PROCESS_OPEN_FORM: string;
|
|
62
|
+
PROCESS_GET_FIELDS: string;
|
|
63
|
+
PROCESS_GET_MYTASK_FIELDS: string;
|
|
64
|
+
PROCESS_GET_PARTICIPATED_FIELDS: string;
|
|
65
|
+
PROCESS_GET_MY_ITEMS_FIELDS: string;
|
|
66
|
+
PROCESS_GET_MY_ITEMS: string;
|
|
67
|
+
PROCESS_GET_MY_TASKS_ITEMS: string;
|
|
68
|
+
PROCESS_GET_PARTICIPATED_ITEMS: string;
|
|
69
|
+
PROCESS_GET_ADMIN_ITEMS: string;
|
|
70
|
+
PROCESS_CREATE_ITEM: string;
|
|
71
|
+
PROCESS_UPDATE_ITEM: string;
|
|
72
|
+
PROCESS_GET_ITEM: string;
|
|
73
|
+
PROCESS_DELETE_ITEM: string;
|
|
74
|
+
PROCESS_SUBMIT_ITEM: string;
|
|
75
|
+
PROCESS_REJECT_ITEM: string;
|
|
76
|
+
PROCESS_WITHDRAW_ITEM: string;
|
|
77
|
+
PROCESS_SENDBACK_ITEM: string;
|
|
78
|
+
PROCESS_REASSIGN_ITEM: string;
|
|
79
|
+
PROCESS_GET_REASSIGNEES: string;
|
|
80
|
+
PROCESS_RESTART_ITEM: string;
|
|
81
|
+
PROCESS_DISCARD_ITEM: string;
|
|
82
|
+
PROCESS_GET_PROGRESS: string;
|
|
54
83
|
BOARD_IMPORT_CSV: string;
|
|
55
84
|
BOARD_OPEN_FORM: string;
|
|
85
|
+
BOARD_GET_FIELDS: string;
|
|
86
|
+
BOARD_GET_ITEMS: string;
|
|
87
|
+
BOARD_CREATE_ITEM: string;
|
|
88
|
+
BOARD_UPDATE_ITEM: string;
|
|
89
|
+
BOARD_GET_ITEM: string;
|
|
90
|
+
BOARD_DELETE_ITEM: string;
|
|
91
|
+
BOARD_SUBMIT_ITEM: string;
|
|
92
|
+
BOARD_DISCARD_ITEM: string;
|
|
56
93
|
};
|
|
57
94
|
export const EVENT_TYPES: {
|
|
58
95
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -139,9 +176,32 @@ declare module "utils/formatter" {
|
|
|
139
176
|
toBoolean(value: string): any;
|
|
140
177
|
}
|
|
141
178
|
}
|
|
179
|
+
declare module "utils/validation" {
|
|
180
|
+
/**
|
|
181
|
+
* Validation utilities for SDK methods
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* Throws error if value is falsy
|
|
185
|
+
*/
|
|
186
|
+
export function requireField(value: any, fieldName: string): void;
|
|
187
|
+
/**
|
|
188
|
+
* Returns a rejected promise if value is falsy, null otherwise
|
|
189
|
+
* Use for async validation in SDK methods
|
|
190
|
+
*/
|
|
191
|
+
export function requireFieldAsync(value: any, fieldName: string): Promise<never> | null;
|
|
192
|
+
/**
|
|
193
|
+
* Returns a rejected promise if any of the values are falsy
|
|
194
|
+
* Use for validating multiple required fields
|
|
195
|
+
*/
|
|
196
|
+
export function requireFieldsAsync(fields: Array<{
|
|
197
|
+
value: any;
|
|
198
|
+
name: string;
|
|
199
|
+
}>): Promise<never> | null;
|
|
200
|
+
}
|
|
142
201
|
declare module "utils/index" {
|
|
143
202
|
export * from "utils/client";
|
|
144
203
|
export * from "utils/formatter";
|
|
204
|
+
export * from "utils/validation";
|
|
145
205
|
export const isObject: (value: any) => boolean;
|
|
146
206
|
}
|
|
147
207
|
declare module "core/proxy" {
|
|
@@ -154,6 +214,32 @@ declare module "core/proxy" {
|
|
|
154
214
|
}
|
|
155
215
|
}
|
|
156
216
|
declare module "types/external" {
|
|
217
|
+
export type QueryResponse = {
|
|
218
|
+
items: any[];
|
|
219
|
+
total: number;
|
|
220
|
+
page?: number;
|
|
221
|
+
pageSize?: number;
|
|
222
|
+
};
|
|
223
|
+
export type BaseQueryOptions = {
|
|
224
|
+
searchValue?: string;
|
|
225
|
+
pageNumber?: number;
|
|
226
|
+
pageSize?: number;
|
|
227
|
+
};
|
|
228
|
+
export type PayloadSortItem = {
|
|
229
|
+
Id: string;
|
|
230
|
+
SortType: "ASC" | "DESC";
|
|
231
|
+
};
|
|
232
|
+
export type PayloadOptions = {
|
|
233
|
+
Columns?: any[];
|
|
234
|
+
Filters?: any;
|
|
235
|
+
Sort?: PayloadSortItem[];
|
|
236
|
+
FilterParam?: any;
|
|
237
|
+
};
|
|
238
|
+
export type ProcessPayloadOptions = {
|
|
239
|
+
Columns?: any[];
|
|
240
|
+
Filters?: any;
|
|
241
|
+
Sort?: PayloadSortItem[];
|
|
242
|
+
};
|
|
157
243
|
export type userObject = {
|
|
158
244
|
_id: string;
|
|
159
245
|
Name: string;
|
|
@@ -183,11 +269,138 @@ declare module "types/external" {
|
|
|
183
269
|
_id: string;
|
|
184
270
|
_activity_instance_id: string;
|
|
185
271
|
};
|
|
272
|
+
export type ProcessMyItemsOptions = BaseQueryOptions & {
|
|
273
|
+
status?: "draft" | "inprogress" | "completed" | "withdrawn" | "rejected" | "all";
|
|
274
|
+
payload?: ProcessPayloadOptions;
|
|
275
|
+
};
|
|
276
|
+
export type ProcessMyTasksOptions = BaseQueryOptions & {
|
|
277
|
+
activityId?: string;
|
|
278
|
+
payload?: ProcessPayloadOptions;
|
|
279
|
+
};
|
|
280
|
+
export type ProcessParticipatedOptions = BaseQueryOptions & {
|
|
281
|
+
activityId?: string;
|
|
282
|
+
payload?: ProcessPayloadOptions;
|
|
283
|
+
};
|
|
284
|
+
export type ProcessAdminOptions = BaseQueryOptions & {
|
|
285
|
+
payload?: ProcessPayloadOptions;
|
|
286
|
+
};
|
|
287
|
+
export type ProcessQueryResponse = QueryResponse;
|
|
288
|
+
export type ProcessGetItemOptions = {
|
|
289
|
+
instanceId: string;
|
|
290
|
+
};
|
|
291
|
+
export type ProcessCreateItemOptions = {
|
|
292
|
+
data?: object;
|
|
293
|
+
};
|
|
294
|
+
export type ProcessUpdateItemOptions = {
|
|
295
|
+
instanceId: string;
|
|
296
|
+
activityInstanceId: string;
|
|
297
|
+
data: object;
|
|
298
|
+
};
|
|
299
|
+
export type ProcessDeleteItemOptions = {
|
|
300
|
+
instanceId: string;
|
|
301
|
+
};
|
|
302
|
+
export type ProcessSubmitItemOptions = {
|
|
303
|
+
instanceId: string;
|
|
304
|
+
activityInstanceId: string;
|
|
305
|
+
comment?: string;
|
|
306
|
+
};
|
|
307
|
+
export type ProcessRejectItemOptions = {
|
|
308
|
+
instanceId: string;
|
|
309
|
+
activityInstanceId: string;
|
|
310
|
+
comment: string;
|
|
311
|
+
};
|
|
312
|
+
export type ProcessWithdrawItemOptions = {
|
|
313
|
+
instanceId: string;
|
|
314
|
+
comment?: string;
|
|
315
|
+
};
|
|
316
|
+
export type ProcessSendbackItemOptions = {
|
|
317
|
+
instanceId: string;
|
|
318
|
+
activityInstanceId: string;
|
|
319
|
+
stepId: string;
|
|
320
|
+
comment: string;
|
|
321
|
+
};
|
|
322
|
+
export type ProcessReassignItemOptions = {
|
|
323
|
+
instanceId: string;
|
|
324
|
+
activityInstanceId: string;
|
|
325
|
+
reassignTo: object;
|
|
326
|
+
comment: string;
|
|
327
|
+
reassignType?: "initiator" | "approver" | "admin";
|
|
328
|
+
reassignedFrom?: object[];
|
|
329
|
+
};
|
|
330
|
+
export type ProcessGetReassigneesOptions = {
|
|
331
|
+
instanceId: string;
|
|
332
|
+
activityInstanceId: string;
|
|
333
|
+
pageNumber?: number;
|
|
334
|
+
pageSize?: number;
|
|
335
|
+
query?: string;
|
|
336
|
+
};
|
|
337
|
+
export type ProcessRestartItemOptions = {
|
|
338
|
+
instanceId: string;
|
|
339
|
+
activityInstanceId: string;
|
|
340
|
+
};
|
|
341
|
+
export type ProcessDiscardItemOptions = {
|
|
342
|
+
instanceId: string;
|
|
343
|
+
};
|
|
186
344
|
export type FetchOptions = {
|
|
187
345
|
method?: string;
|
|
188
346
|
body?: string | object;
|
|
189
347
|
headers?: object;
|
|
190
348
|
};
|
|
349
|
+
export type DataformQueryOptions = BaseQueryOptions & {
|
|
350
|
+
viewId?: string;
|
|
351
|
+
payload?: PayloadOptions;
|
|
352
|
+
};
|
|
353
|
+
export type DataformQueryResponse = QueryResponse;
|
|
354
|
+
export type DataformCreateItemOptions = {
|
|
355
|
+
data?: object;
|
|
356
|
+
viewId?: string;
|
|
357
|
+
};
|
|
358
|
+
export type DataformUpdateItemOptions = {
|
|
359
|
+
itemId: string;
|
|
360
|
+
data: object;
|
|
361
|
+
viewId?: string;
|
|
362
|
+
};
|
|
363
|
+
export type DataformGetItemOptions = {
|
|
364
|
+
itemId: string;
|
|
365
|
+
viewId?: string;
|
|
366
|
+
};
|
|
367
|
+
export type DataformDeleteItemOptions = {
|
|
368
|
+
itemId: string;
|
|
369
|
+
viewId?: string;
|
|
370
|
+
};
|
|
371
|
+
export type DataformDiscardItemOptions = {
|
|
372
|
+
viewId?: string;
|
|
373
|
+
};
|
|
374
|
+
export type DataformSubmitItemOptions = {
|
|
375
|
+
itemId: string;
|
|
376
|
+
data?: object;
|
|
377
|
+
viewId?: string;
|
|
378
|
+
};
|
|
379
|
+
export type BoardGetItemsOptions = BaseQueryOptions & {
|
|
380
|
+
viewId?: string;
|
|
381
|
+
payload?: PayloadOptions;
|
|
382
|
+
};
|
|
383
|
+
export type BoardQueryResponse = QueryResponse;
|
|
384
|
+
export type BoardGetItemOptions = {
|
|
385
|
+
instanceId: string;
|
|
386
|
+
};
|
|
387
|
+
export type BoardCreateItemOptions = {
|
|
388
|
+
data?: object;
|
|
389
|
+
};
|
|
390
|
+
export type BoardUpdateItemOptions = {
|
|
391
|
+
instanceId: string;
|
|
392
|
+
data: object;
|
|
393
|
+
};
|
|
394
|
+
export type BoardDeleteItemOptions = {
|
|
395
|
+
instanceId: string;
|
|
396
|
+
};
|
|
397
|
+
export type BoardSubmitItemOptions = {
|
|
398
|
+
instanceId: string;
|
|
399
|
+
comment?: string;
|
|
400
|
+
};
|
|
401
|
+
export type BoardDiscardItemOptions = {
|
|
402
|
+
instanceId: string;
|
|
403
|
+
};
|
|
191
404
|
}
|
|
192
405
|
declare module "types/internal" {
|
|
193
406
|
import { userObject, accountObject, environmentObject } from "types/external";
|
|
@@ -287,33 +500,353 @@ declare module "app/decisiontable" {
|
|
|
287
500
|
evaluate(payload?: object): any;
|
|
288
501
|
}
|
|
289
502
|
}
|
|
290
|
-
declare module "
|
|
503
|
+
declare module "dataform/index" {
|
|
291
504
|
import { BaseSDK } from "core/index";
|
|
292
|
-
import { DataformItem } from "types/external";
|
|
505
|
+
import { DataformItem, DataformQueryOptions, DataformQueryResponse, DataformCreateItemOptions, DataformUpdateItemOptions, DataformGetItemOptions, DataformDeleteItemOptions, DataformDiscardItemOptions, DataformSubmitItemOptions } from "types/external";
|
|
293
506
|
export class Dataform extends BaseSDK {
|
|
294
507
|
private _id;
|
|
295
508
|
constructor(flowId: string);
|
|
509
|
+
/**
|
|
510
|
+
* Get all items from this dataform with optional filtering, sorting, and pagination
|
|
511
|
+
* @param options - Query options (searchValue, pageNumber, pageSize, payload)
|
|
512
|
+
* @returns Promise containing items and total count
|
|
513
|
+
*/
|
|
514
|
+
getItems(options?: DataformQueryOptions): Promise<DataformQueryResponse>;
|
|
515
|
+
/**
|
|
516
|
+
* Get a single item by ID from this dataform
|
|
517
|
+
* @param options - itemId (required), optional viewId
|
|
518
|
+
* @returns Promise containing the item data
|
|
519
|
+
*/
|
|
520
|
+
getItem(options: DataformGetItemOptions): Promise<DataformItem>;
|
|
521
|
+
/**
|
|
522
|
+
* Create a new item in this dataform
|
|
523
|
+
* @param options - Creation options (data: initial field values, viewId: optional view ID)
|
|
524
|
+
* @returns Promise containing the newly created item with _id
|
|
525
|
+
*/
|
|
526
|
+
createItem(options?: DataformCreateItemOptions): Promise<DataformItem>;
|
|
527
|
+
/**
|
|
528
|
+
* Update an existing item in this dataform
|
|
529
|
+
* @param options - Update options (itemId: required, data: required updated values, viewId: optional view ID)
|
|
530
|
+
* @returns Promise containing the updated item
|
|
531
|
+
*/
|
|
532
|
+
updateItem(options: DataformUpdateItemOptions): Promise<DataformItem>;
|
|
533
|
+
/**
|
|
534
|
+
* Import items from a CSV file into this dataform
|
|
535
|
+
* @param defaultValues - Optional default field values to apply to all imported items
|
|
536
|
+
*/
|
|
296
537
|
importCSV(defaultValues?: object): any;
|
|
538
|
+
/**
|
|
539
|
+
* Open the form UI for an existing dataform item
|
|
540
|
+
* @param item - Dataform item with _id
|
|
541
|
+
*/
|
|
297
542
|
openForm(item: DataformItem): any;
|
|
543
|
+
/**
|
|
544
|
+
* Delete an item from this dataform
|
|
545
|
+
* @param options - itemId (required), optional viewId
|
|
546
|
+
*
|
|
547
|
+
* @example
|
|
548
|
+
* await dataform.deleteItem({ itemId: "item_123" });
|
|
549
|
+
*/
|
|
550
|
+
deleteItem(options: DataformDeleteItemOptions): Promise<void>;
|
|
551
|
+
/**
|
|
552
|
+
* Discard the current draft for this dataform
|
|
553
|
+
* @param options - optional viewId
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* await dataform.discardItem();
|
|
557
|
+
*/
|
|
558
|
+
discardItem(options?: DataformDiscardItemOptions): Promise<void>;
|
|
559
|
+
/**
|
|
560
|
+
* Submit/finalize a dataform item
|
|
561
|
+
* @param options - itemId (required), optional data and viewId
|
|
562
|
+
*
|
|
563
|
+
* @example
|
|
564
|
+
* await dataform.submitItem({ itemId: "item_123" });
|
|
565
|
+
*/
|
|
566
|
+
submitItem(options: DataformSubmitItemOptions): Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Get field definitions for this dataform
|
|
569
|
+
* @param options - Optional viewId to scope fields to a specific view
|
|
570
|
+
*/
|
|
571
|
+
getFields(options?: {
|
|
572
|
+
viewId?: string;
|
|
573
|
+
}): Promise<any>;
|
|
298
574
|
}
|
|
299
575
|
}
|
|
300
576
|
declare module "board/index" {
|
|
301
577
|
import { BaseSDK } from "core/index";
|
|
302
|
-
import { BoardItem } from "types/external";
|
|
578
|
+
import { BoardItem, BoardGetItemOptions, BoardGetItemsOptions, BoardQueryResponse, BoardCreateItemOptions, BoardUpdateItemOptions, BoardDeleteItemOptions, BoardSubmitItemOptions, BoardDiscardItemOptions } from "types/external";
|
|
303
579
|
export class Board extends BaseSDK {
|
|
304
580
|
private _id;
|
|
305
581
|
constructor(flowId: string);
|
|
582
|
+
/**
|
|
583
|
+
* Import data from CSV file
|
|
584
|
+
* @param defaultValues - Optional default values to apply to imported items
|
|
585
|
+
*/
|
|
306
586
|
importCSV(defaultValues?: object): any;
|
|
587
|
+
/**
|
|
588
|
+
* Open the form UI for a board item
|
|
589
|
+
* @param item - Board item with _id and optional _view_id
|
|
590
|
+
*/
|
|
307
591
|
openForm(item: BoardItem): any;
|
|
592
|
+
/**
|
|
593
|
+
* Get items from a board view
|
|
594
|
+
* @param options - Query options (viewId, searchValue, pageNumber, pageSize, payload)
|
|
595
|
+
* @returns Promise containing items array and total count
|
|
596
|
+
*
|
|
597
|
+
* @example
|
|
598
|
+
* const board = kf.app.getBoard("Inventory");
|
|
599
|
+
* const { items } = await board.getItems({ viewId: "AllItems_View" });
|
|
600
|
+
*/
|
|
601
|
+
getItems(options?: BoardGetItemsOptions): Promise<BoardQueryResponse>;
|
|
602
|
+
/**
|
|
603
|
+
* Get a single board/case item by instance ID
|
|
604
|
+
* @param options - instanceId (required)
|
|
605
|
+
* @returns Promise containing the item data
|
|
606
|
+
*/
|
|
607
|
+
getItem(options: BoardGetItemOptions): Promise<BoardItem>;
|
|
608
|
+
/**
|
|
609
|
+
* Create a new board item
|
|
610
|
+
* @param options - Creation options (data: initial field values)
|
|
611
|
+
* @returns Promise containing the newly created item with _id
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* const board = kf.app.getBoard("Inventory");
|
|
615
|
+
* const item = await board.createItem({ data: { Name: "New Item" } });
|
|
616
|
+
*/
|
|
617
|
+
createItem(options?: BoardCreateItemOptions): Promise<BoardItem>;
|
|
618
|
+
/**
|
|
619
|
+
* Update an existing board item
|
|
620
|
+
* @param options - Update options (instanceId, data)
|
|
621
|
+
* @returns Promise containing the updated item
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* const board = kf.app.getBoard("Inventory");
|
|
625
|
+
* await board.updateItem({
|
|
626
|
+
* instanceId: "item_123",
|
|
627
|
+
* data: { Name: "Updated Item" }
|
|
628
|
+
* });
|
|
629
|
+
*/
|
|
630
|
+
updateItem(options: BoardUpdateItemOptions): Promise<BoardItem>;
|
|
631
|
+
/**
|
|
632
|
+
* Delete a board item
|
|
633
|
+
* @param options - Delete options (instanceId)
|
|
634
|
+
* @returns Promise resolving on successful deletion
|
|
635
|
+
*
|
|
636
|
+
* @example
|
|
637
|
+
* const board = kf.app.getBoard("Inventory");
|
|
638
|
+
* await board.deleteItem({ instanceId: "item_123" });
|
|
639
|
+
*/
|
|
640
|
+
deleteItem(options: BoardDeleteItemOptions): Promise<void>;
|
|
641
|
+
/**
|
|
642
|
+
* Submit a board item
|
|
643
|
+
* @param options - instanceId
|
|
644
|
+
*/
|
|
645
|
+
submitItem(options: BoardSubmitItemOptions): Promise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* Discard a board item
|
|
648
|
+
* @param options - instanceId
|
|
649
|
+
*/
|
|
650
|
+
discardItem(options: BoardDiscardItemOptions): Promise<void>;
|
|
651
|
+
/**
|
|
652
|
+
* Get field definitions for this board
|
|
653
|
+
* @param options - Optional viewId to scope fields to a specific view
|
|
654
|
+
*/
|
|
655
|
+
getFields(options?: {
|
|
656
|
+
viewId?: string;
|
|
657
|
+
}): Promise<any>;
|
|
308
658
|
}
|
|
309
659
|
}
|
|
310
660
|
declare module "process/index" {
|
|
311
661
|
import { BaseSDK } from "core/index";
|
|
312
|
-
import { ProcessItem } from "types/external";
|
|
662
|
+
import { ProcessItem, ProcessGetItemOptions, ProcessMyItemsOptions, ProcessMyTasksOptions, ProcessParticipatedOptions, ProcessAdminOptions, ProcessQueryResponse, ProcessCreateItemOptions, ProcessUpdateItemOptions, ProcessDeleteItemOptions, ProcessSubmitItemOptions, ProcessRejectItemOptions, ProcessWithdrawItemOptions, ProcessSendbackItemOptions, ProcessReassignItemOptions, ProcessGetReassigneesOptions, ProcessRestartItemOptions, ProcessDiscardItemOptions } from "types/external";
|
|
313
663
|
export class Process extends BaseSDK {
|
|
314
664
|
private _id;
|
|
315
665
|
constructor(flowId: string);
|
|
666
|
+
/**
|
|
667
|
+
* Get my items from this process (items I initiated)
|
|
668
|
+
* @param options - Query options (status, searchValue, pageNumber, pageSize, payload)
|
|
669
|
+
* @returns Promise containing items and total count
|
|
670
|
+
*
|
|
671
|
+
* @example
|
|
672
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
673
|
+
* // Get draft items
|
|
674
|
+
* const { items } = await process.getMyItems({ status: "draft" });
|
|
675
|
+
* // Get in-progress items
|
|
676
|
+
* const { items } = await process.getMyItems({ status: "inprogress" });
|
|
677
|
+
*/
|
|
678
|
+
getMyItems(options?: ProcessMyItemsOptions): Promise<ProcessQueryResponse>;
|
|
679
|
+
/**
|
|
680
|
+
* Get my pending tasks from this process (tasks assigned to me)
|
|
681
|
+
* @param options - Query options (activityId, searchValue, pageNumber, pageSize, payload)
|
|
682
|
+
* @returns Promise containing tasks and total count
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
686
|
+
* // Get all pending tasks
|
|
687
|
+
* const { items } = await process.getMyTasksItems();
|
|
688
|
+
* // Get tasks for specific activity/step
|
|
689
|
+
* const { items } = await process.getMyTasksItems({ activityId: "Approval_Step" });
|
|
690
|
+
*/
|
|
691
|
+
getMyTasksItems(options?: ProcessMyTasksOptions): Promise<ProcessQueryResponse>;
|
|
692
|
+
/**
|
|
693
|
+
* Get items I participated in (items where I took action)
|
|
694
|
+
* @param options - Query options (activityId, searchValue, pageNumber, pageSize, payload)
|
|
695
|
+
* @returns Promise containing items and total count
|
|
696
|
+
*
|
|
697
|
+
* @example
|
|
698
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
699
|
+
* const { items } = await process.getParticipatedItems();
|
|
700
|
+
*/
|
|
701
|
+
getParticipatedItems(options?: ProcessParticipatedOptions): Promise<ProcessQueryResponse>;
|
|
702
|
+
/**
|
|
703
|
+
* Get all items as admin (requires admin access)
|
|
704
|
+
* @param options - Query options (searchValue, pageNumber, pageSize, payload)
|
|
705
|
+
* @returns Promise containing items and total count
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
709
|
+
* const { items } = await process.getAdminItems();
|
|
710
|
+
*/
|
|
711
|
+
getAdminItems(options?: ProcessAdminOptions): Promise<ProcessQueryResponse>;
|
|
712
|
+
/**
|
|
713
|
+
* Get a single process instance by ID
|
|
714
|
+
* @param options - instanceId (required)
|
|
715
|
+
* @returns Promise containing the instance data
|
|
716
|
+
*/
|
|
717
|
+
getItem(options: ProcessGetItemOptions): Promise<ProcessItem>;
|
|
718
|
+
/**
|
|
719
|
+
* Create a new process instance (start a new process)
|
|
720
|
+
* @param options - Creation options (data: initial field values)
|
|
721
|
+
* @returns Promise containing the newly created process item with _id and _activity_instance_id
|
|
722
|
+
*
|
|
723
|
+
* @example
|
|
724
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
725
|
+
* const item = await process.createItem({ data: { LeaveType: "Annual" } });
|
|
726
|
+
*/
|
|
727
|
+
createItem(options?: ProcessCreateItemOptions): Promise<ProcessItem>;
|
|
728
|
+
/**
|
|
729
|
+
* Update an existing process instance
|
|
730
|
+
* @param options - Update options (instanceId, activityInstanceId, data)
|
|
731
|
+
* @returns Promise containing the updated item
|
|
732
|
+
*
|
|
733
|
+
* @example
|
|
734
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
735
|
+
* await process.updateItem({
|
|
736
|
+
* instanceId: "item_123",
|
|
737
|
+
* activityInstanceId: "activity_456",
|
|
738
|
+
* data: { LeaveType: "Sick" }
|
|
739
|
+
* });
|
|
740
|
+
*/
|
|
741
|
+
updateItem(options: ProcessUpdateItemOptions): Promise<ProcessItem>;
|
|
742
|
+
/**
|
|
743
|
+
* Delete a process instance
|
|
744
|
+
* @param options - Delete options (instanceId)
|
|
745
|
+
* @returns Promise resolving on successful deletion
|
|
746
|
+
*
|
|
747
|
+
* @example
|
|
748
|
+
* const process = kf.app.getProcess("LeaveRequest");
|
|
749
|
+
* await process.deleteItem({ instanceId: "item_123" });
|
|
750
|
+
*/
|
|
751
|
+
deleteItem(options: ProcessDeleteItemOptions): Promise<void>;
|
|
752
|
+
/**
|
|
753
|
+
* Open the form UI for a process instance
|
|
754
|
+
* @param item - Process item with _id and _activity_instance_id
|
|
755
|
+
*/
|
|
316
756
|
openForm(item: ProcessItem): any;
|
|
757
|
+
/**
|
|
758
|
+
* Submit a process task
|
|
759
|
+
* @param options - instanceId, activityInstanceId, optional comment
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* await process.submitItem({ instanceId: "item_123", activityInstanceId: "act_456" });
|
|
763
|
+
*/
|
|
764
|
+
submitItem(options: ProcessSubmitItemOptions): Promise<void>;
|
|
765
|
+
/**
|
|
766
|
+
* Reject a process task
|
|
767
|
+
* @param options - instanceId, activityInstanceId, comment (required)
|
|
768
|
+
*
|
|
769
|
+
* @example
|
|
770
|
+
* await process.reject({ instanceId: "item_123", activityInstanceId: "act_456", comment: "Not approved" });
|
|
771
|
+
*/
|
|
772
|
+
rejectItem(options: ProcessRejectItemOptions): Promise<void>;
|
|
773
|
+
/**
|
|
774
|
+
* Withdraw a process instance (initiator only)
|
|
775
|
+
* @param options - instanceId, optional comment
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* await process.withdraw({ instanceId: "item_123", comment: "Withdrawing request" });
|
|
779
|
+
*/
|
|
780
|
+
withdrawItem(options: ProcessWithdrawItemOptions): Promise<void>;
|
|
781
|
+
/**
|
|
782
|
+
* Send back a process task to a previous step
|
|
783
|
+
* @param options - instanceId, activityInstanceId, stepId (target step), comment (required)
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* await process.sendback({ instanceId: "item_123", activityInstanceId: "act_456", stepId: "step_789", comment: "Please revise" });
|
|
787
|
+
*/
|
|
788
|
+
sendbackItem(options: ProcessSendbackItemOptions): Promise<void>;
|
|
789
|
+
/**
|
|
790
|
+
* Reassign a process task to another user
|
|
791
|
+
* @param options - instanceId, activityInstanceId, reassignTo (user object), comment (required), optional reassignType and reassignedFrom
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
* await process.reassign({ instanceId: "item_123", activityInstanceId: "act_456", reassignTo: { _id: "user_789" }, comment: "Reassigning to manager" });
|
|
795
|
+
*/
|
|
796
|
+
reassignItem(options: ProcessReassignItemOptions): Promise<void>;
|
|
797
|
+
/**
|
|
798
|
+
* Get list of eligible reassignees for a process task
|
|
799
|
+
* @param options - instanceId, activityInstanceId, optional pageNumber, pageSize, query
|
|
800
|
+
*/
|
|
801
|
+
getReassignees(options: ProcessGetReassigneesOptions): Promise<any>;
|
|
802
|
+
/**
|
|
803
|
+
* Restart a rejected/withdrawn process instance
|
|
804
|
+
* @param options - instanceId, activityInstanceId
|
|
805
|
+
*
|
|
806
|
+
* @example
|
|
807
|
+
* await process.restart({ instanceId: "item_123", activityInstanceId: "act_456" });
|
|
808
|
+
*/
|
|
809
|
+
restartItem(options: ProcessRestartItemOptions): Promise<void>;
|
|
810
|
+
/**
|
|
811
|
+
* Discard a draft process instance
|
|
812
|
+
* @param options - instanceId
|
|
813
|
+
*
|
|
814
|
+
* @example
|
|
815
|
+
* await process.discard({ instanceId: "item_123" });
|
|
816
|
+
*/
|
|
817
|
+
discardItem(options: ProcessDiscardItemOptions): Promise<void>;
|
|
818
|
+
/**
|
|
819
|
+
* Get field definitions for this process
|
|
820
|
+
*/
|
|
821
|
+
getFields(): Promise<any>;
|
|
822
|
+
/**
|
|
823
|
+
* Get field definitions for a specific task step (my tasks view)
|
|
824
|
+
* @param options - activityId of the target step
|
|
825
|
+
*/
|
|
826
|
+
getMyTaskFields(options: {
|
|
827
|
+
activityId: string;
|
|
828
|
+
}): Promise<any>;
|
|
829
|
+
/**
|
|
830
|
+
* Get field definitions for a specific task step (participated view)
|
|
831
|
+
* @param options - activityId of the target step
|
|
832
|
+
*/
|
|
833
|
+
getParticipatedFields(options: {
|
|
834
|
+
activityId: string;
|
|
835
|
+
}): Promise<any>;
|
|
836
|
+
/**
|
|
837
|
+
* Get field definitions for the my items view filtered by status
|
|
838
|
+
* @param options - status filter (e.g. "draft", "inprogress", "all")
|
|
839
|
+
*/
|
|
840
|
+
getMyItemsFields(options: {
|
|
841
|
+
status: string;
|
|
842
|
+
}): Promise<any>;
|
|
843
|
+
/**
|
|
844
|
+
* Get the progress/timeline of a process instance
|
|
845
|
+
* @param options - instanceId (required)
|
|
846
|
+
*/
|
|
847
|
+
getProgress(options: {
|
|
848
|
+
instanceId: string;
|
|
849
|
+
}): Promise<any>;
|
|
317
850
|
}
|
|
318
851
|
}
|
|
319
852
|
declare module "app/index" {
|
|
@@ -321,7 +854,7 @@ declare module "app/index" {
|
|
|
321
854
|
import { Page } from "app/page";
|
|
322
855
|
import { AppContext } from "types/internal";
|
|
323
856
|
import { DecisionTable } from "app/decisiontable";
|
|
324
|
-
import { Dataform } from "
|
|
857
|
+
import { Dataform } from "dataform/index";
|
|
325
858
|
import { Board } from "board/index";
|
|
326
859
|
import { Process } from "process/index";
|
|
327
860
|
export class Application extends BaseSDK {
|