@openfn/language-mongodb 2.1.0 → 2.1.1

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 CHANGED
@@ -1,5 +1,135 @@
1
1
  {
2
- "operations": [],
2
+ "operations": [
3
+ {
4
+ "name": "insertDocuments",
5
+ "params": [
6
+ "params"
7
+ ],
8
+ "docs": {
9
+ "description": "Inserts documents into a mongoDb collection",
10
+ "tags": [
11
+ {
12
+ "title": "example",
13
+ "description": "insertDocuments({\n database: 'str',\n collection: 'kids',\n documents: [1,2,3]\n });"
14
+ },
15
+ {
16
+ "title": "function",
17
+ "description": null,
18
+ "name": null
19
+ },
20
+ {
21
+ "title": "public",
22
+ "description": null,
23
+ "type": null
24
+ },
25
+ {
26
+ "title": "param",
27
+ "description": "Configuration for mongo",
28
+ "type": {
29
+ "type": "NameExpression",
30
+ "name": "object"
31
+ },
32
+ "name": "params"
33
+ },
34
+ {
35
+ "title": "returns",
36
+ "description": null,
37
+ "type": {
38
+ "type": "NameExpression",
39
+ "name": "State"
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "valid": true
45
+ },
46
+ {
47
+ "name": "findDocuments",
48
+ "params": [
49
+ "params"
50
+ ],
51
+ "docs": {
52
+ "description": "Find documents in a mongoDb collection",
53
+ "tags": [
54
+ {
55
+ "title": "example",
56
+ "description": "findDocuments({\n database: 'str',\n collection: 'cases',\n query: {a:3}\n });"
57
+ },
58
+ {
59
+ "title": "function",
60
+ "description": null,
61
+ "name": null
62
+ },
63
+ {
64
+ "title": "public",
65
+ "description": null,
66
+ "type": null
67
+ },
68
+ {
69
+ "title": "param",
70
+ "description": "Configuration for mongo",
71
+ "type": {
72
+ "type": "NameExpression",
73
+ "name": "object"
74
+ },
75
+ "name": "params"
76
+ },
77
+ {
78
+ "title": "returns",
79
+ "description": null,
80
+ "type": {
81
+ "type": "NameExpression",
82
+ "name": "State"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ "valid": true
88
+ },
89
+ {
90
+ "name": "updateDocument",
91
+ "params": [
92
+ "params"
93
+ ],
94
+ "docs": {
95
+ "description": "Updates document (optionally upserting) into a mongoDb collection",
96
+ "tags": [
97
+ {
98
+ "title": "example",
99
+ "description": "updateDocuments({\n database: 'str',\n collection: 'animals',\n filter: { type: 'fuzzy' },\n changes: { kind: 'soft' },\n options: { upsert: true }\n });"
100
+ },
101
+ {
102
+ "title": "function",
103
+ "description": null,
104
+ "name": null
105
+ },
106
+ {
107
+ "title": "public",
108
+ "description": null,
109
+ "type": null
110
+ },
111
+ {
112
+ "title": "param",
113
+ "description": "Configuration for mongo",
114
+ "type": {
115
+ "type": "NameExpression",
116
+ "name": "object"
117
+ },
118
+ "name": "params"
119
+ },
120
+ {
121
+ "title": "returns",
122
+ "description": null,
123
+ "type": {
124
+ "type": "NameExpression",
125
+ "name": "State"
126
+ }
127
+ }
128
+ ]
129
+ },
130
+ "valid": true
131
+ }
132
+ ],
3
133
  "exports": [],
4
134
  "common": [
5
135
  {
@@ -15,15 +145,15 @@
15
145
  "description": null,
16
146
  "type": null
17
147
  },
18
- {
19
- "title": "example",
20
- "description": "fn(state => {\n // do some things to state\n return state;\n});"
21
- },
22
148
  {
23
149
  "title": "function",
24
150
  "description": null,
25
151
  "name": null
26
152
  },
153
+ {
154
+ "title": "example",
155
+ "description": "fn(state => {\n // do some things to state\n return state;\n});"
156
+ },
27
157
  {
28
158
  "title": "param",
29
159
  "description": "is the function",
@@ -59,15 +189,15 @@
59
189
  "description": null,
60
190
  "type": null
61
191
  },
62
- {
63
- "title": "example",
64
- "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
65
- },
66
192
  {
67
193
  "title": "function",
68
194
  "description": null,
69
195
  "name": null
70
196
  },
197
+ {
198
+ "title": "example",
199
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
200
+ },
71
201
  {
72
202
  "title": "param",
73
203
  "description": "The condition that returns true",
@@ -111,15 +241,15 @@
111
241
  "description": null,
112
242
  "type": null
113
243
  },
114
- {
115
- "title": "example",
116
- "description": "sourceValue('$.key')"
117
- },
118
244
  {
119
245
  "title": "function",
120
246
  "description": null,
121
247
  "name": null
122
248
  },
249
+ {
250
+ "title": "example",
251
+ "description": "sourceValue('$.key')"
252
+ },
123
253
  {
124
254
  "title": "param",
125
255
  "description": "JSONPath referencing a point in `state`.",
@@ -154,15 +284,15 @@
154
284
  "description": null,
155
285
  "type": null
156
286
  },
157
- {
158
- "title": "example",
159
- "description": "dataPath('key')"
160
- },
161
287
  {
162
288
  "title": "function",
163
289
  "description": null,
164
290
  "name": null
165
291
  },
292
+ {
293
+ "title": "example",
294
+ "description": "dataPath('key')"
295
+ },
166
296
  {
167
297
  "title": "param",
168
298
  "description": "JSONPath referencing a point in `data`.",
@@ -197,15 +327,15 @@
197
327
  "description": null,
198
328
  "type": null
199
329
  },
200
- {
201
- "title": "example",
202
- "description": "dataValue('key')"
203
- },
204
330
  {
205
331
  "title": "function",
206
332
  "description": null,
207
333
  "name": null
208
334
  },
335
+ {
336
+ "title": "example",
337
+ "description": "dataValue('key')"
338
+ },
209
339
  {
210
340
  "title": "param",
211
341
  "description": "JSONPath referencing a point in `data`.",
@@ -240,15 +370,15 @@
240
370
  "description": null,
241
371
  "type": null
242
372
  },
243
- {
244
- "title": "example",
245
- "description": "lastReferenceValue('key')"
246
- },
247
373
  {
248
374
  "title": "function",
249
375
  "description": null,
250
376
  "name": null
251
377
  },
378
+ {
379
+ "title": "example",
380
+ "description": "lastReferenceValue('key')"
381
+ },
252
382
  {
253
383
  "title": "param",
254
384
  "description": "JSONPath referencing a point in `references`.",
@@ -284,15 +414,15 @@
284
414
  "description": null,
285
415
  "type": null
286
416
  },
287
- {
288
- "title": "example",
289
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
290
- },
291
417
  {
292
418
  "title": "function",
293
419
  "description": null,
294
420
  "name": null
295
421
  },
422
+ {
423
+ "title": "example",
424
+ "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
425
+ },
296
426
  {
297
427
  "title": "param",
298
428
  "description": "JSONPath referencing a point in `state`.",
@@ -337,15 +467,15 @@
337
467
  "description": null,
338
468
  "type": null
339
469
  },
340
- {
341
- "title": "example",
342
- "description": "field('destination_field_name__c', 'value')"
343
- },
344
470
  {
345
471
  "title": "function",
346
472
  "description": null,
347
473
  "name": null
348
474
  },
475
+ {
476
+ "title": "example",
477
+ "description": "field('destination_field_name__c', 'value')"
478
+ },
349
479
  {
350
480
  "title": "param",
351
481
  "description": "Name of the field",
@@ -389,15 +519,15 @@
389
519
  "description": null,
390
520
  "type": null
391
521
  },
392
- {
393
- "title": "example",
394
- "description": "fields(list_of_fields)"
395
- },
396
522
  {
397
523
  "title": "function",
398
524
  "description": null,
399
525
  "name": null
400
526
  },
527
+ {
528
+ "title": "example",
529
+ "description": "fields(list_of_fields)"
530
+ },
401
531
  {
402
532
  "title": "param",
403
533
  "description": "a list of fields",
@@ -442,6 +572,11 @@
442
572
  "description": null,
443
573
  "name": null
444
574
  },
575
+ {
576
+ "title": "public",
577
+ "description": null,
578
+ "type": null
579
+ },
445
580
  {
446
581
  "title": "param",
447
582
  "description": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-mongodb",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
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.14.0",
15
+ "@openfn/language-common": "^1.15.1",
16
16
  "mongodb": "^3.7.3"
17
17
  },
18
18
  "devDependencies": {
@@ -20,6 +20,7 @@ export function execute(...operations: Operations): Operation;
20
20
  * documents: [1,2,3]
21
21
  * });
22
22
  * @function
23
+ * @public
23
24
  * @param {object} params - Configuration for mongo
24
25
  * @returns {State}
25
26
  */
@@ -33,6 +34,7 @@ export function insertDocuments(params: object): State;
33
34
  * query: {a:3}
34
35
  * });
35
36
  * @function
37
+ * @public
36
38
  * @param {object} params - Configuration for mongo
37
39
  * @returns {State}
38
40
  */
@@ -48,6 +50,7 @@ export function findDocuments(params: object): State;
48
50
  * options: { upsert: true }
49
51
  * });
50
52
  * @function
53
+ * @public
51
54
  * @param {object} params - Configuration for mongo
52
55
  * @returns {State}
53
56
  */