diff --git a/packages/asana/CHANGELOG.md b/packages/asana/CHANGELOG.md
index ec4216984..5028dca51 100644
--- a/packages/asana/CHANGELOG.md
+++ b/packages/asana/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-asana
+## 4.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 4.0.4
### Patch Changes
diff --git a/packages/asana/ast.json b/packages/asana/ast.json
index 8aa578d3d..f8eb57476 100644
--- a/packages/asana/ast.json
+++ b/packages/asana/ast.json
@@ -720,7 +720,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -734,7 +734,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/asana/package.json b/packages/asana/package.json
index 15afacd20..8a953cb8a 100644
--- a/packages/asana/package.json
+++ b/packages/asana/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-asana",
- "version": "4.0.4",
+ "version": "4.0.5",
"description": "An adaptor to access objects in Asana",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/azure-storage/CHANGELOG.md b/packages/azure-storage/CHANGELOG.md
index 75c6561e3..3ec9274ec 100644
--- a/packages/azure-storage/CHANGELOG.md
+++ b/packages/azure-storage/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-azure-storage
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/azure-storage/ast.json b/packages/azure-storage/ast.json
index bf2df63fd..844f9a86c 100644
--- a/packages/azure-storage/ast.json
+++ b/packages/azure-storage/ast.json
@@ -503,7 +503,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -517,7 +517,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/azure-storage/package.json b/packages/azure-storage/package.json
index ca1a0e4e0..f65c69126 100644
--- a/packages/azure-storage/package.json
+++ b/packages/azure-storage/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-azure-storage",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "OpenFn adaptor for Azure Storage",
"type": "module",
"exports": {
diff --git a/packages/bigquery/CHANGELOG.md b/packages/bigquery/CHANGELOG.md
index 97de4b2ec..6c41a3c97 100644
--- a/packages/bigquery/CHANGELOG.md
+++ b/packages/bigquery/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-bigquery
+## 3.0.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.0.5
### Patch Changes
diff --git a/packages/bigquery/ast.json b/packages/bigquery/ast.json
index 4a6c5f47d..1dc1a870a 100644
--- a/packages/bigquery/ast.json
+++ b/packages/bigquery/ast.json
@@ -371,7 +371,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -385,7 +385,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/bigquery/package.json b/packages/bigquery/package.json
index 45e15caec..aeda12628 100644
--- a/packages/bigquery/package.json
+++ b/packages/bigquery/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-bigquery",
- "version": "3.0.5",
+ "version": "3.0.6",
"description": "A Google BigQuery language package for use with Open Function",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/cartodb/CHANGELOG.md b/packages/cartodb/CHANGELOG.md
index 1261520ae..f34239e6c 100644
--- a/packages/cartodb/CHANGELOG.md
+++ b/packages/cartodb/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-cartodb
+## 0.4.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.4.6
### Patch Changes
diff --git a/packages/cartodb/ast.json b/packages/cartodb/ast.json
index 014ed5268..e6038b346 100644
--- a/packages/cartodb/ast.json
+++ b/packages/cartodb/ast.json
@@ -374,7 +374,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -388,7 +388,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/cartodb/package.json b/packages/cartodb/package.json
index 5b1b0cc7e..179fca86e 100644
--- a/packages/cartodb/package.json
+++ b/packages/cartodb/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-cartodb",
- "version": "0.4.6",
+ "version": "0.4.7",
"description": "cartodb Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/cht/CHANGELOG.md b/packages/cht/CHANGELOG.md
index 2ae44736a..3632c3edb 100644
--- a/packages/cht/CHANGELOG.md
+++ b/packages/cht/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-cht
+## 1.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.0.4
### Patch Changes
diff --git a/packages/cht/ast.json b/packages/cht/ast.json
index 87c1a99b8..897976d5a 100644
--- a/packages/cht/ast.json
+++ b/packages/cht/ast.json
@@ -467,7 +467,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -481,7 +481,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/cht/package.json b/packages/cht/package.json
index 5076e756c..579a13fd8 100644
--- a/packages/cht/package.json
+++ b/packages/cht/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-cht",
- "version": "1.0.4",
+ "version": "1.0.5",
"description": "OpenFn CHT adaptor",
"type": "module",
"exports": {
diff --git a/packages/commcare/CHANGELOG.md b/packages/commcare/CHANGELOG.md
index 36cc085a8..e49dd819b 100644
--- a/packages/commcare/CHANGELOG.md
+++ b/packages/commcare/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-commcare
+## 3.2.4
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.2.3
### Patch Changes
diff --git a/packages/commcare/ast.json b/packages/commcare/ast.json
index b841103b3..a5855e3a8 100644
--- a/packages/commcare/ast.json
+++ b/packages/commcare/ast.json
@@ -799,7 +799,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -813,7 +813,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/commcare/package.json b/packages/commcare/package.json
index 9cbb3dc59..b49a515d4 100644
--- a/packages/commcare/package.json
+++ b/packages/commcare/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-commcare",
- "version": "3.2.3",
+ "version": "3.2.4",
"description": "Commcare Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md
index 36a5d9c40..d6e1c5e1e 100644
--- a/packages/common/CHANGELOG.md
+++ b/packages/common/CHANGELOG.md
@@ -1,5 +1,11 @@
## 2.0.0
+## 2.1.1
+
+### Patch Changes
+
+- Updated docs for each()
+
## 2.1.0
### Minor Changes
diff --git a/packages/common/ast.json b/packages/common/ast.json
index be515400f..276d27877 100644
--- a/packages/common/ast.json
+++ b/packages/common/ast.json
@@ -541,7 +541,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -555,7 +555,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/common/package.json b/packages/common/package.json
index 34f27f0ef..5830507cb 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-common",
- "version": "2.1.0",
+ "version": "2.1.1",
"description": "Common Expressions for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/common/src/Adaptor.js b/packages/common/src/Adaptor.js
index 68a606e0b..7efcba0c3 100644
--- a/packages/common/src/Adaptor.js
+++ b/packages/common/src/Adaptor.js
@@ -257,22 +257,38 @@ export function asData(data, state) {
}
/**
- * Scopes an array of data based on a JSONPath.
- * Useful when the source data has `n` items you would like to map to
- * an operation.
- * The operation will receive a slice of the data based of each item
- * of the JSONPath provided.
- *
- * It also ensures the results of an operation make their way back into
- * the state's references.
+ * Iterates over an array of items and invokes an operation upon each one, where the state
+ * object is _scoped_ so that state.data is the item under iteration.
+ * The rest of the state object is untouched and can be referenced as usual.
+ * You can pass an array directly, or use lazy state or a JSONPath string to
+ * reference a slice of state.
* @public
* @function
- * @example
- * each("$.[*]",
- * create("SObject",
- * field("FirstName", sourceValue("$.firstName"))
- * )
- * )
+ * @example
Using lazy state ($) to iterate over items in state.data and pass each into an "insert" operation
+ * each(
+ * $.data,
+ * // Inside the callback operation, `$.data` is scoped to the item under iteration
+ * insert("patient", {
+ * patient_name: $.data.properties.case_name,
+ * patient_id: $.data.case_id,
+ * })
+ * );
+ * @example Iterate over items in state.data and pass each one into an "insert" operation
+ * each(
+ * $.data,
+ * insert("patient", (state) => ({
+ * patient_id: state.data.case_id,
+ * ...state.data
+ * }))
+ * );
+ * @example Using JSON path to iterate over items in state.data and pass each one into an "insert" operation
+ * each(
+ * "$.data[*]",
+ * insert("patient", (state) => ({
+ * patient_name: state.data.properties.case_name,
+ * patient_id: state.data.case_id,
+ * }))
+ * );
* @param {DataSource} dataSource - JSONPath referencing a point in `state`.
* @param {Operation} operation - The operation needed to be repeated.
* @returns {Operation}
diff --git a/packages/dhis2/CHANGELOG.md b/packages/dhis2/CHANGELOG.md
index 71d3b452b..05219c8c5 100644
--- a/packages/dhis2/CHANGELOG.md
+++ b/packages/dhis2/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-dhis2
+## 5.0.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 5.0.5
### Patch Changes
diff --git a/packages/dhis2/ast.json b/packages/dhis2/ast.json
index e8e6d76cd..c33662197 100644
--- a/packages/dhis2/ast.json
+++ b/packages/dhis2/ast.json
@@ -1186,7 +1186,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -1200,7 +1200,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/dhis2/package.json b/packages/dhis2/package.json
index 41f24acbb..f29cad9b8 100644
--- a/packages/dhis2/package.json
+++ b/packages/dhis2/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-dhis2",
- "version": "5.0.5",
+ "version": "5.0.6",
"description": "DHIS2 Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/dynamics/CHANGELOG.md b/packages/dynamics/CHANGELOG.md
index fdc9d43e9..86719c9ad 100644
--- a/packages/dynamics/CHANGELOG.md
+++ b/packages/dynamics/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-dynamics
+## 0.5.9
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.8
### Patch Changes
diff --git a/packages/dynamics/ast.json b/packages/dynamics/ast.json
index 236ebfd3d..94bbf2f95 100644
--- a/packages/dynamics/ast.json
+++ b/packages/dynamics/ast.json
@@ -277,7 +277,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -291,7 +291,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/dynamics/package.json b/packages/dynamics/package.json
index 1b455e21d..a4543470e 100644
--- a/packages/dynamics/package.json
+++ b/packages/dynamics/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-dynamics",
- "version": "0.5.8",
+ "version": "0.5.9",
"description": "A Microsoft Dynamics Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
@@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "2.1.0",
+ "@openfn/language-common": "2.1.1",
"request": "^2.72.0"
},
"devDependencies": {
diff --git a/packages/facebook/CHANGELOG.md b/packages/facebook/CHANGELOG.md
index 73739cd63..d4810afc9 100644
--- a/packages/facebook/CHANGELOG.md
+++ b/packages/facebook/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-facebook
+## 0.4.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.4.6
### Patch Changes
diff --git a/packages/facebook/ast.json b/packages/facebook/ast.json
index 89785f9dd..2a3c407f2 100644
--- a/packages/facebook/ast.json
+++ b/packages/facebook/ast.json
@@ -321,7 +321,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -335,7 +335,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/facebook/package.json b/packages/facebook/package.json
index f8a081a14..de2af7b50 100644
--- a/packages/facebook/package.json
+++ b/packages/facebook/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-facebook",
- "version": "0.4.6",
+ "version": "0.4.7",
"description": "An Language Package for Facebook Messenger API",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/fhir-ndr-et/CHANGELOG.md b/packages/fhir-ndr-et/CHANGELOG.md
index ab664944f..6a500bea7 100644
--- a/packages/fhir-ndr-et/CHANGELOG.md
+++ b/packages/fhir-ndr-et/CHANGELOG.md
@@ -1,5 +1,12 @@
# @openfn/language-fhir-ndr-et
+## 0.1.6
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+ - @openfn/language-fhir@5.0.3
+
## 0.1.5
### Patch Changes
diff --git a/packages/fhir-ndr-et/ast.json b/packages/fhir-ndr-et/ast.json
index 395da632e..e7daa32d0 100644
--- a/packages/fhir-ndr-et/ast.json
+++ b/packages/fhir-ndr-et/ast.json
@@ -298,7 +298,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -312,7 +312,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/fhir-ndr-et/package.json b/packages/fhir-ndr-et/package.json
index 74cbd4727..90b42c2c5 100644
--- a/packages/fhir-ndr-et/package.json
+++ b/packages/fhir-ndr-et/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-fhir-ndr-et",
- "version": "0.1.5",
+ "version": "0.1.6",
"description": "OpenFn fhir adaptor for NDR HIV in Ehtiopia",
"type": "module",
"exports": {
@@ -41,7 +41,7 @@
],
"dependencies": {
"@openfn/language-common": "workspace:*",
- "@openfn/language-fhir": "^5.0.2",
+ "@openfn/language-fhir": "^5.0.3",
"@types/fhir": "^0.0.41",
"ast-types": "^0.14.2",
"lodash": "^4.17.21",
diff --git a/packages/fhir/CHANGELOG.md b/packages/fhir/CHANGELOG.md
index d0b94c8e0..67ba80b5c 100644
--- a/packages/fhir/CHANGELOG.md
+++ b/packages/fhir/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-fhir
+## 5.0.3
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 5.0.2
### Patch Changes
diff --git a/packages/fhir/ast.json b/packages/fhir/ast.json
index e7e3015f5..5a72dae95 100644
--- a/packages/fhir/ast.json
+++ b/packages/fhir/ast.json
@@ -641,7 +641,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -655,7 +655,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/fhir/package.json b/packages/fhir/package.json
index 2addb307a..6be6690d1 100644
--- a/packages/fhir/package.json
+++ b/packages/fhir/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-fhir",
- "version": "5.0.2",
+ "version": "5.0.3",
"description": "A FHIR adaptor for OpenFn",
"main": "dist/index.cjs",
"scripts": {
@@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "workspace:^2.0.1",
+ "@openfn/language-common": "workspace:^2.1.1",
"undici": "^5.28.4"
},
"devDependencies": {
diff --git a/packages/godata/CHANGELOG.md b/packages/godata/CHANGELOG.md
index ce524949a..4b7fd6388 100644
--- a/packages/godata/CHANGELOG.md
+++ b/packages/godata/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-godata
+## 3.5.4
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.5.3
### Patch Changes
diff --git a/packages/godata/ast.json b/packages/godata/ast.json
index 334e8a446..d75db9a41 100644
--- a/packages/godata/ast.json
+++ b/packages/godata/ast.json
@@ -1123,7 +1123,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -1137,7 +1137,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/godata/package.json b/packages/godata/package.json
index 45d7e838e..1279f3db3 100644
--- a/packages/godata/package.json
+++ b/packages/godata/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-godata",
- "version": "3.5.3",
+ "version": "3.5.4",
"description": "An OpenFn adaptor for use with the WHO's GoData API",
"main": "dist/index.cjs",
"scripts": {
@@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "^2.0.1",
+ "@openfn/language-common": "^2.1.1",
"axios": "^1.7.7"
},
"devDependencies": {
diff --git a/packages/googlehealthcare/CHANGELOG.md b/packages/googlehealthcare/CHANGELOG.md
index decc40424..cfe4b2f93 100644
--- a/packages/googlehealthcare/CHANGELOG.md
+++ b/packages/googlehealthcare/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-googlehealthcare
+## 1.1.3
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.1.2
### Patch Changes
diff --git a/packages/googlehealthcare/ast.json b/packages/googlehealthcare/ast.json
index 2b0eaaba1..4266506a5 100644
--- a/packages/googlehealthcare/ast.json
+++ b/packages/googlehealthcare/ast.json
@@ -381,7 +381,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -395,7 +395,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/googlehealthcare/package.json b/packages/googlehealthcare/package.json
index 878c1bb22..609b64b80 100644
--- a/packages/googlehealthcare/package.json
+++ b/packages/googlehealthcare/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-googlehealthcare",
- "version": "1.1.2",
+ "version": "1.1.3",
"description": "A Google Health Care language package for use with Open Function",
"type": "module",
"exports": {
@@ -28,7 +28,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "^2.0.1"
+ "@openfn/language-common": "^2.1.1"
},
"devDependencies": {
"@openfn/simple-ast": "0.4.1",
diff --git a/packages/googlesheets/CHANGELOG.md b/packages/googlesheets/CHANGELOG.md
index cb36d1dda..4297324ec 100644
--- a/packages/googlesheets/CHANGELOG.md
+++ b/packages/googlesheets/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-googlesheets
+## 3.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.0.4
### Patch Changes
diff --git a/packages/googlesheets/ast.json b/packages/googlesheets/ast.json
index cf2527202..37bb7936a 100644
--- a/packages/googlesheets/ast.json
+++ b/packages/googlesheets/ast.json
@@ -531,7 +531,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -545,7 +545,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/googlesheets/package.json b/packages/googlesheets/package.json
index 1f5ce8559..ef963824b 100644
--- a/packages/googlesheets/package.json
+++ b/packages/googlesheets/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-googlesheets",
- "version": "3.0.4",
+ "version": "3.0.5",
"description": "A Google Sheets Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/hive/CHANGELOG.md b/packages/hive/CHANGELOG.md
index 734aa3291..d6d85b781 100644
--- a/packages/hive/CHANGELOG.md
+++ b/packages/hive/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-hive
+## 0.3.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.3.6
### Patch Changes
diff --git a/packages/hive/ast.json b/packages/hive/ast.json
index 243887c0d..d8685b567 100644
--- a/packages/hive/ast.json
+++ b/packages/hive/ast.json
@@ -342,7 +342,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -356,7 +356,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/hive/package.json b/packages/hive/package.json
index 93c1c806c..49ebcc010 100644
--- a/packages/hive/package.json
+++ b/packages/hive/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-hive",
- "version": "0.3.6",
+ "version": "0.3.7",
"description": "An Apache HIVE adaptor for OpenFn",
"type": "module",
"exports": {
diff --git a/packages/http/CHANGELOG.md b/packages/http/CHANGELOG.md
index e3a8d5a53..871cb28d8 100644
--- a/packages/http/CHANGELOG.md
+++ b/packages/http/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-http
+## 6.5.1
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 6.5.0
### Minor Changes
diff --git a/packages/http/ast.json b/packages/http/ast.json
index e147a7916..dc37513d1 100644
--- a/packages/http/ast.json
+++ b/packages/http/ast.json
@@ -873,7 +873,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -887,7 +887,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/http/package.json b/packages/http/package.json
index a337ce4c3..31587cfd4 100644
--- a/packages/http/package.json
+++ b/packages/http/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-http",
- "version": "6.5.0",
+ "version": "6.5.1",
"description": "An HTTP request language package for use with Open Function",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/magpi/CHANGELOG.md b/packages/magpi/CHANGELOG.md
index eb77be645..2187c1ad6 100644
--- a/packages/magpi/CHANGELOG.md
+++ b/packages/magpi/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-magpi
+## 1.2.4
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.2.3
### Patch Changes
diff --git a/packages/magpi/ast.json b/packages/magpi/ast.json
index 10bd589f6..b1e96e027 100644
--- a/packages/magpi/ast.json
+++ b/packages/magpi/ast.json
@@ -364,7 +364,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -378,7 +378,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/magpi/package.json b/packages/magpi/package.json
index 933c2db8d..bce5c6ce9 100644
--- a/packages/magpi/package.json
+++ b/packages/magpi/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-magpi",
- "version": "1.2.3",
+ "version": "1.2.4",
"description": "A Magpi Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
@@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "workspace:^2.0.1",
+ "@openfn/language-common": "workspace:^2.1.1",
"JSONPath": "^0.10.0",
"js2xmlparser": "^3.0.0",
"lodash-fp": "^0.10.4",
diff --git a/packages/mailchimp/CHANGELOG.md b/packages/mailchimp/CHANGELOG.md
index e07601ab1..22ab7815b 100644
--- a/packages/mailchimp/CHANGELOG.md
+++ b/packages/mailchimp/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-mailchimp
+## 1.0.8
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.0.7
### Patch Changes
diff --git a/packages/mailchimp/ast.json b/packages/mailchimp/ast.json
index 4c2ab1ec6..ea0868f1c 100644
--- a/packages/mailchimp/ast.json
+++ b/packages/mailchimp/ast.json
@@ -1144,7 +1144,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -1158,7 +1158,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mailchimp/package.json b/packages/mailchimp/package.json
index 41cdb7735..e4e2ce01a 100644
--- a/packages/mailchimp/package.json
+++ b/packages/mailchimp/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mailchimp",
- "version": "1.0.7",
+ "version": "1.0.8",
"description": "An OpenFn adaptor for use with Mailchimp",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/mailgun/CHANGELOG.md b/packages/mailgun/CHANGELOG.md
index c72fa9475..e6ddc49ce 100644
--- a/packages/mailgun/CHANGELOG.md
+++ b/packages/mailgun/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-mailgun
+## 0.5.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.5
### Patch Changes
diff --git a/packages/mailgun/ast.json b/packages/mailgun/ast.json
index 130ca0e65..5c15d2cb1 100644
--- a/packages/mailgun/ast.json
+++ b/packages/mailgun/ast.json
@@ -313,7 +313,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -327,7 +327,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mailgun/package.json b/packages/mailgun/package.json
index ad8a15db2..b7c062323 100644
--- a/packages/mailgun/package.json
+++ b/packages/mailgun/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mailgun",
- "version": "0.5.5",
+ "version": "0.5.6",
"description": "mailgun Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/maximo/CHANGELOG.md b/packages/maximo/CHANGELOG.md
index d74279249..e071f25fa 100644
--- a/packages/maximo/CHANGELOG.md
+++ b/packages/maximo/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-maximo
+## 0.5.8
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.7
### Patch Changes
diff --git a/packages/maximo/ast.json b/packages/maximo/ast.json
index 56d4ecb2e..4fc34e181 100644
--- a/packages/maximo/ast.json
+++ b/packages/maximo/ast.json
@@ -407,7 +407,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -421,7 +421,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/maximo/package.json b/packages/maximo/package.json
index c283c4e2a..af70d6646 100644
--- a/packages/maximo/package.json
+++ b/packages/maximo/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-maximo",
- "version": "0.5.7",
+ "version": "0.5.8",
"description": "An IBM Maximo EAM Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/medicmobile/CHANGELOG.md b/packages/medicmobile/CHANGELOG.md
index 42f7f9c56..a79026f26 100644
--- a/packages/medicmobile/CHANGELOG.md
+++ b/packages/medicmobile/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-medicmobile
+## 0.5.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.6
### Patch Changes
diff --git a/packages/medicmobile/ast.json b/packages/medicmobile/ast.json
index ce650aff2..113d7e925 100644
--- a/packages/medicmobile/ast.json
+++ b/packages/medicmobile/ast.json
@@ -437,7 +437,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -451,7 +451,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/medicmobile/package.json b/packages/medicmobile/package.json
index 4759ce273..f26b75c46 100644
--- a/packages/medicmobile/package.json
+++ b/packages/medicmobile/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-medicmobile",
- "version": "0.5.6",
+ "version": "0.5.7",
"description": "A Medic Mobile language pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/mogli/CHANGELOG.md b/packages/mogli/CHANGELOG.md
index 4680a4e9a..a40abc509 100644
--- a/packages/mogli/CHANGELOG.md
+++ b/packages/mogli/CHANGELOG.md
@@ -1,5 +1,13 @@
v0.1.6
+## 0.5.8
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.7
### Patch Changes
diff --git a/packages/mogli/ast.json b/packages/mogli/ast.json
index 54431f620..d4e618596 100644
--- a/packages/mogli/ast.json
+++ b/packages/mogli/ast.json
@@ -381,7 +381,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -395,7 +395,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mogli/package.json b/packages/mogli/package.json
index 6e3d8022e..2891c999b 100644
--- a/packages/mogli/package.json
+++ b/packages/mogli/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mogli",
- "version": "0.5.7",
+ "version": "0.5.8",
"description": "A Mogli SMS Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/mojatax/CHANGELOG.md b/packages/mojatax/CHANGELOG.md
index 0e84af55e..6f53df6f5 100644
--- a/packages/mojatax/CHANGELOG.md
+++ b/packages/mojatax/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-mojatax
+## 1.0.2
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.0.1
### Patch Changes
diff --git a/packages/mojatax/ast.json b/packages/mojatax/ast.json
index 05a8ff3d0..6b67caa3b 100644
--- a/packages/mojatax/ast.json
+++ b/packages/mojatax/ast.json
@@ -397,7 +397,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -411,7 +411,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mojatax/package.json b/packages/mojatax/package.json
index 6a6c1289f..8aa1f8b0c 100644
--- a/packages/mojatax/package.json
+++ b/packages/mojatax/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mojatax",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "OpenFn mojatax adaptor",
"type": "module",
"exports": {
diff --git a/packages/mongodb/CHANGELOG.md b/packages/mongodb/CHANGELOG.md
index ed168ac1c..384390e16 100644
--- a/packages/mongodb/CHANGELOG.md
+++ b/packages/mongodb/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-mongodb
+## 2.1.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.1.6
### Patch Changes
diff --git a/packages/mongodb/ast.json b/packages/mongodb/ast.json
index 05585eef8..960523635 100644
--- a/packages/mongodb/ast.json
+++ b/packages/mongodb/ast.json
@@ -407,7 +407,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -421,7 +421,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mongodb/package.json b/packages/mongodb/package.json
index 893082712..ac91a77f2 100644
--- a/packages/mongodb/package.json
+++ b/packages/mongodb/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mongodb",
- "version": "2.1.6",
+ "version": "2.1.7",
"description": "A language package for working with MongoDb",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/msgraph/CHANGELOG.md b/packages/msgraph/CHANGELOG.md
index 9785a9daf..1de1e3c0a 100644
--- a/packages/msgraph/CHANGELOG.md
+++ b/packages/msgraph/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-msgraph
+## 0.7.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.7.6
### Patch Changes
diff --git a/packages/msgraph/ast.json b/packages/msgraph/ast.json
index 954991be6..dc639e45b 100644
--- a/packages/msgraph/ast.json
+++ b/packages/msgraph/ast.json
@@ -734,7 +734,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -748,7 +748,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/msgraph/package.json b/packages/msgraph/package.json
index bf6d11601..8eb984d86 100644
--- a/packages/msgraph/package.json
+++ b/packages/msgraph/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-msgraph",
- "version": "0.7.6",
+ "version": "0.7.7",
"description": "Microsoft Graph Language Pack for OpenFn",
"type": "module",
"exports": {
diff --git a/packages/mssql/CHANGELOG.md b/packages/mssql/CHANGELOG.md
index 958f0d42b..588384500 100644
--- a/packages/mssql/CHANGELOG.md
+++ b/packages/mssql/CHANGELOG.md
@@ -4,6 +4,14 @@
### Patch Changes
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
+## 5.0.7
+
+### Patch Changes
+
- Updated dependencies [03a1a74]
- @openfn/language-common@2.1.0
diff --git a/packages/mssql/ast.json b/packages/mssql/ast.json
index c3ed2749f..b4326d6a5 100644
--- a/packages/mssql/ast.json
+++ b/packages/mssql/ast.json
@@ -898,7 +898,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -912,7 +912,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mssql/package.json b/packages/mssql/package.json
index 82d0033c0..1875c1cfb 100644
--- a/packages/mssql/package.json
+++ b/packages/mssql/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mssql",
- "version": "5.0.6",
+ "version": "5.0.7",
"description": "A Microsoft SQL language pack for OpenFn",
"exports": {
".": {
diff --git a/packages/mysql/CHANGELOG.md b/packages/mysql/CHANGELOG.md
index d6130b138..5a6679f7f 100644
--- a/packages/mysql/CHANGELOG.md
+++ b/packages/mysql/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-mysql
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/mysql/ast.json b/packages/mysql/ast.json
index 767dbdb2c..d6ac11c60 100644
--- a/packages/mysql/ast.json
+++ b/packages/mysql/ast.json
@@ -528,7 +528,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -542,7 +542,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/mysql/package.json b/packages/mysql/package.json
index c960260fe..325968a7f 100644
--- a/packages/mysql/package.json
+++ b/packages/mysql/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-mysql",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "A MySQL Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"main": "dist/index.cjs",
diff --git a/packages/nexmo/CHANGELOG.md b/packages/nexmo/CHANGELOG.md
index d1f7f5f02..babf340b1 100644
--- a/packages/nexmo/CHANGELOG.md
+++ b/packages/nexmo/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-nexmo
+## 0.5.9
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.5.8
### Patch Changes
diff --git a/packages/nexmo/ast.json b/packages/nexmo/ast.json
index 16fcec117..2e4b2dd84 100644
--- a/packages/nexmo/ast.json
+++ b/packages/nexmo/ast.json
@@ -341,7 +341,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -355,7 +355,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/nexmo/package.json b/packages/nexmo/package.json
index 6d5ce7927..c2f3655fb 100644
--- a/packages/nexmo/package.json
+++ b/packages/nexmo/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-nexmo",
- "version": "0.5.8",
+ "version": "0.5.9",
"description": "An Language Package for Nexmo",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/ocl/CHANGELOG.md b/packages/ocl/CHANGELOG.md
index 4acd45814..d30b3be4c 100644
--- a/packages/ocl/CHANGELOG.md
+++ b/packages/ocl/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-ocl
+## 1.2.8
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.2.7
### Patch Changes
diff --git a/packages/ocl/ast.json b/packages/ocl/ast.json
index f9f0f219d..d18e744bd 100644
--- a/packages/ocl/ast.json
+++ b/packages/ocl/ast.json
@@ -450,7 +450,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -464,7 +464,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/ocl/package.json b/packages/ocl/package.json
index ce2321c83..4af4dc2e5 100644
--- a/packages/ocl/package.json
+++ b/packages/ocl/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-ocl",
- "version": "1.2.7",
+ "version": "1.2.8",
"description": "An OCL language package for use with Open Function",
"main": "dist/index.cjs",
"scripts": {
@@ -20,7 +20,7 @@
"configuration-schema.json"
],
"dependencies": {
- "@openfn/language-common": "2.1.0"
+ "@openfn/language-common": "2.1.1"
},
"devDependencies": {
"@openfn/simple-ast": "^0.4.1",
diff --git a/packages/odk/CHANGELOG.md b/packages/odk/CHANGELOG.md
index 933b86174..f8e40a21f 100644
--- a/packages/odk/CHANGELOG.md
+++ b/packages/odk/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-odk
+## 3.0.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.0.6
### Patch Changes
diff --git a/packages/odk/ast.json b/packages/odk/ast.json
index 0c8a3c29c..15b484e8c 100644
--- a/packages/odk/ast.json
+++ b/packages/odk/ast.json
@@ -539,7 +539,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -553,7 +553,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/odk/package.json b/packages/odk/package.json
index f6283fa88..d644e2673 100644
--- a/packages/odk/package.json
+++ b/packages/odk/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-odk",
- "version": "3.0.6",
+ "version": "3.0.7",
"description": "OpenFn odk adaptor",
"type": "module",
"exports": {
diff --git a/packages/openfn/CHANGELOG.md b/packages/openfn/CHANGELOG.md
index e927237df..57da940fc 100644
--- a/packages/openfn/CHANGELOG.md
+++ b/packages/openfn/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-openfn
+## 2.0.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.5
### Patch Changes
diff --git a/packages/openfn/ast.json b/packages/openfn/ast.json
index cbd4cc491..448d0745b 100644
--- a/packages/openfn/ast.json
+++ b/packages/openfn/ast.json
@@ -331,7 +331,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -345,7 +345,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/openfn/package.json b/packages/openfn/package.json
index 23c8b90ed..3435e0a14 100644
--- a/packages/openfn/package.json
+++ b/packages/openfn/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-openfn",
- "version": "2.0.5",
+ "version": "2.0.6",
"description": "An (experimental) adaptor for accessing the OpenFn web API",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/openimis/CHANGELOG.md b/packages/openimis/CHANGELOG.md
index 1759e0a13..3a48e326c 100644
--- a/packages/openimis/CHANGELOG.md
+++ b/packages/openimis/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-openimis
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/openimis/ast.json b/packages/openimis/ast.json
index 5fdccdd31..145a4f6f0 100644
--- a/packages/openimis/ast.json
+++ b/packages/openimis/ast.json
@@ -341,7 +341,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -355,7 +355,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/openimis/package.json b/packages/openimis/package.json
index aa29e4b68..156e09d23 100644
--- a/packages/openimis/package.json
+++ b/packages/openimis/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-openimis",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "An OpenIMIS adaptor for OpenFn",
"type": "module",
"exports": {
diff --git a/packages/openlmis/CHANGELOG.md b/packages/openlmis/CHANGELOG.md
index c94d425b0..244f54367 100644
--- a/packages/openlmis/CHANGELOG.md
+++ b/packages/openlmis/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-openlmis
+## 1.0.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.0.6
### Patch Changes
diff --git a/packages/openlmis/ast.json b/packages/openlmis/ast.json
index 4487431e1..899877538 100644
--- a/packages/openlmis/ast.json
+++ b/packages/openlmis/ast.json
@@ -581,7 +581,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -595,7 +595,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/openlmis/package.json b/packages/openlmis/package.json
index d0f6f1313..08ed54f39 100644
--- a/packages/openlmis/package.json
+++ b/packages/openlmis/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-openlmis",
- "version": "1.0.6",
+ "version": "1.0.7",
"description": "OpenFn openlmis adaptor",
"type": "module",
"exports": {
diff --git a/packages/openmrs/CHANGELOG.md b/packages/openmrs/CHANGELOG.md
index e64fd6489..deb6218af 100644
--- a/packages/openmrs/CHANGELOG.md
+++ b/packages/openmrs/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-openmrs
+## 4.1.3
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 4.1.2
### Patch Changes
diff --git a/packages/openmrs/ast.json b/packages/openmrs/ast.json
index c868640b3..662f49b4d 100644
--- a/packages/openmrs/ast.json
+++ b/packages/openmrs/ast.json
@@ -935,7 +935,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -949,7 +949,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/openmrs/package.json b/packages/openmrs/package.json
index edcfa90a5..0ad3f4101 100644
--- a/packages/openmrs/package.json
+++ b/packages/openmrs/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-openmrs",
- "version": "4.1.2",
+ "version": "4.1.3",
"description": "OpenMRS Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/openspp/CHANGELOG.md b/packages/openspp/CHANGELOG.md
index c58496bf5..3ea12a44e 100644
--- a/packages/openspp/CHANGELOG.md
+++ b/packages/openspp/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-openspp
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/openspp/ast.json b/packages/openspp/ast.json
index 7a0996d1d..e2de2c529 100644
--- a/packages/openspp/ast.json
+++ b/packages/openspp/ast.json
@@ -1451,7 +1451,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -1465,7 +1465,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/openspp/package.json b/packages/openspp/package.json
index 4bc741c6a..5dabc80e8 100644
--- a/packages/openspp/package.json
+++ b/packages/openspp/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-openspp",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "An OpenFn adaptor for working with the OpenSPP json rpc",
"type": "module",
"exports": {
diff --git a/packages/postgresql/CHANGELOG.md b/packages/postgresql/CHANGELOG.md
index a110dc263..4724b7606 100644
--- a/packages/postgresql/CHANGELOG.md
+++ b/packages/postgresql/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-postgresql
+## 6.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 6.0.4
### Patch Changes
diff --git a/packages/postgresql/ast.json b/packages/postgresql/ast.json
index 294d51711..ab35f831d 100644
--- a/packages/postgresql/ast.json
+++ b/packages/postgresql/ast.json
@@ -1412,7 +1412,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -1426,7 +1426,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/postgresql/package.json b/packages/postgresql/package.json
index 740bb5183..532c06d30 100644
--- a/packages/postgresql/package.json
+++ b/packages/postgresql/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-postgresql",
- "version": "6.0.4",
+ "version": "6.0.5",
"description": "A PostgreSQL Language Pack for OpenFn",
"homepage": "https://docs.openfn.org",
"exports": {
diff --git a/packages/primero/CHANGELOG.md b/packages/primero/CHANGELOG.md
index ea5f53d2b..29f42f76d 100644
--- a/packages/primero/CHANGELOG.md
+++ b/packages/primero/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-primero
+## 3.0.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 3.0.5
### Patch Changes
diff --git a/packages/primero/ast.json b/packages/primero/ast.json
index f1234fde5..7f2eda27b 100644
--- a/packages/primero/ast.json
+++ b/packages/primero/ast.json
@@ -872,7 +872,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -886,7 +886,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/primero/package.json b/packages/primero/package.json
index 8db9bfe5d..0853c2b70 100644
--- a/packages/primero/package.json
+++ b/packages/primero/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-primero",
- "version": "3.0.5",
+ "version": "3.0.6",
"description": "A UNICEF Primero language package for use with Open Function",
"exports": {
".": {
diff --git a/packages/redis/CHANGELOG.md b/packages/redis/CHANGELOG.md
index 16ed47d57..310391181 100644
--- a/packages/redis/CHANGELOG.md
+++ b/packages/redis/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-redis
+## 1.2.4
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.2.3
### Patch Changes
diff --git a/packages/redis/ast.json b/packages/redis/ast.json
index 741632f90..533d4df80 100644
--- a/packages/redis/ast.json
+++ b/packages/redis/ast.json
@@ -840,7 +840,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -854,7 +854,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/redis/package.json b/packages/redis/package.json
index 78e6ac57d..e20bc6f22 100644
--- a/packages/redis/package.json
+++ b/packages/redis/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-redis",
- "version": "1.2.3",
+ "version": "1.2.4",
"description": "OpenFn redis adaptor",
"type": "module",
"exports": {
diff --git a/packages/resourcemap/CHANGELOG.md b/packages/resourcemap/CHANGELOG.md
index e07457324..385fb1204 100644
--- a/packages/resourcemap/CHANGELOG.md
+++ b/packages/resourcemap/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-resourcemap
+## 0.4.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.4.6
### Patch Changes
diff --git a/packages/resourcemap/ast.json b/packages/resourcemap/ast.json
index 236ebfd3d..94bbf2f95 100644
--- a/packages/resourcemap/ast.json
+++ b/packages/resourcemap/ast.json
@@ -277,7 +277,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -291,7 +291,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/resourcemap/package.json b/packages/resourcemap/package.json
index 929491ce0..ffe00a765 100644
--- a/packages/resourcemap/package.json
+++ b/packages/resourcemap/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-resourcemap",
- "version": "0.4.6",
+ "version": "0.4.7",
"description": "Resourcemap Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/satusehat/CHANGELOG.md b/packages/satusehat/CHANGELOG.md
index 844314bce..c199417dd 100644
--- a/packages/satusehat/CHANGELOG.md
+++ b/packages/satusehat/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-satusehat
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/satusehat/ast.json b/packages/satusehat/ast.json
index c86b70328..6da6c2c98 100644
--- a/packages/satusehat/ast.json
+++ b/packages/satusehat/ast.json
@@ -569,7 +569,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -583,7 +583,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/satusehat/package.json b/packages/satusehat/package.json
index 6a308018a..a22deba3f 100644
--- a/packages/satusehat/package.json
+++ b/packages/satusehat/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-satusehat",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "OpenFn Satusehat adaptor",
"type": "module",
"exports": {
diff --git a/packages/sftp/CHANGELOG.md b/packages/sftp/CHANGELOG.md
index 9b54d577b..08945adf1 100644
--- a/packages/sftp/CHANGELOG.md
+++ b/packages/sftp/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-sftp
+## 2.0.5
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 2.0.4
### Patch Changes
diff --git a/packages/sftp/ast.json b/packages/sftp/ast.json
index dc108d05e..ce04a2054 100644
--- a/packages/sftp/ast.json
+++ b/packages/sftp/ast.json
@@ -637,7 +637,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -651,7 +651,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/sftp/package.json b/packages/sftp/package.json
index e6bf038e4..f75196dbf 100644
--- a/packages/sftp/package.json
+++ b/packages/sftp/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-sftp",
- "version": "2.0.4",
+ "version": "2.0.5",
"description": "An SFTP language package for use with Open Function",
"homepage": "https://docs.openfn.org",
"repository": {
diff --git a/packages/smpp/CHANGELOG.md b/packages/smpp/CHANGELOG.md
index e72f4b5e6..fd78de39a 100644
--- a/packages/smpp/CHANGELOG.md
+++ b/packages/smpp/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-smpp
+## 1.4.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.4.6
### Patch Changes
diff --git a/packages/smpp/ast.json b/packages/smpp/ast.json
index 236ebfd3d..94bbf2f95 100644
--- a/packages/smpp/ast.json
+++ b/packages/smpp/ast.json
@@ -277,7 +277,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -291,7 +291,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/smpp/package.json b/packages/smpp/package.json
index e0045e1b8..6b3d5d202 100644
--- a/packages/smpp/package.json
+++ b/packages/smpp/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-smpp",
- "version": "1.4.6",
+ "version": "1.4.7",
"description": "An SMPP client API Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/vtiger/CHANGELOG.md b/packages/vtiger/CHANGELOG.md
index e1e56acdc..e8f400894 100644
--- a/packages/vtiger/CHANGELOG.md
+++ b/packages/vtiger/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-vtiger
+## 1.3.7
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 1.3.6
### Patch Changes
diff --git a/packages/vtiger/ast.json b/packages/vtiger/ast.json
index 236ebfd3d..94bbf2f95 100644
--- a/packages/vtiger/ast.json
+++ b/packages/vtiger/ast.json
@@ -277,7 +277,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -291,7 +291,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/vtiger/package.json b/packages/vtiger/package.json
index 1c421eb8a..108846219 100644
--- a/packages/vtiger/package.json
+++ b/packages/vtiger/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-vtiger",
- "version": "1.3.6",
+ "version": "1.3.7",
"description": "A Vtiger Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/packages/zoho/CHANGELOG.md b/packages/zoho/CHANGELOG.md
index c3cc3c755..ce780ff80 100644
--- a/packages/zoho/CHANGELOG.md
+++ b/packages/zoho/CHANGELOG.md
@@ -1,5 +1,13 @@
# @openfn/language-zoho
+## 0.4.6
+
+### Patch Changes
+
+- Updated docs for each()
+- Updated dependencies
+ - @openfn/language-common@2.1.1
+
## 0.4.5
### Patch Changes
diff --git a/packages/zoho/ast.json b/packages/zoho/ast.json
index 236ebfd3d..94bbf2f95 100644
--- a/packages/zoho/ast.json
+++ b/packages/zoho/ast.json
@@ -277,7 +277,7 @@
"operation"
],
"docs": {
- "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.",
+ "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.",
"tags": [
{
"title": "public",
@@ -291,7 +291,18 @@
},
{
"title": "example",
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
+ "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);",
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
+ },
+ {
+ "title": "example",
+ "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);",
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
},
{
"title": "param",
diff --git a/packages/zoho/package.json b/packages/zoho/package.json
index 9eecbe600..cfd5abaa1 100644
--- a/packages/zoho/package.json
+++ b/packages/zoho/package.json
@@ -1,6 +1,6 @@
{
"name": "@openfn/language-zoho",
- "version": "0.4.5",
+ "version": "0.4.6",
"description": "zoho Language Pack for OpenFn",
"main": "dist/index.cjs",
"scripts": {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c88940769..d205c76a6 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -403,7 +403,7 @@ importers:
packages/dynamics:
dependencies:
'@openfn/language-common':
- specifier: 2.1.0
+ specifier: 2.1.1
version: link:../common
request:
specifier: ^2.72.0
@@ -471,7 +471,7 @@ importers:
packages/fhir:
dependencies:
'@openfn/language-common':
- specifier: workspace:^2.0.1
+ specifier: workspace:^2.1.1
version: link:../common
undici:
specifier: ^5.28.4
@@ -502,7 +502,7 @@ importers:
specifier: workspace:*
version: link:../common
'@openfn/language-fhir':
- specifier: ^5.0.2
+ specifier: ^5.0.3
version: link:../fhir
'@types/fhir':
specifier: ^0.0.41
@@ -545,7 +545,7 @@ importers:
packages/godata:
dependencies:
'@openfn/language-common':
- specifier: ^2.0.1
+ specifier: ^2.1.1
version: link:../common
axios:
specifier: ^1.7.7
@@ -579,7 +579,7 @@ importers:
packages/googlehealthcare:
dependencies:
'@openfn/language-common':
- specifier: ^2.0.1
+ specifier: ^2.1.1
version: link:../common
devDependencies:
'@openfn/simple-ast':
@@ -759,7 +759,7 @@ importers:
packages/magpi:
dependencies:
'@openfn/language-common':
- specifier: workspace:^2.0.1
+ specifier: workspace:^2.1.1
version: link:../common
JSONPath:
specifier: ^0.10.0
@@ -1209,7 +1209,7 @@ importers:
packages/ocl:
dependencies:
'@openfn/language-common':
- specifier: 2.1.0
+ specifier: 2.1.1
version: link:../common
devDependencies:
'@openfn/simple-ast':
@@ -2070,7 +2070,7 @@ importers:
tools/import-tests:
dependencies:
'@openfn/language-common':
- specifier: workspace:^2.1.0
+ specifier: workspace:^2.1.1
version: link:../../packages/common
tools/metadata:
diff --git a/tools/import-tests/package.json b/tools/import-tests/package.json
index 80c0a9b73..d419193bd 100644
--- a/tools/import-tests/package.json
+++ b/tools/import-tests/package.json
@@ -11,6 +11,6 @@
"author": "",
"license": "ISC",
"dependencies": {
- "@openfn/language-common": "workspace:^2.1.0"
+ "@openfn/language-common": "workspace:^2.1.1"
}
}
\ No newline at end of file