@openfn/language-beyonic 0.1.9 → 0.3.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 +53 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +4 -4
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -45,6 +45,59 @@
|
|
|
45
45
|
},
|
|
46
46
|
"valid": true
|
|
47
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
|
+
},
|
|
48
101
|
{
|
|
49
102
|
"name": "sourceValue",
|
|
50
103
|
"params": [
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
field: () => import_language_common2.field,
|
|
36
36
|
fields: () => import_language_common2.fields,
|
|
37
37
|
fn: () => import_language_common2.fn,
|
|
38
|
+
fnIf: () => import_language_common2.fnIf,
|
|
38
39
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
39
40
|
merge: () => import_language_common2.merge,
|
|
40
41
|
sourceValue: () => import_language_common2.sourceValue
|
|
@@ -53,6 +54,7 @@ __export(Adaptor_exports, {
|
|
|
53
54
|
field: () => import_language_common2.field,
|
|
54
55
|
fields: () => import_language_common2.fields,
|
|
55
56
|
fn: () => import_language_common2.fn,
|
|
57
|
+
fnIf: () => import_language_common2.fnIf,
|
|
56
58
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
57
59
|
merge: () => import_language_common2.merge,
|
|
58
60
|
sourceValue: () => import_language_common2.sourceValue
|
|
@@ -137,6 +139,7 @@ var src_default = Adaptor_exports;
|
|
|
137
139
|
field,
|
|
138
140
|
fields,
|
|
139
141
|
fn,
|
|
142
|
+
fnIf,
|
|
140
143
|
lastReferenceValue,
|
|
141
144
|
merge,
|
|
142
145
|
sourceValue
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __export(Adaptor_exports, {
|
|
|
16
16
|
field: () => field,
|
|
17
17
|
fields: () => fields,
|
|
18
18
|
fn: () => fn,
|
|
19
|
+
fnIf: () => fnIf,
|
|
19
20
|
lastReferenceValue: () => lastReferenceValue,
|
|
20
21
|
merge: () => merge,
|
|
21
22
|
sourceValue: () => sourceValue
|
|
@@ -42,6 +43,7 @@ function post({ apiToken, body, url }) {
|
|
|
42
43
|
import { resolve as resolveUrl } from "url";
|
|
43
44
|
import {
|
|
44
45
|
fn,
|
|
46
|
+
fnIf,
|
|
45
47
|
field,
|
|
46
48
|
fields,
|
|
47
49
|
sourceValue,
|
|
@@ -112,6 +114,7 @@ export {
|
|
|
112
114
|
field,
|
|
113
115
|
fields,
|
|
114
116
|
fn,
|
|
117
|
+
fnIf,
|
|
115
118
|
lastReferenceValue,
|
|
116
119
|
merge,
|
|
117
120
|
sourceValue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-beyonic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "beyonic Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -23,13 +23,12 @@
|
|
|
23
23
|
"configuration-schema.json"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@openfn/language-common": "^1.
|
|
26
|
+
"@openfn/language-common": "^1.14.0",
|
|
27
27
|
"JSONPath": "^0.10.0",
|
|
28
28
|
"lodash-fp": "^0.10.2",
|
|
29
29
|
"superagent": "^8.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@openfn/buildtools": "^1.0.2",
|
|
33
32
|
"@openfn/simple-ast": "0.4.1",
|
|
34
33
|
"assertion-error": "2.0.0",
|
|
35
34
|
"chai": "4.3.6",
|
|
@@ -46,6 +45,7 @@
|
|
|
46
45
|
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
47
46
|
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
48
47
|
"clean": "rimraf dist types docs",
|
|
49
|
-
"pack": "pnpm pack --pack-destination ../../dist"
|
|
48
|
+
"pack": "pnpm pack --pack-destination ../../dist",
|
|
49
|
+
"lint": "eslint src"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -44,4 +44,4 @@ export function createContact(data: object): Operation;
|
|
|
44
44
|
* @returns {Operation}
|
|
45
45
|
*/
|
|
46
46
|
export function createCollectionRequest(data: object): Operation;
|
|
47
|
-
export { fn, field, fields, sourceValue, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
|
47
|
+
export { fn, fnIf, field, fields, sourceValue, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|