@openfn/language-kobotoolbox 1.1.0 → 1.1.1

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/ast.json +434 -0
  2. package/package.json +9 -5
package/ast.json ADDED
@@ -0,0 +1,434 @@
1
+ {
2
+ "operations": [
3
+ {
4
+ "name": "getForms",
5
+ "params": [
6
+ "params",
7
+ "callback"
8
+ ],
9
+ "docs": {
10
+ "description": "Make a request to get the list of forms",
11
+ "tags": [
12
+ {
13
+ "title": "public",
14
+ "description": null,
15
+ "type": null
16
+ },
17
+ {
18
+ "title": "example",
19
+ "description": "getForms({}, state => {\n console.log(state.data);\n return state;\n});"
20
+ },
21
+ {
22
+ "title": "function",
23
+ "description": null,
24
+ "name": null
25
+ },
26
+ {
27
+ "title": "param",
28
+ "description": "Query, Headers and Authentication parameters",
29
+ "type": {
30
+ "type": "NameExpression",
31
+ "name": "object"
32
+ },
33
+ "name": "params"
34
+ },
35
+ {
36
+ "title": "param",
37
+ "description": "(Optional) Callback function to execute after fetching form list",
38
+ "type": {
39
+ "type": "NameExpression",
40
+ "name": "function"
41
+ },
42
+ "name": "callback"
43
+ },
44
+ {
45
+ "title": "returns",
46
+ "description": null,
47
+ "type": {
48
+ "type": "NameExpression",
49
+ "name": "Operation"
50
+ }
51
+ }
52
+ ]
53
+ },
54
+ "valid": true
55
+ }
56
+ ],
57
+ "exports": [],
58
+ "common": [
59
+ {
60
+ "name": "sourceValue",
61
+ "params": [
62
+ "path"
63
+ ],
64
+ "docs": {
65
+ "description": "Picks out a single value from source data.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
66
+ "tags": [
67
+ {
68
+ "title": "public",
69
+ "description": null,
70
+ "type": null
71
+ },
72
+ {
73
+ "title": "example",
74
+ "description": "sourceValue('$.key')"
75
+ },
76
+ {
77
+ "title": "function",
78
+ "description": null,
79
+ "name": null
80
+ },
81
+ {
82
+ "title": "param",
83
+ "description": "JSONPath referencing a point in `state`.",
84
+ "type": {
85
+ "type": "NameExpression",
86
+ "name": "String"
87
+ },
88
+ "name": "path"
89
+ },
90
+ {
91
+ "title": "returns",
92
+ "description": null,
93
+ "type": {
94
+ "type": "NameExpression",
95
+ "name": "Operation"
96
+ }
97
+ }
98
+ ]
99
+ },
100
+ "valid": true
101
+ },
102
+ {
103
+ "name": "dataPath",
104
+ "params": [
105
+ "path"
106
+ ],
107
+ "docs": {
108
+ "description": "Ensures a path points at the data.",
109
+ "tags": [
110
+ {
111
+ "title": "public",
112
+ "description": null,
113
+ "type": null
114
+ },
115
+ {
116
+ "title": "example",
117
+ "description": "dataPath('key')"
118
+ },
119
+ {
120
+ "title": "function",
121
+ "description": null,
122
+ "name": null
123
+ },
124
+ {
125
+ "title": "param",
126
+ "description": "JSONPath referencing a point in `data`.",
127
+ "type": {
128
+ "type": "NameExpression",
129
+ "name": "string"
130
+ },
131
+ "name": "path"
132
+ },
133
+ {
134
+ "title": "returns",
135
+ "description": null,
136
+ "type": {
137
+ "type": "NameExpression",
138
+ "name": "string"
139
+ }
140
+ }
141
+ ]
142
+ },
143
+ "valid": true
144
+ },
145
+ {
146
+ "name": "dataValue",
147
+ "params": [
148
+ "path"
149
+ ],
150
+ "docs": {
151
+ "description": "Picks out a single value from the source data object—usually `state.data`.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
152
+ "tags": [
153
+ {
154
+ "title": "public",
155
+ "description": null,
156
+ "type": null
157
+ },
158
+ {
159
+ "title": "example",
160
+ "description": "dataValue('key')"
161
+ },
162
+ {
163
+ "title": "function",
164
+ "description": null,
165
+ "name": null
166
+ },
167
+ {
168
+ "title": "param",
169
+ "description": "JSONPath referencing a point in `data`.",
170
+ "type": {
171
+ "type": "NameExpression",
172
+ "name": "String"
173
+ },
174
+ "name": "path"
175
+ },
176
+ {
177
+ "title": "returns",
178
+ "description": null,
179
+ "type": {
180
+ "type": "NameExpression",
181
+ "name": "Operation"
182
+ }
183
+ }
184
+ ]
185
+ },
186
+ "valid": true
187
+ },
188
+ {
189
+ "name": "lastReferenceValue",
190
+ "params": [
191
+ "path"
192
+ ],
193
+ "docs": {
194
+ "description": "Picks out the last reference value from source data.",
195
+ "tags": [
196
+ {
197
+ "title": "public",
198
+ "description": null,
199
+ "type": null
200
+ },
201
+ {
202
+ "title": "example",
203
+ "description": "lastReferenceValue('key')"
204
+ },
205
+ {
206
+ "title": "function",
207
+ "description": null,
208
+ "name": null
209
+ },
210
+ {
211
+ "title": "param",
212
+ "description": "JSONPath referencing a point in `references`.",
213
+ "type": {
214
+ "type": "NameExpression",
215
+ "name": "String"
216
+ },
217
+ "name": "path"
218
+ },
219
+ {
220
+ "title": "returns",
221
+ "description": null,
222
+ "type": {
223
+ "type": "NameExpression",
224
+ "name": "Operation"
225
+ }
226
+ }
227
+ ]
228
+ },
229
+ "valid": true
230
+ },
231
+ {
232
+ "name": "each",
233
+ "params": [
234
+ "dataSource",
235
+ "operation"
236
+ ],
237
+ "docs": {
238
+ "description": "Scopes an array of data based on a JSONPath.\nUseful when the source data has `n` items you would like to map to\nan operation.\nThe operation will receive a slice of the data based of each item\nof the JSONPath provided.\n\nIt also ensures the results of an operation make their way back into\nthe state's references.",
239
+ "tags": [
240
+ {
241
+ "title": "public",
242
+ "description": null,
243
+ "type": null
244
+ },
245
+ {
246
+ "title": "example",
247
+ "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
248
+ },
249
+ {
250
+ "title": "function",
251
+ "description": null,
252
+ "name": null
253
+ },
254
+ {
255
+ "title": "param",
256
+ "description": "JSONPath referencing a point in `state`.",
257
+ "type": {
258
+ "type": "NameExpression",
259
+ "name": "DataSource"
260
+ },
261
+ "name": "dataSource"
262
+ },
263
+ {
264
+ "title": "param",
265
+ "description": "The operation needed to be repeated.",
266
+ "type": {
267
+ "type": "NameExpression",
268
+ "name": "Operation"
269
+ },
270
+ "name": "operation"
271
+ },
272
+ {
273
+ "title": "returns",
274
+ "description": null,
275
+ "type": {
276
+ "type": "NameExpression",
277
+ "name": "Operation"
278
+ }
279
+ }
280
+ ]
281
+ },
282
+ "valid": true
283
+ },
284
+ {
285
+ "name": "field",
286
+ "params": [
287
+ "key",
288
+ "value"
289
+ ],
290
+ "docs": {
291
+ "description": "Returns a key, value pair in an array.",
292
+ "tags": [
293
+ {
294
+ "title": "public",
295
+ "description": null,
296
+ "type": null
297
+ },
298
+ {
299
+ "title": "example",
300
+ "description": "field('destination_field_name__c', 'value')"
301
+ },
302
+ {
303
+ "title": "function",
304
+ "description": null,
305
+ "name": null
306
+ },
307
+ {
308
+ "title": "param",
309
+ "description": "Name of the field",
310
+ "type": {
311
+ "type": "NameExpression",
312
+ "name": "string"
313
+ },
314
+ "name": "key"
315
+ },
316
+ {
317
+ "title": "param",
318
+ "description": "The value itself or a sourceable operation.",
319
+ "type": {
320
+ "type": "NameExpression",
321
+ "name": "Value"
322
+ },
323
+ "name": "value"
324
+ },
325
+ {
326
+ "title": "returns",
327
+ "description": null,
328
+ "type": {
329
+ "type": "NameExpression",
330
+ "name": "Field"
331
+ }
332
+ }
333
+ ]
334
+ },
335
+ "valid": true
336
+ },
337
+ {
338
+ "name": "fields",
339
+ "params": [
340
+ "fields"
341
+ ],
342
+ "docs": {
343
+ "description": "Zips key value pairs into an object.",
344
+ "tags": [
345
+ {
346
+ "title": "public",
347
+ "description": null,
348
+ "type": null
349
+ },
350
+ {
351
+ "title": "example",
352
+ "description": "fields(list_of_fields)"
353
+ },
354
+ {
355
+ "title": "function",
356
+ "description": null,
357
+ "name": null
358
+ },
359
+ {
360
+ "title": "param",
361
+ "description": "a list of fields",
362
+ "type": {
363
+ "type": "NameExpression",
364
+ "name": "Fields"
365
+ },
366
+ "name": "fields"
367
+ },
368
+ {
369
+ "title": "returns",
370
+ "description": null,
371
+ "type": {
372
+ "type": "NameExpression",
373
+ "name": "Object"
374
+ }
375
+ }
376
+ ]
377
+ },
378
+ "valid": true
379
+ },
380
+ {
381
+ "name": "merge",
382
+ "params": [
383
+ "dataSource",
384
+ "fields"
385
+ ],
386
+ "docs": {
387
+ "description": "Merges fields into each item in an array.",
388
+ "tags": [
389
+ {
390
+ "title": "public",
391
+ "description": null,
392
+ "type": null
393
+ },
394
+ {
395
+ "title": "example",
396
+ "description": "merge(\n \"$.books[*]\",\n fields(\n field( \"publisher\", sourceValue(\"$.publisher\") )\n )\n)"
397
+ },
398
+ {
399
+ "title": "function",
400
+ "description": null,
401
+ "name": null
402
+ },
403
+ {
404
+ "title": "param",
405
+ "description": null,
406
+ "type": {
407
+ "type": "NameExpression",
408
+ "name": "DataSource"
409
+ },
410
+ "name": "dataSource"
411
+ },
412
+ {
413
+ "title": "param",
414
+ "description": "Group of fields to merge in.",
415
+ "type": {
416
+ "type": "NameExpression",
417
+ "name": "Object"
418
+ },
419
+ "name": "fields"
420
+ },
421
+ {
422
+ "title": "returns",
423
+ "description": null,
424
+ "type": {
425
+ "type": "NameExpression",
426
+ "name": "DataSource"
427
+ }
428
+ }
429
+ ]
430
+ },
431
+ "valid": true
432
+ }
433
+ ]
434
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-kobotoolbox",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A Kobo Toolbox Language Pack for OpenFn",
5
5
  "homepage": "https://docs.openfn.org",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "configuration-schema.json"
18
18
  ],
19
19
  "dependencies": {
20
- "@openfn/language-common": "1.7.4"
20
+ "@openfn/language-common": "^1.7.5"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@openfn/buildtools": "^1.0.2",
@@ -27,13 +27,17 @@
27
27
  "esno": "^0.16.3",
28
28
  "mocha": "^7.1.1",
29
29
  "nock": "^12.0.3",
30
- "rimraf": "^3.0.2"
30
+ "rimraf": "^3.0.2",
31
+ "@openfn/simple-ast": "0.4.1"
31
32
  },
32
33
  "type": "module",
33
34
  "types": "types/index.d.ts",
34
35
  "exports": {
35
- "import": "./dist/index.js",
36
- "require": "./dist/index.cjs"
36
+ ".": {
37
+ "import": "./dist/index.js",
38
+ "require": "./dist/index.cjs"
39
+ },
40
+ "./package.json": "./package.json"
37
41
  },
38
42
  "scripts": {
39
43
  "build": "pnpm clean && build-adaptor kobotoolbox",