@openfn/language-kobotoolbox 2.4.0 → 2.4.2
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/ast.json +157 -41
- package/package.json +5 -4
- package/types/Adaptor.d.ts +2 -0
package/ast.json
CHANGED
|
@@ -52,6 +52,112 @@
|
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"valid": true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "getSubmissions",
|
|
58
|
+
"params": [
|
|
59
|
+
"params",
|
|
60
|
+
"callback"
|
|
61
|
+
],
|
|
62
|
+
"docs": {
|
|
63
|
+
"description": "Get submissions for a specific form",
|
|
64
|
+
"tags": [
|
|
65
|
+
{
|
|
66
|
+
"title": "example",
|
|
67
|
+
"description": "getSubmissions({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {\n console.log(state.data);\n return state;\n});"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"title": "function",
|
|
71
|
+
"description": null,
|
|
72
|
+
"name": null
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"title": "public",
|
|
76
|
+
"description": null,
|
|
77
|
+
"type": null
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"title": "param",
|
|
81
|
+
"description": "Form Id and data to make the fetch or filter",
|
|
82
|
+
"type": {
|
|
83
|
+
"type": "NameExpression",
|
|
84
|
+
"name": "object"
|
|
85
|
+
},
|
|
86
|
+
"name": "params"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"title": "param",
|
|
90
|
+
"description": "(Optional) Callback function to execute after fetching form submissions",
|
|
91
|
+
"type": {
|
|
92
|
+
"type": "NameExpression",
|
|
93
|
+
"name": "function"
|
|
94
|
+
},
|
|
95
|
+
"name": "callback"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"title": "returns",
|
|
99
|
+
"description": null,
|
|
100
|
+
"type": {
|
|
101
|
+
"type": "NameExpression",
|
|
102
|
+
"name": "Operation"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"valid": true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "getDeploymentInfo",
|
|
111
|
+
"params": [
|
|
112
|
+
"params",
|
|
113
|
+
"callback"
|
|
114
|
+
],
|
|
115
|
+
"docs": {
|
|
116
|
+
"description": "Get deployment information for a specific form",
|
|
117
|
+
"tags": [
|
|
118
|
+
{
|
|
119
|
+
"title": "example",
|
|
120
|
+
"description": "getDeploymentInfo({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {\n console.log(state.data);\n return state;\n});"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"title": "function",
|
|
124
|
+
"description": null,
|
|
125
|
+
"name": null
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"title": "public",
|
|
129
|
+
"description": null,
|
|
130
|
+
"type": null
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"title": "param",
|
|
134
|
+
"description": "Form Id and data to make the fetch or filter",
|
|
135
|
+
"type": {
|
|
136
|
+
"type": "NameExpression",
|
|
137
|
+
"name": "object"
|
|
138
|
+
},
|
|
139
|
+
"name": "params"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"title": "param",
|
|
143
|
+
"description": "(Optional) Callback function to execute after fetching form deployment information",
|
|
144
|
+
"type": {
|
|
145
|
+
"type": "NameExpression",
|
|
146
|
+
"name": "function"
|
|
147
|
+
},
|
|
148
|
+
"name": "callback"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"title": "returns",
|
|
152
|
+
"description": null,
|
|
153
|
+
"type": {
|
|
154
|
+
"type": "NameExpression",
|
|
155
|
+
"name": "Operation"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"valid": true
|
|
55
161
|
}
|
|
56
162
|
],
|
|
57
163
|
"exports": [],
|
|
@@ -69,15 +175,15 @@
|
|
|
69
175
|
"description": null,
|
|
70
176
|
"type": null
|
|
71
177
|
},
|
|
72
|
-
{
|
|
73
|
-
"title": "example",
|
|
74
|
-
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
75
|
-
},
|
|
76
178
|
{
|
|
77
179
|
"title": "function",
|
|
78
180
|
"description": null,
|
|
79
181
|
"name": null
|
|
80
182
|
},
|
|
183
|
+
{
|
|
184
|
+
"title": "example",
|
|
185
|
+
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
186
|
+
},
|
|
81
187
|
{
|
|
82
188
|
"title": "param",
|
|
83
189
|
"description": "is the function",
|
|
@@ -113,15 +219,15 @@
|
|
|
113
219
|
"description": null,
|
|
114
220
|
"type": null
|
|
115
221
|
},
|
|
116
|
-
{
|
|
117
|
-
"title": "example",
|
|
118
|
-
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
119
|
-
},
|
|
120
222
|
{
|
|
121
223
|
"title": "function",
|
|
122
224
|
"description": null,
|
|
123
225
|
"name": null
|
|
124
226
|
},
|
|
227
|
+
{
|
|
228
|
+
"title": "example",
|
|
229
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
230
|
+
},
|
|
125
231
|
{
|
|
126
232
|
"title": "param",
|
|
127
233
|
"description": "The condition that returns true",
|
|
@@ -165,15 +271,15 @@
|
|
|
165
271
|
"description": null,
|
|
166
272
|
"type": null
|
|
167
273
|
},
|
|
168
|
-
{
|
|
169
|
-
"title": "example",
|
|
170
|
-
"description": "sourceValue('$.key')"
|
|
171
|
-
},
|
|
172
274
|
{
|
|
173
275
|
"title": "function",
|
|
174
276
|
"description": null,
|
|
175
277
|
"name": null
|
|
176
278
|
},
|
|
279
|
+
{
|
|
280
|
+
"title": "example",
|
|
281
|
+
"description": "sourceValue('$.key')"
|
|
282
|
+
},
|
|
177
283
|
{
|
|
178
284
|
"title": "param",
|
|
179
285
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -208,15 +314,15 @@
|
|
|
208
314
|
"description": null,
|
|
209
315
|
"type": null
|
|
210
316
|
},
|
|
211
|
-
{
|
|
212
|
-
"title": "example",
|
|
213
|
-
"description": "dataPath('key')"
|
|
214
|
-
},
|
|
215
317
|
{
|
|
216
318
|
"title": "function",
|
|
217
319
|
"description": null,
|
|
218
320
|
"name": null
|
|
219
321
|
},
|
|
322
|
+
{
|
|
323
|
+
"title": "example",
|
|
324
|
+
"description": "dataPath('key')"
|
|
325
|
+
},
|
|
220
326
|
{
|
|
221
327
|
"title": "param",
|
|
222
328
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -251,15 +357,15 @@
|
|
|
251
357
|
"description": null,
|
|
252
358
|
"type": null
|
|
253
359
|
},
|
|
254
|
-
{
|
|
255
|
-
"title": "example",
|
|
256
|
-
"description": "dataValue('key')"
|
|
257
|
-
},
|
|
258
360
|
{
|
|
259
361
|
"title": "function",
|
|
260
362
|
"description": null,
|
|
261
363
|
"name": null
|
|
262
364
|
},
|
|
365
|
+
{
|
|
366
|
+
"title": "example",
|
|
367
|
+
"description": "dataValue('key')"
|
|
368
|
+
},
|
|
263
369
|
{
|
|
264
370
|
"title": "param",
|
|
265
371
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -294,15 +400,15 @@
|
|
|
294
400
|
"description": null,
|
|
295
401
|
"type": null
|
|
296
402
|
},
|
|
297
|
-
{
|
|
298
|
-
"title": "example",
|
|
299
|
-
"description": "lastReferenceValue('key')"
|
|
300
|
-
},
|
|
301
403
|
{
|
|
302
404
|
"title": "function",
|
|
303
405
|
"description": null,
|
|
304
406
|
"name": null
|
|
305
407
|
},
|
|
408
|
+
{
|
|
409
|
+
"title": "example",
|
|
410
|
+
"description": "lastReferenceValue('key')"
|
|
411
|
+
},
|
|
306
412
|
{
|
|
307
413
|
"title": "param",
|
|
308
414
|
"description": "JSONPath referencing a point in `references`.",
|
|
@@ -338,15 +444,15 @@
|
|
|
338
444
|
"description": null,
|
|
339
445
|
"type": null
|
|
340
446
|
},
|
|
341
|
-
{
|
|
342
|
-
"title": "example",
|
|
343
|
-
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
344
|
-
},
|
|
345
447
|
{
|
|
346
448
|
"title": "function",
|
|
347
449
|
"description": null,
|
|
348
450
|
"name": null
|
|
349
451
|
},
|
|
452
|
+
{
|
|
453
|
+
"title": "example",
|
|
454
|
+
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
455
|
+
},
|
|
350
456
|
{
|
|
351
457
|
"title": "param",
|
|
352
458
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -391,15 +497,15 @@
|
|
|
391
497
|
"description": null,
|
|
392
498
|
"type": null
|
|
393
499
|
},
|
|
394
|
-
{
|
|
395
|
-
"title": "example",
|
|
396
|
-
"description": "field('destination_field_name__c', 'value')"
|
|
397
|
-
},
|
|
398
500
|
{
|
|
399
501
|
"title": "function",
|
|
400
502
|
"description": null,
|
|
401
503
|
"name": null
|
|
402
504
|
},
|
|
505
|
+
{
|
|
506
|
+
"title": "example",
|
|
507
|
+
"description": "field('destination_field_name__c', 'value')"
|
|
508
|
+
},
|
|
403
509
|
{
|
|
404
510
|
"title": "param",
|
|
405
511
|
"description": "Name of the field",
|
|
@@ -443,15 +549,15 @@
|
|
|
443
549
|
"description": null,
|
|
444
550
|
"type": null
|
|
445
551
|
},
|
|
446
|
-
{
|
|
447
|
-
"title": "example",
|
|
448
|
-
"description": "fields(list_of_fields)"
|
|
449
|
-
},
|
|
450
552
|
{
|
|
451
553
|
"title": "function",
|
|
452
554
|
"description": null,
|
|
453
555
|
"name": null
|
|
454
556
|
},
|
|
557
|
+
{
|
|
558
|
+
"title": "example",
|
|
559
|
+
"description": "fields(list_of_fields)"
|
|
560
|
+
},
|
|
455
561
|
{
|
|
456
562
|
"title": "param",
|
|
457
563
|
"description": "a list of fields",
|
|
@@ -496,6 +602,11 @@
|
|
|
496
602
|
"description": null,
|
|
497
603
|
"name": null
|
|
498
604
|
},
|
|
605
|
+
{
|
|
606
|
+
"title": "public",
|
|
607
|
+
"description": null,
|
|
608
|
+
"type": null
|
|
609
|
+
},
|
|
499
610
|
{
|
|
500
611
|
"title": "param",
|
|
501
612
|
"description": null,
|
|
@@ -550,6 +661,11 @@
|
|
|
550
661
|
"description": null,
|
|
551
662
|
"name": null
|
|
552
663
|
},
|
|
664
|
+
{
|
|
665
|
+
"title": "public",
|
|
666
|
+
"description": null,
|
|
667
|
+
"type": null
|
|
668
|
+
},
|
|
553
669
|
{
|
|
554
670
|
"title": "param",
|
|
555
671
|
"description": "The array of objects to be grouped.",
|
|
@@ -612,6 +728,11 @@
|
|
|
612
728
|
"description": null,
|
|
613
729
|
"type": null
|
|
614
730
|
},
|
|
731
|
+
{
|
|
732
|
+
"title": "function",
|
|
733
|
+
"description": null,
|
|
734
|
+
"name": null
|
|
735
|
+
},
|
|
615
736
|
{
|
|
616
737
|
"title": "example",
|
|
617
738
|
"description": "cursor($.cursor, { defaultValue: 'today' })",
|
|
@@ -622,11 +743,6 @@
|
|
|
622
743
|
"description": "cursor(22)",
|
|
623
744
|
"caption": "Use a pagination cursor"
|
|
624
745
|
},
|
|
625
|
-
{
|
|
626
|
-
"title": "function",
|
|
627
|
-
"description": null,
|
|
628
|
-
"name": null
|
|
629
|
-
},
|
|
630
746
|
{
|
|
631
747
|
"title": "param",
|
|
632
748
|
"description": "the cursor value. Usually an ISO date, natural language date, or page number",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-kobotoolbox",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "A Kobo Toolbox Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -17,23 +17,24 @@
|
|
|
17
17
|
"configuration-schema.json"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@openfn/language-common": "
|
|
20
|
+
"@openfn/language-common": "1.15.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@openfn/simple-ast": "0.4.1",
|
|
23
24
|
"assertion-error": "^1.0.1",
|
|
24
25
|
"chai": "^3.4.0",
|
|
25
26
|
"deep-eql": "^0.1.3",
|
|
26
27
|
"esno": "^0.16.3",
|
|
27
28
|
"mocha": "^7.1.1",
|
|
28
29
|
"nock": "^12.0.3",
|
|
29
|
-
"rimraf": "^3.0.2"
|
|
30
|
-
"@openfn/simple-ast": "0.4.1"
|
|
30
|
+
"rimraf": "^3.0.2"
|
|
31
31
|
},
|
|
32
32
|
"type": "module",
|
|
33
33
|
"types": "types/index.d.ts",
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
36
|
"import": "./dist/index.js",
|
|
37
|
+
"types": "./types/index.d.ts",
|
|
37
38
|
"require": "./dist/index.cjs"
|
|
38
39
|
},
|
|
39
40
|
"./package.json": "./package.json"
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export function getForms(params: object, callback: Function): Operation;
|
|
|
33
33
|
* return state;
|
|
34
34
|
* });
|
|
35
35
|
* @function
|
|
36
|
+
* @public
|
|
36
37
|
* @param {object} params - Form Id and data to make the fetch or filter
|
|
37
38
|
* @param {function} callback - (Optional) Callback function to execute after fetching form submissions
|
|
38
39
|
* @returns {Operation}
|
|
@@ -46,6 +47,7 @@ export function getSubmissions(params: object, callback: Function): Operation;
|
|
|
46
47
|
* return state;
|
|
47
48
|
* });
|
|
48
49
|
* @function
|
|
50
|
+
* @public
|
|
49
51
|
* @param {object} params - Form Id and data to make the fetch or filter
|
|
50
52
|
* @param {function} callback - (Optional) Callback function to execute after fetching form deployment information
|
|
51
53
|
* @returns {Operation}
|