@openfn/language-mtn-momo 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ast.json CHANGED
@@ -830,6 +830,60 @@
830
830
  ]
831
831
  },
832
832
  "valid": false
833
+ },
834
+ {
835
+ "name": "as",
836
+ "params": [
837
+ "key",
838
+ "operation"
839
+ ],
840
+ "docs": {
841
+ "description": "Run an operation and save the result to a custom key in state instead of overwriting state.data.",
842
+ "tags": [
843
+ {
844
+ "title": "public",
845
+ "description": null,
846
+ "type": null
847
+ },
848
+ {
849
+ "title": "function",
850
+ "description": null,
851
+ "name": null
852
+ },
853
+ {
854
+ "title": "example",
855
+ "description": "as('cceData', collections.get('cce-data-dhis2', { key: `*:*:${$.syncedAt}*` }));",
856
+ "caption": "Fetch cce-data from collections and store them under state.cceData"
857
+ },
858
+ {
859
+ "title": "param",
860
+ "description": "The state key to assign the result of the operation to.",
861
+ "type": {
862
+ "type": "NameExpression",
863
+ "name": "string"
864
+ },
865
+ "name": "key"
866
+ },
867
+ {
868
+ "title": "param",
869
+ "description": " An operation that returns a new state object with a `data` property",
870
+ "type": {
871
+ "type": "NameExpression",
872
+ "name": "function"
873
+ },
874
+ "name": "operation"
875
+ },
876
+ {
877
+ "title": "returns",
878
+ "description": null,
879
+ "type": {
880
+ "type": "NameExpression",
881
+ "name": "Operation"
882
+ }
883
+ }
884
+ ]
885
+ },
886
+ "valid": true
833
887
  }
834
888
  ]
835
889
  }
package/dist/index.cjs CHANGED
@@ -25,6 +25,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
25
25
  // src/index.js
26
26
  var src_exports = {};
27
27
  __export(src_exports, {
28
+ as: () => import_language_common2.as,
28
29
  combine: () => import_language_common2.combine,
29
30
  cursor: () => import_language_common2.cursor,
30
31
  dataPath: () => import_language_common2.dataPath,
@@ -49,6 +50,7 @@ module.exports = __toCommonJS(src_exports);
49
50
  // src/Adaptor.js
50
51
  var Adaptor_exports = {};
51
52
  __export(Adaptor_exports, {
53
+ as: () => import_language_common2.as,
52
54
  combine: () => import_language_common2.combine,
53
55
  cursor: () => import_language_common2.cursor,
54
56
  dataPath: () => import_language_common2.dataPath,
@@ -146,6 +148,7 @@ function request2(method, path, body, options = {}) {
146
148
  var src_default = Adaptor_exports;
147
149
  // Annotate the CommonJS export names for ESM import in node:
148
150
  0 && (module.exports = {
151
+ as,
149
152
  combine,
150
153
  cursor,
151
154
  dataPath,
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ var __export = (target, all) => {
7
7
  // src/Adaptor.js
8
8
  var Adaptor_exports = {};
9
9
  __export(Adaptor_exports, {
10
+ as: () => as,
10
11
  combine: () => combine,
11
12
  cursor: () => cursor,
12
13
  dataPath: () => dataPath,
@@ -103,7 +104,8 @@ import {
103
104
  merge,
104
105
  scrubEmojis,
105
106
  sourceValue,
106
- util
107
+ util,
108
+ as
107
109
  } from "@openfn/language-common";
108
110
  function request2(method, path, body, options = {}) {
109
111
  return async (state) => {
@@ -124,6 +126,7 @@ function request2(method, path, body, options = {}) {
124
126
  // src/index.js
125
127
  var src_default = Adaptor_exports;
126
128
  export {
129
+ as,
127
130
  combine,
128
131
  cursor,
129
132
  dataPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-mtn-momo",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "OpenFn mtn-momo 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.5.0"
23
+ "@openfn/language-common": "3.0.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "assertion-error": "2.0.0",
@@ -28,7 +28,7 @@
28
28
  "deep-eql": "4.1.1",
29
29
  "mocha": "^10.7.3",
30
30
  "rimraf": "3.0.2",
31
- "undici": "^5.22.1"
31
+ "undici": "^5.29.0"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -75,4 +75,4 @@ export type HttpState = {
75
75
  * Options provided to the HTTP request
76
76
  */
77
77
  export type RequestOptions = any;
78
- export { combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, group, lastReferenceValue, merge, scrubEmojis, sourceValue, util } from "@openfn/language-common";
78
+ export { combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, group, lastReferenceValue, merge, scrubEmojis, sourceValue, util, as } from "@openfn/language-common";