@openfn/language-msgraph 0.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/LICENSE +674 -0
- package/LICENSE.LESSER +165 -0
- package/README.md +26 -0
- package/ast.json +550 -0
- package/configuration-schema.json +38 -0
- package/dist/index.cjs +185 -0
- package/dist/index.js +166 -0
- package/package.json +49 -0
- package/types/Adaptor.d.ts +39 -0
- package/types/Utils.d.ts +9 -0
- package/types/index.d.ts +3 -0
package/ast.json
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
{
|
|
2
|
+
"operations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "create",
|
|
5
|
+
"params": [
|
|
6
|
+
"resource",
|
|
7
|
+
"data",
|
|
8
|
+
"callback"
|
|
9
|
+
],
|
|
10
|
+
"docs": {
|
|
11
|
+
"description": "Create some resource in msgraph",
|
|
12
|
+
"tags": [
|
|
13
|
+
{
|
|
14
|
+
"title": "public",
|
|
15
|
+
"description": null,
|
|
16
|
+
"type": null
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"title": "example",
|
|
20
|
+
"description": "create(\"applications\", {\"displayName\": \"My App\"})"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"title": "function",
|
|
24
|
+
"description": null,
|
|
25
|
+
"name": null
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"title": "param",
|
|
29
|
+
"description": "The type of entity that will be created",
|
|
30
|
+
"type": {
|
|
31
|
+
"type": "NameExpression",
|
|
32
|
+
"name": "string"
|
|
33
|
+
},
|
|
34
|
+
"name": "resource"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"title": "param",
|
|
38
|
+
"description": "The data to create the new resource",
|
|
39
|
+
"type": {
|
|
40
|
+
"type": "NameExpression",
|
|
41
|
+
"name": "object"
|
|
42
|
+
},
|
|
43
|
+
"name": "data"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"title": "param",
|
|
47
|
+
"description": "An optional callback function",
|
|
48
|
+
"type": {
|
|
49
|
+
"type": "NameExpression",
|
|
50
|
+
"name": "function"
|
|
51
|
+
},
|
|
52
|
+
"name": "callback"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"title": "returns",
|
|
56
|
+
"description": null,
|
|
57
|
+
"type": {
|
|
58
|
+
"type": "NameExpression",
|
|
59
|
+
"name": "Operation"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"valid": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "get",
|
|
68
|
+
"params": [
|
|
69
|
+
"path",
|
|
70
|
+
"query",
|
|
71
|
+
"callback"
|
|
72
|
+
],
|
|
73
|
+
"docs": {
|
|
74
|
+
"description": "Make a GET request to msgraph resource",
|
|
75
|
+
"tags": [
|
|
76
|
+
{
|
|
77
|
+
"title": "public",
|
|
78
|
+
"description": null,
|
|
79
|
+
"type": null
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"title": "example",
|
|
83
|
+
"description": "get('sites/root/lists')"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"title": "function",
|
|
87
|
+
"description": null,
|
|
88
|
+
"name": null
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "param",
|
|
92
|
+
"description": "Path to resource",
|
|
93
|
+
"type": {
|
|
94
|
+
"type": "NameExpression",
|
|
95
|
+
"name": "string"
|
|
96
|
+
},
|
|
97
|
+
"name": "path"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"title": "param",
|
|
101
|
+
"description": "Query, Headers and Authentication parameters",
|
|
102
|
+
"type": {
|
|
103
|
+
"type": "NameExpression",
|
|
104
|
+
"name": "object"
|
|
105
|
+
},
|
|
106
|
+
"name": "query"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"title": "param",
|
|
110
|
+
"description": "(Optional) Callback function",
|
|
111
|
+
"type": {
|
|
112
|
+
"type": "NameExpression",
|
|
113
|
+
"name": "function"
|
|
114
|
+
},
|
|
115
|
+
"name": "callback"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"title": "returns",
|
|
119
|
+
"description": null,
|
|
120
|
+
"type": {
|
|
121
|
+
"type": "NameExpression",
|
|
122
|
+
"name": "Operation"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"valid": true
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"exports": [],
|
|
131
|
+
"common": [
|
|
132
|
+
{
|
|
133
|
+
"name": "fn",
|
|
134
|
+
"params": [
|
|
135
|
+
"func"
|
|
136
|
+
],
|
|
137
|
+
"docs": {
|
|
138
|
+
"description": "Creates a custom step (or operation) for more flexible job writing.",
|
|
139
|
+
"tags": [
|
|
140
|
+
{
|
|
141
|
+
"title": "public",
|
|
142
|
+
"description": null,
|
|
143
|
+
"type": null
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"title": "example",
|
|
147
|
+
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"title": "function",
|
|
151
|
+
"description": null,
|
|
152
|
+
"name": null
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"title": "param",
|
|
156
|
+
"description": "is the function",
|
|
157
|
+
"type": {
|
|
158
|
+
"type": "NameExpression",
|
|
159
|
+
"name": "Function"
|
|
160
|
+
},
|
|
161
|
+
"name": "func"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"title": "returns",
|
|
165
|
+
"description": null,
|
|
166
|
+
"type": {
|
|
167
|
+
"type": "NameExpression",
|
|
168
|
+
"name": "Operation"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
"valid": true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "sourceValue",
|
|
177
|
+
"params": [
|
|
178
|
+
"path"
|
|
179
|
+
],
|
|
180
|
+
"docs": {
|
|
181
|
+
"description": "Picks out a single value from source data.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
|
|
182
|
+
"tags": [
|
|
183
|
+
{
|
|
184
|
+
"title": "public",
|
|
185
|
+
"description": null,
|
|
186
|
+
"type": null
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"title": "example",
|
|
190
|
+
"description": "sourceValue('$.key')"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"title": "function",
|
|
194
|
+
"description": null,
|
|
195
|
+
"name": null
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"title": "param",
|
|
199
|
+
"description": "JSONPath referencing a point in `state`.",
|
|
200
|
+
"type": {
|
|
201
|
+
"type": "NameExpression",
|
|
202
|
+
"name": "String"
|
|
203
|
+
},
|
|
204
|
+
"name": "path"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"title": "returns",
|
|
208
|
+
"description": null,
|
|
209
|
+
"type": {
|
|
210
|
+
"type": "NameExpression",
|
|
211
|
+
"name": "Operation"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"valid": true
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "dataPath",
|
|
220
|
+
"params": [
|
|
221
|
+
"path"
|
|
222
|
+
],
|
|
223
|
+
"docs": {
|
|
224
|
+
"description": "Ensures a path points at the data.",
|
|
225
|
+
"tags": [
|
|
226
|
+
{
|
|
227
|
+
"title": "public",
|
|
228
|
+
"description": null,
|
|
229
|
+
"type": null
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"title": "example",
|
|
233
|
+
"description": "dataPath('key')"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"title": "function",
|
|
237
|
+
"description": null,
|
|
238
|
+
"name": null
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"title": "param",
|
|
242
|
+
"description": "JSONPath referencing a point in `data`.",
|
|
243
|
+
"type": {
|
|
244
|
+
"type": "NameExpression",
|
|
245
|
+
"name": "string"
|
|
246
|
+
},
|
|
247
|
+
"name": "path"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"title": "returns",
|
|
251
|
+
"description": null,
|
|
252
|
+
"type": {
|
|
253
|
+
"type": "NameExpression",
|
|
254
|
+
"name": "string"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"valid": true
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "dataValue",
|
|
263
|
+
"params": [
|
|
264
|
+
"path"
|
|
265
|
+
],
|
|
266
|
+
"docs": {
|
|
267
|
+
"description": "Picks out a single value from the source data object—usually `state.data`.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
|
|
268
|
+
"tags": [
|
|
269
|
+
{
|
|
270
|
+
"title": "public",
|
|
271
|
+
"description": null,
|
|
272
|
+
"type": null
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"title": "example",
|
|
276
|
+
"description": "dataValue('key')"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"title": "function",
|
|
280
|
+
"description": null,
|
|
281
|
+
"name": null
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"title": "param",
|
|
285
|
+
"description": "JSONPath referencing a point in `data`.",
|
|
286
|
+
"type": {
|
|
287
|
+
"type": "NameExpression",
|
|
288
|
+
"name": "String"
|
|
289
|
+
},
|
|
290
|
+
"name": "path"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"title": "returns",
|
|
294
|
+
"description": null,
|
|
295
|
+
"type": {
|
|
296
|
+
"type": "NameExpression",
|
|
297
|
+
"name": "Operation"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
"valid": true
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "lastReferenceValue",
|
|
306
|
+
"params": [
|
|
307
|
+
"path"
|
|
308
|
+
],
|
|
309
|
+
"docs": {
|
|
310
|
+
"description": "Picks out the last reference value from source data.",
|
|
311
|
+
"tags": [
|
|
312
|
+
{
|
|
313
|
+
"title": "public",
|
|
314
|
+
"description": null,
|
|
315
|
+
"type": null
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"title": "example",
|
|
319
|
+
"description": "lastReferenceValue('key')"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"title": "function",
|
|
323
|
+
"description": null,
|
|
324
|
+
"name": null
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"title": "param",
|
|
328
|
+
"description": "JSONPath referencing a point in `references`.",
|
|
329
|
+
"type": {
|
|
330
|
+
"type": "NameExpression",
|
|
331
|
+
"name": "String"
|
|
332
|
+
},
|
|
333
|
+
"name": "path"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"title": "returns",
|
|
337
|
+
"description": null,
|
|
338
|
+
"type": {
|
|
339
|
+
"type": "NameExpression",
|
|
340
|
+
"name": "Operation"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
"valid": true
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "each",
|
|
349
|
+
"params": [
|
|
350
|
+
"dataSource",
|
|
351
|
+
"operation"
|
|
352
|
+
],
|
|
353
|
+
"docs": {
|
|
354
|
+
"description": "Scopes an array of data based on a JSONPath.\nUseful when the source data has `n` items you would like to map to\nan operation.\nThe operation will receive a slice of the data based of each item\nof the JSONPath provided.\n\nIt also ensures the results of an operation make their way back into\nthe state's references.",
|
|
355
|
+
"tags": [
|
|
356
|
+
{
|
|
357
|
+
"title": "public",
|
|
358
|
+
"description": null,
|
|
359
|
+
"type": null
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"title": "example",
|
|
363
|
+
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"title": "function",
|
|
367
|
+
"description": null,
|
|
368
|
+
"name": null
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"title": "param",
|
|
372
|
+
"description": "JSONPath referencing a point in `state`.",
|
|
373
|
+
"type": {
|
|
374
|
+
"type": "NameExpression",
|
|
375
|
+
"name": "DataSource"
|
|
376
|
+
},
|
|
377
|
+
"name": "dataSource"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"title": "param",
|
|
381
|
+
"description": "The operation needed to be repeated.",
|
|
382
|
+
"type": {
|
|
383
|
+
"type": "NameExpression",
|
|
384
|
+
"name": "Operation"
|
|
385
|
+
},
|
|
386
|
+
"name": "operation"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"title": "returns",
|
|
390
|
+
"description": null,
|
|
391
|
+
"type": {
|
|
392
|
+
"type": "NameExpression",
|
|
393
|
+
"name": "Operation"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
"valid": true
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "field",
|
|
402
|
+
"params": [
|
|
403
|
+
"key",
|
|
404
|
+
"value"
|
|
405
|
+
],
|
|
406
|
+
"docs": {
|
|
407
|
+
"description": "Returns a key, value pair in an array.",
|
|
408
|
+
"tags": [
|
|
409
|
+
{
|
|
410
|
+
"title": "public",
|
|
411
|
+
"description": null,
|
|
412
|
+
"type": null
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"title": "example",
|
|
416
|
+
"description": "field('destination_field_name__c', 'value')"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"title": "function",
|
|
420
|
+
"description": null,
|
|
421
|
+
"name": null
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"title": "param",
|
|
425
|
+
"description": "Name of the field",
|
|
426
|
+
"type": {
|
|
427
|
+
"type": "NameExpression",
|
|
428
|
+
"name": "string"
|
|
429
|
+
},
|
|
430
|
+
"name": "key"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"title": "param",
|
|
434
|
+
"description": "The value itself or a sourceable operation.",
|
|
435
|
+
"type": {
|
|
436
|
+
"type": "NameExpression",
|
|
437
|
+
"name": "Value"
|
|
438
|
+
},
|
|
439
|
+
"name": "value"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"title": "returns",
|
|
443
|
+
"description": null,
|
|
444
|
+
"type": {
|
|
445
|
+
"type": "NameExpression",
|
|
446
|
+
"name": "Field"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
]
|
|
450
|
+
},
|
|
451
|
+
"valid": true
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "fields",
|
|
455
|
+
"params": [
|
|
456
|
+
"fields"
|
|
457
|
+
],
|
|
458
|
+
"docs": {
|
|
459
|
+
"description": "Zips key value pairs into an object.",
|
|
460
|
+
"tags": [
|
|
461
|
+
{
|
|
462
|
+
"title": "public",
|
|
463
|
+
"description": null,
|
|
464
|
+
"type": null
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"title": "example",
|
|
468
|
+
"description": "fields(list_of_fields)"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"title": "function",
|
|
472
|
+
"description": null,
|
|
473
|
+
"name": null
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"title": "param",
|
|
477
|
+
"description": "a list of fields",
|
|
478
|
+
"type": {
|
|
479
|
+
"type": "NameExpression",
|
|
480
|
+
"name": "Fields"
|
|
481
|
+
},
|
|
482
|
+
"name": "fields"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"title": "returns",
|
|
486
|
+
"description": null,
|
|
487
|
+
"type": {
|
|
488
|
+
"type": "NameExpression",
|
|
489
|
+
"name": "Object"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
]
|
|
493
|
+
},
|
|
494
|
+
"valid": true
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"name": "merge",
|
|
498
|
+
"params": [
|
|
499
|
+
"dataSource",
|
|
500
|
+
"fields"
|
|
501
|
+
],
|
|
502
|
+
"docs": {
|
|
503
|
+
"description": "Merges fields into each item in an array.",
|
|
504
|
+
"tags": [
|
|
505
|
+
{
|
|
506
|
+
"title": "public",
|
|
507
|
+
"description": null,
|
|
508
|
+
"type": null
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"title": "example",
|
|
512
|
+
"description": "merge(\n \"$.books[*]\",\n fields(\n field( \"publisher\", sourceValue(\"$.publisher\") )\n )\n)"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"title": "function",
|
|
516
|
+
"description": null,
|
|
517
|
+
"name": null
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"title": "param",
|
|
521
|
+
"description": null,
|
|
522
|
+
"type": {
|
|
523
|
+
"type": "NameExpression",
|
|
524
|
+
"name": "DataSource"
|
|
525
|
+
},
|
|
526
|
+
"name": "dataSource"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"title": "param",
|
|
530
|
+
"description": "Group of fields to merge in.",
|
|
531
|
+
"type": {
|
|
532
|
+
"type": "NameExpression",
|
|
533
|
+
"name": "Object"
|
|
534
|
+
},
|
|
535
|
+
"name": "fields"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"title": "returns",
|
|
539
|
+
"description": null,
|
|
540
|
+
"type": {
|
|
541
|
+
"type": "NameExpression",
|
|
542
|
+
"name": "DataSource"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
},
|
|
547
|
+
"valid": true
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"properties": {
|
|
4
|
+
"apiVersion": {
|
|
5
|
+
"title": "API Version",
|
|
6
|
+
"anyOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "null"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"placeholder": "v1.0",
|
|
15
|
+
"description": "Microsoft Graph api version",
|
|
16
|
+
"minLength": 1,
|
|
17
|
+
"examples": [
|
|
18
|
+
"v1.0",
|
|
19
|
+
"beta"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"accessToken": {
|
|
23
|
+
"title": "Access Token",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Your Microsoft Graph access token",
|
|
26
|
+
"writeOnly": true,
|
|
27
|
+
"minLength": 1,
|
|
28
|
+
"examples": [
|
|
29
|
+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": true,
|
|
35
|
+
"required": [
|
|
36
|
+
"accessToken"
|
|
37
|
+
]
|
|
38
|
+
}
|