@openfn/language-telerivet 0.2.1 → 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 +2 -3
- 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
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
field: () => import_language_common2.field,
|
|
34
34
|
fields: () => import_language_common2.fields,
|
|
35
35
|
fn: () => import_language_common2.fn,
|
|
36
|
+
fnIf: () => import_language_common2.fnIf,
|
|
36
37
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
37
38
|
merge: () => import_language_common2.merge,
|
|
38
39
|
send: () => send,
|
|
@@ -50,6 +51,7 @@ __export(Adaptor_exports, {
|
|
|
50
51
|
field: () => import_language_common2.field,
|
|
51
52
|
fields: () => import_language_common2.fields,
|
|
52
53
|
fn: () => import_language_common2.fn,
|
|
54
|
+
fnIf: () => import_language_common2.fnIf,
|
|
53
55
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
54
56
|
merge: () => import_language_common2.merge,
|
|
55
57
|
send: () => send,
|
|
@@ -110,6 +112,7 @@ var src_default = Adaptor_exports;
|
|
|
110
112
|
field,
|
|
111
113
|
fields,
|
|
112
114
|
fn,
|
|
115
|
+
fnIf,
|
|
113
116
|
lastReferenceValue,
|
|
114
117
|
merge,
|
|
115
118
|
send,
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ __export(Adaptor_exports, {
|
|
|
14
14
|
field: () => field,
|
|
15
15
|
fields: () => fields,
|
|
16
16
|
fn: () => fn,
|
|
17
|
+
fnIf: () => fnIf,
|
|
17
18
|
lastReferenceValue: () => lastReferenceValue,
|
|
18
19
|
merge: () => merge,
|
|
19
20
|
send: () => send,
|
|
@@ -40,6 +41,7 @@ function post({ apiKey, body, url }) {
|
|
|
40
41
|
// src/Adaptor.js
|
|
41
42
|
import {
|
|
42
43
|
fn,
|
|
44
|
+
fnIf,
|
|
43
45
|
alterState,
|
|
44
46
|
field,
|
|
45
47
|
fields,
|
|
@@ -87,6 +89,7 @@ export {
|
|
|
87
89
|
field,
|
|
88
90
|
fields,
|
|
89
91
|
fn,
|
|
92
|
+
fnIf,
|
|
90
93
|
lastReferenceValue,
|
|
91
94
|
merge,
|
|
92
95
|
send,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-telerivet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "telerivet Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.
|
|
15
|
+
"@openfn/language-common": "^1.14.0",
|
|
16
16
|
"JSONPath": "^0.10.0",
|
|
17
17
|
"lodash-fp": "^0.10.4",
|
|
18
18
|
"superagent": "^3.7.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@openfn/buildtools": "^1.0.2",
|
|
22
21
|
"@openfn/simple-ast": "0.4.1",
|
|
23
22
|
"assertion-error": "^1.1.0",
|
|
24
23
|
"chai": "^3.5.0",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export function execute(...operations: Operations): Operation;
|
|
|
22
22
|
* @returns {Operation}
|
|
23
23
|
*/
|
|
24
24
|
export function send(sendData: object): Operation;
|
|
25
|
-
export { fn, alterState, field, fields, sourceValue, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
|
25
|
+
export { fn, fnIf, alterState, field, fields, sourceValue, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|