@openfn/language-beyonic 0.3.15 → 0.3.16
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/dist/index.cjs +4 -3
- package/dist/index.js +5 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -76,6 +76,7 @@ function post({ apiToken, body, url }) {
|
|
|
76
76
|
|
|
77
77
|
// src/Adaptor.js
|
|
78
78
|
var import_url = require("url");
|
|
79
|
+
var import_util = require("@openfn/language-common/util");
|
|
79
80
|
var import_language_common2 = require("@openfn/language-common");
|
|
80
81
|
function execute(...operations) {
|
|
81
82
|
const initialState = {
|
|
@@ -88,7 +89,7 @@ function execute(...operations) {
|
|
|
88
89
|
}
|
|
89
90
|
function createPayment(data) {
|
|
90
91
|
return (state) => {
|
|
91
|
-
const body = (0,
|
|
92
|
+
const [body] = (0, import_util.expandReferences)(state, data);
|
|
92
93
|
const { apiUrl, apiToken } = state.configuration;
|
|
93
94
|
const url = (0, import_url.resolve)(apiUrl + "/", "payments");
|
|
94
95
|
console.log("Posting payment:");
|
|
@@ -101,7 +102,7 @@ function createPayment(data) {
|
|
|
101
102
|
}
|
|
102
103
|
function createContact(data) {
|
|
103
104
|
return (state) => {
|
|
104
|
-
const body = (0,
|
|
105
|
+
const [body] = (0, import_util.expandReferences)(state, data);
|
|
105
106
|
const { apiUrl, apiToken } = state.configuration;
|
|
106
107
|
const url = (0, import_url.resolve)(apiUrl + "/", "contacts");
|
|
107
108
|
console.log("Posting contact:");
|
|
@@ -114,7 +115,7 @@ function createContact(data) {
|
|
|
114
115
|
}
|
|
115
116
|
function createCollectionRequest(data) {
|
|
116
117
|
return (state) => {
|
|
117
|
-
const body = (0,
|
|
118
|
+
const [body] = (0, import_util.expandReferences)(state, data);
|
|
118
119
|
const { apiUrl, apiToken } = state.configuration;
|
|
119
120
|
const url = (0, import_url.resolve)(apiUrl + "/", "collectionrequests");
|
|
120
121
|
console.log("Posting collection request:");
|
package/dist/index.js
CHANGED
|
@@ -21,10 +21,7 @@ __export(Adaptor_exports, {
|
|
|
21
21
|
merge: () => merge,
|
|
22
22
|
sourceValue: () => sourceValue
|
|
23
23
|
});
|
|
24
|
-
import {
|
|
25
|
-
execute as commonExecute,
|
|
26
|
-
expandReferences
|
|
27
|
-
} from "@openfn/language-common";
|
|
24
|
+
import { execute as commonExecute } from "@openfn/language-common";
|
|
28
25
|
|
|
29
26
|
// src/Client.js
|
|
30
27
|
import request from "superagent";
|
|
@@ -41,6 +38,7 @@ function post({ apiToken, body, url }) {
|
|
|
41
38
|
|
|
42
39
|
// src/Adaptor.js
|
|
43
40
|
import { resolve as resolveUrl } from "url";
|
|
41
|
+
import { expandReferences } from "@openfn/language-common/util";
|
|
44
42
|
import {
|
|
45
43
|
fn,
|
|
46
44
|
fnIf,
|
|
@@ -63,7 +61,7 @@ function execute(...operations) {
|
|
|
63
61
|
}
|
|
64
62
|
function createPayment(data) {
|
|
65
63
|
return (state) => {
|
|
66
|
-
const body = expandReferences(data)
|
|
64
|
+
const [body] = expandReferences(state, data);
|
|
67
65
|
const { apiUrl, apiToken } = state.configuration;
|
|
68
66
|
const url = resolveUrl(apiUrl + "/", "payments");
|
|
69
67
|
console.log("Posting payment:");
|
|
@@ -76,7 +74,7 @@ function createPayment(data) {
|
|
|
76
74
|
}
|
|
77
75
|
function createContact(data) {
|
|
78
76
|
return (state) => {
|
|
79
|
-
const body = expandReferences(data)
|
|
77
|
+
const [body] = expandReferences(state, data);
|
|
80
78
|
const { apiUrl, apiToken } = state.configuration;
|
|
81
79
|
const url = resolveUrl(apiUrl + "/", "contacts");
|
|
82
80
|
console.log("Posting contact:");
|
|
@@ -89,7 +87,7 @@ function createContact(data) {
|
|
|
89
87
|
}
|
|
90
88
|
function createCollectionRequest(data) {
|
|
91
89
|
return (state) => {
|
|
92
|
-
const body = expandReferences(data)
|
|
90
|
+
const [body] = expandReferences(state, data);
|
|
93
91
|
const { apiUrl, apiToken } = state.configuration;
|
|
94
92
|
const url = resolveUrl(apiUrl + "/", "collectionrequests");
|
|
95
93
|
console.log("Posting collection request:");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-beyonic",
|
|
3
3
|
"label": "Beyonic",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.16",
|
|
5
5
|
"description": "beyonic Language Pack for OpenFn",
|
|
6
6
|
"homepage": "https://docs.openfn.org",
|
|
7
7
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"JSONPath": "^0.10.0",
|
|
29
29
|
"lodash-fp": "^0.10.2",
|
|
30
30
|
"superagent": "^8.0.0",
|
|
31
|
-
"@openfn/language-common": "
|
|
31
|
+
"@openfn/language-common": "3.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"assertion-error": "2.0.0",
|