@kissflow/lowcode-client-sdk 1.0.14 → 1.0.16

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.
Files changed (2) hide show
  1. package/dist/snippets.json +184 -0
  2. package/package.json +1 -1
@@ -0,0 +1,184 @@
1
+ {
2
+ "lowcode": [
3
+ {
4
+ "label": "get app variable",
5
+ "documentation": "Get value of the global variable",
6
+ "insertText": "let variableName = await kf.app.getVariable(\"${1:variableId}\")"
7
+ },
8
+ {
9
+ "label": "set app variable",
10
+ "documentation": "Sets a new value to the global variable",
11
+ "insertText": "kf.app.setVariable(\"${1:variableId}\", \"${2:newValue}\")"
12
+ },
13
+ {
14
+ "label": "open or navigate page",
15
+ "documentation": "Navigate to another page",
16
+ "insertText": "kf.app.openPage(\"${1:pageId}\", { inputParam1: \"value1\" })"
17
+ },
18
+ {
19
+ "label": "get local variable",
20
+ "documentation": "Get value of the local variable",
21
+ "insertText": "let variableName = await kf.app.page.getVariable(\"${1:variableId}\")"
22
+ },
23
+ {
24
+ "label": "set local variable",
25
+ "documentation": "Sets specified variable to new value in page scope",
26
+ "insertText": "kf.app.page.setVariable(\"${1:variableId}\", \"${2:newValue}\")"
27
+ },
28
+ {
29
+ "label": "get input parameter",
30
+ "documentation": "Get specific input parameter of the page",
31
+ "insertText": "let value = await kf.app.page.getParameter(\"${1:parameterId}\"); "
32
+ },
33
+ {
34
+ "label": "get all input parameters",
35
+ "documentation": "Get all input parameters in the page",
36
+ "insertText": "let allParams = await kf.app.page.getAllParameters();"
37
+ },
38
+ {
39
+ "label": "open a popup",
40
+ "documentation": "Opens a popup in the page",
41
+ "insertText": "kf.app.page.openPopup(\"${1:popupId}\", { popupParam1: \"value\" });"
42
+ },
43
+ {
44
+ "label": "get component in page",
45
+ "documentation": "Get the specified component instance from the current page",
46
+ "insertText": "let componentInstance = await kf.app.page.getComponent(\"${1:componentId}\")"
47
+ },
48
+ {
49
+ "label": "refresh the component",
50
+ "documentation": "Refreshes the component",
51
+ "insertText": "componentInstance.refresh()"
52
+ },
53
+ {
54
+ "label": "hide the component",
55
+ "documentation": "Hides the component from page",
56
+ "insertText": "componentInstance.hide()"
57
+ },
58
+ {
59
+ "label": "show the component",
60
+ "documentation": "Shows the hidden component from page",
61
+ "insertText": "componentInstance.show()"
62
+ },
63
+ {
64
+ "label": "set active tab",
65
+ "documentation": "Sets the specified tab index as active - works only for the tab component",
66
+ "insertText": "// sets 2nd tab as active\ncomponentInstance.setActiveTab(${1:2})"
67
+ },
68
+ {
69
+ "label": "get popup parameter",
70
+ "documentation": "Get specific parameter in the popup",
71
+ "insertText": "let value = await kf.app.page.popup.getParameter(\"${1:parameterId}\"); "
72
+ },
73
+ {
74
+ "label": "get all popup parameters",
75
+ "documentation": "Get all parameters in the popup as object",
76
+ "insertText": "let allParams = await kf.app.page.popup.getAllParameters();"
77
+ },
78
+ {
79
+ "label": "close active popup",
80
+ "documentation": "Closes the active popup in the page",
81
+ "insertText": "kf.app.page.popup.close()"
82
+ },
83
+ {
84
+ "label": "get instance id",
85
+ "documentation": "Get the instance id from event arguments",
86
+ "insertText": "kf.eventParameters._id"
87
+ },
88
+ {
89
+ "label": "get activity instance id",
90
+ "documentation": "Get the activity instance id from event arguments",
91
+ "insertText": "kf.eventParameters._activity_instance_id"
92
+ }
93
+ ],
94
+ "nocode": [
95
+ {
96
+ "label": "get field value",
97
+ "documentation": "Get value of a field in form",
98
+ "insertText": "let fieldValue = await kf.context.getField(\"${1:fieldId}\");"
99
+ },
100
+ {
101
+ "label": "set field value",
102
+ "documentation": "Set value of a field in form",
103
+ "insertText": "kf.context.updateField({\"${1:fieldId}\": \"${2:value}\"});"
104
+ },
105
+ {
106
+ "label": "set field value - bulk",
107
+ "documentation": "Set value of a field in form",
108
+ "insertText": "let payload = { \"fieldId\": \"value\", \"fieldId2\": \"value2\" };\nkf.context.updateField(payload);"
109
+ },
110
+ {
111
+ "label": "get form json",
112
+ "documentation": "Returns whole data of current form in json format",
113
+ "insertText": "let formJSON = await kf.context.getJSON();"
114
+ },
115
+ {
116
+ "label": "get table instance",
117
+ "documentation": "Get instance of table, which can be further used to add or delete rows",
118
+ "insertText": "let tableInstance = kf.context.getTable(\"${1:tableId}\");"
119
+ },
120
+ {
121
+ "label": "add a row in table",
122
+ "documentation": "Appends a row entry to table",
123
+ "insertText": "let rowDetails = { \"columnId1\": \"value1\", \"columnId2\": \"value2\" };\ntableInstance.addRow(rowDetails)"
124
+ },
125
+ {
126
+ "label": "get table row",
127
+ "documentation": "Returns all columns with values in specified row",
128
+ "insertText": "tableInstance.getRow(\"${1:rowId}\")"
129
+ },
130
+ {
131
+ "label": "get table json",
132
+ "documentation": "Returns all rows & columns data inside table in json format",
133
+ "insertText": "let tableJSON = await kf.context.getJSON();"
134
+ }
135
+ ],
136
+ "common": [
137
+ {
138
+ "label": "showinfo",
139
+ "documentation": "Shows toast information",
140
+ "insertText": "kf.client.showInfo(\"${1:message}\")"
141
+ },
142
+ {
143
+ "label": "api call",
144
+ "documentation": "Makes an API call to any kissflow rest api end points",
145
+ "insertText": "kf.api(`/${1:url}`)\n.then((resp) => {${2}})\n.catch((err) => {${3}})"
146
+ },
147
+ {
148
+ "label": "get account id",
149
+ "documentation": "Retrieves the acccount id",
150
+ "insertText": "kf.account._id"
151
+ },
152
+
153
+ {
154
+ "label": "get dataform item",
155
+ "documentation": "API call to get dataform item",
156
+ "insertText": "kf.api(`/form/2/${kf.account._id}/${1:formId}/${2:instanceId}`)\n.then((resp) => {${3}})\n.catch((err) => {${4}})"
157
+ },
158
+ {
159
+ "label": "update dataform item",
160
+ "documentation": "API call to update dataform item",
161
+ "insertText": "let payload = {};\nkf.api(`/form/2/${kf.account._id}/${1:formId}/${2:instanceId}`, {\n\tmethod: \"POST\",\n\tbody: JSON.stringify(payload)\n})\n.then((resp) => {${4}})\n.catch((err) => {${5}})"
162
+ },
163
+ {
164
+ "label": "delete dataform item",
165
+ "documentation": "API call to delete dataform item",
166
+ "insertText": "let payload = {};\nkf.api(`/form/2/${kf.account._id}/${1:formId}/${2:instanceId}`, { method: \"DELETE\" })\n.then((resp) => {${3}})\n.catch((err) => {${4}})"
167
+ },
168
+ {
169
+ "label": "create new dataform item",
170
+ "documentation": "API call to create new dataform item",
171
+ "insertText": "let payload = {};\nkf.api(`/form/2/${kf.account._id}/${1:formId}/`,{\n\tmethod: \"POST\",\n\tbody: JSON.stringify(payload)\n})\n.then((resp) => {${2}})\n.catch((err) => {${3}})"
172
+ },
173
+ {
174
+ "label": "create new case item",
175
+ "documentation": "API call to create new case item",
176
+ "insertText": "let payload = {};\nkf.api(`/case/2/${kf.account._id}/${1:caseId}/`, {\n\tmethod: \"POST\",\n\tbody: JSON.stringify(payload)\n})\n.then((resp) => {${2}})\n.catch((err) => {${3}})"
177
+ },
178
+ {
179
+ "label": "create new process item",
180
+ "documentation": "API call to create new process item",
181
+ "insertText": "let payload = {}:\nkf.api(`/process/2/${kf.account._id}/${1:processId}/`, {\n\tmethod: \"POST\",\n\tbody: JSON.stringify(payload)\n})\n.then((resp) => {${2}})\n.catch((err) => {${3}})"
182
+ }
183
+ ]
184
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kissflow/lowcode-client-sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "JavaScript SDK for developing over the Kissflow lowcode platform",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [