@openfn/language-magpi 1.2.3 → 1.2.4
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
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
"operation"
|
|
365
365
|
],
|
|
366
366
|
"docs": {
|
|
367
|
-
"description": "
|
|
367
|
+
"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.",
|
|
368
368
|
"tags": [
|
|
369
369
|
{
|
|
370
370
|
"title": "public",
|
|
@@ -378,7 +378,18 @@
|
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"title": "example",
|
|
381
|
-
"description": "each(\
|
|
381
|
+
"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);",
|
|
382
|
+
"caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"title": "example",
|
|
386
|
+
"description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
|
|
387
|
+
"caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"title": "example",
|
|
391
|
+
"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);",
|
|
392
|
+
"caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
382
393
|
},
|
|
383
394
|
{
|
|
384
395
|
"title": "param",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-magpi",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "A Magpi Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^2.
|
|
15
|
+
"@openfn/language-common": "^2.1.1",
|
|
16
16
|
"JSONPath": "^0.10.0",
|
|
17
17
|
"js2xmlparser": "^3.0.0",
|
|
18
18
|
"lodash-fp": "^0.10.4",
|