@openfn/language-mogli 0.5.7 → 0.5.8
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 +13 -2
- package/package.json +2 -2
package/ast.json
CHANGED
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
"operation"
|
|
382
382
|
],
|
|
383
383
|
"docs": {
|
|
384
|
-
"description": "
|
|
384
|
+
"description": "Iterates over an array of items and invokes an operation upon each one, where the state\nobject is _scoped_ so that state.data is the item under iteration.\nThe rest of the state object is untouched and can be referenced as usual.\nYou can pass an array directly, or use lazy state or a JSONPath string to\nreference a slice of state.",
|
|
385
385
|
"tags": [
|
|
386
386
|
{
|
|
387
387
|
"title": "public",
|
|
@@ -395,7 +395,18 @@
|
|
|
395
395
|
},
|
|
396
396
|
{
|
|
397
397
|
"title": "example",
|
|
398
|
-
"description": "each(\
|
|
398
|
+
"description": "each(\n $.data,\n // Inside the callback operation, `$.data` is scoped to the item under iteration\n insert(\"patient\", {\n patient_name: $.data.properties.case_name,\n patient_id: $.data.case_id,\n })\n);",
|
|
399
|
+
"caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"title": "example",
|
|
403
|
+
"description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
|
|
404
|
+
"caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"title": "example",
|
|
408
|
+
"description": "each(\n \"$.data[*]\",\n insert(\"patient\", (state) => ({\n patient_name: state.data.properties.case_name,\n patient_id: state.data.case_id,\n }))\n);",
|
|
409
|
+
"caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
399
410
|
},
|
|
400
411
|
{
|
|
401
412
|
"title": "param",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-mogli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "A Mogli SMS Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"mustache": "^2.3.2",
|
|
19
19
|
"request": "^2.88.2",
|
|
20
20
|
"yargs": "^3.32.0",
|
|
21
|
-
"@openfn/language-common": "2.1.
|
|
21
|
+
"@openfn/language-common": "2.1.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@openfn/simple-ast": "0.4.1",
|