@openfn/language-magpi 1.2.12 → 1.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 +92 -0
- package/dist/index.cjs +6 -0
- package/dist/index.js +13 -7
- package/package.json +1 -1
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -421,6 +421,49 @@
|
|
|
421
421
|
},
|
|
422
422
|
"valid": true
|
|
423
423
|
},
|
|
424
|
+
{
|
|
425
|
+
"name": "combine",
|
|
426
|
+
"params": [
|
|
427
|
+
"operations"
|
|
428
|
+
],
|
|
429
|
+
"docs": {
|
|
430
|
+
"description": "Combines two operations into one",
|
|
431
|
+
"tags": [
|
|
432
|
+
{
|
|
433
|
+
"title": "public",
|
|
434
|
+
"description": null,
|
|
435
|
+
"type": null
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"title": "function",
|
|
439
|
+
"description": null,
|
|
440
|
+
"name": null
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"title": "example",
|
|
444
|
+
"description": "combine(\n create('foo'),\n delete('bar')\n)"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"title": "param",
|
|
448
|
+
"description": "Operations to be performed.",
|
|
449
|
+
"type": {
|
|
450
|
+
"type": "NameExpression",
|
|
451
|
+
"name": "Operations"
|
|
452
|
+
},
|
|
453
|
+
"name": "operations"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"title": "returns",
|
|
457
|
+
"description": null,
|
|
458
|
+
"type": {
|
|
459
|
+
"type": "NameExpression",
|
|
460
|
+
"name": "Operation"
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
"valid": true
|
|
466
|
+
},
|
|
424
467
|
{
|
|
425
468
|
"name": "field",
|
|
426
469
|
"params": [
|
|
@@ -574,6 +617,55 @@
|
|
|
574
617
|
]
|
|
575
618
|
},
|
|
576
619
|
"valid": true
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "log",
|
|
623
|
+
"params": [
|
|
624
|
+
"args"
|
|
625
|
+
],
|
|
626
|
+
"docs": {
|
|
627
|
+
"description": "Outputs a message, like calling `console.log`. Use this at the top level of your job code, but not inside callbacks.",
|
|
628
|
+
"tags": [
|
|
629
|
+
{
|
|
630
|
+
"title": "public",
|
|
631
|
+
"description": null,
|
|
632
|
+
"type": null
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"title": "function",
|
|
636
|
+
"description": null,
|
|
637
|
+
"name": null
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"title": "example",
|
|
641
|
+
"description": "log('Patient List::', $.patients);",
|
|
642
|
+
"caption": "Log values from state"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"title": "example",
|
|
646
|
+
"description": "fn((state) => {\n console.log(state.data);\n return state;\n})",
|
|
647
|
+
"caption": "Use console.log inside a callback or fn block"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"title": "param",
|
|
651
|
+
"description": "A value or message to display in the logs",
|
|
652
|
+
"type": {
|
|
653
|
+
"type": "NameExpression",
|
|
654
|
+
"name": "any"
|
|
655
|
+
},
|
|
656
|
+
"name": "args"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"title": "returns",
|
|
660
|
+
"description": null,
|
|
661
|
+
"type": {
|
|
662
|
+
"type": "NameExpression",
|
|
663
|
+
"name": "Operation"
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
"valid": true
|
|
577
669
|
}
|
|
578
670
|
]
|
|
579
671
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
26
26
|
var src_exports = {};
|
|
27
27
|
__export(src_exports, {
|
|
28
28
|
alterState: () => import_language_common2.alterState,
|
|
29
|
+
combine: () => import_language_common2.combine,
|
|
29
30
|
dataPath: () => import_language_common2.dataPath,
|
|
30
31
|
dataValue: () => import_language_common2.dataValue,
|
|
31
32
|
default: () => src_default,
|
|
@@ -37,6 +38,7 @@ __export(src_exports, {
|
|
|
37
38
|
fn: () => import_language_common2.fn,
|
|
38
39
|
fnIf: () => import_language_common2.fnIf,
|
|
39
40
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
41
|
+
log: () => import_language_common2.log,
|
|
40
42
|
merge: () => import_language_common2.merge,
|
|
41
43
|
sourceValue: () => import_language_common2.sourceValue,
|
|
42
44
|
submitRecord: () => submitRecord
|
|
@@ -47,6 +49,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
47
49
|
var Adaptor_exports = {};
|
|
48
50
|
__export(Adaptor_exports, {
|
|
49
51
|
alterState: () => import_language_common2.alterState,
|
|
52
|
+
combine: () => import_language_common2.combine,
|
|
50
53
|
dataPath: () => import_language_common2.dataPath,
|
|
51
54
|
dataValue: () => import_language_common2.dataValue,
|
|
52
55
|
each: () => import_language_common2.each,
|
|
@@ -57,6 +60,7 @@ __export(Adaptor_exports, {
|
|
|
57
60
|
fn: () => import_language_common2.fn,
|
|
58
61
|
fnIf: () => import_language_common2.fnIf,
|
|
59
62
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
63
|
+
log: () => import_language_common2.log,
|
|
60
64
|
merge: () => import_language_common2.merge,
|
|
61
65
|
sourceValue: () => import_language_common2.sourceValue,
|
|
62
66
|
submitRecord: () => submitRecord
|
|
@@ -189,6 +193,7 @@ var src_default = Adaptor_exports;
|
|
|
189
193
|
// Annotate the CommonJS export names for ESM import in node:
|
|
190
194
|
0 && (module.exports = {
|
|
191
195
|
alterState,
|
|
196
|
+
combine,
|
|
192
197
|
dataPath,
|
|
193
198
|
dataValue,
|
|
194
199
|
each,
|
|
@@ -199,6 +204,7 @@ var src_default = Adaptor_exports;
|
|
|
199
204
|
fn,
|
|
200
205
|
fnIf,
|
|
201
206
|
lastReferenceValue,
|
|
207
|
+
log,
|
|
202
208
|
merge,
|
|
203
209
|
sourceValue,
|
|
204
210
|
submitRecord
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
var Adaptor_exports = {};
|
|
9
9
|
__export(Adaptor_exports, {
|
|
10
10
|
alterState: () => alterState,
|
|
11
|
+
combine: () => combine,
|
|
11
12
|
dataPath: () => dataPath,
|
|
12
13
|
dataValue: () => dataValue,
|
|
13
14
|
each: () => each,
|
|
@@ -18,6 +19,7 @@ __export(Adaptor_exports, {
|
|
|
18
19
|
fn: () => fn,
|
|
19
20
|
fnIf: () => fnIf,
|
|
20
21
|
lastReferenceValue: () => lastReferenceValue,
|
|
22
|
+
log: () => log,
|
|
21
23
|
merge: () => merge,
|
|
22
24
|
sourceValue: () => sourceValue,
|
|
23
25
|
submitRecord: () => submitRecord
|
|
@@ -29,17 +31,19 @@ import js2xmlparser from "js2xmlparser";
|
|
|
29
31
|
import request from "request";
|
|
30
32
|
import xml2js from "xml2js";
|
|
31
33
|
import {
|
|
32
|
-
fn,
|
|
33
|
-
fnIf,
|
|
34
34
|
alterState,
|
|
35
|
+
combine,
|
|
36
|
+
dataPath,
|
|
37
|
+
dataValue,
|
|
38
|
+
each,
|
|
35
39
|
field,
|
|
36
40
|
fields,
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
fn,
|
|
42
|
+
fnIf,
|
|
43
|
+
lastReferenceValue,
|
|
44
|
+
log,
|
|
39
45
|
merge,
|
|
40
|
-
|
|
41
|
-
dataValue,
|
|
42
|
-
lastReferenceValue
|
|
46
|
+
sourceValue
|
|
43
47
|
} from "@openfn/language-common";
|
|
44
48
|
function execute(...operations) {
|
|
45
49
|
const initialState = {
|
|
@@ -161,6 +165,7 @@ function submitRecord(jsonData) {
|
|
|
161
165
|
var src_default = Adaptor_exports;
|
|
162
166
|
export {
|
|
163
167
|
alterState,
|
|
168
|
+
combine,
|
|
164
169
|
dataPath,
|
|
165
170
|
dataValue,
|
|
166
171
|
src_default as default,
|
|
@@ -172,6 +177,7 @@ export {
|
|
|
172
177
|
fn,
|
|
173
178
|
fnIf,
|
|
174
179
|
lastReferenceValue,
|
|
180
|
+
log,
|
|
175
181
|
merge,
|
|
176
182
|
sourceValue,
|
|
177
183
|
submitRecord
|
package/package.json
CHANGED
package/types/Adaptor.d.ts
CHANGED
|
@@ -35,4 +35,4 @@ export function fetchSurveyData(params: object): Operation;
|
|
|
35
35
|
* @returns {Operation}
|
|
36
36
|
*/
|
|
37
37
|
export function submitRecord(jsonData: object): Operation;
|
|
38
|
-
export {
|
|
38
|
+
export { alterState, combine, dataPath, dataValue, each, field, fields, fn, fnIf, lastReferenceValue, log, merge, sourceValue } from "@openfn/language-common";
|