@openfn/language-resourcemap 0.4.6 → 0.4.7
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
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
"operation"
|
|
278
278
|
],
|
|
279
279
|
"docs": {
|
|
280
|
-
"description": "
|
|
280
|
+
"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.",
|
|
281
281
|
"tags": [
|
|
282
282
|
{
|
|
283
283
|
"title": "public",
|
|
@@ -291,7 +291,18 @@
|
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
"title": "example",
|
|
294
|
-
"description": "each(\
|
|
294
|
+
"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);",
|
|
295
|
+
"caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"title": "example",
|
|
299
|
+
"description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
|
|
300
|
+
"caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"title": "example",
|
|
304
|
+
"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);",
|
|
305
|
+
"caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
295
306
|
},
|
|
296
307
|
{
|
|
297
308
|
"title": "param",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-resourcemap",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Resourcemap Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"request": "^2.88.2",
|
|
16
|
-
"@openfn/language-common": "2.1.
|
|
16
|
+
"@openfn/language-common": "2.1.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@openfn/simple-ast": "0.4.1",
|