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