@openfn/language-mogli 0.4.1 → 0.5.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
@@ -2,6 +2,102 @@
2
2
  "operations": [],
3
3
  "exports": [],
4
4
  "common": [
5
+ {
6
+ "name": "fn",
7
+ "params": [
8
+ "func"
9
+ ],
10
+ "docs": {
11
+ "description": "Creates a custom step (or operation) for more flexible job writing.",
12
+ "tags": [
13
+ {
14
+ "title": "public",
15
+ "description": null,
16
+ "type": null
17
+ },
18
+ {
19
+ "title": "example",
20
+ "description": "fn(state => {\n // do some things to state\n return state;\n});"
21
+ },
22
+ {
23
+ "title": "function",
24
+ "description": null,
25
+ "name": null
26
+ },
27
+ {
28
+ "title": "param",
29
+ "description": "is the function",
30
+ "type": {
31
+ "type": "NameExpression",
32
+ "name": "Function"
33
+ },
34
+ "name": "func"
35
+ },
36
+ {
37
+ "title": "returns",
38
+ "description": null,
39
+ "type": {
40
+ "type": "NameExpression",
41
+ "name": "Operation"
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ "valid": true
47
+ },
48
+ {
49
+ "name": "fnIf",
50
+ "params": [
51
+ "condition",
52
+ "operation"
53
+ ],
54
+ "docs": {
55
+ "description": "A custom operation that will only execute the function if the condition returns true",
56
+ "tags": [
57
+ {
58
+ "title": "public",
59
+ "description": null,
60
+ "type": null
61
+ },
62
+ {
63
+ "title": "example",
64
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
65
+ },
66
+ {
67
+ "title": "function",
68
+ "description": null,
69
+ "name": null
70
+ },
71
+ {
72
+ "title": "param",
73
+ "description": "The condition that returns true",
74
+ "type": {
75
+ "type": "NameExpression",
76
+ "name": "Boolean"
77
+ },
78
+ "name": "condition"
79
+ },
80
+ {
81
+ "title": "param",
82
+ "description": "The operation needed to be executed.",
83
+ "type": {
84
+ "type": "NameExpression",
85
+ "name": "Operation"
86
+ },
87
+ "name": "operation"
88
+ },
89
+ {
90
+ "title": "returns",
91
+ "description": null,
92
+ "type": {
93
+ "type": "NameExpression",
94
+ "name": "Operation"
95
+ }
96
+ }
97
+ ]
98
+ },
99
+ "valid": true
100
+ },
5
101
  {
6
102
  "name": "sourceValue",
7
103
  "params": [
package/dist/index.cjs CHANGED
@@ -37,6 +37,8 @@ __export(src_exports, {
37
37
  execute: () => execute,
38
38
  field: () => import_language_common3.field,
39
39
  fields: () => import_language_common3.fields,
40
+ fn: () => import_language_common3.fn,
41
+ fnIf: () => import_language_common3.fnIf,
40
42
  index: () => import_language_common3.index,
41
43
  join: () => import_language_common3.join,
42
44
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
@@ -68,6 +70,8 @@ __export(Adaptor_exports, {
68
70
  execute: () => execute,
69
71
  field: () => import_language_common3.field,
70
72
  fields: () => import_language_common3.fields,
73
+ fn: () => import_language_common3.fn,
74
+ fnIf: () => import_language_common3.fnIf,
71
75
  index: () => import_language_common3.index,
72
76
  join: () => import_language_common3.join,
73
77
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
@@ -268,6 +272,8 @@ var src_default = Adaptor_exports;
268
272
  execute,
269
273
  field,
270
274
  fields,
275
+ fn,
276
+ fnIf,
271
277
  index,
272
278
  join,
273
279
  lastReferenceValue,
package/dist/index.js CHANGED
@@ -18,6 +18,8 @@ __export(Adaptor_exports, {
18
18
  execute: () => execute,
19
19
  field: () => field2,
20
20
  fields: () => fields,
21
+ fn: () => fn,
22
+ fnIf: () => fnIf,
21
23
  index: () => index,
22
24
  join: () => join,
23
25
  lastReferenceValue: () => lastReferenceValue,
@@ -73,7 +75,9 @@ import {
73
75
  beta,
74
76
  toArray,
75
77
  arrayToString,
76
- alterState
78
+ alterState,
79
+ fn,
80
+ fnIf
77
81
  } from "@openfn/language-common";
78
82
  var { curry, mapValues, flatten } = pkg;
79
83
  var createSMS = curry(function(params, state) {
@@ -237,6 +241,8 @@ export {
237
241
  execute,
238
242
  field2 as field,
239
243
  fields,
244
+ fn,
245
+ fnIf,
240
246
  index,
241
247
  join,
242
248
  lastReferenceValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-mogli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "A Mogli SMS Language Pack for OpenFn",
5
5
  "main": "dist/index.cjs",
6
6
  "author": "Open Function Group",
@@ -12,7 +12,7 @@
12
12
  "configuration-schema.json"
13
13
  ],
14
14
  "dependencies": {
15
- "@openfn/language-common": "^1.8.1",
15
+ "@openfn/language-common": "^1.14.0",
16
16
  "JSONPath": "^0.10.0",
17
17
  "jsforce": "1.5.1",
18
18
  "lodash-fp": "^0.10.4",
@@ -21,7 +21,6 @@
21
21
  "yargs": "^3.32.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@openfn/buildtools": "^1.0.2",
25
24
  "@openfn/simple-ast": "0.4.1",
26
25
  "assertion-error": "^2.0.0",
27
26
  "chai": "^4.3.7",
@@ -26,4 +26,4 @@ export type State = {
26
26
  };
27
27
  export type Operation = Function;
28
28
  export { lookup, relationship } from "./sourceHelpers";
29
- export { each, join, fields, field, source, sourceValue, map, combine, merge, dataPath, dataValue, referencePath, lastReferenceValue, index, beta, toArray, arrayToString, alterState } from "@openfn/language-common";
29
+ export { each, join, fields, field, source, sourceValue, map, combine, merge, dataPath, dataValue, referencePath, lastReferenceValue, index, beta, toArray, arrayToString, alterState, fn, fnIf } from "@openfn/language-common";