@kissflow/lowcode-client-sdk 1.0.21 → 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 +1 -492
- package/dist/index.d.ts +23 -1
- package/dist/kf.lowcodeworkersdk.es.js +33 -1
- package/dist/kf.nocodeworkersdk.es.js +3 -1
- package/dist/kfsdk.es.js +38 -1
- package/dist/kfsdk.umd.js +1 -1
- package/dist/lowcode.d.ts +23 -1
- package/dist/lowcode.types.d.ts +6 -1
- package/dist/nocode.d.ts +23 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,496 +1,5 @@
|
|
|
1
1
|
# _Kissflow Lowcode JavaScript SDK_
|
|
2
2
|
|
|
3
3
|
JavaScript SDK for developing over the Kissflow lowcode platform
|
|
4
|
-
### Use as an `npm` module
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import KFSDK from "@kissflow/lowcode-client-sdk";
|
|
9
|
-
let kf;
|
|
10
|
-
(async function () {
|
|
11
|
-
kf = await KFSDK.initialize();
|
|
12
|
-
})();
|
|
13
|
-
```
|
|
14
|
-
> Note: Initializing Kf SDK in custom components returns a promise.
|
|
15
|
-
### Use as a `<script>` tag directly in HTML
|
|
16
|
-
|
|
17
|
-
SDK can also be loaded directly into HTML by adding:
|
|
18
|
-
```html
|
|
19
|
-
<script src="https://unpkg.com/@kissflow/lowcode-client-sdk@latest/dist/kfsdk.umd.js"></script>
|
|
20
|
-
```
|
|
21
|
-
Then SDK can be initialized as:
|
|
22
|
-
```js
|
|
23
|
-
let kf;
|
|
24
|
-
window.onload = async function () {
|
|
25
|
-
kf = await window.kf.initialize();
|
|
26
|
-
};
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### User and Account details
|
|
30
|
-
Details of authenticated user can be accessed as following
|
|
31
|
-
```js
|
|
32
|
-
const { Name, Email, _id } = kf.user
|
|
33
|
-
```
|
|
34
|
-
And account id can be accessed as `kf.account._id`
|
|
35
|
-
|
|
36
|
-
### Fetch Api through sdk
|
|
37
|
-
Fetch any other kissflow api & external api using this method.
|
|
38
|
-
kf.api has header tokens by default for making authenticated kissflow api calls
|
|
39
|
-
> Note: This method has a limit of 10 seconds for an api call
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
kf.api(url, config).then((res) => {...})
|
|
43
|
-
// or
|
|
44
|
-
let resp = await kf.api(url, config)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Table of contents
|
|
48
|
-
- [1. Context](#1-context)
|
|
49
|
-
- [Custom Components](#custom-component)
|
|
50
|
-
- [Form](#custom-component)
|
|
51
|
-
- [Form Table](#form-table)
|
|
52
|
-
- [Table Row](#table-row)
|
|
53
|
-
- [2. Client](#2-client)
|
|
54
|
-
- [3. Application](#3-application)
|
|
55
|
-
- [4. Page](#4-page)
|
|
56
|
-
- [5. Component](#5-component)
|
|
57
|
-
- [Standard Component methods](#standard-component-methods)
|
|
58
|
-
- [Component Specific methods](#component-specific-methods)
|
|
59
|
-
- [Tab](#521-tab-component)
|
|
60
|
-
- [6. Popup](#6-popup)
|
|
61
|
-
- [7. Formatter](#7-formatter)
|
|
62
|
-
|
|
63
|
-
## 1) Context
|
|
64
|
-
|
|
65
|
-
Context methods are polymorphic, it has different classes pre-initialized based on execution context.
|
|
66
|
-
|
|
67
|
-
### Custom component
|
|
68
|
-
|
|
69
|
-
`kf.context` returns a `CustomComponent` class while using inside custom component. Custom component supported methods:
|
|
70
|
-
|
|
71
|
-
##### a) Watch Params
|
|
72
|
-
|
|
73
|
-
Listens for changes in parameter given to custom components in lowcode application.
|
|
74
|
-
|
|
75
|
-
```js
|
|
76
|
-
kf.context.watchParams(function (data) {
|
|
77
|
-
console.log(data);
|
|
78
|
-
});
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Kissflow Forms
|
|
82
|
-
|
|
83
|
-
`kf.context` returns a `Form` class when it is used inside a kissflow's form that could be either Process, case or Dataform & it has following supported methods
|
|
84
|
-
|
|
85
|
-
##### a) getField()
|
|
86
|
-
|
|
87
|
-
###### Description:
|
|
88
|
-
Use this function to get the current value of a form field
|
|
89
|
-
|
|
90
|
-
###### Syntax:
|
|
91
|
-
```js
|
|
92
|
-
kf.context.getField(fieldId).then((res) => {...})
|
|
93
|
-
// or
|
|
94
|
-
let value = await kf.context.getField(fieldId)
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
##### b) updateField()
|
|
98
|
-
|
|
99
|
-
###### Description:
|
|
100
|
-
Use this function to get update any field in the form
|
|
101
|
-
|
|
102
|
-
###### Syntax:
|
|
103
|
-
```js
|
|
104
|
-
kf.context.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
##### c) toJSON()
|
|
108
|
-
|
|
109
|
-
###### Description:
|
|
110
|
-
Use this function to get the JSON data of the current form
|
|
111
|
-
|
|
112
|
-
###### Syntax:
|
|
113
|
-
```js
|
|
114
|
-
const json = await kf.context.toJSON();
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
###### Output:
|
|
118
|
-
```
|
|
119
|
-
{
|
|
120
|
-
"Untitled_Field": "testing",
|
|
121
|
-
"_created_at": "2022-03-01T03:04:09Z",
|
|
122
|
-
"_flow_name": "form events",
|
|
123
|
-
"_id": "Pk4_T1WGWuMe",
|
|
124
|
-
"_modified_at": "2022-03-01T03:04:09Z"
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Form Table
|
|
129
|
-
|
|
130
|
-
`kf.context.getTable(tableId)` returns a `Table` class which has the following methods
|
|
131
|
-
|
|
132
|
-
#### a) addRow()
|
|
133
|
-
|
|
134
|
-
###### Description:
|
|
135
|
-
Appends row details to the table.
|
|
136
|
-
|
|
137
|
-
###### Syntax:
|
|
138
|
-
```js
|
|
139
|
-
const table = kf.context.getTable(tableId);
|
|
140
|
-
table.addRow({ columnId1: value, columnId2: value });
|
|
141
|
-
```
|
|
142
|
-
> ##### Note: If there are more than one rows to be added to table then use `addRows()` instead for these bulk operations
|
|
143
|
-
|
|
144
|
-
#### b) addRows()
|
|
145
|
-
|
|
146
|
-
###### Description:
|
|
147
|
-
Appends multiple rows details to the table.
|
|
148
|
-
|
|
149
|
-
###### Syntax:
|
|
150
|
-
```js
|
|
151
|
-
const table = kf.context.getTable(tableId);
|
|
152
|
-
let accumulator = [];
|
|
153
|
-
someArrayOfObjects.forEach(function(rowDetail) {
|
|
154
|
-
accumulator.push({
|
|
155
|
-
columnId1: rowDetail[columnId1],
|
|
156
|
-
columnId2: rowDetail[columnId2]
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
await table.addRows(accumulator);
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
#### c) deleteRow()
|
|
163
|
-
|
|
164
|
-
###### Description:
|
|
165
|
-
Deletes a row from the table based on the row id
|
|
166
|
-
|
|
167
|
-
###### Syntax:
|
|
168
|
-
```js
|
|
169
|
-
const table = kf.context.getTable(tableId);
|
|
170
|
-
await table.deleteRow(rowId);
|
|
171
|
-
```
|
|
172
|
-
> ##### Note: If there are more than one rows to be deleted then use `deleteRows()` instead.
|
|
173
|
-
|
|
174
|
-
#### d) deleteRows()
|
|
175
|
-
|
|
176
|
-
###### Description:
|
|
177
|
-
Deletes multiple rows from the table based on given array of strings.
|
|
178
|
-
|
|
179
|
-
###### Syntax:
|
|
180
|
-
```js
|
|
181
|
-
const table = kf.context.getTable(tableId);
|
|
182
|
-
await table.deleteRows([rowId1, rowId2, rowId3]);
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
#### e) getRow()
|
|
186
|
-
|
|
187
|
-
###### Description:
|
|
188
|
-
Use this function to perform form actions on any row inside a child table
|
|
189
|
-
|
|
190
|
-
###### Syntax:
|
|
191
|
-
```js
|
|
192
|
-
const table = kf.context.getTable(tableId);
|
|
193
|
-
const row = table.getRow(rowId);
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
###### Output:
|
|
197
|
-
Returns an instance of `TableForm` class
|
|
198
|
-
|
|
199
|
-
#### f) getRows()
|
|
200
|
-
|
|
201
|
-
###### Description:
|
|
202
|
-
Gets all the rows of the table
|
|
203
|
-
|
|
204
|
-
###### Syntax:
|
|
205
|
-
```js
|
|
206
|
-
const rows = await kf.context.getTable(tableId).getRows();
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
###### Output:
|
|
210
|
-
Returns an array of `TableForm` instances
|
|
211
|
-
|
|
212
|
-
##### g) toJSON()
|
|
213
|
-
|
|
214
|
-
###### Description:
|
|
215
|
-
Use this function to get the JSON data of the child table
|
|
216
|
-
|
|
217
|
-
###### Syntax:
|
|
218
|
-
```js
|
|
219
|
-
const json = await kf.context.getTable(tableId).toJSON();
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
###### Output:
|
|
223
|
-
```
|
|
224
|
-
[{
|
|
225
|
-
"Untitled_Field": "row 1",
|
|
226
|
-
"_created_at": "2022-03-01T03:04:09Z",
|
|
227
|
-
"_flow_name": "form events",
|
|
228
|
-
"_id": "Pk4_T1WGWuMe",
|
|
229
|
-
"_modified_at": "2022-03-01T03:04:09Z"
|
|
230
|
-
},{
|
|
231
|
-
"Untitled_Field": "row 2",
|
|
232
|
-
"_created_at": "2022-03-01T03:04:09Z",
|
|
233
|
-
"_flow_name": "form events",
|
|
234
|
-
"_id": "Pk4_T1WGWuMe",
|
|
235
|
-
"_modified_at": "2022-03-01T03:04:09Z"
|
|
236
|
-
}]
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Table Row
|
|
240
|
-
|
|
241
|
-
A single row inside a table is known as Table row
|
|
242
|
-
`kf.context` returns a `TableForm` class which has the following methods
|
|
243
|
-
|
|
244
|
-
##### a) getField()
|
|
245
|
-
|
|
246
|
-
###### Description:
|
|
247
|
-
Use this function to get the value of the table row
|
|
248
|
-
|
|
249
|
-
###### Syntax:
|
|
250
|
-
```js
|
|
251
|
-
kf.context.getField(fieldId).then((res) => {...})
|
|
252
|
-
// or
|
|
253
|
-
let value = await kf.context.getField(fieldId)
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
##### b) updateField()
|
|
257
|
-
|
|
258
|
-
###### Description:
|
|
259
|
-
Use this function to get update any field in the table row
|
|
260
|
-
|
|
261
|
-
###### Syntax:
|
|
262
|
-
```js
|
|
263
|
-
kf.context.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
##### c) getParent()
|
|
267
|
-
|
|
268
|
-
###### Description:
|
|
269
|
-
Use this function to perform form actions on the main form
|
|
270
|
-
|
|
271
|
-
###### Syntax:
|
|
272
|
-
```js
|
|
273
|
-
const mainForm = kf.context.getParent();
|
|
274
|
-
mainForm.updateField({ fieldId_1: fieldValue, fieldId_2: fieldValue });
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
###### Output:
|
|
278
|
-
Returns an instance of `Form` class using which we can perform any action on the
|
|
279
|
-
main form
|
|
280
|
-
|
|
281
|
-
##### d) toJson()
|
|
282
|
-
|
|
283
|
-
##### Description:
|
|
284
|
-
Get JSON output of table row
|
|
285
|
-
|
|
286
|
-
##### Syntax:
|
|
287
|
-
```js
|
|
288
|
-
const json = await kf.context.toJSON();
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
###### Output:
|
|
292
|
-
```
|
|
293
|
-
{
|
|
294
|
-
"Untitled_Field": "testing",
|
|
295
|
-
"_created_at": "2022-03-01T03:04:09Z",
|
|
296
|
-
"_flow_name": "form events",
|
|
297
|
-
"_id": "Pk4_T1WGWuMe",
|
|
298
|
-
"_modified_at": "2022-03-01T03:04:09Z"
|
|
299
|
-
}
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
### 2) Client
|
|
305
|
-
|
|
306
|
-
##### Show Toast
|
|
307
|
-
```js
|
|
308
|
-
kf.client.showInfo(message);
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
##### Show confirm
|
|
312
|
-
Displays the confirmation dialog, and returns users's action as a response
|
|
313
|
-
```js
|
|
314
|
-
kf.client.showConfirm({ title, content }).then((action) => {
|
|
315
|
-
if(action === "OK") // user clicked ok button
|
|
316
|
-
|
|
317
|
-
else // user clicked cancel button or clicked outside the popup
|
|
318
|
-
})
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
##### Redirect to URL
|
|
322
|
-
```js
|
|
323
|
-
kf.client.redirect(url);
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### 3) Application
|
|
327
|
-
|
|
328
|
-
`kf.app` represents the active kissflow app and `kf.app._id` returns its id.
|
|
329
|
-
|
|
330
|
-
##### Get value to application variable
|
|
331
|
-
```js
|
|
332
|
-
const appVarible1 = await kf.app.getVariable("variableId");
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
##### Set value of application variable
|
|
336
|
-
```js
|
|
337
|
-
let value = await kf.app.setVariable("variableId", value);
|
|
338
|
-
// or
|
|
339
|
-
await kf.app.setVariable({
|
|
340
|
-
variableId_1: "value_1",
|
|
341
|
-
variableId_2: 3345
|
|
342
|
-
});
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
##### Open a page
|
|
346
|
-
`openPage(id)` returns [Page](#4-page) class instance
|
|
347
|
-
```js
|
|
348
|
-
const pageInputParameters = {
|
|
349
|
-
param1: value,
|
|
350
|
-
param2: value
|
|
351
|
-
};
|
|
352
|
-
kf.app.openPage(pageId, pageInputParameters);
|
|
353
|
-
// Note: Page Input parameters are optional.
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
### 4) Page
|
|
357
|
-
`kf.app.page` returns the active page opened inside application and `kf.app.page._id` returns its id.
|
|
358
|
-
|
|
359
|
-
##### Page parameters
|
|
360
|
-
```js
|
|
361
|
-
let value = await kf.app.page.getParameter("parameterId"); // for retreiving single parameter
|
|
362
|
-
```
|
|
363
|
-
Get all page parameters
|
|
364
|
-
```js
|
|
365
|
-
let allParams = await kf.app.page.getAllParameters();
|
|
366
|
-
// returns an object
|
|
367
|
-
{
|
|
368
|
-
parameterName: "Sample value",
|
|
369
|
-
parameterName2: "Sample value 2"
|
|
370
|
-
}
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
##### Access a Component
|
|
374
|
-
`getComponent` returns a [Component](#5-component) class.
|
|
375
|
-
```js
|
|
376
|
-
const componentName = await kf.app.page.getComponent("componentId");
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
##### Open a popup
|
|
380
|
-
`openPoup` returns a [Popup](#6-popup) class.
|
|
381
|
-
```js
|
|
382
|
-
kf.app.page.openPopup("popupId", { inputParam1: "value" });
|
|
383
|
-
// Note: Popup parameters are optional.
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
### 5) Component
|
|
387
|
-
#### getComponent(id)
|
|
388
|
-
Parameter: Component's Id
|
|
389
|
-
Returns: Component class instance
|
|
390
|
-
```js
|
|
391
|
-
const component = await kf.app.page.getComponent(componentId);
|
|
392
|
-
```
|
|
393
|
-
##### Standard Component Methods
|
|
394
|
-
```js
|
|
395
|
-
component.refresh(); // Refreshes the component
|
|
396
|
-
component.hide(); // Hides the component
|
|
397
|
-
component.show(); // Shows the component if it's been hidden previously
|
|
398
|
-
```
|
|
399
|
-
##### Component Specific Methods
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
##### 5.2.0) Component onMount
|
|
403
|
-
Component onMount takes in callBack function as argument.
|
|
404
|
-
> ##### Note: Any component specific methods that are used on Page load must be called inside component's onMount event.
|
|
405
|
-
Parameter: function
|
|
406
|
-
```js
|
|
407
|
-
component.onMount(() => {
|
|
408
|
-
// function logic goes here... For eg.
|
|
409
|
-
// component.setActiveTab(2)
|
|
410
|
-
})
|
|
411
|
-
```
|
|
412
|
-
##### 5.2.1) Tab component
|
|
413
|
-
##### 1) setActiveTab
|
|
414
|
-
Sets specified tab as active.
|
|
415
|
-
Parameter: Tabs' Number (Starts from 1 to N)
|
|
416
|
-
```js
|
|
417
|
-
component.setActiveTab(2) // sets 2nd tab as active one
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
### 6) Popup
|
|
422
|
-
`kf.app.page.popup` returns the active popup instance opened inside the page and its id can be accessed via `kf.app.page.popup._id`
|
|
423
|
-
And `kf.app.page.getPopup(id)` returns this popup class instance.
|
|
424
|
-
|
|
425
|
-
##### Popup parameters
|
|
426
|
-
```js
|
|
427
|
-
let value = await kf.app.page.popup.getParameter("parameterId"); // for retreiving single popup parameter
|
|
428
|
-
```
|
|
429
|
-
Get all popup parameters
|
|
430
|
-
```js
|
|
431
|
-
let allParams = await kf.app.page.popup.getAllParameters();
|
|
432
|
-
// Returns an object
|
|
433
|
-
{
|
|
434
|
-
parameterName: "Sample value",
|
|
435
|
-
parameterName2: "Sample value 2"
|
|
436
|
-
}
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
##### Close popup
|
|
440
|
-
```js
|
|
441
|
-
kf.app.page.popup.close() // for active popup
|
|
442
|
-
// or if you already have a popup instance...
|
|
443
|
-
greetPopup.close();
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
### 7) Formatter
|
|
447
|
-
|
|
448
|
-
##### Format to KF Date
|
|
449
|
-
|
|
450
|
-
```js
|
|
451
|
-
kf.formatter.toDate("08-24-2021").then((res) => {...})
|
|
452
|
-
// or
|
|
453
|
-
let value = await kf.formatter.toDate("08-24-2021");
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
##### Format to KF Date Time
|
|
457
|
-
|
|
458
|
-
```js
|
|
459
|
-
kf.formatter.toDateTime("2021-08-26T14:30").then((res) => {...})
|
|
460
|
-
// or
|
|
461
|
-
let value = await kf.formatter.toDateTime("2021-08-26T14:30");
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
##### Format to KF Number
|
|
465
|
-
|
|
466
|
-
```js
|
|
467
|
-
kf.formatter.toNumber("1,00,000.500000").then((res) => {...})
|
|
468
|
-
// or
|
|
469
|
-
let value = await kf.formatter.toNumber("1,00,000.500000");
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
##### Format to KF Currency
|
|
473
|
-
|
|
474
|
-
```js
|
|
475
|
-
kf.formatter.toCurrency("1,00,000.500000", "USD").then((res) => {...})
|
|
476
|
-
// or
|
|
477
|
-
let value = await kf.formatter.toCurrency("1,00,000.500000", "USD");
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
##### Format to KF Boolean
|
|
481
|
-
|
|
482
|
-
```js
|
|
483
|
-
kf.formatter.toBoolean("yes").then((res) => {...})
|
|
484
|
-
// or
|
|
485
|
-
let value = await kf.formatter.toBoolean("yes");
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
##### Other supported Boolean values
|
|
489
|
-
|
|
490
|
-
```js
|
|
491
|
-
let value = await kf.formatter.toBoolean("1");
|
|
492
|
-
let value = await kf.formatter.toBoolean("true");
|
|
493
|
-
let value = await kf.formatter.toBoolean("no");
|
|
494
|
-
let value = await kf.formatter.toBoolean("0");
|
|
495
|
-
let value = await kf.formatter.toBoolean("false");
|
|
496
|
-
```
|
|
5
|
+
Please refer docs [here](https://kissflow.github.io/lcnc-sdk-js/)
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare module "core/constants" {
|
|
|
47
47
|
WINDOW_NDEF_READER_MAKE_READONLY: string;
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
|
+
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
50
52
|
};
|
|
51
53
|
export const EVENT_TYPES: {
|
|
52
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -170,7 +172,7 @@ declare module "app/page" {
|
|
|
170
172
|
getParameter(key: string): any;
|
|
171
173
|
getAllParameters(): any;
|
|
172
174
|
getVariable(key: string): any;
|
|
173
|
-
setVariable(key: string, value: any): any;
|
|
175
|
+
setVariable(key: string | object, value: any): any;
|
|
174
176
|
openPopup(popupId: string, popupParams: object): any;
|
|
175
177
|
getComponent(componentId: string): Component;
|
|
176
178
|
}
|
|
@@ -183,11 +185,29 @@ declare module "app/decisiontable" {
|
|
|
183
185
|
evaluate(payload?: object): any;
|
|
184
186
|
}
|
|
185
187
|
}
|
|
188
|
+
declare module "app/dataform" {
|
|
189
|
+
import { BaseSDK } from "core/index";
|
|
190
|
+
export class Dataform extends BaseSDK {
|
|
191
|
+
private _id;
|
|
192
|
+
constructor(flowId: string);
|
|
193
|
+
importCSV(defaultValues: object): any;
|
|
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
|
+
}
|
|
186
204
|
declare module "app/index" {
|
|
187
205
|
import { BaseSDK } from "core/index";
|
|
188
206
|
import { Page } from "app/page";
|
|
189
207
|
import { AppContext } from "types/internal";
|
|
190
208
|
import { DecisionTable } from "app/decisiontable";
|
|
209
|
+
import { Dataform } from "app/dataform";
|
|
210
|
+
import { Board } from "board/index";
|
|
191
211
|
export class Application extends BaseSDK {
|
|
192
212
|
page: Page;
|
|
193
213
|
_id: string;
|
|
@@ -196,6 +216,8 @@ declare module "app/index" {
|
|
|
196
216
|
setVariable(key: string | object, value?: any): any;
|
|
197
217
|
openPage(pageId: string, pageParams: object): any;
|
|
198
218
|
getDecisionTable(flowId: string): DecisionTable;
|
|
219
|
+
getDataform(flowId: string): Dataform;
|
|
220
|
+
getBoard(flowId: string): Board;
|
|
199
221
|
}
|
|
200
222
|
export * from "app/component";
|
|
201
223
|
export { Page };
|
|
@@ -81,7 +81,9 @@ const LISTENER_CMDS = {
|
|
|
81
81
|
WINDOW_NDEF_READER_ADD_EVENT_LISTENER: "WINDOW_NDEF_READER_ADD_EVENT_LISTENER",
|
|
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
|
-
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE"
|
|
84
|
+
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
85
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
86
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
85
87
|
};
|
|
86
88
|
const EVENT_TYPES = {
|
|
87
89
|
COMPONENT_ON_MOUNT: "componentOnMount",
|
|
@@ -497,6 +499,30 @@ class DecisionTable extends BaseSDK {
|
|
|
497
499
|
});
|
|
498
500
|
}
|
|
499
501
|
}
|
|
502
|
+
class Dataform extends BaseSDK {
|
|
503
|
+
constructor(flowId) {
|
|
504
|
+
super();
|
|
505
|
+
this._id = flowId;
|
|
506
|
+
}
|
|
507
|
+
importCSV(defaultValues) {
|
|
508
|
+
return this._postMessageAsync(LISTENER_CMDS.DATAFORM_IMPORT_CSV, {
|
|
509
|
+
flowId: this._id,
|
|
510
|
+
defaultValues
|
|
511
|
+
});
|
|
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
|
+
}
|
|
500
526
|
class Application extends BaseSDK {
|
|
501
527
|
constructor(props) {
|
|
502
528
|
super();
|
|
@@ -523,6 +549,12 @@ class Application extends BaseSDK {
|
|
|
523
549
|
getDecisionTable(flowId) {
|
|
524
550
|
return new DecisionTable(flowId);
|
|
525
551
|
}
|
|
552
|
+
getDataform(flowId) {
|
|
553
|
+
return new Dataform(flowId);
|
|
554
|
+
}
|
|
555
|
+
getBoard(flowId) {
|
|
556
|
+
return new Board(flowId);
|
|
557
|
+
}
|
|
526
558
|
}
|
|
527
559
|
class NDEFReader extends BaseSDK {
|
|
528
560
|
constructor() {
|
|
@@ -77,7 +77,9 @@ const LISTENER_CMDS = {
|
|
|
77
77
|
WINDOW_NDEF_READER_ADD_EVENT_LISTENER: "WINDOW_NDEF_READER_ADD_EVENT_LISTENER",
|
|
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
|
-
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE"
|
|
80
|
+
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
81
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
82
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
81
83
|
};
|
|
82
84
|
function generateId(prefix = "lcncsdk") {
|
|
83
85
|
return `${prefix}-${nanoid()}`;
|
package/dist/kfsdk.es.js
CHANGED
|
@@ -81,7 +81,9 @@ const LISTENER_CMDS = {
|
|
|
81
81
|
WINDOW_NDEF_READER_ADD_EVENT_LISTENER: "WINDOW_NDEF_READER_ADD_EVENT_LISTENER",
|
|
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
|
-
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE"
|
|
84
|
+
DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
|
|
85
|
+
DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
|
|
86
|
+
BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
|
|
85
87
|
};
|
|
86
88
|
const EVENT_TYPES = {
|
|
87
89
|
COMPONENT_ON_MOUNT: "componentOnMount",
|
|
@@ -361,6 +363,30 @@ class DecisionTable extends BaseSDK {
|
|
|
361
363
|
});
|
|
362
364
|
}
|
|
363
365
|
}
|
|
366
|
+
class Dataform extends BaseSDK {
|
|
367
|
+
constructor(flowId) {
|
|
368
|
+
super();
|
|
369
|
+
this._id = flowId;
|
|
370
|
+
}
|
|
371
|
+
importCSV(defaultValues) {
|
|
372
|
+
return this._postMessageAsync(LISTENER_CMDS.DATAFORM_IMPORT_CSV, {
|
|
373
|
+
flowId: this._id,
|
|
374
|
+
defaultValues
|
|
375
|
+
});
|
|
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
|
+
}
|
|
364
390
|
class Application extends BaseSDK {
|
|
365
391
|
constructor(props) {
|
|
366
392
|
super();
|
|
@@ -387,6 +413,12 @@ class Application extends BaseSDK {
|
|
|
387
413
|
getDecisionTable(flowId) {
|
|
388
414
|
return new DecisionTable(flowId);
|
|
389
415
|
}
|
|
416
|
+
getDataform(flowId) {
|
|
417
|
+
return new Dataform(flowId);
|
|
418
|
+
}
|
|
419
|
+
getBoard(flowId) {
|
|
420
|
+
return new Board(flowId);
|
|
421
|
+
}
|
|
390
422
|
}
|
|
391
423
|
class Client extends BaseSDK {
|
|
392
424
|
showInfo(message) {
|
|
@@ -442,6 +474,11 @@ class CustomComponentSDK extends BaseSDK {
|
|
|
442
474
|
return this._postMessageAsync(LISTENER_CMDS.API, { url, args });
|
|
443
475
|
}
|
|
444
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
|
+
}
|
|
445
482
|
return this._postMessageAsync(
|
|
446
483
|
LISTENER_CMDS.CC_INITIALIZE,
|
|
447
484
|
{},
|
package/dist/kfsdk.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var h=(
|
|
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
|
@@ -47,6 +47,8 @@ declare module "core/constants" {
|
|
|
47
47
|
WINDOW_NDEF_READER_MAKE_READONLY: string;
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
|
+
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
50
52
|
};
|
|
51
53
|
export const EVENT_TYPES: {
|
|
52
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -232,7 +234,7 @@ declare module "app/page" {
|
|
|
232
234
|
getParameter(key: string): any;
|
|
233
235
|
getAllParameters(): any;
|
|
234
236
|
getVariable(key: string): any;
|
|
235
|
-
setVariable(key: string, value: any): any;
|
|
237
|
+
setVariable(key: string | object, value: any): any;
|
|
236
238
|
openPopup(popupId: string, popupParams: object): any;
|
|
237
239
|
getComponent(componentId: string): Component;
|
|
238
240
|
}
|
|
@@ -245,11 +247,29 @@ declare module "app/decisiontable" {
|
|
|
245
247
|
evaluate(payload?: object): any;
|
|
246
248
|
}
|
|
247
249
|
}
|
|
250
|
+
declare module "app/dataform" {
|
|
251
|
+
import { BaseSDK } from "core/index";
|
|
252
|
+
export class Dataform extends BaseSDK {
|
|
253
|
+
private _id;
|
|
254
|
+
constructor(flowId: string);
|
|
255
|
+
importCSV(defaultValues: object): any;
|
|
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
|
+
}
|
|
248
266
|
declare module "app/index" {
|
|
249
267
|
import { BaseSDK } from "core/index";
|
|
250
268
|
import { Page } from "app/page";
|
|
251
269
|
import { AppContext } from "types/internal";
|
|
252
270
|
import { DecisionTable } from "app/decisiontable";
|
|
271
|
+
import { Dataform } from "app/dataform";
|
|
272
|
+
import { Board } from "board/index";
|
|
253
273
|
export class Application extends BaseSDK {
|
|
254
274
|
page: Page;
|
|
255
275
|
_id: string;
|
|
@@ -258,6 +278,8 @@ declare module "app/index" {
|
|
|
258
278
|
setVariable(key: string | object, value?: any): any;
|
|
259
279
|
openPage(pageId: string, pageParams: object): any;
|
|
260
280
|
getDecisionTable(flowId: string): DecisionTable;
|
|
281
|
+
getDataform(flowId: string): Dataform;
|
|
282
|
+
getBoard(flowId: string): Board;
|
|
261
283
|
}
|
|
262
284
|
export * from "app/component";
|
|
263
285
|
export { Page };
|
package/dist/lowcode.types.d.ts
CHANGED
|
@@ -62,13 +62,16 @@ 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
|
}
|
|
69
69
|
declare class DecisionTable {
|
|
70
70
|
evaluate(payload?: object): any;
|
|
71
71
|
}
|
|
72
|
+
declare class Dataform {
|
|
73
|
+
importCSV(defaultValues: object): any;
|
|
74
|
+
}
|
|
72
75
|
declare class Application {
|
|
73
76
|
page: Page
|
|
74
77
|
_id: string
|
|
@@ -76,6 +79,8 @@ declare class Application {
|
|
|
76
79
|
setVariable(key: string | object, value?: any): any;
|
|
77
80
|
openPage(pageId: string, pageParams: object): any;
|
|
78
81
|
getDecisionTable(flowId: string): DecisionTable;
|
|
82
|
+
getDataform(flowId: string): Dataform;
|
|
83
|
+
getBoard(flowId: string): Board;
|
|
79
84
|
}
|
|
80
85
|
declare class kf {
|
|
81
86
|
static context: Component
|
package/dist/nocode.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare module "core/constants" {
|
|
|
47
47
|
WINDOW_NDEF_READER_MAKE_READONLY: string;
|
|
48
48
|
WINDOW_NDEF_READER_ABORT_SCAN: string;
|
|
49
49
|
DECISION_TABLE_EXECUTE: string;
|
|
50
|
+
DATAFORM_IMPORT_CSV: string;
|
|
51
|
+
BOARD_IMPORT_CSV: string;
|
|
50
52
|
};
|
|
51
53
|
export const EVENT_TYPES: {
|
|
52
54
|
COMPONENT_ON_MOUNT: string;
|
|
@@ -245,6 +247,14 @@ declare module "app/component" {
|
|
|
245
247
|
watchParams(callBack: (data: any) => any): void;
|
|
246
248
|
}
|
|
247
249
|
}
|
|
250
|
+
declare module "app/dataform" {
|
|
251
|
+
import { BaseSDK } from "core/index";
|
|
252
|
+
export class Dataform extends BaseSDK {
|
|
253
|
+
private _id;
|
|
254
|
+
constructor(flowId: string);
|
|
255
|
+
importCSV(defaultValues: object): any;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
248
258
|
declare module "app/decisiontable" {
|
|
249
259
|
import { BaseSDK } from "core/index";
|
|
250
260
|
export class DecisionTable extends BaseSDK {
|
|
@@ -280,16 +290,26 @@ declare module "app/page" {
|
|
|
280
290
|
getParameter(key: string): any;
|
|
281
291
|
getAllParameters(): any;
|
|
282
292
|
getVariable(key: string): any;
|
|
283
|
-
setVariable(key: string, value: any): any;
|
|
293
|
+
setVariable(key: string | object, value: any): any;
|
|
284
294
|
openPopup(popupId: string, popupParams: object): any;
|
|
285
295
|
getComponent(componentId: string): Component;
|
|
286
296
|
}
|
|
287
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
|
+
}
|
|
288
306
|
declare module "app/index" {
|
|
289
307
|
import { BaseSDK } from "core/index";
|
|
290
308
|
import { Page } from "app/page";
|
|
291
309
|
import { AppContext } from "types/internal";
|
|
292
310
|
import { DecisionTable } from "app/decisiontable";
|
|
311
|
+
import { Dataform } from "app/dataform";
|
|
312
|
+
import { Board } from "board/index";
|
|
293
313
|
export class Application extends BaseSDK {
|
|
294
314
|
page: Page;
|
|
295
315
|
_id: string;
|
|
@@ -298,6 +318,8 @@ declare module "app/index" {
|
|
|
298
318
|
setVariable(key: string | object, value?: any): any;
|
|
299
319
|
openPage(pageId: string, pageParams: object): any;
|
|
300
320
|
getDecisionTable(flowId: string): DecisionTable;
|
|
321
|
+
getDataform(flowId: string): Dataform;
|
|
322
|
+
getBoard(flowId: string): Board;
|
|
301
323
|
}
|
|
302
324
|
export * from "app/component";
|
|
303
325
|
export { Page };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kissflow/lowcode-client-sdk",
|
|
3
|
-
"version": "1.0.
|
|
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": [
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"start": "vite serve",
|
|
41
41
|
"customBuild": "node custom.build.mjs",
|
|
42
42
|
"build": "pnpm run customBuild",
|
|
43
|
-
"serve": "http-server -p 8080"
|
|
43
|
+
"serve": "http-server -p 8080",
|
|
44
|
+
"publish-canary": "pnpm publish --tag canary"
|
|
44
45
|
}
|
|
45
46
|
}
|