@openfn/language-godata 3.4.0 → 3.5.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 +96 -0
- package/dist/index.cjs +6 -0
- package/dist/index.js +6 -0
- package/package.json +2 -3
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -848,6 +848,102 @@
|
|
|
848
848
|
],
|
|
849
849
|
"exports": [],
|
|
850
850
|
"common": [
|
|
851
|
+
{
|
|
852
|
+
"name": "fn",
|
|
853
|
+
"params": [
|
|
854
|
+
"func"
|
|
855
|
+
],
|
|
856
|
+
"docs": {
|
|
857
|
+
"description": "Creates a custom step (or operation) for more flexible job writing.",
|
|
858
|
+
"tags": [
|
|
859
|
+
{
|
|
860
|
+
"title": "public",
|
|
861
|
+
"description": null,
|
|
862
|
+
"type": null
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"title": "example",
|
|
866
|
+
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"title": "function",
|
|
870
|
+
"description": null,
|
|
871
|
+
"name": null
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"title": "param",
|
|
875
|
+
"description": "is the function",
|
|
876
|
+
"type": {
|
|
877
|
+
"type": "NameExpression",
|
|
878
|
+
"name": "Function"
|
|
879
|
+
},
|
|
880
|
+
"name": "func"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"title": "returns",
|
|
884
|
+
"description": null,
|
|
885
|
+
"type": {
|
|
886
|
+
"type": "NameExpression",
|
|
887
|
+
"name": "Operation"
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
]
|
|
891
|
+
},
|
|
892
|
+
"valid": true
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"name": "fnIf",
|
|
896
|
+
"params": [
|
|
897
|
+
"condition",
|
|
898
|
+
"operation"
|
|
899
|
+
],
|
|
900
|
+
"docs": {
|
|
901
|
+
"description": "A custom operation that will only execute the function if the condition returns true",
|
|
902
|
+
"tags": [
|
|
903
|
+
{
|
|
904
|
+
"title": "public",
|
|
905
|
+
"description": null,
|
|
906
|
+
"type": null
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
"title": "example",
|
|
910
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"title": "function",
|
|
914
|
+
"description": null,
|
|
915
|
+
"name": null
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
"title": "param",
|
|
919
|
+
"description": "The condition that returns true",
|
|
920
|
+
"type": {
|
|
921
|
+
"type": "NameExpression",
|
|
922
|
+
"name": "Boolean"
|
|
923
|
+
},
|
|
924
|
+
"name": "condition"
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
"title": "param",
|
|
928
|
+
"description": "The operation needed to be executed.",
|
|
929
|
+
"type": {
|
|
930
|
+
"type": "NameExpression",
|
|
931
|
+
"name": "Operation"
|
|
932
|
+
},
|
|
933
|
+
"name": "operation"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"title": "returns",
|
|
937
|
+
"description": null,
|
|
938
|
+
"type": {
|
|
939
|
+
"type": "NameExpression",
|
|
940
|
+
"name": "Operation"
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
]
|
|
944
|
+
},
|
|
945
|
+
"valid": true
|
|
946
|
+
},
|
|
851
947
|
{
|
|
852
948
|
"name": "sourceValue",
|
|
853
949
|
"params": [
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,8 @@ __export(src_exports, {
|
|
|
34
34
|
execute: () => execute,
|
|
35
35
|
field: () => import_language_common2.field,
|
|
36
36
|
fields: () => import_language_common2.fields,
|
|
37
|
+
fn: () => import_language_common2.fn,
|
|
38
|
+
fnIf: () => import_language_common2.fnIf,
|
|
37
39
|
getCase: () => getCase,
|
|
38
40
|
getContact: () => getContact,
|
|
39
41
|
getLocation: () => getLocation,
|
|
@@ -66,6 +68,8 @@ __export(Adaptor_exports, {
|
|
|
66
68
|
execute: () => execute,
|
|
67
69
|
field: () => import_language_common2.field,
|
|
68
70
|
fields: () => import_language_common2.fields,
|
|
71
|
+
fn: () => import_language_common2.fn,
|
|
72
|
+
fnIf: () => import_language_common2.fnIf,
|
|
69
73
|
getCase: () => getCase,
|
|
70
74
|
getContact: () => getContact,
|
|
71
75
|
getLocation: () => getLocation,
|
|
@@ -657,6 +661,8 @@ var src_default = Adaptor_exports;
|
|
|
657
661
|
execute,
|
|
658
662
|
field,
|
|
659
663
|
fields,
|
|
664
|
+
fn,
|
|
665
|
+
fnIf,
|
|
660
666
|
getCase,
|
|
661
667
|
getContact,
|
|
662
668
|
getLocation,
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,8 @@ __export(Adaptor_exports, {
|
|
|
15
15
|
execute: () => execute,
|
|
16
16
|
field: () => field,
|
|
17
17
|
fields: () => fields,
|
|
18
|
+
fn: () => fn,
|
|
19
|
+
fnIf: () => fnIf,
|
|
18
20
|
getCase: () => getCase,
|
|
19
21
|
getContact: () => getContact,
|
|
20
22
|
getLocation: () => getLocation,
|
|
@@ -41,6 +43,8 @@ import {
|
|
|
41
43
|
} from "@openfn/language-common";
|
|
42
44
|
import axios from "axios";
|
|
43
45
|
import {
|
|
46
|
+
fn,
|
|
47
|
+
fnIf,
|
|
44
48
|
alterState,
|
|
45
49
|
dataPath,
|
|
46
50
|
dataValue,
|
|
@@ -620,6 +624,8 @@ export {
|
|
|
620
624
|
execute,
|
|
621
625
|
field,
|
|
622
626
|
fields,
|
|
627
|
+
fn,
|
|
628
|
+
fnIf,
|
|
623
629
|
getCase,
|
|
624
630
|
getContact,
|
|
625
631
|
getLocation,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-godata",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "An OpenFn adaptor for use with the WHO's GoData API",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"axios": "^0.21.2",
|
|
16
|
-
"@openfn/language-common": "^1.
|
|
16
|
+
"@openfn/language-common": "^1.14.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"assertion-error": "^1.0.1",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"nock": "^12.0.3",
|
|
24
24
|
"sinon": "^1.17.2",
|
|
25
25
|
"esno": "^0.16.3",
|
|
26
|
-
"@openfn/buildtools": "^1.0.1",
|
|
27
26
|
"@openfn/simple-ast": "0.4.1",
|
|
28
27
|
"rimraf": "^3.0.2"
|
|
29
28
|
},
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -235,4 +235,4 @@ export function getReferenceData(query: object, callback: Function): Operation;
|
|
|
235
235
|
export function upsertReferenceData(externalId: string, goDataReferenceData: object, callback: Function): Operation;
|
|
236
236
|
export { axios };
|
|
237
237
|
import axios from "axios";
|
|
238
|
-
export { alterState, dataPath, dataValue, each, field, fields, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
|
238
|
+
export { fn, fnIf, alterState, dataPath, dataValue, each, field, fields, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|