@openfn/language-beyonic 0.1.2 → 0.1.4
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 +75 -0
- package/dist/index.cjs +28 -5
- package/dist/index.js +20 -4
- package/package.json +18 -13
- package/types/Adaptor.d.ts +103 -0
- package/types/Client.d.ts +5 -0
- package/types/index.d.ts +3 -121
package/ast.json
CHANGED
|
@@ -2,6 +2,49 @@
|
|
|
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
|
+
},
|
|
5
48
|
{
|
|
6
49
|
"name": "sourceValue",
|
|
7
50
|
"params": [
|
|
@@ -32,6 +75,14 @@
|
|
|
32
75
|
"name": "String"
|
|
33
76
|
},
|
|
34
77
|
"name": "path"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"title": "returns",
|
|
81
|
+
"description": null,
|
|
82
|
+
"type": {
|
|
83
|
+
"type": "NameExpression",
|
|
84
|
+
"name": "Operation"
|
|
85
|
+
}
|
|
35
86
|
}
|
|
36
87
|
]
|
|
37
88
|
},
|
|
@@ -110,6 +161,14 @@
|
|
|
110
161
|
"name": "String"
|
|
111
162
|
},
|
|
112
163
|
"name": "path"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"title": "returns",
|
|
167
|
+
"description": null,
|
|
168
|
+
"type": {
|
|
169
|
+
"type": "NameExpression",
|
|
170
|
+
"name": "Operation"
|
|
171
|
+
}
|
|
113
172
|
}
|
|
114
173
|
]
|
|
115
174
|
},
|
|
@@ -145,6 +204,14 @@
|
|
|
145
204
|
"name": "String"
|
|
146
205
|
},
|
|
147
206
|
"name": "path"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"title": "returns",
|
|
210
|
+
"description": null,
|
|
211
|
+
"type": {
|
|
212
|
+
"type": "NameExpression",
|
|
213
|
+
"name": "Operation"
|
|
214
|
+
}
|
|
148
215
|
}
|
|
149
216
|
]
|
|
150
217
|
},
|
|
@@ -190,6 +257,14 @@
|
|
|
190
257
|
"name": "Value"
|
|
191
258
|
},
|
|
192
259
|
"name": "value"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"title": "returns",
|
|
263
|
+
"description": null,
|
|
264
|
+
"type": {
|
|
265
|
+
"type": "NameExpression",
|
|
266
|
+
"name": "Field"
|
|
267
|
+
}
|
|
193
268
|
}
|
|
194
269
|
]
|
|
195
270
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -25,8 +25,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
25
25
|
// src/index.js
|
|
26
26
|
var src_exports = {};
|
|
27
27
|
__export(src_exports, {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
createCollectionRequest: () => createCollectionRequest,
|
|
29
|
+
createContact: () => createContact,
|
|
30
|
+
createPayment: () => createPayment,
|
|
31
|
+
dataPath: () => import_language_common2.dataPath,
|
|
32
|
+
dataValue: () => import_language_common2.dataValue,
|
|
33
|
+
default: () => src_default,
|
|
34
|
+
execute: () => execute,
|
|
35
|
+
field: () => import_language_common2.field,
|
|
36
|
+
fields: () => import_language_common2.fields,
|
|
37
|
+
fn: () => import_language_common2.fn,
|
|
38
|
+
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
39
|
+
merge: () => import_language_common2.merge,
|
|
40
|
+
sourceValue: () => import_language_common2.sourceValue
|
|
30
41
|
});
|
|
31
42
|
module.exports = __toCommonJS(src_exports);
|
|
32
43
|
|
|
@@ -41,11 +52,12 @@ __export(Adaptor_exports, {
|
|
|
41
52
|
execute: () => execute,
|
|
42
53
|
field: () => import_language_common2.field,
|
|
43
54
|
fields: () => import_language_common2.fields,
|
|
55
|
+
fn: () => import_language_common2.fn,
|
|
44
56
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
45
57
|
merge: () => import_language_common2.merge,
|
|
46
58
|
sourceValue: () => import_language_common2.sourceValue
|
|
47
59
|
});
|
|
48
|
-
var import_language_common = require("language-common");
|
|
60
|
+
var import_language_common = require("@openfn/language-common");
|
|
49
61
|
|
|
50
62
|
// src/Client.js
|
|
51
63
|
var import_superagent = __toESM(require("superagent"), 1);
|
|
@@ -62,7 +74,7 @@ function post({ apiToken, body, url }) {
|
|
|
62
74
|
|
|
63
75
|
// src/Adaptor.js
|
|
64
76
|
var import_url = require("url");
|
|
65
|
-
var import_language_common2 = require("language-common");
|
|
77
|
+
var import_language_common2 = require("@openfn/language-common");
|
|
66
78
|
function execute(...operations) {
|
|
67
79
|
const initialState = {
|
|
68
80
|
references: [],
|
|
@@ -116,5 +128,16 @@ function createCollectionRequest(data) {
|
|
|
116
128
|
var src_default = Adaptor_exports;
|
|
117
129
|
// Annotate the CommonJS export names for ESM import in node:
|
|
118
130
|
0 && (module.exports = {
|
|
119
|
-
|
|
131
|
+
createCollectionRequest,
|
|
132
|
+
createContact,
|
|
133
|
+
createPayment,
|
|
134
|
+
dataPath,
|
|
135
|
+
dataValue,
|
|
136
|
+
execute,
|
|
137
|
+
field,
|
|
138
|
+
fields,
|
|
139
|
+
fn,
|
|
140
|
+
lastReferenceValue,
|
|
141
|
+
merge,
|
|
142
|
+
sourceValue
|
|
120
143
|
});
|
package/dist/index.js
CHANGED
|
@@ -15,11 +15,15 @@ __export(Adaptor_exports, {
|
|
|
15
15
|
execute: () => execute,
|
|
16
16
|
field: () => field,
|
|
17
17
|
fields: () => fields,
|
|
18
|
+
fn: () => fn,
|
|
18
19
|
lastReferenceValue: () => lastReferenceValue,
|
|
19
20
|
merge: () => merge,
|
|
20
21
|
sourceValue: () => sourceValue
|
|
21
22
|
});
|
|
22
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
execute as commonExecute,
|
|
25
|
+
expandReferences
|
|
26
|
+
} from "@openfn/language-common";
|
|
23
27
|
|
|
24
28
|
// src/Client.js
|
|
25
29
|
import request from "superagent";
|
|
@@ -37,6 +41,7 @@ function post({ apiToken, body, url }) {
|
|
|
37
41
|
// src/Adaptor.js
|
|
38
42
|
import { resolve as resolveUrl } from "url";
|
|
39
43
|
import {
|
|
44
|
+
fn,
|
|
40
45
|
field,
|
|
41
46
|
fields,
|
|
42
47
|
sourceValue,
|
|
@@ -44,7 +49,7 @@ import {
|
|
|
44
49
|
dataPath,
|
|
45
50
|
dataValue,
|
|
46
51
|
lastReferenceValue
|
|
47
|
-
} from "language-common";
|
|
52
|
+
} from "@openfn/language-common";
|
|
48
53
|
function execute(...operations) {
|
|
49
54
|
const initialState = {
|
|
50
55
|
references: [],
|
|
@@ -97,6 +102,17 @@ function createCollectionRequest(data) {
|
|
|
97
102
|
// src/index.js
|
|
98
103
|
var src_default = Adaptor_exports;
|
|
99
104
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
createCollectionRequest,
|
|
106
|
+
createContact,
|
|
107
|
+
createPayment,
|
|
108
|
+
dataPath,
|
|
109
|
+
dataValue,
|
|
110
|
+
src_default as default,
|
|
111
|
+
execute,
|
|
112
|
+
field,
|
|
113
|
+
fields,
|
|
114
|
+
fn,
|
|
115
|
+
lastReferenceValue,
|
|
116
|
+
merge,
|
|
117
|
+
sourceValue
|
|
102
118
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-beyonic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "beyonic Language Pack for OpenFn",
|
|
5
|
-
"
|
|
5
|
+
"homepage": "https://docs.openfn.org",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/openfn/adaptors.git"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
6
14
|
"author": "Open Function Group",
|
|
7
15
|
"license": "LGPLv3",
|
|
8
16
|
"files": [
|
|
@@ -12,32 +20,29 @@
|
|
|
12
20
|
"configuration-schema.json"
|
|
13
21
|
],
|
|
14
22
|
"dependencies": {
|
|
23
|
+
"@openfn/language-common": "^1.7.4",
|
|
15
24
|
"JSONPath": "^0.10.0",
|
|
16
|
-
"language-common": "github:openfn/language-common",
|
|
17
25
|
"lodash-fp": "^0.10.2",
|
|
18
26
|
"superagent": "^8.0.0"
|
|
19
27
|
},
|
|
20
28
|
"devDependencies": {
|
|
29
|
+
"@openfn/buildtools": "^1.0.2",
|
|
21
30
|
"@openfn/simple-ast": "0.4.1",
|
|
22
31
|
"assertion-error": "2.0.0",
|
|
23
32
|
"chai": "4.3.6",
|
|
24
33
|
"deep-eql": "4.1.1",
|
|
34
|
+
"esno": "^0.16.3",
|
|
25
35
|
"mocha": "7.2.0",
|
|
26
|
-
"
|
|
27
|
-
"superagent-mock": "1.12.0",
|
|
28
|
-
"esno": "0.16.3",
|
|
29
|
-
"rimraf": "3.0.2",
|
|
30
|
-
"@openfn/buildtools": "^1.0.0"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/openfn/adaptors.git"
|
|
36
|
+
"rimraf": "3.0.2"
|
|
35
37
|
},
|
|
36
38
|
"type": "module",
|
|
37
39
|
"types": "types/index.d.ts",
|
|
40
|
+
"main": "dist/index.cjs",
|
|
38
41
|
"scripts": {
|
|
39
42
|
"build": "pnpm clean && build-adaptor beyonic",
|
|
40
|
-
"
|
|
43
|
+
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
44
|
+
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
45
|
+
"clean": "rimraf dist types docs",
|
|
41
46
|
"pack": "pnpm pack --pack-destination ../../dist"
|
|
42
47
|
}
|
|
43
48
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** @module Adaptor */
|
|
2
|
+
/**
|
|
3
|
+
* Execute a sequence of operations.
|
|
4
|
+
* Wraps `language-common/execute`, and prepends initial state for beyonic.
|
|
5
|
+
* @example
|
|
6
|
+
* execute(
|
|
7
|
+
* create('foo'),
|
|
8
|
+
* delete('bar')
|
|
9
|
+
* )(state)
|
|
10
|
+
* @constructor
|
|
11
|
+
* @param {Operations} operations - Operations to be performed.
|
|
12
|
+
* @returns {Operation}
|
|
13
|
+
*/
|
|
14
|
+
export function execute(...operations: Operations): Operation;
|
|
15
|
+
export class execute {
|
|
16
|
+
/** @module Adaptor */
|
|
17
|
+
/**
|
|
18
|
+
* Execute a sequence of operations.
|
|
19
|
+
* Wraps `language-common/execute`, and prepends initial state for beyonic.
|
|
20
|
+
* @example
|
|
21
|
+
* execute(
|
|
22
|
+
* create('foo'),
|
|
23
|
+
* delete('bar')
|
|
24
|
+
* )(state)
|
|
25
|
+
* @constructor
|
|
26
|
+
* @param {Operations} operations - Operations to be performed.
|
|
27
|
+
* @returns {Operation}
|
|
28
|
+
*/
|
|
29
|
+
constructor(...operations: Operations);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create a payment
|
|
33
|
+
* @example
|
|
34
|
+
* execute(
|
|
35
|
+
* createPayment(data)
|
|
36
|
+
* )(state)
|
|
37
|
+
* @constructor
|
|
38
|
+
* @param {object} data - Payload data for the payment
|
|
39
|
+
* @returns {Operation}
|
|
40
|
+
*/
|
|
41
|
+
export function createPayment(data: object): Operation;
|
|
42
|
+
export class createPayment {
|
|
43
|
+
/**
|
|
44
|
+
* Create a payment
|
|
45
|
+
* @example
|
|
46
|
+
* execute(
|
|
47
|
+
* createPayment(data)
|
|
48
|
+
* )(state)
|
|
49
|
+
* @constructor
|
|
50
|
+
* @param {object} data - Payload data for the payment
|
|
51
|
+
* @returns {Operation}
|
|
52
|
+
*/
|
|
53
|
+
constructor(data: object);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a contact
|
|
57
|
+
* @example
|
|
58
|
+
* execute(
|
|
59
|
+
* createContact(data)
|
|
60
|
+
* )(state)
|
|
61
|
+
* @constructor
|
|
62
|
+
* @param {object} data - Payload data for the contact
|
|
63
|
+
* @returns {Operation}
|
|
64
|
+
*/
|
|
65
|
+
export function createContact(data: object): Operation;
|
|
66
|
+
export class createContact {
|
|
67
|
+
/**
|
|
68
|
+
* Create a contact
|
|
69
|
+
* @example
|
|
70
|
+
* execute(
|
|
71
|
+
* createContact(data)
|
|
72
|
+
* )(state)
|
|
73
|
+
* @constructor
|
|
74
|
+
* @param {object} data - Payload data for the contact
|
|
75
|
+
* @returns {Operation}
|
|
76
|
+
*/
|
|
77
|
+
constructor(data: object);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a collection request
|
|
81
|
+
* @example
|
|
82
|
+
* execute(
|
|
83
|
+
* createCollectionRequest(data)
|
|
84
|
+
* )(state)
|
|
85
|
+
* @constructor
|
|
86
|
+
* @param {object} data - Payload data for the collection request
|
|
87
|
+
* @returns {Operation}
|
|
88
|
+
*/
|
|
89
|
+
export function createCollectionRequest(data: object): Operation;
|
|
90
|
+
export class createCollectionRequest {
|
|
91
|
+
/**
|
|
92
|
+
* Create a collection request
|
|
93
|
+
* @example
|
|
94
|
+
* execute(
|
|
95
|
+
* createCollectionRequest(data)
|
|
96
|
+
* )(state)
|
|
97
|
+
* @constructor
|
|
98
|
+
* @param {object} data - Payload data for the collection request
|
|
99
|
+
* @returns {Operation}
|
|
100
|
+
*/
|
|
101
|
+
constructor(data: object);
|
|
102
|
+
}
|
|
103
|
+
export { fn, field, fields, sourceValue, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
package/types/index.d.ts
CHANGED
|
@@ -1,121 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Wraps `language-common/execute`, and prepends initial state for beyonic.
|
|
5
|
-
* @example
|
|
6
|
-
* execute(
|
|
7
|
-
* create('foo'),
|
|
8
|
-
* delete('bar')
|
|
9
|
-
* )(state)
|
|
10
|
-
* @constructor
|
|
11
|
-
* @param {Operations} operations - Operations to be performed.
|
|
12
|
-
* @returns {Operation}
|
|
13
|
-
*/
|
|
14
|
-
declare function execute(...operations: Operations): Operation;
|
|
15
|
-
declare class execute {
|
|
16
|
-
/** @module Adaptor */
|
|
17
|
-
/**
|
|
18
|
-
* Execute a sequence of operations.
|
|
19
|
-
* Wraps `language-common/execute`, and prepends initial state for beyonic.
|
|
20
|
-
* @example
|
|
21
|
-
* execute(
|
|
22
|
-
* create('foo'),
|
|
23
|
-
* delete('bar')
|
|
24
|
-
* )(state)
|
|
25
|
-
* @constructor
|
|
26
|
-
* @param {Operations} operations - Operations to be performed.
|
|
27
|
-
* @returns {Operation}
|
|
28
|
-
*/
|
|
29
|
-
constructor(...operations: Operations);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create a payment
|
|
33
|
-
* @example
|
|
34
|
-
* execute(
|
|
35
|
-
* createPayment(data)
|
|
36
|
-
* )(state)
|
|
37
|
-
* @constructor
|
|
38
|
-
* @param {object} data - Payload data for the payment
|
|
39
|
-
* @returns {Operation}
|
|
40
|
-
*/
|
|
41
|
-
declare function createPayment(data: object): Operation;
|
|
42
|
-
declare class createPayment {
|
|
43
|
-
/**
|
|
44
|
-
* Create a payment
|
|
45
|
-
* @example
|
|
46
|
-
* execute(
|
|
47
|
-
* createPayment(data)
|
|
48
|
-
* )(state)
|
|
49
|
-
* @constructor
|
|
50
|
-
* @param {object} data - Payload data for the payment
|
|
51
|
-
* @returns {Operation}
|
|
52
|
-
*/
|
|
53
|
-
constructor(data: object);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Create a contact
|
|
57
|
-
* @example
|
|
58
|
-
* execute(
|
|
59
|
-
* createContact(data)
|
|
60
|
-
* )(state)
|
|
61
|
-
* @constructor
|
|
62
|
-
* @param {object} data - Payload data for the contact
|
|
63
|
-
* @returns {Operation}
|
|
64
|
-
*/
|
|
65
|
-
declare function createContact(data: object): Operation;
|
|
66
|
-
declare class createContact {
|
|
67
|
-
/**
|
|
68
|
-
* Create a contact
|
|
69
|
-
* @example
|
|
70
|
-
* execute(
|
|
71
|
-
* createContact(data)
|
|
72
|
-
* )(state)
|
|
73
|
-
* @constructor
|
|
74
|
-
* @param {object} data - Payload data for the contact
|
|
75
|
-
* @returns {Operation}
|
|
76
|
-
*/
|
|
77
|
-
constructor(data: object);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Create a collection request
|
|
81
|
-
* @example
|
|
82
|
-
* execute(
|
|
83
|
-
* createCollectionRequest(data)
|
|
84
|
-
* )(state)
|
|
85
|
-
* @constructor
|
|
86
|
-
* @param {object} data - Payload data for the collection request
|
|
87
|
-
* @returns {Operation}
|
|
88
|
-
*/
|
|
89
|
-
declare function createCollectionRequest(data: object): Operation;
|
|
90
|
-
declare class createCollectionRequest {
|
|
91
|
-
/**
|
|
92
|
-
* Create a collection request
|
|
93
|
-
* @example
|
|
94
|
-
* execute(
|
|
95
|
-
* createCollectionRequest(data)
|
|
96
|
-
* )(state)
|
|
97
|
-
* @constructor
|
|
98
|
-
* @param {object} data - Payload data for the collection request
|
|
99
|
-
* @returns {Operation}
|
|
100
|
-
*/
|
|
101
|
-
constructor(data: object);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
type Adaptor_execute = execute;
|
|
105
|
-
declare const Adaptor_execute: typeof execute;
|
|
106
|
-
type Adaptor_createPayment = createPayment;
|
|
107
|
-
declare const Adaptor_createPayment: typeof createPayment;
|
|
108
|
-
type Adaptor_createContact = createContact;
|
|
109
|
-
declare const Adaptor_createContact: typeof createContact;
|
|
110
|
-
type Adaptor_createCollectionRequest = createCollectionRequest;
|
|
111
|
-
declare const Adaptor_createCollectionRequest: typeof createCollectionRequest;
|
|
112
|
-
declare namespace Adaptor {
|
|
113
|
-
export {
|
|
114
|
-
Adaptor_execute as execute,
|
|
115
|
-
Adaptor_createPayment as createPayment,
|
|
116
|
-
Adaptor_createContact as createContact,
|
|
117
|
-
Adaptor_createCollectionRequest as createCollectionRequest,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export { Adaptor, Adaptor as default };
|
|
1
|
+
export default Adaptor;
|
|
2
|
+
export * from "./Adaptor";
|
|
3
|
+
import * as Adaptor from "./Adaptor";
|