@openfn/language-commcare 3.2.2 → 3.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
|
@@ -799,7 +799,7 @@
|
|
|
799
799
|
"operation"
|
|
800
800
|
],
|
|
801
801
|
"docs": {
|
|
802
|
-
"description": "
|
|
802
|
+
"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.",
|
|
803
803
|
"tags": [
|
|
804
804
|
{
|
|
805
805
|
"title": "public",
|
|
@@ -813,7 +813,18 @@
|
|
|
813
813
|
},
|
|
814
814
|
{
|
|
815
815
|
"title": "example",
|
|
816
|
-
"description": "each(\
|
|
816
|
+
"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);",
|
|
817
|
+
"caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"title": "example",
|
|
821
|
+
"description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
|
|
822
|
+
"caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
"title": "example",
|
|
826
|
+
"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);",
|
|
827
|
+
"caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
|
|
817
828
|
},
|
|
818
829
|
{
|
|
819
830
|
"title": "param",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-commcare",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Commcare Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"js2xmlparser": "^1.0.0",
|
|
22
22
|
"lodash-fp": "^0.10.4",
|
|
23
23
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz",
|
|
24
|
-
"@openfn/language-common": "2.
|
|
24
|
+
"@openfn/language-common": "2.1.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@openfn/simple-ast": "^0.4.1",
|