@openfn/language-satusehat 1.0.1 → 1.1.1

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
@@ -109,6 +109,59 @@
109
109
  },
110
110
  "valid": true
111
111
  },
112
+ {
113
+ "name": "fnIf",
114
+ "params": [
115
+ "condition",
116
+ "operation"
117
+ ],
118
+ "docs": {
119
+ "description": "A custom operation that will only execute the function if the condition returns true",
120
+ "tags": [
121
+ {
122
+ "title": "public",
123
+ "description": null,
124
+ "type": null
125
+ },
126
+ {
127
+ "title": "example",
128
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
129
+ },
130
+ {
131
+ "title": "function",
132
+ "description": null,
133
+ "name": null
134
+ },
135
+ {
136
+ "title": "param",
137
+ "description": "The condition that returns true",
138
+ "type": {
139
+ "type": "NameExpression",
140
+ "name": "Boolean"
141
+ },
142
+ "name": "condition"
143
+ },
144
+ {
145
+ "title": "param",
146
+ "description": "The operation needed to be executed.",
147
+ "type": {
148
+ "type": "NameExpression",
149
+ "name": "Operation"
150
+ },
151
+ "name": "operation"
152
+ },
153
+ {
154
+ "title": "returns",
155
+ "description": null,
156
+ "type": {
157
+ "type": "NameExpression",
158
+ "name": "Operation"
159
+ }
160
+ }
161
+ ]
162
+ },
163
+ "valid": true
164
+ },
112
165
  {
113
166
  "name": "sourceValue",
114
167
  "params": [
package/dist/index.cjs CHANGED
@@ -30,6 +30,7 @@ __export(src_exports, {
30
30
  field: () => import_language_common3.field,
31
31
  fields: () => import_language_common3.fields,
32
32
  fn: () => import_language_common3.fn,
33
+ fnIf: () => import_language_common3.fnIf,
33
34
  get: () => get,
34
35
  http: () => import_language_common3.http,
35
36
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
@@ -54,6 +55,7 @@ __export(Adaptor_exports, {
54
55
  field: () => import_language_common3.field,
55
56
  fields: () => import_language_common3.fields,
56
57
  fn: () => import_language_common3.fn,
58
+ fnIf: () => import_language_common3.fnIf,
57
59
  get: () => get,
58
60
  http: () => import_language_common3.http,
59
61
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
@@ -260,6 +262,7 @@ var src_default = Adaptor_exports;
260
262
  field,
261
263
  fields,
262
264
  fn,
265
+ fnIf,
263
266
  get,
264
267
  http,
265
268
  lastReferenceValue,
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ __export(Adaptor_exports, {
17
17
  field: () => field,
18
18
  fields: () => fields,
19
19
  fn: () => fn,
20
+ fnIf: () => fnIf,
20
21
  get: () => get,
21
22
  http: () => http,
22
23
  lastReferenceValue: () => lastReferenceValue,
@@ -118,6 +119,7 @@ async function request(configuration, path, opts) {
118
119
  // src/Adaptor.js
119
120
  import {
120
121
  fn,
122
+ fnIf,
121
123
  alterState,
122
124
  arrayToString,
123
125
  combine,
@@ -240,6 +242,7 @@ export {
240
242
  field,
241
243
  fields,
242
244
  fn,
245
+ fnIf,
243
246
  get,
244
247
  http,
245
248
  lastReferenceValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-satusehat",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "OpenFn satusehat adaptor",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "configuration-schema.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@openfn/language-common": "1.13.5"
22
+ "@openfn/language-common": "1.15.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "assertion-error": "2.0.0",
@@ -75,4 +75,4 @@ export function put(path: string, data: object, params?: any, callback?: Functio
75
75
  * @returns {Operation}
76
76
  */
77
77
  export function patch(path: string, data: any[], params?: any, callback?: Function): Operation;
78
- export { fn, alterState, arrayToString, combine, dataPath, dataValue, each, field, fields, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
78
+ export { fn, fnIf, alterState, arrayToString, combine, dataPath, dataValue, each, field, fields, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";