@salesforce/lds-adapters-service-ecm 1.322.0 → 1.324.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/dist/es/es2018/service-ecm.js +938 -5
- package/dist/es/es2018/types/src/generated/adapters/createCatalogItem.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/getCatalogItem.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/updateCatalogItem.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectCatalogCatalogItemByCatalogItemId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectCatalogCatalogItemByCatalogItemId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectCatalogCatalogItem.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemAttributeInputRepresentation.d.ts +58 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemAttributeOutputRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemCreateInputRepresentation.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemCreateWrapperInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemInputRepresentation.d.ts +61 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemOutputRepresentation.d.ts +75 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemUpdateInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/CatalogItemUpdateWrapperInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/FulfillmentFlowOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/FulfillmentFowInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/IntakeFormInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/IntakeFormOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/PreprocessorInputRepresentation.d.ts +31 -0
- package/package.json +3 -3
- package/sfdc/index.js +1041 -44
- package/src/raml/api.raml +324 -0
- package/src/raml/luvio.raml +17 -1
package/sfdc/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
16
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
-
import { serializeStructuredKey, ingestShape, deepFreeze,
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$4 } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -140,13 +140,696 @@ const keyPrefix = 'ecm';
|
|
|
140
140
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
141
141
|
const { isArray: ArrayIsArray } = Array;
|
|
142
142
|
const { stringify: JSONStringify } = JSON;
|
|
143
|
+
function equalsArray(a, b, equalsItem) {
|
|
144
|
+
const aLength = a.length;
|
|
145
|
+
const bLength = b.length;
|
|
146
|
+
if (aLength !== bLength) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
for (let i = 0; i < aLength; i++) {
|
|
150
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
143
156
|
function createLink(ref) {
|
|
144
157
|
return {
|
|
145
158
|
__ref: serializeStructuredKey(ref),
|
|
146
159
|
};
|
|
147
160
|
}
|
|
148
161
|
|
|
149
|
-
function validate$
|
|
162
|
+
function validate$7(obj, path = 'CatalogItemCreateInputRepresentation') {
|
|
163
|
+
const v_error = (() => {
|
|
164
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
165
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
166
|
+
}
|
|
167
|
+
})();
|
|
168
|
+
return v_error === undefined ? null : v_error;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const VERSION$4 = "984f5657f237c67c169022cb991d17de";
|
|
172
|
+
function validate$6(obj, path = 'CatalogItemAttributeOutputRepresentation') {
|
|
173
|
+
const v_error = (() => {
|
|
174
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
175
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
176
|
+
}
|
|
177
|
+
const obj_apiName = obj.apiName;
|
|
178
|
+
const path_apiName = path + '.apiName';
|
|
179
|
+
if (typeof obj_apiName !== 'string') {
|
|
180
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
181
|
+
}
|
|
182
|
+
const obj_contextAttributeId = obj.contextAttributeId;
|
|
183
|
+
const path_contextAttributeId = path + '.contextAttributeId';
|
|
184
|
+
if (typeof obj_contextAttributeId !== 'string') {
|
|
185
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextAttributeId + '" (at "' + path_contextAttributeId + '")');
|
|
186
|
+
}
|
|
187
|
+
const obj_dataType = obj.dataType;
|
|
188
|
+
const path_dataType = path + '.dataType';
|
|
189
|
+
if (typeof obj_dataType !== 'string') {
|
|
190
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
191
|
+
}
|
|
192
|
+
const obj_defaultValue = obj.defaultValue;
|
|
193
|
+
const path_defaultValue = path + '.defaultValue';
|
|
194
|
+
if (typeof obj_defaultValue !== 'string') {
|
|
195
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
196
|
+
}
|
|
197
|
+
const obj_description = obj.description;
|
|
198
|
+
const path_description = path + '.description';
|
|
199
|
+
if (typeof obj_description !== 'string') {
|
|
200
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
201
|
+
}
|
|
202
|
+
const obj_isHidden = obj.isHidden;
|
|
203
|
+
const path_isHidden = path + '.isHidden';
|
|
204
|
+
if (typeof obj_isHidden !== 'boolean') {
|
|
205
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isHidden + '" (at "' + path_isHidden + '")');
|
|
206
|
+
}
|
|
207
|
+
const obj_name = obj.name;
|
|
208
|
+
const path_name = path + '.name';
|
|
209
|
+
if (typeof obj_name !== 'string') {
|
|
210
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
211
|
+
}
|
|
212
|
+
const obj_parent = obj.parent;
|
|
213
|
+
const path_parent = path + '.parent';
|
|
214
|
+
if (typeof obj_parent !== 'string') {
|
|
215
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parent + '" (at "' + path_parent + '")');
|
|
216
|
+
}
|
|
217
|
+
const obj_sequence = obj.sequence;
|
|
218
|
+
const path_sequence = path + '.sequence';
|
|
219
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
220
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
221
|
+
}
|
|
222
|
+
})();
|
|
223
|
+
return v_error === undefined ? null : v_error;
|
|
224
|
+
}
|
|
225
|
+
const select$8 = function CatalogItemAttributeOutputRepresentationSelect() {
|
|
226
|
+
return {
|
|
227
|
+
kind: 'Fragment',
|
|
228
|
+
version: VERSION$4,
|
|
229
|
+
private: [],
|
|
230
|
+
selections: [
|
|
231
|
+
{
|
|
232
|
+
name: 'apiName',
|
|
233
|
+
kind: 'Scalar'
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'contextAttributeId',
|
|
237
|
+
kind: 'Scalar'
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'dataType',
|
|
241
|
+
kind: 'Scalar'
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'defaultValue',
|
|
245
|
+
kind: 'Scalar'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: 'description',
|
|
249
|
+
kind: 'Scalar'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'isHidden',
|
|
253
|
+
kind: 'Scalar'
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: 'name',
|
|
257
|
+
kind: 'Scalar'
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'parent',
|
|
261
|
+
kind: 'Scalar'
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'sequence',
|
|
265
|
+
kind: 'Scalar'
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
function equals$4(existing, incoming) {
|
|
271
|
+
const existing_isHidden = existing.isHidden;
|
|
272
|
+
const incoming_isHidden = incoming.isHidden;
|
|
273
|
+
if (!(existing_isHidden === incoming_isHidden)) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
const existing_sequence = existing.sequence;
|
|
277
|
+
const incoming_sequence = incoming.sequence;
|
|
278
|
+
if (!(existing_sequence === incoming_sequence)) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const existing_apiName = existing.apiName;
|
|
282
|
+
const incoming_apiName = incoming.apiName;
|
|
283
|
+
if (!(existing_apiName === incoming_apiName)) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const existing_contextAttributeId = existing.contextAttributeId;
|
|
287
|
+
const incoming_contextAttributeId = incoming.contextAttributeId;
|
|
288
|
+
if (!(existing_contextAttributeId === incoming_contextAttributeId)) {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
const existing_dataType = existing.dataType;
|
|
292
|
+
const incoming_dataType = incoming.dataType;
|
|
293
|
+
if (!(existing_dataType === incoming_dataType)) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
const existing_defaultValue = existing.defaultValue;
|
|
297
|
+
const incoming_defaultValue = incoming.defaultValue;
|
|
298
|
+
if (!(existing_defaultValue === incoming_defaultValue)) {
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
const existing_description = existing.description;
|
|
302
|
+
const incoming_description = incoming.description;
|
|
303
|
+
if (!(existing_description === incoming_description)) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
const existing_name = existing.name;
|
|
307
|
+
const incoming_name = incoming.name;
|
|
308
|
+
if (!(existing_name === incoming_name)) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
const existing_parent = existing.parent;
|
|
312
|
+
const incoming_parent = incoming.parent;
|
|
313
|
+
if (!(existing_parent === incoming_parent)) {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const VERSION$3 = "a629c7f39e6f7bfcb57e38849c46ba98";
|
|
320
|
+
function validate$5(obj, path = 'FulfillmentFlowOutputRepresentation') {
|
|
321
|
+
const v_error = (() => {
|
|
322
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
323
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
324
|
+
}
|
|
325
|
+
const obj_id = obj.id;
|
|
326
|
+
const path_id = path + '.id';
|
|
327
|
+
if (typeof obj_id !== 'string') {
|
|
328
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
329
|
+
}
|
|
330
|
+
const obj_type = obj.type;
|
|
331
|
+
const path_type = path + '.type';
|
|
332
|
+
if (typeof obj_type !== 'string') {
|
|
333
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
334
|
+
}
|
|
335
|
+
})();
|
|
336
|
+
return v_error === undefined ? null : v_error;
|
|
337
|
+
}
|
|
338
|
+
const select$7 = function FulfillmentFlowOutputRepresentationSelect() {
|
|
339
|
+
return {
|
|
340
|
+
kind: 'Fragment',
|
|
341
|
+
version: VERSION$3,
|
|
342
|
+
private: [],
|
|
343
|
+
selections: [
|
|
344
|
+
{
|
|
345
|
+
name: 'id',
|
|
346
|
+
kind: 'Scalar'
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'type',
|
|
350
|
+
kind: 'Scalar'
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
function equals$3(existing, incoming) {
|
|
356
|
+
const existing_id = existing.id;
|
|
357
|
+
const incoming_id = incoming.id;
|
|
358
|
+
if (!(existing_id === incoming_id)) {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
const existing_type = existing.type;
|
|
362
|
+
const incoming_type = incoming.type;
|
|
363
|
+
if (!(existing_type === incoming_type)) {
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const VERSION$2 = "d0fe6f2d5b8246f10afe4067d3721d5b";
|
|
370
|
+
function validate$4(obj, path = 'IntakeFormOutputRepresentation') {
|
|
371
|
+
const v_error = (() => {
|
|
372
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
373
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
374
|
+
}
|
|
375
|
+
const obj_id = obj.id;
|
|
376
|
+
const path_id = path + '.id';
|
|
377
|
+
if (typeof obj_id !== 'string') {
|
|
378
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
379
|
+
}
|
|
380
|
+
const obj_type = obj.type;
|
|
381
|
+
const path_type = path + '.type';
|
|
382
|
+
if (typeof obj_type !== 'string') {
|
|
383
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
384
|
+
}
|
|
385
|
+
})();
|
|
386
|
+
return v_error === undefined ? null : v_error;
|
|
387
|
+
}
|
|
388
|
+
const select$6 = function IntakeFormOutputRepresentationSelect() {
|
|
389
|
+
return {
|
|
390
|
+
kind: 'Fragment',
|
|
391
|
+
version: VERSION$2,
|
|
392
|
+
private: [],
|
|
393
|
+
selections: [
|
|
394
|
+
{
|
|
395
|
+
name: 'id',
|
|
396
|
+
kind: 'Scalar'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'type',
|
|
400
|
+
kind: 'Scalar'
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
function equals$2(existing, incoming) {
|
|
406
|
+
const existing_id = existing.id;
|
|
407
|
+
const incoming_id = incoming.id;
|
|
408
|
+
if (!(existing_id === incoming_id)) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
const existing_type = existing.type;
|
|
412
|
+
const incoming_type = incoming.type;
|
|
413
|
+
if (!(existing_type === incoming_type)) {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const TTL$1 = 6000;
|
|
420
|
+
const VERSION$1 = "d0103a1b0725c5c2006308b12e54542c";
|
|
421
|
+
function validate$3(obj, path = 'CatalogItemOutputRepresentation') {
|
|
422
|
+
const v_error = (() => {
|
|
423
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
424
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
425
|
+
}
|
|
426
|
+
const obj_associatedArticles = obj.associatedArticles;
|
|
427
|
+
const path_associatedArticles = path + '.associatedArticles';
|
|
428
|
+
if (!ArrayIsArray(obj_associatedArticles)) {
|
|
429
|
+
return new TypeError('Expected "array" but received "' + typeof obj_associatedArticles + '" (at "' + path_associatedArticles + '")');
|
|
430
|
+
}
|
|
431
|
+
for (let i = 0; i < obj_associatedArticles.length; i++) {
|
|
432
|
+
const obj_associatedArticles_item = obj_associatedArticles[i];
|
|
433
|
+
const path_associatedArticles_item = path_associatedArticles + '[' + i + ']';
|
|
434
|
+
if (typeof obj_associatedArticles_item !== 'string') {
|
|
435
|
+
return new TypeError('Expected "string" but received "' + typeof obj_associatedArticles_item + '" (at "' + path_associatedArticles_item + '")');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const obj_attributes = obj.attributes;
|
|
439
|
+
const path_attributes = path + '.attributes';
|
|
440
|
+
if (!ArrayIsArray(obj_attributes)) {
|
|
441
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
442
|
+
}
|
|
443
|
+
for (let i = 0; i < obj_attributes.length; i++) {
|
|
444
|
+
const obj_attributes_item = obj_attributes[i];
|
|
445
|
+
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
446
|
+
const referencepath_attributes_itemValidationError = validate$6(obj_attributes_item, path_attributes_item);
|
|
447
|
+
if (referencepath_attributes_itemValidationError !== null) {
|
|
448
|
+
let message = 'Object doesn\'t match CatalogItemAttributeOutputRepresentation (at "' + path_attributes_item + '")\n';
|
|
449
|
+
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
450
|
+
return new TypeError(message);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const obj_catalogItemId = obj.catalogItemId;
|
|
454
|
+
const path_catalogItemId = path + '.catalogItemId';
|
|
455
|
+
if (typeof obj_catalogItemId !== 'string') {
|
|
456
|
+
return new TypeError('Expected "string" but received "' + typeof obj_catalogItemId + '" (at "' + path_catalogItemId + '")');
|
|
457
|
+
}
|
|
458
|
+
const obj_contextDefinitionId = obj.contextDefinitionId;
|
|
459
|
+
const path_contextDefinitionId = path + '.contextDefinitionId';
|
|
460
|
+
if (typeof obj_contextDefinitionId !== 'string') {
|
|
461
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextDefinitionId + '" (at "' + path_contextDefinitionId + '")');
|
|
462
|
+
}
|
|
463
|
+
const obj_description = obj.description;
|
|
464
|
+
const path_description = path + '.description';
|
|
465
|
+
if (typeof obj_description !== 'string') {
|
|
466
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
467
|
+
}
|
|
468
|
+
const obj_eligibilityRules = obj.eligibilityRules;
|
|
469
|
+
const path_eligibilityRules = path + '.eligibilityRules';
|
|
470
|
+
if (!ArrayIsArray(obj_eligibilityRules)) {
|
|
471
|
+
return new TypeError('Expected "array" but received "' + typeof obj_eligibilityRules + '" (at "' + path_eligibilityRules + '")');
|
|
472
|
+
}
|
|
473
|
+
for (let i = 0; i < obj_eligibilityRules.length; i++) {
|
|
474
|
+
const obj_eligibilityRules_item = obj_eligibilityRules[i];
|
|
475
|
+
const path_eligibilityRules_item = path_eligibilityRules + '[' + i + ']';
|
|
476
|
+
if (typeof obj_eligibilityRules_item !== 'string') {
|
|
477
|
+
return new TypeError('Expected "string" but received "' + typeof obj_eligibilityRules_item + '" (at "' + path_eligibilityRules_item + '")');
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const obj_fulfillmentFlow = obj.fulfillmentFlow;
|
|
481
|
+
const path_fulfillmentFlow = path + '.fulfillmentFlow';
|
|
482
|
+
const referencepath_fulfillmentFlowValidationError = validate$5(obj_fulfillmentFlow, path_fulfillmentFlow);
|
|
483
|
+
if (referencepath_fulfillmentFlowValidationError !== null) {
|
|
484
|
+
let message = 'Object doesn\'t match FulfillmentFlowOutputRepresentation (at "' + path_fulfillmentFlow + '")\n';
|
|
485
|
+
message += referencepath_fulfillmentFlowValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
486
|
+
return new TypeError(message);
|
|
487
|
+
}
|
|
488
|
+
const obj_intakeForm = obj.intakeForm;
|
|
489
|
+
const path_intakeForm = path + '.intakeForm';
|
|
490
|
+
const referencepath_intakeFormValidationError = validate$4(obj_intakeForm, path_intakeForm);
|
|
491
|
+
if (referencepath_intakeFormValidationError !== null) {
|
|
492
|
+
let message = 'Object doesn\'t match IntakeFormOutputRepresentation (at "' + path_intakeForm + '")\n';
|
|
493
|
+
message += referencepath_intakeFormValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
494
|
+
return new TypeError(message);
|
|
495
|
+
}
|
|
496
|
+
const obj_integrations = obj.integrations;
|
|
497
|
+
const path_integrations = path + '.integrations';
|
|
498
|
+
if (!ArrayIsArray(obj_integrations)) {
|
|
499
|
+
return new TypeError('Expected "array" but received "' + typeof obj_integrations + '" (at "' + path_integrations + '")');
|
|
500
|
+
}
|
|
501
|
+
for (let i = 0; i < obj_integrations.length; i++) {
|
|
502
|
+
const obj_integrations_item = obj_integrations[i];
|
|
503
|
+
const path_integrations_item = path_integrations + '[' + i + ']';
|
|
504
|
+
if (typeof obj_integrations_item !== 'string') {
|
|
505
|
+
return new TypeError('Expected "string" but received "' + typeof obj_integrations_item + '" (at "' + path_integrations_item + '")');
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
const obj_isActive = obj.isActive;
|
|
509
|
+
const path_isActive = path + '.isActive';
|
|
510
|
+
if (typeof obj_isActive !== 'boolean') {
|
|
511
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
|
|
512
|
+
}
|
|
513
|
+
const obj_name = obj.name;
|
|
514
|
+
const path_name = path + '.name';
|
|
515
|
+
if (typeof obj_name !== 'string') {
|
|
516
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
517
|
+
}
|
|
518
|
+
const obj_preProcessors = obj.preProcessors;
|
|
519
|
+
const path_preProcessors = path + '.preProcessors';
|
|
520
|
+
if (!ArrayIsArray(obj_preProcessors)) {
|
|
521
|
+
return new TypeError('Expected "array" but received "' + typeof obj_preProcessors + '" (at "' + path_preProcessors + '")');
|
|
522
|
+
}
|
|
523
|
+
for (let i = 0; i < obj_preProcessors.length; i++) {
|
|
524
|
+
const obj_preProcessors_item = obj_preProcessors[i];
|
|
525
|
+
const path_preProcessors_item = path_preProcessors + '[' + i + ']';
|
|
526
|
+
if (typeof obj_preProcessors_item !== 'string') {
|
|
527
|
+
return new TypeError('Expected "string" but received "' + typeof obj_preProcessors_item + '" (at "' + path_preProcessors_item + '")');
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
const obj_type = obj.type;
|
|
531
|
+
const path_type = path + '.type';
|
|
532
|
+
if (typeof obj_type !== 'string') {
|
|
533
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
534
|
+
}
|
|
535
|
+
})();
|
|
536
|
+
return v_error === undefined ? null : v_error;
|
|
537
|
+
}
|
|
538
|
+
const RepresentationType$1 = 'CatalogItemOutputRepresentation';
|
|
539
|
+
function keyBuilder$4(luvio, config) {
|
|
540
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.catalogItemId;
|
|
541
|
+
}
|
|
542
|
+
function keyBuilderFromType(luvio, object) {
|
|
543
|
+
const keyParams = {
|
|
544
|
+
catalogItemId: object.catalogItemId
|
|
545
|
+
};
|
|
546
|
+
return keyBuilder$4(luvio, keyParams);
|
|
547
|
+
}
|
|
548
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
549
|
+
return input;
|
|
550
|
+
}
|
|
551
|
+
const select$5 = function CatalogItemOutputRepresentationSelect() {
|
|
552
|
+
const { selections: CatalogItemAttributeOutputRepresentation__selections, opaque: CatalogItemAttributeOutputRepresentation__opaque, } = select$8();
|
|
553
|
+
const { selections: FulfillmentFlowOutputRepresentation__selections, opaque: FulfillmentFlowOutputRepresentation__opaque, } = select$7();
|
|
554
|
+
const { selections: IntakeFormOutputRepresentation__selections, opaque: IntakeFormOutputRepresentation__opaque, } = select$6();
|
|
555
|
+
return {
|
|
556
|
+
kind: 'Fragment',
|
|
557
|
+
version: VERSION$1,
|
|
558
|
+
private: [],
|
|
559
|
+
selections: [
|
|
560
|
+
{
|
|
561
|
+
name: 'associatedArticles',
|
|
562
|
+
kind: 'Scalar',
|
|
563
|
+
plural: true
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: 'attributes',
|
|
567
|
+
kind: 'Object',
|
|
568
|
+
plural: true,
|
|
569
|
+
selections: CatalogItemAttributeOutputRepresentation__selections
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: 'catalogItemId',
|
|
573
|
+
kind: 'Scalar'
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: 'contextDefinitionId',
|
|
577
|
+
kind: 'Scalar'
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: 'description',
|
|
581
|
+
kind: 'Scalar'
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: 'eligibilityRules',
|
|
585
|
+
kind: 'Scalar',
|
|
586
|
+
plural: true
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: 'fulfillmentFlow',
|
|
590
|
+
kind: 'Object',
|
|
591
|
+
selections: FulfillmentFlowOutputRepresentation__selections
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: 'intakeForm',
|
|
595
|
+
kind: 'Object',
|
|
596
|
+
selections: IntakeFormOutputRepresentation__selections
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: 'integrations',
|
|
600
|
+
kind: 'Scalar',
|
|
601
|
+
plural: true
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: 'isActive',
|
|
605
|
+
kind: 'Scalar'
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
name: 'name',
|
|
609
|
+
kind: 'Scalar'
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: 'preProcessors',
|
|
613
|
+
kind: 'Scalar',
|
|
614
|
+
plural: true
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: 'type',
|
|
618
|
+
kind: 'Scalar'
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
function equals$1(existing, incoming) {
|
|
624
|
+
const existing_isActive = existing.isActive;
|
|
625
|
+
const incoming_isActive = incoming.isActive;
|
|
626
|
+
if (!(existing_isActive === incoming_isActive)) {
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
const existing_catalogItemId = existing.catalogItemId;
|
|
630
|
+
const incoming_catalogItemId = incoming.catalogItemId;
|
|
631
|
+
if (!(existing_catalogItemId === incoming_catalogItemId)) {
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
const existing_contextDefinitionId = existing.contextDefinitionId;
|
|
635
|
+
const incoming_contextDefinitionId = incoming.contextDefinitionId;
|
|
636
|
+
if (!(existing_contextDefinitionId === incoming_contextDefinitionId)) {
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
const existing_description = existing.description;
|
|
640
|
+
const incoming_description = incoming.description;
|
|
641
|
+
if (!(existing_description === incoming_description)) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
const existing_name = existing.name;
|
|
645
|
+
const incoming_name = incoming.name;
|
|
646
|
+
if (!(existing_name === incoming_name)) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
const existing_type = existing.type;
|
|
650
|
+
const incoming_type = incoming.type;
|
|
651
|
+
if (!(existing_type === incoming_type)) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
const existing_associatedArticles = existing.associatedArticles;
|
|
655
|
+
const incoming_associatedArticles = incoming.associatedArticles;
|
|
656
|
+
const equals_associatedArticles_items = equalsArray(existing_associatedArticles, incoming_associatedArticles, (existing_associatedArticles_item, incoming_associatedArticles_item) => {
|
|
657
|
+
if (!(existing_associatedArticles_item === incoming_associatedArticles_item)) {
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
if (equals_associatedArticles_items === false) {
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
const existing_attributes = existing.attributes;
|
|
665
|
+
const incoming_attributes = incoming.attributes;
|
|
666
|
+
const equals_attributes_items = equalsArray(existing_attributes, incoming_attributes, (existing_attributes_item, incoming_attributes_item) => {
|
|
667
|
+
if (!(equals$4(existing_attributes_item, incoming_attributes_item))) {
|
|
668
|
+
return false;
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
if (equals_attributes_items === false) {
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
const existing_eligibilityRules = existing.eligibilityRules;
|
|
675
|
+
const incoming_eligibilityRules = incoming.eligibilityRules;
|
|
676
|
+
const equals_eligibilityRules_items = equalsArray(existing_eligibilityRules, incoming_eligibilityRules, (existing_eligibilityRules_item, incoming_eligibilityRules_item) => {
|
|
677
|
+
if (!(existing_eligibilityRules_item === incoming_eligibilityRules_item)) {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
if (equals_eligibilityRules_items === false) {
|
|
682
|
+
return false;
|
|
683
|
+
}
|
|
684
|
+
const existing_fulfillmentFlow = existing.fulfillmentFlow;
|
|
685
|
+
const incoming_fulfillmentFlow = incoming.fulfillmentFlow;
|
|
686
|
+
if (!(equals$3(existing_fulfillmentFlow, incoming_fulfillmentFlow))) {
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
const existing_intakeForm = existing.intakeForm;
|
|
690
|
+
const incoming_intakeForm = incoming.intakeForm;
|
|
691
|
+
if (!(equals$2(existing_intakeForm, incoming_intakeForm))) {
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
const existing_integrations = existing.integrations;
|
|
695
|
+
const incoming_integrations = incoming.integrations;
|
|
696
|
+
const equals_integrations_items = equalsArray(existing_integrations, incoming_integrations, (existing_integrations_item, incoming_integrations_item) => {
|
|
697
|
+
if (!(existing_integrations_item === incoming_integrations_item)) {
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
if (equals_integrations_items === false) {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
704
|
+
const existing_preProcessors = existing.preProcessors;
|
|
705
|
+
const incoming_preProcessors = incoming.preProcessors;
|
|
706
|
+
const equals_preProcessors_items = equalsArray(existing_preProcessors, incoming_preProcessors, (existing_preProcessors_item, incoming_preProcessors_item) => {
|
|
707
|
+
if (!(existing_preProcessors_item === incoming_preProcessors_item)) {
|
|
708
|
+
return false;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
if (equals_preProcessors_items === false) {
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
return true;
|
|
715
|
+
}
|
|
716
|
+
const ingest$1 = function CatalogItemOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
717
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
718
|
+
const validateError = validate$3(input);
|
|
719
|
+
if (validateError !== null) {
|
|
720
|
+
throw validateError;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
const key = keyBuilderFromType(luvio, input);
|
|
724
|
+
const ttlToUse = TTL$1;
|
|
725
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "ecm", VERSION$1, RepresentationType$1, equals$1);
|
|
726
|
+
return createLink(key);
|
|
727
|
+
};
|
|
728
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
729
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
730
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
731
|
+
rootKeySet.set(rootKey, {
|
|
732
|
+
namespace: keyPrefix,
|
|
733
|
+
representationName: RepresentationType$1,
|
|
734
|
+
mergeable: false
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
function select$4(luvio, params) {
|
|
739
|
+
return select$5();
|
|
740
|
+
}
|
|
741
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
742
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
743
|
+
}
|
|
744
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
745
|
+
const { body } = response;
|
|
746
|
+
const key = keyBuilderFromType(luvio, body);
|
|
747
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
748
|
+
const snapshot = luvio.storeLookup({
|
|
749
|
+
recordId: key,
|
|
750
|
+
node: select$4(),
|
|
751
|
+
variables: {},
|
|
752
|
+
});
|
|
753
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
754
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
755
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
deepFreeze(snapshot.data);
|
|
759
|
+
return snapshot;
|
|
760
|
+
}
|
|
761
|
+
function createResourceRequest$3(config) {
|
|
762
|
+
const headers = {};
|
|
763
|
+
return {
|
|
764
|
+
baseUri: '/services/data/v63.0',
|
|
765
|
+
basePath: '/connect/catalog/catalog-item',
|
|
766
|
+
method: 'post',
|
|
767
|
+
body: config.body,
|
|
768
|
+
urlParams: {},
|
|
769
|
+
queryParams: {},
|
|
770
|
+
headers,
|
|
771
|
+
priority: 'normal',
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
const adapterName$3 = 'createCatalogItem';
|
|
776
|
+
const createCatalogItem_ConfigPropertyMetadata = [
|
|
777
|
+
generateParamConfigMetadata('catalogItemCreateInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
778
|
+
];
|
|
779
|
+
const createCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createCatalogItem_ConfigPropertyMetadata);
|
|
780
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createCatalogItem_ConfigPropertyMetadata);
|
|
781
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
782
|
+
const config = {};
|
|
783
|
+
const untrustedConfig_catalogItemCreateInput = untrustedConfig.catalogItemCreateInput;
|
|
784
|
+
const referenceCatalogItemCreateInputRepresentationValidationError = validate$7(untrustedConfig_catalogItemCreateInput);
|
|
785
|
+
if (referenceCatalogItemCreateInputRepresentationValidationError === null) {
|
|
786
|
+
config.catalogItemCreateInput = untrustedConfig_catalogItemCreateInput;
|
|
787
|
+
}
|
|
788
|
+
return config;
|
|
789
|
+
}
|
|
790
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
791
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
795
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
796
|
+
}
|
|
797
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
798
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
799
|
+
return null;
|
|
800
|
+
}
|
|
801
|
+
return config;
|
|
802
|
+
}
|
|
803
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
804
|
+
const resourceParams = createResourceParams$3(config);
|
|
805
|
+
const request = createResourceRequest$3(resourceParams);
|
|
806
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
807
|
+
.then((response) => {
|
|
808
|
+
return luvio.handleSuccessResponse(() => {
|
|
809
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
810
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
811
|
+
}, () => {
|
|
812
|
+
const cache = new StoreKeyMap();
|
|
813
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
814
|
+
return cache;
|
|
815
|
+
});
|
|
816
|
+
}, (response) => {
|
|
817
|
+
deepFreeze(response);
|
|
818
|
+
throw response;
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
const createCatalogItemAdapterFactory = (luvio) => {
|
|
822
|
+
return function createCatalogItem(untrustedConfig) {
|
|
823
|
+
const config = validateAdapterConfig$3(untrustedConfig, createCatalogItem_ConfigPropertyNames);
|
|
824
|
+
// Invalid or incomplete config
|
|
825
|
+
if (config === null) {
|
|
826
|
+
throw new Error('Invalid config for "createCatalogItem"');
|
|
827
|
+
}
|
|
828
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
829
|
+
};
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
function validate$2(obj, path = 'ServiceAutomationOutputRecordRepresentation') {
|
|
150
833
|
const v_error = (() => {
|
|
151
834
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
152
835
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -171,7 +854,7 @@ function validate$1(obj, path = 'ServiceAutomationOutputRecordRepresentation') {
|
|
|
171
854
|
|
|
172
855
|
const TTL = 6000;
|
|
173
856
|
const VERSION = "7860ae260a600243129acb4ea01e75be";
|
|
174
|
-
function validate(obj, path = 'ServiceAutomationDepOutputRepresentation') {
|
|
857
|
+
function validate$1(obj, path = 'ServiceAutomationDepOutputRepresentation') {
|
|
175
858
|
const v_error = (() => {
|
|
176
859
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
177
860
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -189,7 +872,7 @@ function validate(obj, path = 'ServiceAutomationDepOutputRepresentation') {
|
|
|
189
872
|
for (let i = 0; i < obj_records.length; i++) {
|
|
190
873
|
const obj_records_item = obj_records[i];
|
|
191
874
|
const path_records_item = path_records + '[' + i + ']';
|
|
192
|
-
const referencepath_records_itemValidationError = validate$
|
|
875
|
+
const referencepath_records_itemValidationError = validate$2(obj_records_item, path_records_item);
|
|
193
876
|
if (referencepath_records_itemValidationError !== null) {
|
|
194
877
|
let message = 'Object doesn\'t match ServiceAutomationOutputRecordRepresentation (at "' + path_records_item + '")\n';
|
|
195
878
|
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -203,7 +886,7 @@ const RepresentationType = 'ServiceAutomationDepOutputRepresentation';
|
|
|
203
886
|
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
204
887
|
return input;
|
|
205
888
|
}
|
|
206
|
-
const select$
|
|
889
|
+
const select$3 = function ServiceAutomationDepOutputRepresentationSelect() {
|
|
207
890
|
return {
|
|
208
891
|
kind: 'Fragment',
|
|
209
892
|
version: VERSION,
|
|
@@ -219,7 +902,7 @@ function equals(existing, incoming) {
|
|
|
219
902
|
}
|
|
220
903
|
const ingest = function ServiceAutomationDepOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
221
904
|
if (process.env.NODE_ENV !== 'production') {
|
|
222
|
-
const validateError = validate(input);
|
|
905
|
+
const validateError = validate$1(input);
|
|
223
906
|
if (validateError !== null) {
|
|
224
907
|
throw validateError;
|
|
225
908
|
}
|
|
@@ -239,22 +922,22 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
239
922
|
});
|
|
240
923
|
}
|
|
241
924
|
|
|
242
|
-
function select(luvio, params) {
|
|
243
|
-
return select$
|
|
925
|
+
function select$2(luvio, params) {
|
|
926
|
+
return select$3();
|
|
244
927
|
}
|
|
245
|
-
function keyBuilder$
|
|
928
|
+
function keyBuilder$3(luvio, params) {
|
|
246
929
|
return keyPrefix + '::ServiceAutomationDepOutputRepresentation:(' + 'entityName:' + params.body.entityName + '::' + 'fields:' + params.body.fields + '::' + '[' + params.body.filters.map(element => stableJSONStringify(element)).join(',') + ']' + '::' + 'limit:' + params.body.limit + ')';
|
|
247
930
|
}
|
|
248
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
249
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
931
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
932
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
250
933
|
}
|
|
251
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
934
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
252
935
|
const { body } = response;
|
|
253
|
-
const key = keyBuilder$
|
|
936
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
254
937
|
luvio.storeIngest(key, ingest, body);
|
|
255
938
|
const snapshot = luvio.storeLookup({
|
|
256
939
|
recordId: key,
|
|
257
|
-
node: select(),
|
|
940
|
+
node: select$2(),
|
|
258
941
|
variables: {},
|
|
259
942
|
}, snapshotRefresh);
|
|
260
943
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -265,8 +948,8 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
265
948
|
deepFreeze(snapshot.data);
|
|
266
949
|
return snapshot;
|
|
267
950
|
}
|
|
268
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
269
|
-
const key = keyBuilder$
|
|
951
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
952
|
+
const key = keyBuilder$3(luvio, params);
|
|
270
953
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
271
954
|
const storeMetadataParams = {
|
|
272
955
|
ttl: TTL,
|
|
@@ -277,7 +960,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
|
|
|
277
960
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
278
961
|
return errorSnapshot;
|
|
279
962
|
}
|
|
280
|
-
function createResourceRequest(config) {
|
|
963
|
+
function createResourceRequest$2(config) {
|
|
281
964
|
const headers = {};
|
|
282
965
|
return {
|
|
283
966
|
baseUri: '/services/data/v63.0',
|
|
@@ -291,22 +974,22 @@ function createResourceRequest(config) {
|
|
|
291
974
|
};
|
|
292
975
|
}
|
|
293
976
|
|
|
294
|
-
const adapterName = 'getAllServiceAutomationDep';
|
|
977
|
+
const adapterName$2 = 'getAllServiceAutomationDep';
|
|
295
978
|
const getAllServiceAutomationDep_ConfigPropertyMetadata = [
|
|
296
979
|
generateParamConfigMetadata('entityName', true, 2 /* Body */, 0 /* String */),
|
|
297
980
|
generateParamConfigMetadata('fields', true, 2 /* Body */, 0 /* String */, true),
|
|
298
981
|
generateParamConfigMetadata('filters', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
299
982
|
generateParamConfigMetadata('limit', true, 2 /* Body */, 3 /* Integer */),
|
|
300
983
|
];
|
|
301
|
-
const getAllServiceAutomationDep_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getAllServiceAutomationDep_ConfigPropertyMetadata);
|
|
302
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
303
|
-
function keyBuilder(luvio, config) {
|
|
304
|
-
const resourceParams = createResourceParams(config);
|
|
305
|
-
return keyBuilder$
|
|
984
|
+
const getAllServiceAutomationDep_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getAllServiceAutomationDep_ConfigPropertyMetadata);
|
|
985
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getAllServiceAutomationDep_ConfigPropertyMetadata);
|
|
986
|
+
function keyBuilder$2(luvio, config) {
|
|
987
|
+
const resourceParams = createResourceParams$2(config);
|
|
988
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
306
989
|
}
|
|
307
|
-
function typeCheckConfig(untrustedConfig) {
|
|
990
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
308
991
|
const config = {};
|
|
309
|
-
typeCheckConfig$
|
|
992
|
+
typeCheckConfig$4(untrustedConfig, config, getAllServiceAutomationDep_ConfigPropertyMetadata);
|
|
310
993
|
const untrustedConfig_filters = untrustedConfig.filters;
|
|
311
994
|
if (ArrayIsArray$1(untrustedConfig_filters)) {
|
|
312
995
|
const untrustedConfig_filters_array = [];
|
|
@@ -323,45 +1006,192 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
323
1006
|
}
|
|
324
1007
|
return config;
|
|
325
1008
|
}
|
|
326
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1009
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
327
1010
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
328
1011
|
return null;
|
|
329
1012
|
}
|
|
330
1013
|
if (process.env.NODE_ENV !== 'production') {
|
|
331
1014
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
332
1015
|
}
|
|
333
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1016
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1017
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1018
|
+
return null;
|
|
1019
|
+
}
|
|
1020
|
+
return config;
|
|
1021
|
+
}
|
|
1022
|
+
function adapterFragment$1(luvio, config) {
|
|
1023
|
+
createResourceParams$2(config);
|
|
1024
|
+
return select$2();
|
|
1025
|
+
}
|
|
1026
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1027
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1028
|
+
config,
|
|
1029
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1030
|
+
});
|
|
1031
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1032
|
+
}
|
|
1033
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1034
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1035
|
+
config,
|
|
1036
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1037
|
+
});
|
|
1038
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1039
|
+
}
|
|
1040
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1041
|
+
const resourceParams = createResourceParams$2(config);
|
|
1042
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1043
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1044
|
+
.then((response) => {
|
|
1045
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1046
|
+
const cache = new StoreKeyMap();
|
|
1047
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1048
|
+
return cache;
|
|
1049
|
+
});
|
|
1050
|
+
}, (response) => {
|
|
1051
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1055
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, 'get', false);
|
|
1056
|
+
}
|
|
1057
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1058
|
+
const { luvio, config } = context;
|
|
1059
|
+
const selector = {
|
|
1060
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1061
|
+
node: adapterFragment$1(luvio, config),
|
|
1062
|
+
variables: {},
|
|
1063
|
+
};
|
|
1064
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1065
|
+
config,
|
|
1066
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1067
|
+
});
|
|
1068
|
+
return cacheSnapshot;
|
|
1069
|
+
}
|
|
1070
|
+
const getAllServiceAutomationDepAdapterFactory = (luvio) => function ecm__getAllServiceAutomationDep(untrustedConfig, requestContext) {
|
|
1071
|
+
const config = validateAdapterConfig$2(untrustedConfig, getAllServiceAutomationDep_ConfigPropertyNames);
|
|
1072
|
+
// Invalid or incomplete config
|
|
1073
|
+
if (config === null) {
|
|
1074
|
+
return null;
|
|
1075
|
+
}
|
|
1076
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1077
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
function select$1(luvio, params) {
|
|
1081
|
+
return select$5();
|
|
1082
|
+
}
|
|
1083
|
+
function keyBuilder$1(luvio, params) {
|
|
1084
|
+
return keyBuilder$4(luvio, {
|
|
1085
|
+
catalogItemId: params.urlParams.catalogItemId
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1089
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1090
|
+
}
|
|
1091
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1092
|
+
const { body } = response;
|
|
1093
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1094
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1095
|
+
const snapshot = luvio.storeLookup({
|
|
1096
|
+
recordId: key,
|
|
1097
|
+
node: select$1(),
|
|
1098
|
+
variables: {},
|
|
1099
|
+
}, snapshotRefresh);
|
|
1100
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1101
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1102
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
deepFreeze(snapshot.data);
|
|
1106
|
+
return snapshot;
|
|
1107
|
+
}
|
|
1108
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1109
|
+
const key = keyBuilder$1(luvio, params);
|
|
1110
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1111
|
+
const storeMetadataParams = {
|
|
1112
|
+
ttl: TTL$1,
|
|
1113
|
+
namespace: keyPrefix,
|
|
1114
|
+
version: VERSION$1,
|
|
1115
|
+
representationName: RepresentationType$1
|
|
1116
|
+
};
|
|
1117
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1118
|
+
return errorSnapshot;
|
|
1119
|
+
}
|
|
1120
|
+
function createResourceRequest$1(config) {
|
|
1121
|
+
const headers = {};
|
|
1122
|
+
return {
|
|
1123
|
+
baseUri: '/services/data/v63.0',
|
|
1124
|
+
basePath: '/connect/catalog/catalog-item/' + config.urlParams.catalogItemId + '',
|
|
1125
|
+
method: 'get',
|
|
1126
|
+
body: null,
|
|
1127
|
+
urlParams: config.urlParams,
|
|
1128
|
+
queryParams: {},
|
|
1129
|
+
headers,
|
|
1130
|
+
priority: 'normal',
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
1134
|
+
const config = {
|
|
1135
|
+
urlParams: {},
|
|
1136
|
+
};
|
|
1137
|
+
config.urlParams.catalogItemId = representation.catalogItemId;
|
|
1138
|
+
return createResourceRequest$1(config);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
const adapterName$1 = 'getCatalogItem';
|
|
1142
|
+
const getCatalogItem_ConfigPropertyMetadata = [
|
|
1143
|
+
generateParamConfigMetadata('catalogItemId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1144
|
+
];
|
|
1145
|
+
const getCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getCatalogItem_ConfigPropertyMetadata);
|
|
1146
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getCatalogItem_ConfigPropertyMetadata);
|
|
1147
|
+
function keyBuilder(luvio, config) {
|
|
1148
|
+
const resourceParams = createResourceParams$1(config);
|
|
1149
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1150
|
+
}
|
|
1151
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1152
|
+
const config = {};
|
|
1153
|
+
typeCheckConfig$4(untrustedConfig, config, getCatalogItem_ConfigPropertyMetadata);
|
|
1154
|
+
return config;
|
|
1155
|
+
}
|
|
1156
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1157
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1161
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1162
|
+
}
|
|
1163
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
334
1164
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
335
1165
|
return null;
|
|
336
1166
|
}
|
|
337
1167
|
return config;
|
|
338
1168
|
}
|
|
339
1169
|
function adapterFragment(luvio, config) {
|
|
340
|
-
createResourceParams(config);
|
|
341
|
-
return select();
|
|
1170
|
+
createResourceParams$1(config);
|
|
1171
|
+
return select$1();
|
|
342
1172
|
}
|
|
343
1173
|
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
344
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1174
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
345
1175
|
config,
|
|
346
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1176
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
347
1177
|
});
|
|
348
1178
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
349
1179
|
}
|
|
350
1180
|
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
351
1181
|
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
352
1182
|
config,
|
|
353
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1183
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
354
1184
|
});
|
|
355
1185
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
356
1186
|
}
|
|
357
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
358
|
-
const resourceParams = createResourceParams(config);
|
|
359
|
-
const request = createResourceRequest(resourceParams);
|
|
1187
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1188
|
+
const resourceParams = createResourceParams$1(config);
|
|
1189
|
+
const request = createResourceRequest$1(resourceParams);
|
|
360
1190
|
return luvio.dispatchResourceRequest(request, options)
|
|
361
1191
|
.then((response) => {
|
|
362
1192
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
363
1193
|
const cache = new StoreKeyMap();
|
|
364
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1194
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
365
1195
|
return cache;
|
|
366
1196
|
});
|
|
367
1197
|
}, (response) => {
|
|
@@ -369,7 +1199,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
369
1199
|
});
|
|
370
1200
|
}
|
|
371
1201
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
372
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1202
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
373
1203
|
}
|
|
374
1204
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
375
1205
|
const { luvio, config } = context;
|
|
@@ -380,12 +1210,12 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
380
1210
|
};
|
|
381
1211
|
const cacheSnapshot = storeLookup(selector, {
|
|
382
1212
|
config,
|
|
383
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1213
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
384
1214
|
});
|
|
385
1215
|
return cacheSnapshot;
|
|
386
1216
|
}
|
|
387
|
-
const
|
|
388
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
1217
|
+
const getCatalogItemAdapterFactory = (luvio) => function ecm__getCatalogItem(untrustedConfig, requestContext) {
|
|
1218
|
+
const config = validateAdapterConfig$1(untrustedConfig, getCatalogItem_ConfigPropertyNames);
|
|
389
1219
|
// Invalid or incomplete config
|
|
390
1220
|
if (config === null) {
|
|
391
1221
|
return null;
|
|
@@ -393,30 +1223,197 @@ const getAllServiceAutomationDepAdapterFactory = (luvio) => function ecm__getAll
|
|
|
393
1223
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
394
1224
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
395
1225
|
};
|
|
1226
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
1227
|
+
return function getConnectCatalogCatalogItemByCatalogItemIdNotifyChange(configs) {
|
|
1228
|
+
const keys = configs.map(c => keyBuilder$4(luvio, c));
|
|
1229
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1230
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1231
|
+
const { key, record: val } = entries[i];
|
|
1232
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
1233
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1234
|
+
.then((response) => {
|
|
1235
|
+
return luvio.handleSuccessResponse(() => {
|
|
1236
|
+
const { body } = response;
|
|
1237
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1238
|
+
return luvio.storeBroadcast();
|
|
1239
|
+
}, () => {
|
|
1240
|
+
const cache = new StoreKeyMap();
|
|
1241
|
+
getTypeCacheKeys$1(cache, luvio, response.body);
|
|
1242
|
+
return cache;
|
|
1243
|
+
});
|
|
1244
|
+
}, (error) => {
|
|
1245
|
+
return luvio.handleErrorResponse(() => {
|
|
1246
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1247
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1248
|
+
ttl: TTL$1,
|
|
1249
|
+
namespace: keyPrefix,
|
|
1250
|
+
version: VERSION$1,
|
|
1251
|
+
representationName: RepresentationType$1
|
|
1252
|
+
});
|
|
1253
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1254
|
+
});
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
function validate(obj, path = 'CatalogItemUpdateInputRepresentation') {
|
|
1262
|
+
const v_error = (() => {
|
|
1263
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1264
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1265
|
+
}
|
|
1266
|
+
const obj_id = obj.id;
|
|
1267
|
+
const path_id = path + '.id';
|
|
1268
|
+
if (typeof obj_id !== 'string') {
|
|
1269
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1270
|
+
}
|
|
1271
|
+
})();
|
|
1272
|
+
return v_error === undefined ? null : v_error;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
function select(luvio, params) {
|
|
1276
|
+
return select$5();
|
|
1277
|
+
}
|
|
1278
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1279
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1280
|
+
}
|
|
1281
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1282
|
+
const { body } = response;
|
|
1283
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1284
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1285
|
+
const snapshot = luvio.storeLookup({
|
|
1286
|
+
recordId: key,
|
|
1287
|
+
node: select(),
|
|
1288
|
+
variables: {},
|
|
1289
|
+
});
|
|
1290
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1291
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1292
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
deepFreeze(snapshot.data);
|
|
1296
|
+
return snapshot;
|
|
1297
|
+
}
|
|
1298
|
+
function createResourceRequest(config) {
|
|
1299
|
+
const headers = {};
|
|
1300
|
+
return {
|
|
1301
|
+
baseUri: '/services/data/v63.0',
|
|
1302
|
+
basePath: '/connect/catalog/catalog-item/' + config.urlParams.catalogItemId + '',
|
|
1303
|
+
method: 'patch',
|
|
1304
|
+
body: config.body,
|
|
1305
|
+
urlParams: config.urlParams,
|
|
1306
|
+
queryParams: {},
|
|
1307
|
+
headers,
|
|
1308
|
+
priority: 'normal',
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
const adapterName = 'updateCatalogItem';
|
|
1313
|
+
const updateCatalogItem_ConfigPropertyMetadata = [
|
|
1314
|
+
generateParamConfigMetadata('catalogItemId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1315
|
+
generateParamConfigMetadata('catalogItemUpdateInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1316
|
+
];
|
|
1317
|
+
const updateCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateCatalogItem_ConfigPropertyMetadata);
|
|
1318
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(updateCatalogItem_ConfigPropertyMetadata);
|
|
1319
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1320
|
+
const config = {};
|
|
1321
|
+
typeCheckConfig$4(untrustedConfig, config, updateCatalogItem_ConfigPropertyMetadata);
|
|
1322
|
+
const untrustedConfig_catalogItemUpdateInput = untrustedConfig.catalogItemUpdateInput;
|
|
1323
|
+
const referenceCatalogItemUpdateInputRepresentationValidationError = validate(untrustedConfig_catalogItemUpdateInput);
|
|
1324
|
+
if (referenceCatalogItemUpdateInputRepresentationValidationError === null) {
|
|
1325
|
+
config.catalogItemUpdateInput = untrustedConfig_catalogItemUpdateInput;
|
|
1326
|
+
}
|
|
1327
|
+
return config;
|
|
1328
|
+
}
|
|
1329
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1330
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1331
|
+
return null;
|
|
1332
|
+
}
|
|
1333
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1334
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1335
|
+
}
|
|
1336
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1337
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1338
|
+
return null;
|
|
1339
|
+
}
|
|
1340
|
+
return config;
|
|
1341
|
+
}
|
|
1342
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1343
|
+
const resourceParams = createResourceParams(config);
|
|
1344
|
+
const request = createResourceRequest(resourceParams);
|
|
1345
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1346
|
+
.then((response) => {
|
|
1347
|
+
return luvio.handleSuccessResponse(() => {
|
|
1348
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1349
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1350
|
+
}, () => {
|
|
1351
|
+
const cache = new StoreKeyMap();
|
|
1352
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1353
|
+
return cache;
|
|
1354
|
+
});
|
|
1355
|
+
}, (response) => {
|
|
1356
|
+
deepFreeze(response);
|
|
1357
|
+
throw response;
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
const updateCatalogItemAdapterFactory = (luvio) => {
|
|
1361
|
+
return function updateCatalogItem(untrustedConfig) {
|
|
1362
|
+
const config = validateAdapterConfig(untrustedConfig, updateCatalogItem_ConfigPropertyNames);
|
|
1363
|
+
// Invalid or incomplete config
|
|
1364
|
+
if (config === null) {
|
|
1365
|
+
throw new Error('Invalid config for "updateCatalogItem"');
|
|
1366
|
+
}
|
|
1367
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1368
|
+
};
|
|
1369
|
+
};
|
|
396
1370
|
|
|
1371
|
+
let createCatalogItem;
|
|
397
1372
|
let getAllServiceAutomationDep;
|
|
1373
|
+
let getCatalogItem;
|
|
1374
|
+
let getCatalogItemNotifyChange;
|
|
1375
|
+
let updateCatalogItem;
|
|
398
1376
|
// Imperative GET Adapters
|
|
399
1377
|
let getAllServiceAutomationDep_imperative;
|
|
400
|
-
|
|
1378
|
+
let getCatalogItem_imperative;
|
|
401
1379
|
const getAllServiceAutomationDepMetadata = {
|
|
402
1380
|
apiFamily: 'ecm',
|
|
403
1381
|
name: 'getAllServiceAutomationDep',
|
|
404
1382
|
ttl: 6000,
|
|
405
1383
|
};
|
|
1384
|
+
const getCatalogItemMetadata = { apiFamily: 'ecm', name: 'getCatalogItem', ttl: 6000 };
|
|
406
1385
|
// Notify Update Available
|
|
407
1386
|
function bindExportsTo(luvio) {
|
|
408
1387
|
// LDS Adapters
|
|
409
1388
|
const getAllServiceAutomationDep_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAllServiceAutomationDep', getAllServiceAutomationDepAdapterFactory), getAllServiceAutomationDepMetadata);
|
|
1389
|
+
const getCatalogItem_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCatalogItem', getCatalogItemAdapterFactory), getCatalogItemMetadata);
|
|
1390
|
+
function unwrapSnapshotData(factory) {
|
|
1391
|
+
const adapter = factory(luvio);
|
|
1392
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
1393
|
+
}
|
|
410
1394
|
return {
|
|
1395
|
+
createCatalogItem: unwrapSnapshotData(createCatalogItemAdapterFactory),
|
|
411
1396
|
getAllServiceAutomationDep: createWireAdapterConstructor(luvio, getAllServiceAutomationDep_ldsAdapter, getAllServiceAutomationDepMetadata),
|
|
1397
|
+
getCatalogItem: createWireAdapterConstructor(luvio, getCatalogItem_ldsAdapter, getCatalogItemMetadata),
|
|
1398
|
+
getCatalogItemNotifyChange: createLDSAdapter(luvio, 'getCatalogItemNotifyChange', notifyChangeFactory),
|
|
1399
|
+
updateCatalogItem: unwrapSnapshotData(updateCatalogItemAdapterFactory),
|
|
412
1400
|
// Imperative GET Adapters
|
|
413
1401
|
getAllServiceAutomationDep_imperative: createImperativeAdapter(luvio, getAllServiceAutomationDep_ldsAdapter, getAllServiceAutomationDepMetadata),
|
|
1402
|
+
getCatalogItem_imperative: createImperativeAdapter(luvio, getCatalogItem_ldsAdapter, getCatalogItemMetadata),
|
|
414
1403
|
// Notify Update Availables
|
|
415
1404
|
};
|
|
416
1405
|
}
|
|
417
1406
|
withDefaultLuvio((luvio) => {
|
|
418
|
-
({
|
|
1407
|
+
({
|
|
1408
|
+
createCatalogItem,
|
|
1409
|
+
getAllServiceAutomationDep,
|
|
1410
|
+
getCatalogItem,
|
|
1411
|
+
getCatalogItemNotifyChange,
|
|
1412
|
+
updateCatalogItem,
|
|
1413
|
+
getAllServiceAutomationDep_imperative,
|
|
1414
|
+
getCatalogItem_imperative,
|
|
1415
|
+
} = bindExportsTo(luvio));
|
|
419
1416
|
});
|
|
420
1417
|
|
|
421
|
-
export { getAllServiceAutomationDep, getAllServiceAutomationDep_imperative };
|
|
422
|
-
// version: 1.
|
|
1418
|
+
export { createCatalogItem, getAllServiceAutomationDep, getAllServiceAutomationDep_imperative, getCatalogItem, getCatalogItemNotifyChange, getCatalogItem_imperative, updateCatalogItem };
|
|
1419
|
+
// version: 1.324.0-f16f2a27c7
|