@openfn/language-mogli 0.5.0 → 0.5.2
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 +73 -68
- package/package.json +3 -3
- package/types/sourceHelpers.d.ts +2 -0
package/ast.json
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"description": null,
|
|
16
16
|
"type": null
|
|
17
17
|
},
|
|
18
|
-
{
|
|
19
|
-
"title": "example",
|
|
20
|
-
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
21
|
-
},
|
|
22
18
|
{
|
|
23
19
|
"title": "function",
|
|
24
20
|
"description": null,
|
|
25
21
|
"name": null
|
|
26
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"title": "example",
|
|
25
|
+
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
26
|
+
},
|
|
27
27
|
{
|
|
28
28
|
"title": "param",
|
|
29
29
|
"description": "is the function",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"description": null,
|
|
60
60
|
"type": null
|
|
61
61
|
},
|
|
62
|
-
{
|
|
63
|
-
"title": "example",
|
|
64
|
-
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
65
|
-
},
|
|
66
62
|
{
|
|
67
63
|
"title": "function",
|
|
68
64
|
"description": null,
|
|
69
65
|
"name": null
|
|
70
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"title": "example",
|
|
69
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
70
|
+
},
|
|
71
71
|
{
|
|
72
72
|
"title": "param",
|
|
73
73
|
"description": "The condition that returns true",
|
|
@@ -111,15 +111,15 @@
|
|
|
111
111
|
"description": null,
|
|
112
112
|
"type": null
|
|
113
113
|
},
|
|
114
|
-
{
|
|
115
|
-
"title": "example",
|
|
116
|
-
"description": "sourceValue('$.key')"
|
|
117
|
-
},
|
|
118
114
|
{
|
|
119
115
|
"title": "function",
|
|
120
116
|
"description": null,
|
|
121
117
|
"name": null
|
|
122
118
|
},
|
|
119
|
+
{
|
|
120
|
+
"title": "example",
|
|
121
|
+
"description": "sourceValue('$.key')"
|
|
122
|
+
},
|
|
123
123
|
{
|
|
124
124
|
"title": "param",
|
|
125
125
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -154,15 +154,15 @@
|
|
|
154
154
|
"description": null,
|
|
155
155
|
"type": null
|
|
156
156
|
},
|
|
157
|
-
{
|
|
158
|
-
"title": "example",
|
|
159
|
-
"description": "source('$.key')"
|
|
160
|
-
},
|
|
161
157
|
{
|
|
162
158
|
"title": "function",
|
|
163
159
|
"description": null,
|
|
164
160
|
"name": null
|
|
165
161
|
},
|
|
162
|
+
{
|
|
163
|
+
"title": "example",
|
|
164
|
+
"description": "source('$.key')"
|
|
165
|
+
},
|
|
166
166
|
{
|
|
167
167
|
"title": "param",
|
|
168
168
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -215,15 +215,15 @@
|
|
|
215
215
|
"description": null,
|
|
216
216
|
"type": null
|
|
217
217
|
},
|
|
218
|
-
{
|
|
219
|
-
"title": "example",
|
|
220
|
-
"description": "dataPath('key')"
|
|
221
|
-
},
|
|
222
218
|
{
|
|
223
219
|
"title": "function",
|
|
224
220
|
"description": null,
|
|
225
221
|
"name": null
|
|
226
222
|
},
|
|
223
|
+
{
|
|
224
|
+
"title": "example",
|
|
225
|
+
"description": "dataPath('key')"
|
|
226
|
+
},
|
|
227
227
|
{
|
|
228
228
|
"title": "param",
|
|
229
229
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -258,15 +258,15 @@
|
|
|
258
258
|
"description": null,
|
|
259
259
|
"type": null
|
|
260
260
|
},
|
|
261
|
-
{
|
|
262
|
-
"title": "example",
|
|
263
|
-
"description": "dataValue('key')"
|
|
264
|
-
},
|
|
265
261
|
{
|
|
266
262
|
"title": "function",
|
|
267
263
|
"description": null,
|
|
268
264
|
"name": null
|
|
269
265
|
},
|
|
266
|
+
{
|
|
267
|
+
"title": "example",
|
|
268
|
+
"description": "dataValue('key')"
|
|
269
|
+
},
|
|
270
270
|
{
|
|
271
271
|
"title": "param",
|
|
272
272
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -301,15 +301,15 @@
|
|
|
301
301
|
"description": null,
|
|
302
302
|
"type": null
|
|
303
303
|
},
|
|
304
|
-
{
|
|
305
|
-
"title": "example",
|
|
306
|
-
"description": "referencePath('key')"
|
|
307
|
-
},
|
|
308
304
|
{
|
|
309
305
|
"title": "function",
|
|
310
306
|
"description": null,
|
|
311
307
|
"name": null
|
|
312
308
|
},
|
|
309
|
+
{
|
|
310
|
+
"title": "example",
|
|
311
|
+
"description": "referencePath('key')"
|
|
312
|
+
},
|
|
313
313
|
{
|
|
314
314
|
"title": "param",
|
|
315
315
|
"description": "JSONPath referencing a point in `references`.",
|
|
@@ -344,15 +344,15 @@
|
|
|
344
344
|
"description": null,
|
|
345
345
|
"type": null
|
|
346
346
|
},
|
|
347
|
-
{
|
|
348
|
-
"title": "example",
|
|
349
|
-
"description": "lastReferenceValue('key')"
|
|
350
|
-
},
|
|
351
347
|
{
|
|
352
348
|
"title": "function",
|
|
353
349
|
"description": null,
|
|
354
350
|
"name": null
|
|
355
351
|
},
|
|
352
|
+
{
|
|
353
|
+
"title": "example",
|
|
354
|
+
"description": "lastReferenceValue('key')"
|
|
355
|
+
},
|
|
356
356
|
{
|
|
357
357
|
"title": "param",
|
|
358
358
|
"description": "JSONPath referencing a point in `references`.",
|
|
@@ -388,15 +388,15 @@
|
|
|
388
388
|
"description": null,
|
|
389
389
|
"type": null
|
|
390
390
|
},
|
|
391
|
-
{
|
|
392
|
-
"title": "example",
|
|
393
|
-
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
394
|
-
},
|
|
395
391
|
{
|
|
396
392
|
"title": "function",
|
|
397
393
|
"description": null,
|
|
398
394
|
"name": null
|
|
399
395
|
},
|
|
396
|
+
{
|
|
397
|
+
"title": "example",
|
|
398
|
+
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
399
|
+
},
|
|
400
400
|
{
|
|
401
401
|
"title": "param",
|
|
402
402
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -440,15 +440,15 @@
|
|
|
440
440
|
"description": null,
|
|
441
441
|
"type": null
|
|
442
442
|
},
|
|
443
|
-
{
|
|
444
|
-
"title": "example",
|
|
445
|
-
"description": "combine(\n create('foo'),\n delete('bar')\n)"
|
|
446
|
-
},
|
|
447
443
|
{
|
|
448
444
|
"title": "function",
|
|
449
445
|
"description": null,
|
|
450
446
|
"name": null
|
|
451
447
|
},
|
|
448
|
+
{
|
|
449
|
+
"title": "example",
|
|
450
|
+
"description": "combine(\n create('foo'),\n delete('bar')\n)"
|
|
451
|
+
},
|
|
452
452
|
{
|
|
453
453
|
"title": "param",
|
|
454
454
|
"description": "Operations to be performed.",
|
|
@@ -485,15 +485,15 @@
|
|
|
485
485
|
"description": null,
|
|
486
486
|
"type": null
|
|
487
487
|
},
|
|
488
|
-
{
|
|
489
|
-
"title": "example",
|
|
490
|
-
"description": "join('$.key','$.data','newKey')"
|
|
491
|
-
},
|
|
492
488
|
{
|
|
493
489
|
"title": "function",
|
|
494
490
|
"description": null,
|
|
495
491
|
"name": null
|
|
496
492
|
},
|
|
493
|
+
{
|
|
494
|
+
"title": "example",
|
|
495
|
+
"description": "join('$.key','$.data','newKey')"
|
|
496
|
+
},
|
|
497
497
|
{
|
|
498
498
|
"title": "param",
|
|
499
499
|
"description": "Target path",
|
|
@@ -547,15 +547,15 @@
|
|
|
547
547
|
"description": null,
|
|
548
548
|
"type": null
|
|
549
549
|
},
|
|
550
|
-
{
|
|
551
|
-
"title": "example",
|
|
552
|
-
"description": "field('destination_field_name__c', 'value')"
|
|
553
|
-
},
|
|
554
550
|
{
|
|
555
551
|
"title": "function",
|
|
556
552
|
"description": null,
|
|
557
553
|
"name": null
|
|
558
554
|
},
|
|
555
|
+
{
|
|
556
|
+
"title": "example",
|
|
557
|
+
"description": "field('destination_field_name__c', 'value')"
|
|
558
|
+
},
|
|
559
559
|
{
|
|
560
560
|
"title": "param",
|
|
561
561
|
"description": "Name of the field",
|
|
@@ -599,15 +599,15 @@
|
|
|
599
599
|
"description": null,
|
|
600
600
|
"type": null
|
|
601
601
|
},
|
|
602
|
-
{
|
|
603
|
-
"title": "example",
|
|
604
|
-
"description": "fields(list_of_fields)"
|
|
605
|
-
},
|
|
606
602
|
{
|
|
607
603
|
"title": "function",
|
|
608
604
|
"description": null,
|
|
609
605
|
"name": null
|
|
610
606
|
},
|
|
607
|
+
{
|
|
608
|
+
"title": "example",
|
|
609
|
+
"description": "fields(list_of_fields)"
|
|
610
|
+
},
|
|
611
611
|
{
|
|
612
612
|
"title": "param",
|
|
613
613
|
"description": "a list of fields",
|
|
@@ -652,6 +652,11 @@
|
|
|
652
652
|
"description": null,
|
|
653
653
|
"name": null
|
|
654
654
|
},
|
|
655
|
+
{
|
|
656
|
+
"title": "public",
|
|
657
|
+
"description": null,
|
|
658
|
+
"type": null
|
|
659
|
+
},
|
|
655
660
|
{
|
|
656
661
|
"title": "param",
|
|
657
662
|
"description": null,
|
|
@@ -693,15 +698,15 @@
|
|
|
693
698
|
"description": null,
|
|
694
699
|
"type": null
|
|
695
700
|
},
|
|
696
|
-
{
|
|
697
|
-
"title": "example",
|
|
698
|
-
"description": "index()"
|
|
699
|
-
},
|
|
700
701
|
{
|
|
701
702
|
"title": "function",
|
|
702
703
|
"description": null,
|
|
703
704
|
"name": null
|
|
704
705
|
},
|
|
706
|
+
{
|
|
707
|
+
"title": "example",
|
|
708
|
+
"description": "index()"
|
|
709
|
+
},
|
|
705
710
|
{
|
|
706
711
|
"title": "returns",
|
|
707
712
|
"description": null,
|
|
@@ -728,15 +733,15 @@
|
|
|
728
733
|
"description": null,
|
|
729
734
|
"type": null
|
|
730
735
|
},
|
|
731
|
-
{
|
|
732
|
-
"title": "example",
|
|
733
|
-
"description": "field(\"destination_string__c\", function(state) {\n return arrayToString(dataValue(\"path_of_array\")(state), ', ')\n})"
|
|
734
|
-
},
|
|
735
736
|
{
|
|
736
737
|
"title": "function",
|
|
737
738
|
"description": null,
|
|
738
739
|
"name": null
|
|
739
740
|
},
|
|
741
|
+
{
|
|
742
|
+
"title": "example",
|
|
743
|
+
"description": "field(\"destination_string__c\", function(state) {\n return arrayToString(dataValue(\"path_of_array\")(state), ', ')\n})"
|
|
744
|
+
},
|
|
740
745
|
{
|
|
741
746
|
"title": "param",
|
|
742
747
|
"description": "Array of toString'able primatives.",
|
|
@@ -780,15 +785,15 @@
|
|
|
780
785
|
"description": null,
|
|
781
786
|
"type": null
|
|
782
787
|
},
|
|
783
|
-
{
|
|
784
|
-
"title": "example",
|
|
785
|
-
"description": "each(function(state) {\n return toArray( dataValue(\"path_of_array\")(state) )\n}, ...)"
|
|
786
|
-
},
|
|
787
788
|
{
|
|
788
789
|
"title": "function",
|
|
789
790
|
"description": null,
|
|
790
791
|
"name": null
|
|
791
792
|
},
|
|
793
|
+
{
|
|
794
|
+
"title": "example",
|
|
795
|
+
"description": "each(function(state) {\n return toArray( dataValue(\"path_of_array\")(state) )\n}, ...)"
|
|
796
|
+
},
|
|
792
797
|
{
|
|
793
798
|
"title": "param",
|
|
794
799
|
"description": "Data required to be in an array",
|
|
@@ -825,15 +830,15 @@
|
|
|
825
830
|
"description": null,
|
|
826
831
|
"type": null
|
|
827
832
|
},
|
|
828
|
-
{
|
|
829
|
-
"title": "example",
|
|
830
|
-
"description": "map(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
831
|
-
},
|
|
832
833
|
{
|
|
833
834
|
"title": "function",
|
|
834
835
|
"description": null,
|
|
835
836
|
"name": null
|
|
836
837
|
},
|
|
838
|
+
{
|
|
839
|
+
"title": "example",
|
|
840
|
+
"description": "map(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
841
|
+
},
|
|
837
842
|
{
|
|
838
843
|
"title": "param",
|
|
839
844
|
"description": "JSONPath referencing a point in `state.data`.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-mogli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "A Mogli SMS Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.14.0",
|
|
16
15
|
"JSONPath": "^0.10.0",
|
|
17
16
|
"jsforce": "1.5.1",
|
|
18
17
|
"lodash-fp": "^0.10.4",
|
|
19
18
|
"mustache": "^2.3.2",
|
|
20
19
|
"request": "^2.88.2",
|
|
21
|
-
"yargs": "^3.32.0"
|
|
20
|
+
"yargs": "^3.32.0",
|
|
21
|
+
"@openfn/language-common": "2.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@openfn/simple-ast": "0.4.1",
|
package/types/sourceHelpers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @example <caption>Example</caption>
|
|
4
4
|
* lookup("relationship_name__r", "externalID on related object", "$.path")
|
|
5
5
|
* @function
|
|
6
|
+
* @public
|
|
6
7
|
* @param {string} relationshipName - `__r` relationship field on the record.
|
|
7
8
|
* @param {string} externalID - Salesforce ExternalID field.
|
|
8
9
|
* @param {string} path - JSONPath to data source.
|
|
@@ -16,6 +17,7 @@ export function lookup(relationshipName: string, externalId: any, path: string):
|
|
|
16
17
|
* @example <caption>Fixed Value</caption>
|
|
17
18
|
* relationship("relationship_name__r", "externalID on related object", "hello world")
|
|
18
19
|
* @function
|
|
20
|
+
* @public
|
|
19
21
|
* @param {string} relationshipName - `__r` relationship field on the record.
|
|
20
22
|
* @param {string} externalID - Salesforce ExternalID field.
|
|
21
23
|
* @param {string} dataSource - resolvable source.
|