@openfn/language-maximo 0.4.1 → 0.5.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 +220 -32
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +2 -3
- package/types/Adaptor.d.ts +4 -1
package/ast.json
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
{
|
|
2
|
-
"operations": [
|
|
2
|
+
"operations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "fetch",
|
|
5
|
+
"params": [
|
|
6
|
+
"params"
|
|
7
|
+
],
|
|
8
|
+
"docs": {
|
|
9
|
+
"description": "Make a GET request and POST it somewhere else",
|
|
10
|
+
"tags": [
|
|
11
|
+
{
|
|
12
|
+
"title": "example",
|
|
13
|
+
"description": "fetch({\n endpoint: 'maxrest/rest/os/mxinventory',\n query: {\n ITEMNUM: '01226',\n _format: 'json',\n },\n postUrl: 'https://www.openfn.org/inbox/not-real',\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": "data to make the fetch",
|
|
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": "Operation"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"valid": true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "update",
|
|
48
|
+
"params": [
|
|
49
|
+
"params"
|
|
50
|
+
],
|
|
51
|
+
"docs": {
|
|
52
|
+
"description": "Make an update in Maximo 7.6 and beyond",
|
|
53
|
+
"tags": [
|
|
54
|
+
{
|
|
55
|
+
"title": "example",
|
|
56
|
+
"description": "execute(\n update(params)\n)(state)"
|
|
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": "data to make the update",
|
|
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": "Operation"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"valid": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "update75",
|
|
91
|
+
"params": [
|
|
92
|
+
"params"
|
|
93
|
+
],
|
|
94
|
+
"docs": {
|
|
95
|
+
"description": "Make an upadte in Maximo 7.5",
|
|
96
|
+
"tags": [
|
|
97
|
+
{
|
|
98
|
+
"title": "example",
|
|
99
|
+
"description": "execute(\n update75(params)\n)(state)"
|
|
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": "data to make the update",
|
|
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": "Operation"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"valid": true
|
|
131
|
+
}
|
|
132
|
+
],
|
|
3
133
|
"exports": [],
|
|
4
134
|
"common": [
|
|
5
135
|
{
|
|
@@ -15,23 +145,76 @@
|
|
|
15
145
|
"description": null,
|
|
16
146
|
"type": null
|
|
17
147
|
},
|
|
148
|
+
{
|
|
149
|
+
"title": "function",
|
|
150
|
+
"description": null,
|
|
151
|
+
"name": null
|
|
152
|
+
},
|
|
18
153
|
{
|
|
19
154
|
"title": "example",
|
|
20
155
|
"description": "fn(state => {\n // do some things to state\n return state;\n});"
|
|
21
156
|
},
|
|
157
|
+
{
|
|
158
|
+
"title": "param",
|
|
159
|
+
"description": "is the function",
|
|
160
|
+
"type": {
|
|
161
|
+
"type": "NameExpression",
|
|
162
|
+
"name": "Function"
|
|
163
|
+
},
|
|
164
|
+
"name": "func"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"title": "returns",
|
|
168
|
+
"description": null,
|
|
169
|
+
"type": {
|
|
170
|
+
"type": "NameExpression",
|
|
171
|
+
"name": "Operation"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
"valid": true
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "fnIf",
|
|
180
|
+
"params": [
|
|
181
|
+
"condition",
|
|
182
|
+
"operation"
|
|
183
|
+
],
|
|
184
|
+
"docs": {
|
|
185
|
+
"description": "A custom operation that will only execute the function if the condition returns true",
|
|
186
|
+
"tags": [
|
|
187
|
+
{
|
|
188
|
+
"title": "public",
|
|
189
|
+
"description": null,
|
|
190
|
+
"type": null
|
|
191
|
+
},
|
|
22
192
|
{
|
|
23
193
|
"title": "function",
|
|
24
194
|
"description": null,
|
|
25
195
|
"name": null
|
|
26
196
|
},
|
|
197
|
+
{
|
|
198
|
+
"title": "example",
|
|
199
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
200
|
+
},
|
|
27
201
|
{
|
|
28
202
|
"title": "param",
|
|
29
|
-
"description": "
|
|
203
|
+
"description": "The condition that returns true",
|
|
30
204
|
"type": {
|
|
31
205
|
"type": "NameExpression",
|
|
32
|
-
"name": "
|
|
206
|
+
"name": "Boolean"
|
|
33
207
|
},
|
|
34
|
-
"name": "
|
|
208
|
+
"name": "condition"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"title": "param",
|
|
212
|
+
"description": "The operation needed to be executed.",
|
|
213
|
+
"type": {
|
|
214
|
+
"type": "NameExpression",
|
|
215
|
+
"name": "Operation"
|
|
216
|
+
},
|
|
217
|
+
"name": "operation"
|
|
35
218
|
},
|
|
36
219
|
{
|
|
37
220
|
"title": "returns",
|
|
@@ -58,15 +241,15 @@
|
|
|
58
241
|
"description": null,
|
|
59
242
|
"type": null
|
|
60
243
|
},
|
|
61
|
-
{
|
|
62
|
-
"title": "example",
|
|
63
|
-
"description": "sourceValue('$.key')"
|
|
64
|
-
},
|
|
65
244
|
{
|
|
66
245
|
"title": "function",
|
|
67
246
|
"description": null,
|
|
68
247
|
"name": null
|
|
69
248
|
},
|
|
249
|
+
{
|
|
250
|
+
"title": "example",
|
|
251
|
+
"description": "sourceValue('$.key')"
|
|
252
|
+
},
|
|
70
253
|
{
|
|
71
254
|
"title": "param",
|
|
72
255
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -101,15 +284,15 @@
|
|
|
101
284
|
"description": null,
|
|
102
285
|
"type": null
|
|
103
286
|
},
|
|
104
|
-
{
|
|
105
|
-
"title": "example",
|
|
106
|
-
"description": "dataPath('key')"
|
|
107
|
-
},
|
|
108
287
|
{
|
|
109
288
|
"title": "function",
|
|
110
289
|
"description": null,
|
|
111
290
|
"name": null
|
|
112
291
|
},
|
|
292
|
+
{
|
|
293
|
+
"title": "example",
|
|
294
|
+
"description": "dataPath('key')"
|
|
295
|
+
},
|
|
113
296
|
{
|
|
114
297
|
"title": "param",
|
|
115
298
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -144,15 +327,15 @@
|
|
|
144
327
|
"description": null,
|
|
145
328
|
"type": null
|
|
146
329
|
},
|
|
147
|
-
{
|
|
148
|
-
"title": "example",
|
|
149
|
-
"description": "dataValue('key')"
|
|
150
|
-
},
|
|
151
330
|
{
|
|
152
331
|
"title": "function",
|
|
153
332
|
"description": null,
|
|
154
333
|
"name": null
|
|
155
334
|
},
|
|
335
|
+
{
|
|
336
|
+
"title": "example",
|
|
337
|
+
"description": "dataValue('key')"
|
|
338
|
+
},
|
|
156
339
|
{
|
|
157
340
|
"title": "param",
|
|
158
341
|
"description": "JSONPath referencing a point in `data`.",
|
|
@@ -187,15 +370,15 @@
|
|
|
187
370
|
"description": null,
|
|
188
371
|
"type": null
|
|
189
372
|
},
|
|
190
|
-
{
|
|
191
|
-
"title": "example",
|
|
192
|
-
"description": "lastReferenceValue('key')"
|
|
193
|
-
},
|
|
194
373
|
{
|
|
195
374
|
"title": "function",
|
|
196
375
|
"description": null,
|
|
197
376
|
"name": null
|
|
198
377
|
},
|
|
378
|
+
{
|
|
379
|
+
"title": "example",
|
|
380
|
+
"description": "lastReferenceValue('key')"
|
|
381
|
+
},
|
|
199
382
|
{
|
|
200
383
|
"title": "param",
|
|
201
384
|
"description": "JSONPath referencing a point in `references`.",
|
|
@@ -231,15 +414,15 @@
|
|
|
231
414
|
"description": null,
|
|
232
415
|
"type": null
|
|
233
416
|
},
|
|
234
|
-
{
|
|
235
|
-
"title": "example",
|
|
236
|
-
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
237
|
-
},
|
|
238
417
|
{
|
|
239
418
|
"title": "function",
|
|
240
419
|
"description": null,
|
|
241
420
|
"name": null
|
|
242
421
|
},
|
|
422
|
+
{
|
|
423
|
+
"title": "example",
|
|
424
|
+
"description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
|
|
425
|
+
},
|
|
243
426
|
{
|
|
244
427
|
"title": "param",
|
|
245
428
|
"description": "JSONPath referencing a point in `state`.",
|
|
@@ -284,15 +467,15 @@
|
|
|
284
467
|
"description": null,
|
|
285
468
|
"type": null
|
|
286
469
|
},
|
|
287
|
-
{
|
|
288
|
-
"title": "example",
|
|
289
|
-
"description": "field('destination_field_name__c', 'value')"
|
|
290
|
-
},
|
|
291
470
|
{
|
|
292
471
|
"title": "function",
|
|
293
472
|
"description": null,
|
|
294
473
|
"name": null
|
|
295
474
|
},
|
|
475
|
+
{
|
|
476
|
+
"title": "example",
|
|
477
|
+
"description": "field('destination_field_name__c', 'value')"
|
|
478
|
+
},
|
|
296
479
|
{
|
|
297
480
|
"title": "param",
|
|
298
481
|
"description": "Name of the field",
|
|
@@ -336,15 +519,15 @@
|
|
|
336
519
|
"description": null,
|
|
337
520
|
"type": null
|
|
338
521
|
},
|
|
339
|
-
{
|
|
340
|
-
"title": "example",
|
|
341
|
-
"description": "fields(list_of_fields)"
|
|
342
|
-
},
|
|
343
522
|
{
|
|
344
523
|
"title": "function",
|
|
345
524
|
"description": null,
|
|
346
525
|
"name": null
|
|
347
526
|
},
|
|
527
|
+
{
|
|
528
|
+
"title": "example",
|
|
529
|
+
"description": "fields(list_of_fields)"
|
|
530
|
+
},
|
|
348
531
|
{
|
|
349
532
|
"title": "param",
|
|
350
533
|
"description": "a list of fields",
|
|
@@ -389,6 +572,11 @@
|
|
|
389
572
|
"description": null,
|
|
390
573
|
"name": null
|
|
391
574
|
},
|
|
575
|
+
{
|
|
576
|
+
"title": "public",
|
|
577
|
+
"description": null,
|
|
578
|
+
"type": null
|
|
579
|
+
},
|
|
392
580
|
{
|
|
393
581
|
"title": "param",
|
|
394
582
|
"description": null,
|
package/dist/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
field: () => import_language_common2.field,
|
|
37
37
|
fields: () => import_language_common2.fields,
|
|
38
38
|
fn: () => import_language_common2.fn,
|
|
39
|
+
fnIf: () => import_language_common2.fnIf,
|
|
39
40
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
40
41
|
merge: () => import_language_common2.merge,
|
|
41
42
|
sourceValue: () => import_language_common2.sourceValue,
|
|
@@ -57,6 +58,7 @@ __export(Adaptor_exports, {
|
|
|
57
58
|
field: () => import_language_common2.field,
|
|
58
59
|
fields: () => import_language_common2.fields,
|
|
59
60
|
fn: () => import_language_common2.fn,
|
|
61
|
+
fnIf: () => import_language_common2.fnIf,
|
|
60
62
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
61
63
|
merge: () => import_language_common2.merge,
|
|
62
64
|
sourceValue: () => import_language_common2.sourceValue,
|
|
@@ -300,6 +302,7 @@ var src_default = Adaptor_exports;
|
|
|
300
302
|
field,
|
|
301
303
|
fields,
|
|
302
304
|
fn,
|
|
305
|
+
fnIf,
|
|
303
306
|
lastReferenceValue,
|
|
304
307
|
merge,
|
|
305
308
|
sourceValue,
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ __export(Adaptor_exports, {
|
|
|
17
17
|
field: () => field,
|
|
18
18
|
fields: () => fields,
|
|
19
19
|
fn: () => fn,
|
|
20
|
+
fnIf: () => fnIf,
|
|
20
21
|
lastReferenceValue: () => lastReferenceValue,
|
|
21
22
|
merge: () => merge,
|
|
22
23
|
sourceValue: () => sourceValue,
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
fields,
|
|
37
38
|
sourceValue,
|
|
38
39
|
fn,
|
|
40
|
+
fnIf,
|
|
39
41
|
alterState,
|
|
40
42
|
each,
|
|
41
43
|
merge,
|
|
@@ -274,6 +276,7 @@ export {
|
|
|
274
276
|
field,
|
|
275
277
|
fields,
|
|
276
278
|
fn,
|
|
279
|
+
fnIf,
|
|
277
280
|
lastReferenceValue,
|
|
278
281
|
merge,
|
|
279
282
|
sourceValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-maximo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "An IBM Maximo EAM Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.
|
|
15
|
+
"@openfn/language-common": "^1.15.1",
|
|
16
16
|
"base-64": "^0.1.0",
|
|
17
17
|
"request": "^2.88.2",
|
|
18
18
|
"utf8": "^2.1.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@openfn/buildtools": "^1.0.2",
|
|
22
21
|
"@openfn/simple-ast": "0.4.1",
|
|
23
22
|
"assertion-error": "^2.0.0",
|
|
24
23
|
"babel-cli": "^6.26.0",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export function execute(...operations: Operations): Operation;
|
|
|
23
23
|
* postUrl: 'https://www.openfn.org/inbox/not-real',
|
|
24
24
|
* });
|
|
25
25
|
* @function
|
|
26
|
+
* @public
|
|
26
27
|
* @param {object} params - data to make the fetch
|
|
27
28
|
* @returns {Operation}
|
|
28
29
|
*/
|
|
@@ -35,6 +36,7 @@ export function create(params: any): (state: any) => Promise<any>;
|
|
|
35
36
|
* update(params)
|
|
36
37
|
* )(state)
|
|
37
38
|
* @function
|
|
39
|
+
* @public
|
|
38
40
|
* @param {object} params - data to make the update
|
|
39
41
|
* @returns {Operation}
|
|
40
42
|
*/
|
|
@@ -46,8 +48,9 @@ export function update(params: object): Operation;
|
|
|
46
48
|
* update75(params)
|
|
47
49
|
* )(state)
|
|
48
50
|
* @function
|
|
51
|
+
* @public
|
|
49
52
|
* @param {object} params - data to make the update
|
|
50
53
|
* @returns {Operation}
|
|
51
54
|
*/
|
|
52
55
|
export function update75(params: object): Operation;
|
|
53
|
-
export { field, fields, sourceValue, fn, alterState, each, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
|
56
|
+
export { field, fields, sourceValue, fn, fnIf, alterState, each, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|