@openfn/language-mongodb 2.0.2 → 2.1.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 +53 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +2 -2
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -45,6 +45,59 @@
|
|
|
45
45
|
},
|
|
46
46
|
"valid": true
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"name": "fnIf",
|
|
50
|
+
"params": [
|
|
51
|
+
"condition",
|
|
52
|
+
"operation"
|
|
53
|
+
],
|
|
54
|
+
"docs": {
|
|
55
|
+
"description": "A custom operation that will only execute the function if the condition returns true",
|
|
56
|
+
"tags": [
|
|
57
|
+
{
|
|
58
|
+
"title": "public",
|
|
59
|
+
"description": null,
|
|
60
|
+
"type": null
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"title": "example",
|
|
64
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"title": "function",
|
|
68
|
+
"description": null,
|
|
69
|
+
"name": null
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"title": "param",
|
|
73
|
+
"description": "The condition that returns true",
|
|
74
|
+
"type": {
|
|
75
|
+
"type": "NameExpression",
|
|
76
|
+
"name": "Boolean"
|
|
77
|
+
},
|
|
78
|
+
"name": "condition"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"title": "param",
|
|
82
|
+
"description": "The operation needed to be executed.",
|
|
83
|
+
"type": {
|
|
84
|
+
"type": "NameExpression",
|
|
85
|
+
"name": "Operation"
|
|
86
|
+
},
|
|
87
|
+
"name": "operation"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"title": "returns",
|
|
91
|
+
"description": null,
|
|
92
|
+
"type": {
|
|
93
|
+
"type": "NameExpression",
|
|
94
|
+
"name": "Operation"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"valid": true
|
|
100
|
+
},
|
|
48
101
|
{
|
|
49
102
|
"name": "sourceValue",
|
|
50
103
|
"params": [
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
fields: () => import_language_common2.fields,
|
|
36
36
|
findDocuments: () => findDocuments,
|
|
37
37
|
fn: () => import_language_common2.fn,
|
|
38
|
+
fnIf: () => import_language_common2.fnIf,
|
|
38
39
|
insertDocuments: () => insertDocuments,
|
|
39
40
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
40
41
|
merge: () => import_language_common2.merge,
|
|
@@ -55,6 +56,7 @@ __export(Adaptor_exports, {
|
|
|
55
56
|
fields: () => import_language_common2.fields,
|
|
56
57
|
findDocuments: () => findDocuments,
|
|
57
58
|
fn: () => import_language_common2.fn,
|
|
59
|
+
fnIf: () => import_language_common2.fnIf,
|
|
58
60
|
insertDocuments: () => insertDocuments,
|
|
59
61
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
60
62
|
merge: () => import_language_common2.merge,
|
|
@@ -211,6 +213,7 @@ var src_default = Adaptor_exports;
|
|
|
211
213
|
fields,
|
|
212
214
|
findDocuments,
|
|
213
215
|
fn,
|
|
216
|
+
fnIf,
|
|
214
217
|
insertDocuments,
|
|
215
218
|
lastReferenceValue,
|
|
216
219
|
merge,
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __export(Adaptor_exports, {
|
|
|
16
16
|
fields: () => fields,
|
|
17
17
|
findDocuments: () => findDocuments,
|
|
18
18
|
fn: () => fn,
|
|
19
|
+
fnIf: () => fnIf,
|
|
19
20
|
insertDocuments: () => insertDocuments,
|
|
20
21
|
lastReferenceValue: () => lastReferenceValue,
|
|
21
22
|
merge: () => merge,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
fields,
|
|
34
35
|
sourceValue,
|
|
35
36
|
fn,
|
|
37
|
+
fnIf,
|
|
36
38
|
alterState,
|
|
37
39
|
each,
|
|
38
40
|
merge,
|
|
@@ -187,6 +189,7 @@ export {
|
|
|
187
189
|
fields,
|
|
188
190
|
findDocuments,
|
|
189
191
|
fn,
|
|
192
|
+
fnIf,
|
|
190
193
|
insertDocuments,
|
|
191
194
|
lastReferenceValue,
|
|
192
195
|
merge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-mongodb",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A language package for working with MongoDb",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.
|
|
15
|
+
"@openfn/language-common": "^1.14.0",
|
|
16
16
|
"mongodb": "^3.7.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -52,4 +52,4 @@ export function findDocuments(params: object): State;
|
|
|
52
52
|
* @returns {State}
|
|
53
53
|
*/
|
|
54
54
|
export function updateDocument(params: object): State;
|
|
55
|
-
export { field, fields, sourceValue, fn, alterState, each, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
|
55
|
+
export { field, fields, sourceValue, fn, fnIf, alterState, each, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|