@openfn/language-mojatax 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/ast.json +13 -2
  2. package/package.json +2 -2
package/ast.json CHANGED
@@ -397,7 +397,7 @@
397
397
  "operation"
398
398
  ],
399
399
  "docs": {
400
- "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.",
400
+ "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.",
401
401
  "tags": [
402
402
  {
403
403
  "title": "public",
@@ -411,7 +411,18 @@
411
411
  },
412
412
  {
413
413
  "title": "example",
414
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
414
+ "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);",
415
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
416
+ },
417
+ {
418
+ "title": "example",
419
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
420
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
421
+ },
422
+ {
423
+ "title": "example",
424
+ "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);",
425
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
415
426
  },
416
427
  {
417
428
  "title": "param",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-mojatax",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "OpenFn mojatax adaptor",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,7 +20,7 @@
20
20
  "configuration-schema.json"
21
21
  ],
22
22
  "dependencies": {
23
- "@openfn/language-common": "2.0.3"
23
+ "@openfn/language-common": "2.1.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "assertion-error": "2.0.0",