@kissflow/lowcode-client-sdk 1.0.22 → 1.0.23

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/README.md CHANGED
@@ -2,626 +2,4 @@
2
2
 
3
3
  JavaScript SDK for developing over the Kissflow lowcode platform
4
4
 
5
- ### Use as an `npm` module
6
-
7
- Install the SDK as a module: `npm i @kissflow/lowcode-client-sdk` Then import
8
- into your project:
9
-
10
- ```js
11
- import KFSDK from "@kissflow/lowcode-client-sdk";
12
- let kf;
13
- (async function () {
14
- kf = await KFSDK.initialize();
15
- })();
16
- ```
17
-
18
- > Note: Initializing Kf SDK in custom components returns a promise.
19
-
20
- ### Use as a `<script>` tag directly in HTML
21
-
22
- SDK can also be loaded directly into HTML by adding:
23
-
24
- ```html
25
- <script src="https://unpkg.com/@kissflow/lowcode-client-sdk@latest/dist/kfsdk.umd.js"></script>
26
- ```
27
-
28
- Then SDK can be initialized as:
29
-
30
- ```js
31
- let kf;
32
- window.onload = async function () {
33
- kf = await window.kf.initialize();
34
- };
35
- ```
36
-
37
- ### User and Account details
38
-
39
- Details of authenticated user can be accessed as following
40
-
41
- ```js
42
- const { Name, Email, _id } = kf.user;
43
- ```
44
-
45
- And account id can be accessed as `kf.account._id`
46
-
47
- ### Fetch Api through sdk
48
-
49
- Fetch any other kissflow api & external api using this method. kf.api has header
50
- tokens by default for making authenticated kissflow api calls
51
-
52
- > Note: This method has a limit of 10 seconds for an api call
53
-
54
- ```js
55
- kf.api(url, config).then((res) => {...})
56
- // or
57
- let resp = await kf.api(url, config)
58
- ```
59
-
60
- ## Table of contents
61
-
62
- - [1. Context](#1-context)
63
- - [Custom Components](#custom-component)
64
- - [Form](#custom-component)
65
- - [Form Table](#form-table)
66
- - [Table Row](#table-row)
67
- - [2. Client](#2-client)
68
- - [3. Application](#3-application)
69
- - [4. Page](#4-page)
70
- - [5. Component](#5-component)
71
- - [Standard Component methods](#standard-component-methods)
72
- - [Component Specific methods](#component-specific-methods)
73
- - [Tab](#521-tab-component)
74
- - [6. Popup](#6-popup)
75
- - [7. Formatter](#7-formatter)
76
-
77
- ## 1) Context
78
-
79
- Context methods are polymorphic, it has different classes pre-initialized based
80
- on execution context.
81
-
82
- ### Custom component
83
-
84
- `kf.context` returns a `CustomComponent` class while using inside custom
85
- component. Custom component supported methods:
86
-
87
- ##### a) Watch Params
88
-
89
- Listens for changes in parameter given to custom components in lowcode
90
- application.
91
-
92
- ```js
93
- kf.context.watchParams(function (data) {
94
- console.log(data);
95
- });
96
- ```
97
-
98
- ### Kissflow Forms
99
-
100
- `kf.context` returns a `Form` class when it is used inside a kissflow's form
101
- that could be either Process, case or Dataform & it has following supported
102
- methods
103
-
104
- ##### a) getField()
105
-
106
- ###### Description:
107
-
108
- Use this function to get the current value of a form field
109
-
110
- ###### Syntax:
111
-
112
- ```js
113
- kf.context.getField(fieldId).then((res) => {...})
114
- // or
115
- let value = await kf.context.getField(fieldId)
116
- ```
117
-
118
- ##### b) updateField()
119
-
120
- ###### Description:
121
-
122
- Use this function to get update any field in the form
123
-
124
- ###### Syntax:
125
-
126
- ```js
127
- kf.context.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
128
- ```
129
-
130
- ##### c) toJSON()
131
-
132
- ###### Description:
133
-
134
- Use this function to get the JSON data of the current form
135
-
136
- ###### Syntax:
137
-
138
- ```js
139
- const json = await kf.context.toJSON();
140
- ```
141
-
142
- ###### Output:
143
-
144
- ```
145
- {
146
- "Untitled_Field": "testing",
147
- "_created_at": "2022-03-01T03:04:09Z",
148
- "_flow_name": "form events",
149
- "_id": "Pk4_T1WGWuMe",
150
- "_modified_at": "2022-03-01T03:04:09Z"
151
- }
152
- ```
153
-
154
- ### Form Table
155
-
156
- `kf.context.getTable(tableId)` returns a `Table` class which has the following
157
- methods
158
-
159
- #### a) addRow()
160
-
161
- ###### Description:
162
-
163
- Appends row details to the table.
164
-
165
- ###### Syntax:
166
-
167
- ```js
168
- const table = kf.context.getTable(tableId);
169
- table.addRow({ columnId1: value, columnId2: value });
170
- ```
171
-
172
- > ##### Note: If there are more than one rows to be added to table then use `addRows()` instead for these bulk operations
173
-
174
- #### b) addRows()
175
-
176
- ###### Description:
177
-
178
- Appends multiple rows details to the table.
179
-
180
- ###### Syntax:
181
-
182
- ```js
183
- const table = kf.context.getTable(tableId);
184
- let accumulator = [];
185
- someArrayOfObjects.forEach(function (rowDetail) {
186
- accumulator.push({
187
- columnId1: rowDetail[columnId1],
188
- columnId2: rowDetail[columnId2]
189
- });
190
- });
191
- await table.addRows(accumulator);
192
- ```
193
-
194
- #### c) deleteRow()
195
-
196
- ###### Description:
197
-
198
- Deletes a row from the table based on the row id
199
-
200
- ###### Syntax:
201
-
202
- ```js
203
- const table = kf.context.getTable(tableId);
204
- await table.deleteRow(rowId);
205
- ```
206
-
207
- > ##### Note: If there are more than one rows to be deleted then use `deleteRows()` instead.
208
-
209
- #### d) deleteRows()
210
-
211
- ###### Description:
212
-
213
- Deletes multiple rows from the table based on given array of strings.
214
-
215
- ###### Syntax:
216
-
217
- ```js
218
- const table = kf.context.getTable(tableId);
219
- await table.deleteRows([rowId1, rowId2, rowId3]);
220
- ```
221
-
222
- #### e) getRow()
223
-
224
- ###### Description:
225
-
226
- Use this function to perform form actions on any row inside a child table
227
-
228
- ###### Syntax:
229
-
230
- ```js
231
- const table = kf.context.getTable(tableId);
232
- const row = table.getRow(rowId);
233
- ```
234
-
235
- ###### Output:
236
-
237
- Returns an instance of `TableForm` class
238
-
239
- #### f) getRows()
240
-
241
- ###### Description:
242
-
243
- Gets all the rows of the table
244
-
245
- ###### Syntax:
246
-
247
- ```js
248
- const rows = await kf.context.getTable(tableId).getRows();
249
- ```
250
-
251
- ###### Output:
252
-
253
- Returns an array of `TableForm` instances
254
-
255
- ##### g) toJSON()
256
-
257
- ###### Description:
258
-
259
- Use this function to get the JSON data of the child table
260
-
261
- ###### Syntax:
262
-
263
- ```js
264
- const json = await kf.context.getTable(tableId).toJSON();
265
- ```
266
-
267
- ###### Output:
268
-
269
- ```
270
- [{
271
- "Untitled_Field": "row 1",
272
- "_created_at": "2022-03-01T03:04:09Z",
273
- "_flow_name": "form events",
274
- "_id": "Pk4_T1WGWuMe",
275
- "_modified_at": "2022-03-01T03:04:09Z"
276
- },{
277
- "Untitled_Field": "row 2",
278
- "_created_at": "2022-03-01T03:04:09Z",
279
- "_flow_name": "form events",
280
- "_id": "Pk4_T1WGWuMe",
281
- "_modified_at": "2022-03-01T03:04:09Z"
282
- }]
283
- ```
284
-
285
- ### Table Row
286
-
287
- A single row inside a table is known as Table row `kf.context` returns a
288
- `TableForm` class which has the following methods
289
-
290
- ##### a) getField()
291
-
292
- ###### Description:
293
-
294
- Use this function to get the value of the table row
295
-
296
- ###### Syntax:
297
-
298
- ```js
299
- kf.context.getField(fieldId).then((res) => {...})
300
- // or
301
- let value = await kf.context.getField(fieldId)
302
- ```
303
-
304
- ##### b) updateField()
305
-
306
- ###### Description:
307
-
308
- Use this function to get update any field in the table row
309
-
310
- ###### Syntax:
311
-
312
- ```js
313
- kf.context.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
314
- ```
315
-
316
- ##### c) getParent()
317
-
318
- ###### Description:
319
-
320
- Use this function to perform form actions on the main form
321
-
322
- ###### Syntax:
323
-
324
- ```js
325
- const mainForm = kf.context.getParent();
326
- mainForm.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
327
- ```
328
-
329
- ###### Output:
330
-
331
- Returns an instance of `Form` class using which we can perform any action on the
332
- main form
333
-
334
- ##### d) toJson()
335
-
336
- ##### Description:
337
-
338
- Get JSON output of table row
339
-
340
- ##### Syntax:
341
-
342
- ```js
343
- const json = await kf.context.toJSON();
344
- ```
345
-
346
- ###### Output:
347
-
348
- ```
349
- {
350
- "Untitled_Field": "testing",
351
- "_created_at": "2022-03-01T03:04:09Z",
352
- "_flow_name": "form events",
353
- "_id": "Pk4_T1WGWuMe",
354
- "_modified_at": "2022-03-01T03:04:09Z"
355
- }
356
- ```
357
-
358
- ---
359
-
360
- ### 2) Client
361
-
362
- ##### Show Toast
363
-
364
- ```js
365
- kf.client.showInfo(message);
366
- ```
367
-
368
- ##### Show confirm
369
-
370
- Displays the confirmation dialog, and returns users's action as a response
371
-
372
- ```js
373
- kf.client.showConfirm({ title, content }).then((action) => {
374
- if(action === "OK") // user clicked ok button
375
-
376
- else // user clicked cancel button or clicked outside the popup
377
- })
378
- ```
379
-
380
- ##### Redirect to URL
381
-
382
- ```js
383
- kf.client.redirect(url);
384
- ```
385
-
386
- ### 3) Application
387
-
388
- `kf.app` represents the active kissflow app and `kf.app._id` returns its id.
389
-
390
- ##### Get value to application variable
391
-
392
- ```js
393
- const appVarible1 = await kf.app.getVariable("variableId");
394
- ```
395
-
396
- ##### Set value of application variable
397
-
398
- ```js
399
- let value = await kf.app.setVariable("variableId", value);
400
- // or
401
- await kf.app.setVariable({
402
- variableId_1: "value_1",
403
- variableId_2: 3345
404
- });
405
- ```
406
-
407
- ##### Open a page
408
-
409
- `openPage(id)` returns [Page](#4-page) class instance
410
-
411
- ```js
412
- const pageInputParameters = {
413
- param1: value,
414
- param2: value
415
- };
416
- kf.app.openPage(pageId, pageInputParameters);
417
- // Note: Page Input parameters are optional.
418
- ```
419
-
420
- ##### Get a dataform instance
421
-
422
- `getDataform(formId)` returns a Dataform class instance
423
-
424
- ```js
425
- const dfInstance = kf.app.getDataform("dataform_id");
426
- ```
427
-
428
- ### 4) Page
429
-
430
- `kf.app.page` returns the active page opened inside application and
431
- `kf.app.page._id` returns its id.
432
-
433
- ##### Page parameters
434
-
435
- ```js
436
- let value = await kf.app.page.getParameter("parameterId"); // for retreiving single parameter
437
- ```
438
-
439
- Get all page parameters
440
-
441
- ```js
442
- let allParams = await kf.app.page.getAllParameters();
443
- // returns an object
444
- {
445
- parameterName: "Sample value",
446
- parameterName2: "Sample value 2"
447
- }
448
- ```
449
-
450
- ##### Access a Component
451
-
452
- `getComponent` returns a [Component](#5-component) class.
453
-
454
- ```js
455
- const componentName = await kf.app.page.getComponent("componentId");
456
- ```
457
-
458
- ##### Open a popup
459
-
460
- `openPoup` returns a [Popup](#6-popup) class.
461
-
462
- ```js
463
- kf.app.page.openPopup("popupId", { inputParam1: "value" });
464
- // Note: Popup parameters are optional.
465
- ```
466
-
467
- ### 5) Component
468
-
469
- #### getComponent(id)
470
-
471
- Parameter: Component's Id Returns: Component class instance
472
-
473
- ```js
474
- const component = await kf.app.page.getComponent(componentId);
475
- ```
476
-
477
- ##### Standard Component Methods
478
-
479
- ```js
480
- component.refresh(); // Refreshes the component
481
- component.hide(); // Hides the component
482
- component.show(); // Shows the component if it's been hidden previously
483
- ```
484
-
485
- ##### Component Specific Methods
486
-
487
- ##### 5.2.0) Component onMount
488
-
489
- Component onMount takes in callBack function as argument.
490
-
491
- > ##### Note: Any component specific methods that are used on Page load must be called inside component's onMount event.
492
- >
493
- > Parameter: function
494
-
495
- ```js
496
- component.onMount(() => {
497
- // function logic goes here... For eg.
498
- // component.setActiveTab(2)
499
- });
500
- ```
501
-
502
- ##### 5.2.1) Tab component
503
-
504
- ##### 1) setActiveTab
505
-
506
- Sets specified tab as active. Parameter: Tabs' Number (Starts from 1 to N)
507
-
508
- ```js
509
- component.setActiveTab(2); // sets 2nd tab as active one
510
- ```
511
-
512
- ### 6) Popup
513
-
514
- `kf.app.page.popup` returns the active popup instance opened inside the page and
515
- its id can be accessed via `kf.app.page.popup._id` And
516
- `kf.app.page.getPopup(id)` returns this popup class instance.
517
-
518
- ##### Popup parameters
519
-
520
- ```js
521
- let value = await kf.app.page.popup.getParameter("parameterId"); // for retreiving single popup parameter
522
- ```
523
-
524
- Get all popup parameters
525
-
526
- ```js
527
- let allParams = await kf.app.page.popup.getAllParameters();
528
- // Returns an object
529
- {
530
- parameterName: "Sample value",
531
- parameterName2: "Sample value 2"
532
- }
533
- ```
534
-
535
- ##### Close popup
536
-
537
- ```js
538
- kf.app.page.popup.close(); // for active popup
539
- // or if you already have a popup instance...
540
- greetPopup.close();
541
- ```
542
-
543
- ### 8) Dataform
544
-
545
- > Note: Get dataform instance from `kf.app.getDatform`
546
-
547
- ##### Import CSV
548
-
549
- Opens up the import CSV modal where user could upload CSV file and map
550
- respective columns to the field.
551
-
552
- ```js
553
- let defaultValues = { fieldId: "value" };
554
- dataformInstance.importCSV(defaultValues);
555
- ```
556
-
557
- ###### Example scenario
558
-
559
- Consider scenario where few fields that aren't exposed to user(basically hidden
560
- in form visibilty). In such cases Default values can be used to provide data to
561
- hidden fields
562
-
563
- ```js
564
- // Here the location field is hidden to user,
565
- // thus user isn't aware to include this on import csv.
566
- let defaultValues = { location: "India" };
567
- dataformInstance.importCSV(defaultValues);
568
- ```
569
-
570
- > Note:
571
- > 1. Default values here is optional
572
- > 2. Any variables or parameter can also be mapped in `defaultValues`.
573
- > 3. End user can't pass this value if default value is set by dev.
574
- > 4. Some fields cannot be set as default eg. Auto calculated fields, Sequence numbers etc.
575
-
576
-
577
- ### 7) Formatter
578
-
579
- ##### Format to KF Date
580
-
581
- ```js
582
- kf.formatter.toDate("08-24-2021").then((res) => {...})
583
- // or
584
- let value = await kf.formatter.toDate("08-24-2021");
585
- ```
586
-
587
- ##### Format to KF Date Time
588
-
589
- ```js
590
- kf.formatter.toDateTime("2021-08-26T14:30").then((res) => {...})
591
- // or
592
- let value = await kf.formatter.toDateTime("2021-08-26T14:30");
593
- ```
594
-
595
- ##### Format to KF Number
596
-
597
- ```js
598
- kf.formatter.toNumber("1,00,000.500000").then((res) => {...})
599
- // or
600
- let value = await kf.formatter.toNumber("1,00,000.500000");
601
- ```
602
-
603
- ##### Format to KF Currency
604
-
605
- ```js
606
- kf.formatter.toCurrency("1,00,000.500000", "USD").then((res) => {...})
607
- // or
608
- let value = await kf.formatter.toCurrency("1,00,000.500000", "USD");
609
- ```
610
-
611
- ##### Format to KF Boolean
612
-
613
- ```js
614
- kf.formatter.toBoolean("yes").then((res) => {...})
615
- // or
616
- let value = await kf.formatter.toBoolean("yes");
617
- ```
618
-
619
- ##### Other supported Boolean values
620
-
621
- ```js
622
- let value = await kf.formatter.toBoolean("1");
623
- let value = await kf.formatter.toBoolean("true");
624
- let value = await kf.formatter.toBoolean("no");
625
- let value = await kf.formatter.toBoolean("0");
626
- let value = await kf.formatter.toBoolean("false");
627
- ```
5
+ Please refer docs [here](https://kissflow.github.io/lcnc-sdk-js/)
package/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ BOARD_IMPORT_CSV: string;
51
52
  };
52
53
  export const EVENT_TYPES: {
53
54
  COMPONENT_ON_MOUNT: string;
@@ -171,7 +172,7 @@ declare module "app/page" {
171
172
  getParameter(key: string): any;
172
173
  getAllParameters(): any;
173
174
  getVariable(key: string): any;
174
- setVariable(key: string, value: any): any;
175
+ setVariable(key: string | object, value: any): any;
175
176
  openPopup(popupId: string, popupParams: object): any;
176
177
  getComponent(componentId: string): Component;
177
178
  }
@@ -192,12 +193,21 @@ declare module "app/dataform" {
192
193
  importCSV(defaultValues: object): any;
193
194
  }
194
195
  }
196
+ declare module "board/index" {
197
+ import { BaseSDK } from "core/index";
198
+ export class Board extends BaseSDK {
199
+ private _id;
200
+ constructor(flowId: string);
201
+ importCSV(defaultValues: object): any;
202
+ }
203
+ }
195
204
  declare module "app/index" {
196
205
  import { BaseSDK } from "core/index";
197
206
  import { Page } from "app/page";
198
207
  import { AppContext } from "types/internal";
199
208
  import { DecisionTable } from "app/decisiontable";
200
209
  import { Dataform } from "app/dataform";
210
+ import { Board } from "board/index";
201
211
  export class Application extends BaseSDK {
202
212
  page: Page;
203
213
  _id: string;
@@ -207,6 +217,7 @@ declare module "app/index" {
207
217
  openPage(pageId: string, pageParams: object): any;
208
218
  getDecisionTable(flowId: string): DecisionTable;
209
219
  getDataform(flowId: string): Dataform;
220
+ getBoard(flowId: string): Board;
210
221
  }
211
222
  export * from "app/component";
212
223
  export { Page };
@@ -82,7 +82,8 @@ const LISTENER_CMDS = {
82
82
  WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
83
83
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
84
84
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
85
- DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
85
+ DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
86
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
86
87
  };
87
88
  const EVENT_TYPES = {
88
89
  COMPONENT_ON_MOUNT: "componentOnMount",
@@ -510,6 +511,18 @@ class Dataform extends BaseSDK {
510
511
  });
511
512
  }
512
513
  }
514
+ class Board extends BaseSDK {
515
+ constructor(flowId) {
516
+ super();
517
+ this._id = flowId;
518
+ }
519
+ importCSV(defaultValues) {
520
+ return this._postMessageAsync(LISTENER_CMDS.BOARD_IMPORT_CSV, {
521
+ flowId: this._id,
522
+ defaultValues
523
+ });
524
+ }
525
+ }
513
526
  class Application extends BaseSDK {
514
527
  constructor(props) {
515
528
  super();
@@ -539,6 +552,9 @@ class Application extends BaseSDK {
539
552
  getDataform(flowId) {
540
553
  return new Dataform(flowId);
541
554
  }
555
+ getBoard(flowId) {
556
+ return new Board(flowId);
557
+ }
542
558
  }
543
559
  class NDEFReader extends BaseSDK {
544
560
  constructor() {
@@ -78,7 +78,8 @@ const LISTENER_CMDS = {
78
78
  WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
79
79
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
80
80
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
81
- DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
81
+ DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
82
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
82
83
  };
83
84
  function generateId(prefix = "lcncsdk") {
84
85
  return `${prefix}-${nanoid()}`;
package/dist/kfsdk.es.js CHANGED
@@ -82,7 +82,8 @@ const LISTENER_CMDS = {
82
82
  WINDOW_NDEF_READER_MAKE_READONLY: "WINDOW_NDEF_READER_MAKE_READONLY",
83
83
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
84
84
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
85
- DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV"
85
+ DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
86
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
86
87
  };
87
88
  const EVENT_TYPES = {
88
89
  COMPONENT_ON_MOUNT: "componentOnMount",
@@ -374,6 +375,18 @@ class Dataform extends BaseSDK {
374
375
  });
375
376
  }
376
377
  }
378
+ class Board extends BaseSDK {
379
+ constructor(flowId) {
380
+ super();
381
+ this._id = flowId;
382
+ }
383
+ importCSV(defaultValues) {
384
+ return this._postMessageAsync(LISTENER_CMDS.BOARD_IMPORT_CSV, {
385
+ flowId: this._id,
386
+ defaultValues
387
+ });
388
+ }
389
+ }
377
390
  class Application extends BaseSDK {
378
391
  constructor(props) {
379
392
  super();
@@ -403,6 +416,9 @@ class Application extends BaseSDK {
403
416
  getDataform(flowId) {
404
417
  return new Dataform(flowId);
405
418
  }
419
+ getBoard(flowId) {
420
+ return new Board(flowId);
421
+ }
406
422
  }
407
423
  class Client extends BaseSDK {
408
424
  showInfo(message) {
@@ -458,6 +474,11 @@ class CustomComponentSDK extends BaseSDK {
458
474
  return this._postMessageAsync(LISTENER_CMDS.API, { url, args });
459
475
  }
460
476
  initialize() {
477
+ if (globalThis.parent && globalThis.parent === globalThis) {
478
+ return Promise.reject(
479
+ "SDK can be initialized only inside the Kissflow platform."
480
+ );
481
+ }
461
482
  return this._postMessageAsync(
462
483
  LISTENER_CMDS.CC_INITIALIZE,
463
484
  {},
package/dist/kfsdk.umd.js CHANGED
@@ -1 +1 @@
1
- var h=(E,t,A)=>{if(!t.has(E))throw TypeError("Cannot "+A)};var o=(E,t,A)=>(h(E,t,"read from private field"),A?A.call(E):t.get(E)),p=(E,t,A)=>{if(t.has(E))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(E):t.set(E,A)},l=(E,t,A,N)=>(h(E,t,"write to private field"),N?N.call(E,A):t.set(E,A),A);var g=(E,t,A)=>(h(E,t,"access private method"),A);(function(E,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(E=typeof globalThis!="undefined"?globalThis:E||self,E.kf=t())})(this,function(){var i,M,L;"use strict";let E=(n=21)=>crypto.getRandomValues(new Uint8Array(n)).reduce((e,s)=>(s&=63,s<36?e+=s.toString(36):s<62?e+=(s-26).toString(36).toUpperCase():s>62?e+="-":e+="_",e),"");const t={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV"},A={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},N={POPUP_ID:"ACTIVE_POP_UP"};function u(n="lcncsdk"){return`${n}-${E()}`}const P={};function C(n){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(n,"*"):globalThis.postMessage(n)}function d(n){if(n.origin!==globalThis.location.origin){const e=n.data;if(e!=null&&e.isEvent){const{target:r,eventParams:a,eventName:c,eventConfig:R={}}=e;let O=P[r];O._dispatchEvent(c,a),R.once&&O._removeEventListener(c);return}let{_req:s,resp:_}=e;s!=null&&s._id&&P[s._id]._dispatchMessageEvents(s,_)}}globalThis.addEventListener("message",d);class S{constructor(){p(this,i,void 0);l(this,i,{})}_addEventListener(e,s){var _;o(this,i)[e]=((_=o(this,i))==null?void 0:_[e])||[],o(this,i)[e].push(s)}_removeEventListener(e,s){if(s){let _=o(this,i)[e].findIndex(s);_>-1&&o(this,i)[e].splice(_,1);return}Reflect.deleteProperty(o(this,i),e)}_dispatchEvent(e,s){return Array.isArray(o(this,i)[e])?(o(this,i)[e].forEach(_=>_(s)),!0):!1}_dispatchMessageEvents(e,s){let _=e._id;Array.isArray(o(this,i)[_])&&(o(this,i)[_].forEach(r=>{try{s&&Object.keys(s).length===1&&e.command!==t.API?r(Object.values(s)[0]):r(s)}catch(a){console.error("Message callback error: ",a)}}),this._removeEventListener(_))}}i=new WeakMap;class T extends S{_postMessageAsync(e,s,_,r){return new Promise((a,c)=>{const R=u(e.toLowerCase());C({_id:R,command:e,...s}),P[R]=this,this._addEventListener(R,async O=>{O!=null&&O.errorMessage?c(O):(_&&r&&(O=await r(O)),a(O))})})}_postMessage(e,s,_){const r=u(e.toLowerCase());C({_id:r,command:e,...s}),_&&this._addEventListener(s.eventName,_)}}class D extends T{constructor(s){super();p(this,M);this._id=s.componentId,this.type="Component",P[this._id]=this,g(this,M,L).call(this,s.componentMethods)}onMount(s){this._postMessage(t.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:A.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},s)}refresh(){return this._postMessageAsync(t.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(t.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(t.COMPONENT_HIDE,{id:this._id})}}M=new WeakSet,L=function(s){s==null||s.forEach(_=>{this[_.name]=(...r)=>{if(_.type==="method")return this._postMessageAsync(`COMPONENT_${_.name}`,{id:this._id,parameters:r});_.type==="event"&&this._postMessage(t.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:_.name,eventConfig:r[1]},r[0])}})};class G extends T{constructor(e){super(),this._id=e,this.type="CustomComponent",P[this._id]=this}watchParams(e){this._postMessage(t.CC_WATCH_PARAMS,{id:this._id,eventName:A.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class f extends T{constructor(e){super(),this.type="Popup",this._id=e.popupId||N.POPUP_ID}getParameter(e){return this._postMessageAsync(t.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(t.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(t.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(t.COMPONENT_GET,{componentId:e},!0,s=>new D(s))}}class I extends T{constructor(e){super(),this.type="Page",this.popup=new f({}),this._id=e.pageId}getParameter(e){return this._postMessageAsync(t.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(t.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(t.GET_PAGE_VARIABLE,{key:e})}setVariable(e,s){return this._postMessageAsync(t.SET_PAGE_VARIABLE,{key:e,value:s})}openPopup(e,s){return this._postMessageAsync(t.OPEN_POPUP,{popupId:e,popupParams:s})}getComponent(e){return this._postMessageAsync(t.COMPONENT_GET,{componentId:e},!0,s=>new D(s))}}class y extends T{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(t.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class F extends T{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(t.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class W extends T{constructor(e){super(),this._id=e.appId,this.page=new I(e)}getVariable(e){return this._postMessageAsync(t.GET_APP_VARIABLE,{key:e})}setVariable(e,s){return this._postMessageAsync(t.SET_APP_VARIABLE,{key:e,value:s})}openPage(e,s){return this._postMessageAsync(t.OPEN_PAGE,{pageId:e,pageParams:s})}getDecisionTable(e){return new y(e)}getDataform(e){return new F(e)}}class m extends T{showInfo(e){return super._postMessageAsync(t.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(t.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(t.REDIRECT,{url:e})}}class B extends T{toDate(e){return this._postMessageAsync(t.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(t.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(t.FORMAT_NUMBER,{value:e})}toCurrency(e,s){return this._postMessageAsync(t.FORMAT_CURRENCY,{value:e,currencyCode:s})}toBoolean(e){return this._postMessageAsync(t.FORMAT_BOOLEAN,{value:e})}}class U extends T{constructor(){super()}api(e,s={}){return this._postMessageAsync(t.API,{url:e,args:s})}initialize(){return this._postMessageAsync(t.CC_INITIALIZE,{},!0,e=>(this.app=new W(e),this.page=new I(e),this.context=new G(e.componentId),this.client=new m,this.formatter=new B,this.user=e.user,this.account=e.account,this.env=e.envDetails,this))}initialise(){return this.initialize()}}var V=new U;return V});
1
+ var h=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var T=(n,t,i)=>(h(n,t,"read from private field"),i?i.call(n):t.get(n)),p=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},l=(n,t,i,M)=>(h(n,t,"write to private field"),M?M.call(n,i):t.set(n,i),i);var g=(n,t,i)=>(h(n,t,"access private method"),i);(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.kf=t())})(this,function(){var A,N,d;"use strict";let n=(E=21)=>crypto.getRandomValues(new Uint8Array(E)).reduce((e,s)=>(s&=63,s<36?e+=s.toString(36):s<62?e+=(s-26).toString(36).toUpperCase():s>62?e+="-":e+="_",e),"");const t={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV",BOARD_IMPORT_CSV:"BOARD_IMPORT_CSV"},i={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},M={POPUP_ID:"ACTIVE_POP_UP"};function u(E="lcncsdk"){return`${E}-${n()}`}const a={};function C(E){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(E,"*"):globalThis.postMessage(E)}function S(E){if(E.origin!==globalThis.location.origin){const e=E.data;if(e!=null&&e.isEvent){const{target:r,eventParams:P,eventName:c,eventConfig:R={}}=e;let O=a[r];O._dispatchEvent(c,P),R.once&&O._removeEventListener(c);return}let{_req:s,resp:_}=e;s!=null&&s._id&&a[s._id]._dispatchMessageEvents(s,_)}}globalThis.addEventListener("message",S);class L{constructor(){p(this,A,void 0);l(this,A,{})}_addEventListener(e,s){var _;T(this,A)[e]=((_=T(this,A))==null?void 0:_[e])||[],T(this,A)[e].push(s)}_removeEventListener(e,s){if(s){let _=T(this,A)[e].findIndex(s);_>-1&&T(this,A)[e].splice(_,1);return}Reflect.deleteProperty(T(this,A),e)}_dispatchEvent(e,s){return Array.isArray(T(this,A)[e])?(T(this,A)[e].forEach(_=>_(s)),!0):!1}_dispatchMessageEvents(e,s){let _=e._id;Array.isArray(T(this,A)[_])&&(T(this,A)[_].forEach(r=>{try{s&&Object.keys(s).length===1&&e.command!==t.API?r(Object.values(s)[0]):r(s)}catch(P){console.error("Message callback error: ",P)}}),this._removeEventListener(_))}}A=new WeakMap;class o extends L{_postMessageAsync(e,s,_,r){return new Promise((P,c)=>{const R=u(e.toLowerCase());C({_id:R,command:e,...s}),a[R]=this,this._addEventListener(R,async O=>{O!=null&&O.errorMessage?c(O):(_&&r&&(O=await r(O)),P(O))})})}_postMessage(e,s,_){const r=u(e.toLowerCase());C({_id:r,command:e,...s}),_&&this._addEventListener(s.eventName,_)}}class D extends o{constructor(s){super();p(this,N);this._id=s.componentId,this.type="Component",a[this._id]=this,g(this,N,d).call(this,s.componentMethods)}onMount(s){this._postMessage(t.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:i.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},s)}refresh(){return this._postMessageAsync(t.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(t.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(t.COMPONENT_HIDE,{id:this._id})}}N=new WeakSet,d=function(s){s==null||s.forEach(_=>{this[_.name]=(...r)=>{if(_.type==="method")return this._postMessageAsync(`COMPONENT_${_.name}`,{id:this._id,parameters:r});_.type==="event"&&this._postMessage(t.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:_.name,eventConfig:r[1]},r[0])}})};class f extends o{constructor(e){super(),this._id=e,this.type="CustomComponent",a[this._id]=this}watchParams(e){this._postMessage(t.CC_WATCH_PARAMS,{id:this._id,eventName:i.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class G extends o{constructor(e){super(),this.type="Popup",this._id=e.popupId||M.POPUP_ID}getParameter(e){return this._postMessageAsync(t.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(t.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(t.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(t.COMPONENT_GET,{componentId:e},!0,s=>new D(s))}}class I extends o{constructor(e){super(),this.type="Page",this.popup=new G({}),this._id=e.pageId}getParameter(e){return this._postMessageAsync(t.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(t.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(t.GET_PAGE_VARIABLE,{key:e})}setVariable(e,s){return this._postMessageAsync(t.SET_PAGE_VARIABLE,{key:e,value:s})}openPopup(e,s){return this._postMessageAsync(t.OPEN_POPUP,{popupId:e,popupParams:s})}getComponent(e){return this._postMessageAsync(t.COMPONENT_GET,{componentId:e},!0,s=>new D(s))}}class y extends o{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(t.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class F extends o{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(t.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class W extends o{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(t.BOARD_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class m extends o{constructor(e){super(),this._id=e.appId,this.page=new I(e)}getVariable(e){return this._postMessageAsync(t.GET_APP_VARIABLE,{key:e})}setVariable(e,s){return this._postMessageAsync(t.SET_APP_VARIABLE,{key:e,value:s})}openPage(e,s){return this._postMessageAsync(t.OPEN_PAGE,{pageId:e,pageParams:s})}getDecisionTable(e){return new y(e)}getDataform(e){return new F(e)}getBoard(e){return new W(e)}}class B extends o{showInfo(e){return super._postMessageAsync(t.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(t.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(t.REDIRECT,{url:e})}}class U extends o{toDate(e){return this._postMessageAsync(t.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(t.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(t.FORMAT_NUMBER,{value:e})}toCurrency(e,s){return this._postMessageAsync(t.FORMAT_CURRENCY,{value:e,currencyCode:s})}toBoolean(e){return this._postMessageAsync(t.FORMAT_BOOLEAN,{value:e})}}class V extends o{constructor(){super()}api(e,s={}){return this._postMessageAsync(t.API,{url:e,args:s})}initialize(){return globalThis.parent&&globalThis.parent===globalThis?Promise.reject("SDK can be initialized only inside the Kissflow platform."):this._postMessageAsync(t.CC_INITIALIZE,{},!0,e=>(this.app=new m(e),this.page=new I(e),this.context=new f(e.componentId),this.client=new B,this.formatter=new U,this.user=e.user,this.account=e.account,this.env=e.envDetails,this))}initialise(){return this.initialize()}}var w=new V;return w});
package/dist/lowcode.d.ts CHANGED
@@ -48,6 +48,7 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ BOARD_IMPORT_CSV: string;
51
52
  };
52
53
  export const EVENT_TYPES: {
53
54
  COMPONENT_ON_MOUNT: string;
@@ -233,7 +234,7 @@ declare module "app/page" {
233
234
  getParameter(key: string): any;
234
235
  getAllParameters(): any;
235
236
  getVariable(key: string): any;
236
- setVariable(key: string, value: any): any;
237
+ setVariable(key: string | object, value: any): any;
237
238
  openPopup(popupId: string, popupParams: object): any;
238
239
  getComponent(componentId: string): Component;
239
240
  }
@@ -254,12 +255,21 @@ declare module "app/dataform" {
254
255
  importCSV(defaultValues: object): any;
255
256
  }
256
257
  }
258
+ declare module "board/index" {
259
+ import { BaseSDK } from "core/index";
260
+ export class Board extends BaseSDK {
261
+ private _id;
262
+ constructor(flowId: string);
263
+ importCSV(defaultValues: object): any;
264
+ }
265
+ }
257
266
  declare module "app/index" {
258
267
  import { BaseSDK } from "core/index";
259
268
  import { Page } from "app/page";
260
269
  import { AppContext } from "types/internal";
261
270
  import { DecisionTable } from "app/decisiontable";
262
271
  import { Dataform } from "app/dataform";
272
+ import { Board } from "board/index";
263
273
  export class Application extends BaseSDK {
264
274
  page: Page;
265
275
  _id: string;
@@ -269,6 +279,7 @@ declare module "app/index" {
269
279
  openPage(pageId: string, pageParams: object): any;
270
280
  getDecisionTable(flowId: string): DecisionTable;
271
281
  getDataform(flowId: string): Dataform;
282
+ getBoard(flowId: string): Board;
272
283
  }
273
284
  export * from "app/component";
274
285
  export { Page };
@@ -62,7 +62,7 @@ declare class Page {
62
62
  getParameter(key: string): any;
63
63
  getAllParameters(): any;
64
64
  getVariable(key: string): any;
65
- setVariable(key: string, value: any): any;
65
+ setVariable(key: string | object, value: any): any;
66
66
  openPopup(popupId: string, popupParams: object): any;
67
67
  getComponent(componentId: string): Component;
68
68
  }
@@ -80,6 +80,7 @@ declare class Application {
80
80
  openPage(pageId: string, pageParams: object): any;
81
81
  getDecisionTable(flowId: string): DecisionTable;
82
82
  getDataform(flowId: string): Dataform;
83
+ getBoard(flowId: string): Board;
83
84
  }
84
85
  declare class kf {
85
86
  static context: Component
package/dist/nocode.d.ts CHANGED
@@ -48,6 +48,7 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ BOARD_IMPORT_CSV: string;
51
52
  };
52
53
  export const EVENT_TYPES: {
53
54
  COMPONENT_ON_MOUNT: string;
@@ -289,17 +290,26 @@ declare module "app/page" {
289
290
  getParameter(key: string): any;
290
291
  getAllParameters(): any;
291
292
  getVariable(key: string): any;
292
- setVariable(key: string, value: any): any;
293
+ setVariable(key: string | object, value: any): any;
293
294
  openPopup(popupId: string, popupParams: object): any;
294
295
  getComponent(componentId: string): Component;
295
296
  }
296
297
  }
298
+ declare module "board/index" {
299
+ import { BaseSDK } from "core/index";
300
+ export class Board extends BaseSDK {
301
+ private _id;
302
+ constructor(flowId: string);
303
+ importCSV(defaultValues: object): any;
304
+ }
305
+ }
297
306
  declare module "app/index" {
298
307
  import { BaseSDK } from "core/index";
299
308
  import { Page } from "app/page";
300
309
  import { AppContext } from "types/internal";
301
310
  import { DecisionTable } from "app/decisiontable";
302
311
  import { Dataform } from "app/dataform";
312
+ import { Board } from "board/index";
303
313
  export class Application extends BaseSDK {
304
314
  page: Page;
305
315
  _id: string;
@@ -309,6 +319,7 @@ declare module "app/index" {
309
319
  openPage(pageId: string, pageParams: object): any;
310
320
  getDecisionTable(flowId: string): DecisionTable;
311
321
  getDataform(flowId: string): Dataform;
322
+ getBoard(flowId: string): Board;
312
323
  }
313
324
  export * from "app/component";
314
325
  export { Page };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kissflow/lowcode-client-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "JavaScript SDK for developing over the Kissflow lowcode platform",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [