@openfn/language-magpi 1.0.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/LICENSE +674 -0
- package/LICENSE.LESSER +165 -0
- package/README.md +72 -0
- package/ast.json +510 -0
- package/configuration-schema.json +24 -0
- package/dist/index.cjs +200 -0
- package/dist/index.js +176 -0
- package/package.json +54 -0
- package/types/Adaptor.d.ts +39 -0
- package/types/index.d.ts +3 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
|
|
25
|
+
// src/index.js
|
|
26
|
+
var src_exports = {};
|
|
27
|
+
__export(src_exports, {
|
|
28
|
+
alterState: () => import_language_common2.alterState,
|
|
29
|
+
dataPath: () => import_language_common2.dataPath,
|
|
30
|
+
dataValue: () => import_language_common2.dataValue,
|
|
31
|
+
default: () => src_default,
|
|
32
|
+
each: () => import_language_common2.each,
|
|
33
|
+
execute: () => execute,
|
|
34
|
+
fetchSurveyData: () => fetchSurveyData,
|
|
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,
|
|
41
|
+
submitRecord: () => submitRecord
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(src_exports);
|
|
44
|
+
|
|
45
|
+
// src/Adaptor.js
|
|
46
|
+
var Adaptor_exports = {};
|
|
47
|
+
__export(Adaptor_exports, {
|
|
48
|
+
alterState: () => import_language_common2.alterState,
|
|
49
|
+
dataPath: () => import_language_common2.dataPath,
|
|
50
|
+
dataValue: () => import_language_common2.dataValue,
|
|
51
|
+
each: () => import_language_common2.each,
|
|
52
|
+
execute: () => execute,
|
|
53
|
+
fetchSurveyData: () => fetchSurveyData,
|
|
54
|
+
field: () => import_language_common2.field,
|
|
55
|
+
fields: () => import_language_common2.fields,
|
|
56
|
+
fn: () => import_language_common2.fn,
|
|
57
|
+
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
58
|
+
merge: () => import_language_common2.merge,
|
|
59
|
+
sourceValue: () => import_language_common2.sourceValue,
|
|
60
|
+
submitRecord: () => submitRecord
|
|
61
|
+
});
|
|
62
|
+
var import_language_common = require("@openfn/language-common");
|
|
63
|
+
var import_url = require("url");
|
|
64
|
+
var import_js2xmlparser = __toESM(require("js2xmlparser"), 1);
|
|
65
|
+
var import_request = __toESM(require("request"), 1);
|
|
66
|
+
var import_xml2js = __toESM(require("xml2js"), 1);
|
|
67
|
+
var import_language_common2 = require("@openfn/language-common");
|
|
68
|
+
function execute(...operations) {
|
|
69
|
+
const initialState = {
|
|
70
|
+
references: [],
|
|
71
|
+
data: null
|
|
72
|
+
};
|
|
73
|
+
return (state) => {
|
|
74
|
+
return (0, import_language_common.execute)(...operations)({ ...initialState, ...state });
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function fetchSurveyData(params) {
|
|
78
|
+
return (state) => {
|
|
79
|
+
function assembleError({ response, error }) {
|
|
80
|
+
if (response && [200, 201, 202].indexOf(response.statusCode) > -1)
|
|
81
|
+
return false;
|
|
82
|
+
if (error)
|
|
83
|
+
return error;
|
|
84
|
+
return new Error(`Server responded with ${response.statusCode}`);
|
|
85
|
+
}
|
|
86
|
+
console.log(params.surveyId);
|
|
87
|
+
const { surveyId, afterDate, beforeDate, postUrl } = (0, import_language_common.expandReferences)(params)(state);
|
|
88
|
+
console.log(surveyId);
|
|
89
|
+
const { accessToken, username } = state.configuration;
|
|
90
|
+
const enddate = beforeDate;
|
|
91
|
+
const startdate = state.lastSubmissionDate || afterDate;
|
|
92
|
+
const url = "https://www.magpi.com/api/surveydata/v3";
|
|
93
|
+
const form = {
|
|
94
|
+
username,
|
|
95
|
+
accesstoken: accessToken,
|
|
96
|
+
surveyid: surveyId,
|
|
97
|
+
startdate,
|
|
98
|
+
enddate
|
|
99
|
+
};
|
|
100
|
+
console.log(`Fetching Survey ${form.surveyid} submissions from ${url}`);
|
|
101
|
+
console.log(`Date filters: "${form.startdate}" to "${form.enddate}".`);
|
|
102
|
+
return new Promise((resolve, reject) => {
|
|
103
|
+
(0, import_request.default)(
|
|
104
|
+
{
|
|
105
|
+
method: "POST",
|
|
106
|
+
url,
|
|
107
|
+
form
|
|
108
|
+
},
|
|
109
|
+
(error, response, body) => {
|
|
110
|
+
error = assembleError({ error, response });
|
|
111
|
+
if (error) {
|
|
112
|
+
console.log("Failed to fetch submission data.");
|
|
113
|
+
console.log("Response body: " + response.body);
|
|
114
|
+
reject(error);
|
|
115
|
+
} else {
|
|
116
|
+
const parser = new import_xml2js.default.Parser();
|
|
117
|
+
const jsonBody = JSON.parse(parser.toJson(body));
|
|
118
|
+
if (jsonBody.SurveyDataList.SurveyData) {
|
|
119
|
+
console.log("Successfully fetched submission data.");
|
|
120
|
+
if (jsonBody.SurveyDataList.SurveyData.length) {
|
|
121
|
+
var submissions = jsonBody.SurveyDataList.SurveyData;
|
|
122
|
+
} else {
|
|
123
|
+
var submissions = [jsonBody.SurveyDataList.SurveyData];
|
|
124
|
+
}
|
|
125
|
+
console.log(
|
|
126
|
+
`Converted ${submissions.length} submission(s) to JSON:`
|
|
127
|
+
);
|
|
128
|
+
resolve(submissions);
|
|
129
|
+
} else {
|
|
130
|
+
console.log(
|
|
131
|
+
"There is no survey data matching the current parameters."
|
|
132
|
+
);
|
|
133
|
+
resolve([]);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}).then((submissions) => {
|
|
139
|
+
submissions.forEach((item) => {
|
|
140
|
+
item.surveyId = surveyId;
|
|
141
|
+
item.source = "Magpi API";
|
|
142
|
+
console.log(item);
|
|
143
|
+
import_request.default.post(
|
|
144
|
+
{
|
|
145
|
+
url: postUrl,
|
|
146
|
+
json: item
|
|
147
|
+
},
|
|
148
|
+
(error, response, postResponseBody) => {
|
|
149
|
+
error = assembleError({ error, response });
|
|
150
|
+
if (error) {
|
|
151
|
+
console.error("POST failed.");
|
|
152
|
+
throw error;
|
|
153
|
+
} else {
|
|
154
|
+
console.log("POST succeeded.");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
return submissions;
|
|
160
|
+
}).then((submissions) => {
|
|
161
|
+
if (submissions.length) {
|
|
162
|
+
state.lastSubmissionDate = submissions[0].LastSubmissionDate;
|
|
163
|
+
console.log(
|
|
164
|
+
`Set "lastSubmissionDate" for next run to: ${submissions[0].LastSubmissionDate}`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return state;
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function submitRecord(jsonData) {
|
|
172
|
+
return (state) => {
|
|
173
|
+
const jsonBody = (0, import_language_common.expandReferences)(data)(state);
|
|
174
|
+
const body = (0, import_js2xmlparser.default)("form", jsonBody);
|
|
175
|
+
const { username, password, apiUrl } = state.configuration;
|
|
176
|
+
const url = (0, import_url.resolve)(apiUrl + "/", "mobileApi/uploadData");
|
|
177
|
+
console.log("Posting to url: ".concat(url));
|
|
178
|
+
console.log("Raw JSON body: ".concat(JSON.stringify(jsonBody)));
|
|
179
|
+
console.log("X-form submission: ".concat(body));
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// src/index.js
|
|
184
|
+
var src_default = Adaptor_exports;
|
|
185
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
186
|
+
0 && (module.exports = {
|
|
187
|
+
alterState,
|
|
188
|
+
dataPath,
|
|
189
|
+
dataValue,
|
|
190
|
+
each,
|
|
191
|
+
execute,
|
|
192
|
+
fetchSurveyData,
|
|
193
|
+
field,
|
|
194
|
+
fields,
|
|
195
|
+
fn,
|
|
196
|
+
lastReferenceValue,
|
|
197
|
+
merge,
|
|
198
|
+
sourceValue,
|
|
199
|
+
submitRecord
|
|
200
|
+
});
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/Adaptor.js
|
|
8
|
+
var Adaptor_exports = {};
|
|
9
|
+
__export(Adaptor_exports, {
|
|
10
|
+
alterState: () => alterState,
|
|
11
|
+
dataPath: () => dataPath,
|
|
12
|
+
dataValue: () => dataValue,
|
|
13
|
+
each: () => each,
|
|
14
|
+
execute: () => execute,
|
|
15
|
+
fetchSurveyData: () => fetchSurveyData,
|
|
16
|
+
field: () => field,
|
|
17
|
+
fields: () => fields,
|
|
18
|
+
fn: () => fn,
|
|
19
|
+
lastReferenceValue: () => lastReferenceValue,
|
|
20
|
+
merge: () => merge,
|
|
21
|
+
sourceValue: () => sourceValue,
|
|
22
|
+
submitRecord: () => submitRecord
|
|
23
|
+
});
|
|
24
|
+
import {
|
|
25
|
+
execute as commonExecute,
|
|
26
|
+
expandReferences
|
|
27
|
+
} from "@openfn/language-common";
|
|
28
|
+
import { resolve as resolveUrl } from "url";
|
|
29
|
+
import js2xmlparser from "js2xmlparser";
|
|
30
|
+
import request from "request";
|
|
31
|
+
import xml2js from "xml2js";
|
|
32
|
+
import {
|
|
33
|
+
fn,
|
|
34
|
+
alterState,
|
|
35
|
+
field,
|
|
36
|
+
fields,
|
|
37
|
+
sourceValue,
|
|
38
|
+
each,
|
|
39
|
+
merge,
|
|
40
|
+
dataPath,
|
|
41
|
+
dataValue,
|
|
42
|
+
lastReferenceValue
|
|
43
|
+
} from "@openfn/language-common";
|
|
44
|
+
function execute(...operations) {
|
|
45
|
+
const initialState = {
|
|
46
|
+
references: [],
|
|
47
|
+
data: null
|
|
48
|
+
};
|
|
49
|
+
return (state) => {
|
|
50
|
+
return commonExecute(...operations)({ ...initialState, ...state });
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function fetchSurveyData(params) {
|
|
54
|
+
return (state) => {
|
|
55
|
+
function assembleError({ response, error }) {
|
|
56
|
+
if (response && [200, 201, 202].indexOf(response.statusCode) > -1)
|
|
57
|
+
return false;
|
|
58
|
+
if (error)
|
|
59
|
+
return error;
|
|
60
|
+
return new Error(`Server responded with ${response.statusCode}`);
|
|
61
|
+
}
|
|
62
|
+
console.log(params.surveyId);
|
|
63
|
+
const { surveyId, afterDate, beforeDate, postUrl } = expandReferences(params)(state);
|
|
64
|
+
console.log(surveyId);
|
|
65
|
+
const { accessToken, username } = state.configuration;
|
|
66
|
+
const enddate = beforeDate;
|
|
67
|
+
const startdate = state.lastSubmissionDate || afterDate;
|
|
68
|
+
const url = "https://www.magpi.com/api/surveydata/v3";
|
|
69
|
+
const form = {
|
|
70
|
+
username,
|
|
71
|
+
accesstoken: accessToken,
|
|
72
|
+
surveyid: surveyId,
|
|
73
|
+
startdate,
|
|
74
|
+
enddate
|
|
75
|
+
};
|
|
76
|
+
console.log(`Fetching Survey ${form.surveyid} submissions from ${url}`);
|
|
77
|
+
console.log(`Date filters: "${form.startdate}" to "${form.enddate}".`);
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
request(
|
|
80
|
+
{
|
|
81
|
+
method: "POST",
|
|
82
|
+
url,
|
|
83
|
+
form
|
|
84
|
+
},
|
|
85
|
+
(error, response, body) => {
|
|
86
|
+
error = assembleError({ error, response });
|
|
87
|
+
if (error) {
|
|
88
|
+
console.log("Failed to fetch submission data.");
|
|
89
|
+
console.log("Response body: " + response.body);
|
|
90
|
+
reject(error);
|
|
91
|
+
} else {
|
|
92
|
+
const parser = new xml2js.Parser();
|
|
93
|
+
const jsonBody = JSON.parse(parser.toJson(body));
|
|
94
|
+
if (jsonBody.SurveyDataList.SurveyData) {
|
|
95
|
+
console.log("Successfully fetched submission data.");
|
|
96
|
+
if (jsonBody.SurveyDataList.SurveyData.length) {
|
|
97
|
+
var submissions = jsonBody.SurveyDataList.SurveyData;
|
|
98
|
+
} else {
|
|
99
|
+
var submissions = [jsonBody.SurveyDataList.SurveyData];
|
|
100
|
+
}
|
|
101
|
+
console.log(
|
|
102
|
+
`Converted ${submissions.length} submission(s) to JSON:`
|
|
103
|
+
);
|
|
104
|
+
resolve(submissions);
|
|
105
|
+
} else {
|
|
106
|
+
console.log(
|
|
107
|
+
"There is no survey data matching the current parameters."
|
|
108
|
+
);
|
|
109
|
+
resolve([]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}).then((submissions) => {
|
|
115
|
+
submissions.forEach((item) => {
|
|
116
|
+
item.surveyId = surveyId;
|
|
117
|
+
item.source = "Magpi API";
|
|
118
|
+
console.log(item);
|
|
119
|
+
request.post(
|
|
120
|
+
{
|
|
121
|
+
url: postUrl,
|
|
122
|
+
json: item
|
|
123
|
+
},
|
|
124
|
+
(error, response, postResponseBody) => {
|
|
125
|
+
error = assembleError({ error, response });
|
|
126
|
+
if (error) {
|
|
127
|
+
console.error("POST failed.");
|
|
128
|
+
throw error;
|
|
129
|
+
} else {
|
|
130
|
+
console.log("POST succeeded.");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
return submissions;
|
|
136
|
+
}).then((submissions) => {
|
|
137
|
+
if (submissions.length) {
|
|
138
|
+
state.lastSubmissionDate = submissions[0].LastSubmissionDate;
|
|
139
|
+
console.log(
|
|
140
|
+
`Set "lastSubmissionDate" for next run to: ${submissions[0].LastSubmissionDate}`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return state;
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function submitRecord(jsonData) {
|
|
148
|
+
return (state) => {
|
|
149
|
+
const jsonBody = expandReferences(data)(state);
|
|
150
|
+
const body = js2xmlparser("form", jsonBody);
|
|
151
|
+
const { username, password, apiUrl } = state.configuration;
|
|
152
|
+
const url = resolveUrl(apiUrl + "/", "mobileApi/uploadData");
|
|
153
|
+
console.log("Posting to url: ".concat(url));
|
|
154
|
+
console.log("Raw JSON body: ".concat(JSON.stringify(jsonBody)));
|
|
155
|
+
console.log("X-form submission: ".concat(body));
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// src/index.js
|
|
160
|
+
var src_default = Adaptor_exports;
|
|
161
|
+
export {
|
|
162
|
+
alterState,
|
|
163
|
+
dataPath,
|
|
164
|
+
dataValue,
|
|
165
|
+
src_default as default,
|
|
166
|
+
each,
|
|
167
|
+
execute,
|
|
168
|
+
fetchSurveyData,
|
|
169
|
+
field,
|
|
170
|
+
fields,
|
|
171
|
+
fn,
|
|
172
|
+
lastReferenceValue,
|
|
173
|
+
merge,
|
|
174
|
+
sourceValue,
|
|
175
|
+
submitRecord
|
|
176
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openfn/language-magpi",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Magpi Language Pack for OpenFn",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"author": "Open Function Group",
|
|
7
|
+
"license": "LGPLv3",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/",
|
|
10
|
+
"types/",
|
|
11
|
+
"ast.json",
|
|
12
|
+
"configuration-schema.json"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@openfn/language-common": "^1.7.5",
|
|
16
|
+
"JSONPath": "^0.10.0",
|
|
17
|
+
"js2xmlparser": "^3.0.0",
|
|
18
|
+
"lodash-fp": "^0.10.4",
|
|
19
|
+
"request": "^2.88.2",
|
|
20
|
+
"superagent": "^8.0.3",
|
|
21
|
+
"xml2js": "^0.4.23"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@openfn/buildtools": "^1.0.2",
|
|
25
|
+
"@openfn/simple-ast": "0.4.1",
|
|
26
|
+
"assertion-error": "^2.0.0",
|
|
27
|
+
"chai": "^4.3.7",
|
|
28
|
+
"deep-eql": "^4.1.2",
|
|
29
|
+
"esno": "^0.16.3",
|
|
30
|
+
"mocha": "^10.1.0",
|
|
31
|
+
"rimraf": "^3.0.2",
|
|
32
|
+
"superagent-mock": "^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/openfn/adaptors.git"
|
|
37
|
+
},
|
|
38
|
+
"type": "module",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"import": "./dist/index.js",
|
|
42
|
+
"require": "./dist/index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"types": "types/index.d.ts",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "pnpm clean && build-adaptor magpi",
|
|
49
|
+
"test": "mocha --experimental-specifier-resolution=node --no-warnings",
|
|
50
|
+
"test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
|
|
51
|
+
"clean": "rimraf dist types docs",
|
|
52
|
+
"pack": "pnpm pack --pack-destination ../../dist"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @module Adaptor */
|
|
2
|
+
/**
|
|
3
|
+
* Execute a sequence of operations.
|
|
4
|
+
* Wraps `@openfn/language-common/execute`, and prepends initial state for magpi.
|
|
5
|
+
* @example
|
|
6
|
+
* execute(
|
|
7
|
+
* create('foo'),
|
|
8
|
+
* delete('bar')
|
|
9
|
+
* )(state)
|
|
10
|
+
* @function
|
|
11
|
+
* @param {Operations} operations - Operations to be performed.
|
|
12
|
+
* @returns {Operation}
|
|
13
|
+
*/
|
|
14
|
+
export function execute(...operations: Operations): Operation;
|
|
15
|
+
/**
|
|
16
|
+
* Make a POST request to fetch Magpi data and POST it somewhere else
|
|
17
|
+
* @public
|
|
18
|
+
* @example
|
|
19
|
+
* fetchSurveyData({
|
|
20
|
+
* "surveyId": "37479",
|
|
21
|
+
* "afterDate": "2017-09-27",
|
|
22
|
+
* "postUrl": "https://www.openfn.org/inbox/your-inbox-url"
|
|
23
|
+
* })
|
|
24
|
+
* @function
|
|
25
|
+
* @param {object} params - data to make the fetch
|
|
26
|
+
* @returns {Operation}
|
|
27
|
+
*/
|
|
28
|
+
export function fetchSurveyData(params: object): Operation;
|
|
29
|
+
/**
|
|
30
|
+
* Submit a record for a form/survey which already exists in a Magpi user account
|
|
31
|
+
* @public
|
|
32
|
+
* @example
|
|
33
|
+
* submitRecord(jsonData)
|
|
34
|
+
* @function
|
|
35
|
+
* @param {object} jsonData - Payload data for the record
|
|
36
|
+
* @returns {Operation}
|
|
37
|
+
*/
|
|
38
|
+
export function submitRecord(jsonData: object): Operation;
|
|
39
|
+
export { fn, alterState, field, fields, sourceValue, each, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
package/types/index.d.ts
ADDED