@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.
Files changed (22) hide show
  1. package/dist/es/es2018/service-ecm.js +1046 -5
  2. package/dist/es/es2018/types/src/generated/adapters/createCatalogItem.d.ts +16 -0
  3. package/dist/es/es2018/types/src/generated/adapters/getCatalogItem.d.ts +28 -0
  4. package/dist/es/es2018/types/src/generated/adapters/updateCatalogItem.d.ts +17 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -1
  7. package/dist/es/es2018/types/src/generated/resources/getConnectCatalogCatalogItemByCatalogItemId.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/resources/patchConnectCatalogCatalogItemByCatalogItemId.d.ts +16 -0
  9. package/dist/es/es2018/types/src/generated/resources/postConnectCatalogCatalogItem.d.ts +13 -0
  10. package/dist/es/es2018/types/src/generated/types/CatalogItemAttributeInputRepresentation.d.ts +55 -0
  11. package/dist/es/es2018/types/src/generated/types/CatalogItemAttributeOutputRepresentation.d.ts +52 -0
  12. package/dist/es/es2018/types/src/generated/types/CatalogItemCreateInputRepresentation.d.ts +61 -0
  13. package/dist/es/es2018/types/src/generated/types/CatalogItemCreateWrapperInputRepresentation.d.ts +29 -0
  14. package/dist/es/es2018/types/src/generated/types/CatalogItemOutputRepresentation.d.ts +75 -0
  15. package/dist/es/es2018/types/src/generated/types/CatalogItemUpdateInputRepresentation.d.ts +64 -0
  16. package/dist/es/es2018/types/src/generated/types/CatalogItemUpdateWrapperInputRepresentation.d.ts +29 -0
  17. package/dist/es/es2018/types/src/generated/types/IntakeFormInputRepresentation.d.ts +31 -0
  18. package/dist/es/es2018/types/src/generated/types/IntakeFormOutputRepresentation.d.ts +31 -0
  19. package/package.json +3 -3
  20. package/sfdc/index.js +1149 -44
  21. package/src/raml/api.raml +321 -0
  22. package/src/raml/luvio.raml +17 -1
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$4 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -130,12 +130,1053 @@ const keyPrefix = 'ecm';
130
130
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
131
131
  const { isArray: ArrayIsArray } = Array;
132
132
  const { stringify: JSONStringify } = JSON;
133
+ function equalsArray(a, b, equalsItem) {
134
+ const aLength = a.length;
135
+ const bLength = b.length;
136
+ if (aLength !== bLength) {
137
+ return false;
138
+ }
139
+ for (let i = 0; i < aLength; i++) {
140
+ if (equalsItem(a[i], b[i]) === false) {
141
+ return false;
142
+ }
143
+ }
144
+ return true;
145
+ }
133
146
  function createLink(ref) {
134
147
  return {
135
148
  __ref: serializeStructuredKey(ref),
136
149
  };
137
150
  }
138
151
 
152
+ function validate$6(obj, path = 'CatalogItemCreateInputRepresentation') {
153
+ const v_error = (() => {
154
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
155
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
156
+ }
157
+ const obj_associatedArticles = obj.associatedArticles;
158
+ const path_associatedArticles = path + '.associatedArticles';
159
+ if (!ArrayIsArray(obj_associatedArticles)) {
160
+ return new TypeError('Expected "array" but received "' + typeof obj_associatedArticles + '" (at "' + path_associatedArticles + '")');
161
+ }
162
+ for (let i = 0; i < obj_associatedArticles.length; i++) {
163
+ const obj_associatedArticles_item = obj_associatedArticles[i];
164
+ const path_associatedArticles_item = path_associatedArticles + '[' + i + ']';
165
+ if (typeof obj_associatedArticles_item !== 'object' || ArrayIsArray(obj_associatedArticles_item) || obj_associatedArticles_item === null) {
166
+ return new TypeError('Expected "object" but received "' + typeof obj_associatedArticles_item + '" (at "' + path_associatedArticles_item + '")');
167
+ }
168
+ }
169
+ const obj_attributes = obj.attributes;
170
+ const path_attributes = path + '.attributes';
171
+ if (!ArrayIsArray(obj_attributes)) {
172
+ return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
173
+ }
174
+ for (let i = 0; i < obj_attributes.length; i++) {
175
+ const obj_attributes_item = obj_attributes[i];
176
+ const path_attributes_item = path_attributes + '[' + i + ']';
177
+ if (typeof obj_attributes_item !== 'object' || ArrayIsArray(obj_attributes_item) || obj_attributes_item === null) {
178
+ return new TypeError('Expected "object" but received "' + typeof obj_attributes_item + '" (at "' + path_attributes_item + '")');
179
+ }
180
+ }
181
+ const obj_contextDefinitionId = obj.contextDefinitionId;
182
+ const path_contextDefinitionId = path + '.contextDefinitionId';
183
+ if (typeof obj_contextDefinitionId !== 'string') {
184
+ return new TypeError('Expected "string" but received "' + typeof obj_contextDefinitionId + '" (at "' + path_contextDefinitionId + '")');
185
+ }
186
+ const obj_description = obj.description;
187
+ const path_description = path + '.description';
188
+ if (typeof obj_description !== 'string') {
189
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
190
+ }
191
+ const obj_eligibilityRules = obj.eligibilityRules;
192
+ const path_eligibilityRules = path + '.eligibilityRules';
193
+ if (!ArrayIsArray(obj_eligibilityRules)) {
194
+ return new TypeError('Expected "array" but received "' + typeof obj_eligibilityRules + '" (at "' + path_eligibilityRules + '")');
195
+ }
196
+ for (let i = 0; i < obj_eligibilityRules.length; i++) {
197
+ const obj_eligibilityRules_item = obj_eligibilityRules[i];
198
+ const path_eligibilityRules_item = path_eligibilityRules + '[' + i + ']';
199
+ if (typeof obj_eligibilityRules_item !== 'object' || ArrayIsArray(obj_eligibilityRules_item) || obj_eligibilityRules_item === null) {
200
+ return new TypeError('Expected "object" but received "' + typeof obj_eligibilityRules_item + '" (at "' + path_eligibilityRules_item + '")');
201
+ }
202
+ }
203
+ const obj_fulfillmentFlowId = obj.fulfillmentFlowId;
204
+ const path_fulfillmentFlowId = path + '.fulfillmentFlowId';
205
+ if (typeof obj_fulfillmentFlowId !== 'string') {
206
+ return new TypeError('Expected "string" but received "' + typeof obj_fulfillmentFlowId + '" (at "' + path_fulfillmentFlowId + '")');
207
+ }
208
+ const obj_intakeForm = obj.intakeForm;
209
+ const path_intakeForm = path + '.intakeForm';
210
+ if (typeof obj_intakeForm !== 'object' || ArrayIsArray(obj_intakeForm) || obj_intakeForm === null) {
211
+ return new TypeError('Expected "object" but received "' + typeof obj_intakeForm + '" (at "' + path_intakeForm + '")');
212
+ }
213
+ const obj_integrations = obj.integrations;
214
+ const path_integrations = path + '.integrations';
215
+ if (!ArrayIsArray(obj_integrations)) {
216
+ return new TypeError('Expected "array" but received "' + typeof obj_integrations + '" (at "' + path_integrations + '")');
217
+ }
218
+ for (let i = 0; i < obj_integrations.length; i++) {
219
+ const obj_integrations_item = obj_integrations[i];
220
+ const path_integrations_item = path_integrations + '[' + i + ']';
221
+ if (typeof obj_integrations_item !== 'object' || ArrayIsArray(obj_integrations_item) || obj_integrations_item === null) {
222
+ return new TypeError('Expected "object" but received "' + typeof obj_integrations_item + '" (at "' + path_integrations_item + '")');
223
+ }
224
+ }
225
+ const obj_isActive = obj.isActive;
226
+ const path_isActive = path + '.isActive';
227
+ if (typeof obj_isActive !== 'boolean') {
228
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
229
+ }
230
+ const obj_name = obj.name;
231
+ const path_name = path + '.name';
232
+ if (typeof obj_name !== 'string') {
233
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
234
+ }
235
+ const obj_preProcessorId = obj.preProcessorId;
236
+ const path_preProcessorId = path + '.preProcessorId';
237
+ if (typeof obj_preProcessorId !== 'string') {
238
+ return new TypeError('Expected "string" but received "' + typeof obj_preProcessorId + '" (at "' + path_preProcessorId + '")');
239
+ }
240
+ const obj_type = obj.type;
241
+ const path_type = path + '.type';
242
+ if (typeof obj_type !== 'string') {
243
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
244
+ }
245
+ })();
246
+ return v_error === undefined ? null : v_error;
247
+ }
248
+
249
+ const VERSION$3 = "984f5657f237c67c169022cb991d17de";
250
+ function validate$5(obj, path = 'CatalogItemAttributeOutputRepresentation') {
251
+ const v_error = (() => {
252
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
253
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
254
+ }
255
+ const obj_apiName = obj.apiName;
256
+ const path_apiName = path + '.apiName';
257
+ if (typeof obj_apiName !== 'string') {
258
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
259
+ }
260
+ const obj_contextAttributeId = obj.contextAttributeId;
261
+ const path_contextAttributeId = path + '.contextAttributeId';
262
+ if (typeof obj_contextAttributeId !== 'string') {
263
+ return new TypeError('Expected "string" but received "' + typeof obj_contextAttributeId + '" (at "' + path_contextAttributeId + '")');
264
+ }
265
+ const obj_dataType = obj.dataType;
266
+ const path_dataType = path + '.dataType';
267
+ if (typeof obj_dataType !== 'string') {
268
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
269
+ }
270
+ const obj_defaultValue = obj.defaultValue;
271
+ const path_defaultValue = path + '.defaultValue';
272
+ if (typeof obj_defaultValue !== 'string') {
273
+ return new TypeError('Expected "string" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
274
+ }
275
+ const obj_description = obj.description;
276
+ const path_description = path + '.description';
277
+ if (typeof obj_description !== 'string') {
278
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
279
+ }
280
+ const obj_isHidden = obj.isHidden;
281
+ const path_isHidden = path + '.isHidden';
282
+ if (typeof obj_isHidden !== 'boolean') {
283
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isHidden + '" (at "' + path_isHidden + '")');
284
+ }
285
+ const obj_name = obj.name;
286
+ const path_name = path + '.name';
287
+ if (typeof obj_name !== 'string') {
288
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
289
+ }
290
+ const obj_parent = obj.parent;
291
+ const path_parent = path + '.parent';
292
+ if (typeof obj_parent !== 'string') {
293
+ return new TypeError('Expected "string" but received "' + typeof obj_parent + '" (at "' + path_parent + '")');
294
+ }
295
+ const obj_sequence = obj.sequence;
296
+ const path_sequence = path + '.sequence';
297
+ if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
298
+ return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
299
+ }
300
+ })();
301
+ return v_error === undefined ? null : v_error;
302
+ }
303
+ const select$7 = function CatalogItemAttributeOutputRepresentationSelect() {
304
+ return {
305
+ kind: 'Fragment',
306
+ version: VERSION$3,
307
+ private: [],
308
+ selections: [
309
+ {
310
+ name: 'apiName',
311
+ kind: 'Scalar'
312
+ },
313
+ {
314
+ name: 'contextAttributeId',
315
+ kind: 'Scalar'
316
+ },
317
+ {
318
+ name: 'dataType',
319
+ kind: 'Scalar'
320
+ },
321
+ {
322
+ name: 'defaultValue',
323
+ kind: 'Scalar'
324
+ },
325
+ {
326
+ name: 'description',
327
+ kind: 'Scalar'
328
+ },
329
+ {
330
+ name: 'isHidden',
331
+ kind: 'Scalar'
332
+ },
333
+ {
334
+ name: 'name',
335
+ kind: 'Scalar'
336
+ },
337
+ {
338
+ name: 'parent',
339
+ kind: 'Scalar'
340
+ },
341
+ {
342
+ name: 'sequence',
343
+ kind: 'Scalar'
344
+ }
345
+ ]
346
+ };
347
+ };
348
+ function equals$3(existing, incoming) {
349
+ const existing_isHidden = existing.isHidden;
350
+ const incoming_isHidden = incoming.isHidden;
351
+ if (!(existing_isHidden === incoming_isHidden)) {
352
+ return false;
353
+ }
354
+ const existing_sequence = existing.sequence;
355
+ const incoming_sequence = incoming.sequence;
356
+ if (!(existing_sequence === incoming_sequence)) {
357
+ return false;
358
+ }
359
+ const existing_apiName = existing.apiName;
360
+ const incoming_apiName = incoming.apiName;
361
+ if (!(existing_apiName === incoming_apiName)) {
362
+ return false;
363
+ }
364
+ const existing_contextAttributeId = existing.contextAttributeId;
365
+ const incoming_contextAttributeId = incoming.contextAttributeId;
366
+ if (!(existing_contextAttributeId === incoming_contextAttributeId)) {
367
+ return false;
368
+ }
369
+ const existing_dataType = existing.dataType;
370
+ const incoming_dataType = incoming.dataType;
371
+ if (!(existing_dataType === incoming_dataType)) {
372
+ return false;
373
+ }
374
+ const existing_defaultValue = existing.defaultValue;
375
+ const incoming_defaultValue = incoming.defaultValue;
376
+ if (!(existing_defaultValue === incoming_defaultValue)) {
377
+ return false;
378
+ }
379
+ const existing_description = existing.description;
380
+ const incoming_description = incoming.description;
381
+ if (!(existing_description === incoming_description)) {
382
+ return false;
383
+ }
384
+ const existing_name = existing.name;
385
+ const incoming_name = incoming.name;
386
+ if (!(existing_name === incoming_name)) {
387
+ return false;
388
+ }
389
+ const existing_parent = existing.parent;
390
+ const incoming_parent = incoming.parent;
391
+ if (!(existing_parent === incoming_parent)) {
392
+ return false;
393
+ }
394
+ return true;
395
+ }
396
+
397
+ const VERSION$2 = "d0fe6f2d5b8246f10afe4067d3721d5b";
398
+ function validate$4(obj, path = 'IntakeFormOutputRepresentation') {
399
+ const v_error = (() => {
400
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
401
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
402
+ }
403
+ const obj_id = obj.id;
404
+ const path_id = path + '.id';
405
+ if (typeof obj_id !== 'string') {
406
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
407
+ }
408
+ const obj_type = obj.type;
409
+ const path_type = path + '.type';
410
+ if (typeof obj_type !== 'string') {
411
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
412
+ }
413
+ })();
414
+ return v_error === undefined ? null : v_error;
415
+ }
416
+ const select$6 = function IntakeFormOutputRepresentationSelect() {
417
+ return {
418
+ kind: 'Fragment',
419
+ version: VERSION$2,
420
+ private: [],
421
+ selections: [
422
+ {
423
+ name: 'id',
424
+ kind: 'Scalar'
425
+ },
426
+ {
427
+ name: 'type',
428
+ kind: 'Scalar'
429
+ }
430
+ ]
431
+ };
432
+ };
433
+ function equals$2(existing, incoming) {
434
+ const existing_id = existing.id;
435
+ const incoming_id = incoming.id;
436
+ if (!(existing_id === incoming_id)) {
437
+ return false;
438
+ }
439
+ const existing_type = existing.type;
440
+ const incoming_type = incoming.type;
441
+ if (!(existing_type === incoming_type)) {
442
+ return false;
443
+ }
444
+ return true;
445
+ }
446
+
447
+ const TTL$1 = 6000;
448
+ const VERSION$1 = "5ef83ee2ecf0f385dcf82e0092ec871b";
449
+ function validate$3(obj, path = 'CatalogItemOutputRepresentation') {
450
+ const v_error = (() => {
451
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
452
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
453
+ }
454
+ const obj_associatedArticles = obj.associatedArticles;
455
+ const path_associatedArticles = path + '.associatedArticles';
456
+ if (!ArrayIsArray(obj_associatedArticles)) {
457
+ return new TypeError('Expected "array" but received "' + typeof obj_associatedArticles + '" (at "' + path_associatedArticles + '")');
458
+ }
459
+ for (let i = 0; i < obj_associatedArticles.length; i++) {
460
+ const obj_associatedArticles_item = obj_associatedArticles[i];
461
+ const path_associatedArticles_item = path_associatedArticles + '[' + i + ']';
462
+ if (typeof obj_associatedArticles_item !== 'string') {
463
+ return new TypeError('Expected "string" but received "' + typeof obj_associatedArticles_item + '" (at "' + path_associatedArticles_item + '")');
464
+ }
465
+ }
466
+ const obj_attributes = obj.attributes;
467
+ const path_attributes = path + '.attributes';
468
+ if (!ArrayIsArray(obj_attributes)) {
469
+ return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
470
+ }
471
+ for (let i = 0; i < obj_attributes.length; i++) {
472
+ const obj_attributes_item = obj_attributes[i];
473
+ const path_attributes_item = path_attributes + '[' + i + ']';
474
+ const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
475
+ if (referencepath_attributes_itemValidationError !== null) {
476
+ let message = 'Object doesn\'t match CatalogItemAttributeOutputRepresentation (at "' + path_attributes_item + '")\n';
477
+ message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
478
+ return new TypeError(message);
479
+ }
480
+ }
481
+ const obj_catalogItemId = obj.catalogItemId;
482
+ const path_catalogItemId = path + '.catalogItemId';
483
+ if (typeof obj_catalogItemId !== 'string') {
484
+ return new TypeError('Expected "string" but received "' + typeof obj_catalogItemId + '" (at "' + path_catalogItemId + '")');
485
+ }
486
+ const obj_contextDefinitionId = obj.contextDefinitionId;
487
+ const path_contextDefinitionId = path + '.contextDefinitionId';
488
+ if (typeof obj_contextDefinitionId !== 'string') {
489
+ return new TypeError('Expected "string" but received "' + typeof obj_contextDefinitionId + '" (at "' + path_contextDefinitionId + '")');
490
+ }
491
+ const obj_description = obj.description;
492
+ const path_description = path + '.description';
493
+ if (typeof obj_description !== 'string') {
494
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
495
+ }
496
+ const obj_eligibilityRules = obj.eligibilityRules;
497
+ const path_eligibilityRules = path + '.eligibilityRules';
498
+ if (!ArrayIsArray(obj_eligibilityRules)) {
499
+ return new TypeError('Expected "array" but received "' + typeof obj_eligibilityRules + '" (at "' + path_eligibilityRules + '")');
500
+ }
501
+ for (let i = 0; i < obj_eligibilityRules.length; i++) {
502
+ const obj_eligibilityRules_item = obj_eligibilityRules[i];
503
+ const path_eligibilityRules_item = path_eligibilityRules + '[' + i + ']';
504
+ if (typeof obj_eligibilityRules_item !== 'string') {
505
+ return new TypeError('Expected "string" but received "' + typeof obj_eligibilityRules_item + '" (at "' + path_eligibilityRules_item + '")');
506
+ }
507
+ }
508
+ const obj_fulfillmentFlowId = obj.fulfillmentFlowId;
509
+ const path_fulfillmentFlowId = path + '.fulfillmentFlowId';
510
+ if (typeof obj_fulfillmentFlowId !== 'string') {
511
+ return new TypeError('Expected "string" but received "' + typeof obj_fulfillmentFlowId + '" (at "' + path_fulfillmentFlowId + '")');
512
+ }
513
+ const obj_intakeForm = obj.intakeForm;
514
+ const path_intakeForm = path + '.intakeForm';
515
+ const referencepath_intakeFormValidationError = validate$4(obj_intakeForm, path_intakeForm);
516
+ if (referencepath_intakeFormValidationError !== null) {
517
+ let message = 'Object doesn\'t match IntakeFormOutputRepresentation (at "' + path_intakeForm + '")\n';
518
+ message += referencepath_intakeFormValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
519
+ return new TypeError(message);
520
+ }
521
+ const obj_integrations = obj.integrations;
522
+ const path_integrations = path + '.integrations';
523
+ if (!ArrayIsArray(obj_integrations)) {
524
+ return new TypeError('Expected "array" but received "' + typeof obj_integrations + '" (at "' + path_integrations + '")');
525
+ }
526
+ for (let i = 0; i < obj_integrations.length; i++) {
527
+ const obj_integrations_item = obj_integrations[i];
528
+ const path_integrations_item = path_integrations + '[' + i + ']';
529
+ if (typeof obj_integrations_item !== 'string') {
530
+ return new TypeError('Expected "string" but received "' + typeof obj_integrations_item + '" (at "' + path_integrations_item + '")');
531
+ }
532
+ }
533
+ const obj_isActive = obj.isActive;
534
+ const path_isActive = path + '.isActive';
535
+ if (typeof obj_isActive !== 'boolean') {
536
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
537
+ }
538
+ const obj_name = obj.name;
539
+ const path_name = path + '.name';
540
+ if (typeof obj_name !== 'string') {
541
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
542
+ }
543
+ const obj_preProcessorId = obj.preProcessorId;
544
+ const path_preProcessorId = path + '.preProcessorId';
545
+ if (typeof obj_preProcessorId !== 'string') {
546
+ return new TypeError('Expected "string" but received "' + typeof obj_preProcessorId + '" (at "' + path_preProcessorId + '")');
547
+ }
548
+ const obj_type = obj.type;
549
+ const path_type = path + '.type';
550
+ if (typeof obj_type !== 'string') {
551
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
552
+ }
553
+ })();
554
+ return v_error === undefined ? null : v_error;
555
+ }
556
+ const RepresentationType$1 = 'CatalogItemOutputRepresentation';
557
+ function keyBuilder$4(luvio, config) {
558
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.catalogItemId;
559
+ }
560
+ function keyBuilderFromType(luvio, object) {
561
+ const keyParams = {
562
+ catalogItemId: object.catalogItemId
563
+ };
564
+ return keyBuilder$4(luvio, keyParams);
565
+ }
566
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
567
+ return input;
568
+ }
569
+ const select$5 = function CatalogItemOutputRepresentationSelect() {
570
+ const { selections: CatalogItemAttributeOutputRepresentation__selections, opaque: CatalogItemAttributeOutputRepresentation__opaque, } = select$7();
571
+ const { selections: IntakeFormOutputRepresentation__selections, opaque: IntakeFormOutputRepresentation__opaque, } = select$6();
572
+ return {
573
+ kind: 'Fragment',
574
+ version: VERSION$1,
575
+ private: [],
576
+ selections: [
577
+ {
578
+ name: 'associatedArticles',
579
+ kind: 'Scalar',
580
+ plural: true
581
+ },
582
+ {
583
+ name: 'attributes',
584
+ kind: 'Object',
585
+ plural: true,
586
+ selections: CatalogItemAttributeOutputRepresentation__selections
587
+ },
588
+ {
589
+ name: 'catalogItemId',
590
+ kind: 'Scalar'
591
+ },
592
+ {
593
+ name: 'contextDefinitionId',
594
+ kind: 'Scalar'
595
+ },
596
+ {
597
+ name: 'description',
598
+ kind: 'Scalar'
599
+ },
600
+ {
601
+ name: 'eligibilityRules',
602
+ kind: 'Scalar',
603
+ plural: true
604
+ },
605
+ {
606
+ name: 'fulfillmentFlowId',
607
+ kind: 'Scalar'
608
+ },
609
+ {
610
+ name: 'intakeForm',
611
+ kind: 'Object',
612
+ selections: IntakeFormOutputRepresentation__selections
613
+ },
614
+ {
615
+ name: 'integrations',
616
+ kind: 'Scalar',
617
+ plural: true
618
+ },
619
+ {
620
+ name: 'isActive',
621
+ kind: 'Scalar'
622
+ },
623
+ {
624
+ name: 'name',
625
+ kind: 'Scalar'
626
+ },
627
+ {
628
+ name: 'preProcessorId',
629
+ kind: 'Scalar'
630
+ },
631
+ {
632
+ name: 'type',
633
+ kind: 'Scalar'
634
+ }
635
+ ]
636
+ };
637
+ };
638
+ function equals$1(existing, incoming) {
639
+ const existing_isActive = existing.isActive;
640
+ const incoming_isActive = incoming.isActive;
641
+ if (!(existing_isActive === incoming_isActive)) {
642
+ return false;
643
+ }
644
+ const existing_catalogItemId = existing.catalogItemId;
645
+ const incoming_catalogItemId = incoming.catalogItemId;
646
+ if (!(existing_catalogItemId === incoming_catalogItemId)) {
647
+ return false;
648
+ }
649
+ const existing_contextDefinitionId = existing.contextDefinitionId;
650
+ const incoming_contextDefinitionId = incoming.contextDefinitionId;
651
+ if (!(existing_contextDefinitionId === incoming_contextDefinitionId)) {
652
+ return false;
653
+ }
654
+ const existing_description = existing.description;
655
+ const incoming_description = incoming.description;
656
+ if (!(existing_description === incoming_description)) {
657
+ return false;
658
+ }
659
+ const existing_fulfillmentFlowId = existing.fulfillmentFlowId;
660
+ const incoming_fulfillmentFlowId = incoming.fulfillmentFlowId;
661
+ if (!(existing_fulfillmentFlowId === incoming_fulfillmentFlowId)) {
662
+ return false;
663
+ }
664
+ const existing_name = existing.name;
665
+ const incoming_name = incoming.name;
666
+ if (!(existing_name === incoming_name)) {
667
+ return false;
668
+ }
669
+ const existing_preProcessorId = existing.preProcessorId;
670
+ const incoming_preProcessorId = incoming.preProcessorId;
671
+ if (!(existing_preProcessorId === incoming_preProcessorId)) {
672
+ return false;
673
+ }
674
+ const existing_type = existing.type;
675
+ const incoming_type = incoming.type;
676
+ if (!(existing_type === incoming_type)) {
677
+ return false;
678
+ }
679
+ const existing_associatedArticles = existing.associatedArticles;
680
+ const incoming_associatedArticles = incoming.associatedArticles;
681
+ const equals_associatedArticles_items = equalsArray(existing_associatedArticles, incoming_associatedArticles, (existing_associatedArticles_item, incoming_associatedArticles_item) => {
682
+ if (!(existing_associatedArticles_item === incoming_associatedArticles_item)) {
683
+ return false;
684
+ }
685
+ });
686
+ if (equals_associatedArticles_items === false) {
687
+ return false;
688
+ }
689
+ const existing_attributes = existing.attributes;
690
+ const incoming_attributes = incoming.attributes;
691
+ const equals_attributes_items = equalsArray(existing_attributes, incoming_attributes, (existing_attributes_item, incoming_attributes_item) => {
692
+ if (!(equals$3(existing_attributes_item, incoming_attributes_item))) {
693
+ return false;
694
+ }
695
+ });
696
+ if (equals_attributes_items === false) {
697
+ return false;
698
+ }
699
+ const existing_eligibilityRules = existing.eligibilityRules;
700
+ const incoming_eligibilityRules = incoming.eligibilityRules;
701
+ const equals_eligibilityRules_items = equalsArray(existing_eligibilityRules, incoming_eligibilityRules, (existing_eligibilityRules_item, incoming_eligibilityRules_item) => {
702
+ if (!(existing_eligibilityRules_item === incoming_eligibilityRules_item)) {
703
+ return false;
704
+ }
705
+ });
706
+ if (equals_eligibilityRules_items === false) {
707
+ return false;
708
+ }
709
+ const existing_intakeForm = existing.intakeForm;
710
+ const incoming_intakeForm = incoming.intakeForm;
711
+ if (!(equals$2(existing_intakeForm, incoming_intakeForm))) {
712
+ return false;
713
+ }
714
+ const existing_integrations = existing.integrations;
715
+ const incoming_integrations = incoming.integrations;
716
+ const equals_integrations_items = equalsArray(existing_integrations, incoming_integrations, (existing_integrations_item, incoming_integrations_item) => {
717
+ if (!(existing_integrations_item === incoming_integrations_item)) {
718
+ return false;
719
+ }
720
+ });
721
+ if (equals_integrations_items === false) {
722
+ return false;
723
+ }
724
+ return true;
725
+ }
726
+ const ingest$1 = function CatalogItemOutputRepresentationIngest(input, path, luvio, store, timestamp) {
727
+ if (process.env.NODE_ENV !== 'production') {
728
+ const validateError = validate$3(input);
729
+ if (validateError !== null) {
730
+ throw validateError;
731
+ }
732
+ }
733
+ const key = keyBuilderFromType(luvio, input);
734
+ const ttlToUse = TTL$1;
735
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "ecm", VERSION$1, RepresentationType$1, equals$1);
736
+ return createLink(key);
737
+ };
738
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
739
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
740
+ const rootKey = keyBuilderFromType(luvio, input);
741
+ rootKeySet.set(rootKey, {
742
+ namespace: keyPrefix,
743
+ representationName: RepresentationType$1,
744
+ mergeable: false
745
+ });
746
+ }
747
+
748
+ function select$4(luvio, params) {
749
+ return select$5();
750
+ }
751
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
752
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
753
+ }
754
+ function ingestSuccess$3(luvio, resourceParams, response) {
755
+ const { body } = response;
756
+ const key = keyBuilderFromType(luvio, body);
757
+ luvio.storeIngest(key, ingest$1, body);
758
+ const snapshot = luvio.storeLookup({
759
+ recordId: key,
760
+ node: select$4(),
761
+ variables: {},
762
+ });
763
+ if (process.env.NODE_ENV !== 'production') {
764
+ if (snapshot.state !== 'Fulfilled') {
765
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
766
+ }
767
+ }
768
+ deepFreeze(snapshot.data);
769
+ return snapshot;
770
+ }
771
+ function createResourceRequest$3(config) {
772
+ const headers = {};
773
+ return {
774
+ baseUri: '/services/data/v63.0',
775
+ basePath: '/connect/catalog/catalog-item',
776
+ method: 'post',
777
+ body: config.body,
778
+ urlParams: {},
779
+ queryParams: {},
780
+ headers,
781
+ priority: 'normal',
782
+ };
783
+ }
784
+
785
+ const adapterName$3 = 'createCatalogItem';
786
+ const createCatalogItem_ConfigPropertyMetadata = [
787
+ generateParamConfigMetadata('catalogItemCreateInput', true, 2 /* Body */, 4 /* Unsupported */),
788
+ ];
789
+ const createCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createCatalogItem_ConfigPropertyMetadata);
790
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createCatalogItem_ConfigPropertyMetadata);
791
+ function typeCheckConfig$3(untrustedConfig) {
792
+ const config = {};
793
+ const untrustedConfig_catalogItemCreateInput = untrustedConfig.catalogItemCreateInput;
794
+ const referenceCatalogItemCreateInputRepresentationValidationError = validate$6(untrustedConfig_catalogItemCreateInput);
795
+ if (referenceCatalogItemCreateInputRepresentationValidationError === null) {
796
+ config.catalogItemCreateInput = untrustedConfig_catalogItemCreateInput;
797
+ }
798
+ return config;
799
+ }
800
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
801
+ if (!untrustedIsObject(untrustedConfig)) {
802
+ return null;
803
+ }
804
+ if (process.env.NODE_ENV !== 'production') {
805
+ validateConfig(untrustedConfig, configPropertyNames);
806
+ }
807
+ const config = typeCheckConfig$3(untrustedConfig);
808
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
809
+ return null;
810
+ }
811
+ return config;
812
+ }
813
+ function buildNetworkSnapshot$3(luvio, config, options) {
814
+ const resourceParams = createResourceParams$3(config);
815
+ const request = createResourceRequest$3(resourceParams);
816
+ return luvio.dispatchResourceRequest(request, options)
817
+ .then((response) => {
818
+ return luvio.handleSuccessResponse(() => {
819
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
820
+ return luvio.storeBroadcast().then(() => snapshot);
821
+ }, () => {
822
+ const cache = new StoreKeyMap();
823
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
824
+ return cache;
825
+ });
826
+ }, (response) => {
827
+ deepFreeze(response);
828
+ throw response;
829
+ });
830
+ }
831
+ const createCatalogItemAdapterFactory = (luvio) => {
832
+ return function createCatalogItem(untrustedConfig) {
833
+ const config = validateAdapterConfig$3(untrustedConfig, createCatalogItem_ConfigPropertyNames);
834
+ // Invalid or incomplete config
835
+ if (config === null) {
836
+ throw new Error('Invalid config for "createCatalogItem"');
837
+ }
838
+ return buildNetworkSnapshot$3(luvio, config);
839
+ };
840
+ };
841
+
842
+ function select$3(luvio, params) {
843
+ return select$5();
844
+ }
845
+ function keyBuilder$3(luvio, params) {
846
+ return keyBuilder$4(luvio, {
847
+ catalogItemId: params.urlParams.catalogItemId
848
+ });
849
+ }
850
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
851
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
852
+ }
853
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
854
+ const { body } = response;
855
+ const key = keyBuilder$3(luvio, resourceParams);
856
+ luvio.storeIngest(key, ingest$1, body);
857
+ const snapshot = luvio.storeLookup({
858
+ recordId: key,
859
+ node: select$3(),
860
+ variables: {},
861
+ }, snapshotRefresh);
862
+ if (process.env.NODE_ENV !== 'production') {
863
+ if (snapshot.state !== 'Fulfilled') {
864
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
865
+ }
866
+ }
867
+ deepFreeze(snapshot.data);
868
+ return snapshot;
869
+ }
870
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
871
+ const key = keyBuilder$3(luvio, params);
872
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
873
+ const storeMetadataParams = {
874
+ ttl: TTL$1,
875
+ namespace: keyPrefix,
876
+ version: VERSION$1,
877
+ representationName: RepresentationType$1
878
+ };
879
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
880
+ return errorSnapshot;
881
+ }
882
+ function createResourceRequest$2(config) {
883
+ const headers = {};
884
+ return {
885
+ baseUri: '/services/data/v63.0',
886
+ basePath: '/connect/catalog/catalog-item/' + config.urlParams.catalogItemId + '',
887
+ method: 'get',
888
+ body: null,
889
+ urlParams: config.urlParams,
890
+ queryParams: {},
891
+ headers,
892
+ priority: 'normal',
893
+ };
894
+ }
895
+
896
+ const adapterName$2 = 'getCatalogItem';
897
+ const getCatalogItem_ConfigPropertyMetadata = [
898
+ generateParamConfigMetadata('catalogItemId', true, 0 /* UrlParameter */, 0 /* String */),
899
+ ];
900
+ const getCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getCatalogItem_ConfigPropertyMetadata);
901
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getCatalogItem_ConfigPropertyMetadata);
902
+ function keyBuilder$2(luvio, config) {
903
+ const resourceParams = createResourceParams$2(config);
904
+ return keyBuilder$3(luvio, resourceParams);
905
+ }
906
+ function typeCheckConfig$2(untrustedConfig) {
907
+ const config = {};
908
+ typeCheckConfig$4(untrustedConfig, config, getCatalogItem_ConfigPropertyMetadata);
909
+ return config;
910
+ }
911
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
912
+ if (!untrustedIsObject(untrustedConfig)) {
913
+ return null;
914
+ }
915
+ if (process.env.NODE_ENV !== 'production') {
916
+ validateConfig(untrustedConfig, configPropertyNames);
917
+ }
918
+ const config = typeCheckConfig$2(untrustedConfig);
919
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
920
+ return null;
921
+ }
922
+ return config;
923
+ }
924
+ function adapterFragment$1(luvio, config) {
925
+ createResourceParams$2(config);
926
+ return select$3();
927
+ }
928
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
929
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
930
+ config,
931
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
932
+ });
933
+ return luvio.storeBroadcast().then(() => snapshot);
934
+ }
935
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
936
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
937
+ config,
938
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
939
+ });
940
+ return luvio.storeBroadcast().then(() => snapshot);
941
+ }
942
+ function buildNetworkSnapshot$2(luvio, config, options) {
943
+ const resourceParams = createResourceParams$2(config);
944
+ const request = createResourceRequest$2(resourceParams);
945
+ return luvio.dispatchResourceRequest(request, options)
946
+ .then((response) => {
947
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
948
+ const cache = new StoreKeyMap();
949
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
950
+ return cache;
951
+ });
952
+ }, (response) => {
953
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
954
+ });
955
+ }
956
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
957
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
958
+ }
959
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
960
+ const { luvio, config } = context;
961
+ const selector = {
962
+ recordId: keyBuilder$2(luvio, config),
963
+ node: adapterFragment$1(luvio, config),
964
+ variables: {},
965
+ };
966
+ const cacheSnapshot = storeLookup(selector, {
967
+ config,
968
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
969
+ });
970
+ return cacheSnapshot;
971
+ }
972
+ const getCatalogItemAdapterFactory = (luvio) => function ecm__getCatalogItem(untrustedConfig, requestContext) {
973
+ const config = validateAdapterConfig$2(untrustedConfig, getCatalogItem_ConfigPropertyNames);
974
+ // Invalid or incomplete config
975
+ if (config === null) {
976
+ return null;
977
+ }
978
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
979
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
980
+ };
981
+
982
+ function validate$2(obj, path = 'CatalogItemUpdateInputRepresentation') {
983
+ const v_error = (() => {
984
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
985
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
986
+ }
987
+ const obj_associatedArticles = obj.associatedArticles;
988
+ const path_associatedArticles = path + '.associatedArticles';
989
+ if (!ArrayIsArray(obj_associatedArticles)) {
990
+ return new TypeError('Expected "array" but received "' + typeof obj_associatedArticles + '" (at "' + path_associatedArticles + '")');
991
+ }
992
+ for (let i = 0; i < obj_associatedArticles.length; i++) {
993
+ const obj_associatedArticles_item = obj_associatedArticles[i];
994
+ const path_associatedArticles_item = path_associatedArticles + '[' + i + ']';
995
+ if (typeof obj_associatedArticles_item !== 'object' || ArrayIsArray(obj_associatedArticles_item) || obj_associatedArticles_item === null) {
996
+ return new TypeError('Expected "object" but received "' + typeof obj_associatedArticles_item + '" (at "' + path_associatedArticles_item + '")');
997
+ }
998
+ }
999
+ const obj_attributes = obj.attributes;
1000
+ const path_attributes = path + '.attributes';
1001
+ if (!ArrayIsArray(obj_attributes)) {
1002
+ return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
1003
+ }
1004
+ for (let i = 0; i < obj_attributes.length; i++) {
1005
+ const obj_attributes_item = obj_attributes[i];
1006
+ const path_attributes_item = path_attributes + '[' + i + ']';
1007
+ if (typeof obj_attributes_item !== 'object' || ArrayIsArray(obj_attributes_item) || obj_attributes_item === null) {
1008
+ return new TypeError('Expected "object" but received "' + typeof obj_attributes_item + '" (at "' + path_attributes_item + '")');
1009
+ }
1010
+ }
1011
+ const obj_contextDefinitionId = obj.contextDefinitionId;
1012
+ const path_contextDefinitionId = path + '.contextDefinitionId';
1013
+ if (typeof obj_contextDefinitionId !== 'string') {
1014
+ return new TypeError('Expected "string" but received "' + typeof obj_contextDefinitionId + '" (at "' + path_contextDefinitionId + '")');
1015
+ }
1016
+ const obj_description = obj.description;
1017
+ const path_description = path + '.description';
1018
+ if (typeof obj_description !== 'string') {
1019
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1020
+ }
1021
+ const obj_eligibilityRules = obj.eligibilityRules;
1022
+ const path_eligibilityRules = path + '.eligibilityRules';
1023
+ if (!ArrayIsArray(obj_eligibilityRules)) {
1024
+ return new TypeError('Expected "array" but received "' + typeof obj_eligibilityRules + '" (at "' + path_eligibilityRules + '")');
1025
+ }
1026
+ for (let i = 0; i < obj_eligibilityRules.length; i++) {
1027
+ const obj_eligibilityRules_item = obj_eligibilityRules[i];
1028
+ const path_eligibilityRules_item = path_eligibilityRules + '[' + i + ']';
1029
+ if (typeof obj_eligibilityRules_item !== 'object' || ArrayIsArray(obj_eligibilityRules_item) || obj_eligibilityRules_item === null) {
1030
+ return new TypeError('Expected "object" but received "' + typeof obj_eligibilityRules_item + '" (at "' + path_eligibilityRules_item + '")');
1031
+ }
1032
+ }
1033
+ const obj_fulfillmentFlowId = obj.fulfillmentFlowId;
1034
+ const path_fulfillmentFlowId = path + '.fulfillmentFlowId';
1035
+ if (typeof obj_fulfillmentFlowId !== 'string') {
1036
+ return new TypeError('Expected "string" but received "' + typeof obj_fulfillmentFlowId + '" (at "' + path_fulfillmentFlowId + '")');
1037
+ }
1038
+ const obj_id = obj.id;
1039
+ const path_id = path + '.id';
1040
+ if (typeof obj_id !== 'string') {
1041
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1042
+ }
1043
+ const obj_intakeForm = obj.intakeForm;
1044
+ const path_intakeForm = path + '.intakeForm';
1045
+ if (typeof obj_intakeForm !== 'object' || ArrayIsArray(obj_intakeForm) || obj_intakeForm === null) {
1046
+ return new TypeError('Expected "object" but received "' + typeof obj_intakeForm + '" (at "' + path_intakeForm + '")');
1047
+ }
1048
+ const obj_integrations = obj.integrations;
1049
+ const path_integrations = path + '.integrations';
1050
+ if (!ArrayIsArray(obj_integrations)) {
1051
+ return new TypeError('Expected "array" but received "' + typeof obj_integrations + '" (at "' + path_integrations + '")');
1052
+ }
1053
+ for (let i = 0; i < obj_integrations.length; i++) {
1054
+ const obj_integrations_item = obj_integrations[i];
1055
+ const path_integrations_item = path_integrations + '[' + i + ']';
1056
+ if (typeof obj_integrations_item !== 'object' || ArrayIsArray(obj_integrations_item) || obj_integrations_item === null) {
1057
+ return new TypeError('Expected "object" but received "' + typeof obj_integrations_item + '" (at "' + path_integrations_item + '")');
1058
+ }
1059
+ }
1060
+ const obj_isActive = obj.isActive;
1061
+ const path_isActive = path + '.isActive';
1062
+ if (typeof obj_isActive !== 'boolean') {
1063
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
1064
+ }
1065
+ const obj_name = obj.name;
1066
+ const path_name = path + '.name';
1067
+ if (typeof obj_name !== 'string') {
1068
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1069
+ }
1070
+ const obj_preProcessorId = obj.preProcessorId;
1071
+ const path_preProcessorId = path + '.preProcessorId';
1072
+ if (typeof obj_preProcessorId !== 'string') {
1073
+ return new TypeError('Expected "string" but received "' + typeof obj_preProcessorId + '" (at "' + path_preProcessorId + '")');
1074
+ }
1075
+ const obj_type = obj.type;
1076
+ const path_type = path + '.type';
1077
+ if (typeof obj_type !== 'string') {
1078
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1079
+ }
1080
+ })();
1081
+ return v_error === undefined ? null : v_error;
1082
+ }
1083
+
1084
+ function select$2(luvio, params) {
1085
+ return select$5();
1086
+ }
1087
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1088
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
1089
+ }
1090
+ function ingestSuccess$1(luvio, resourceParams, response) {
1091
+ const { body } = response;
1092
+ const key = keyBuilderFromType(luvio, body);
1093
+ luvio.storeIngest(key, ingest$1, body);
1094
+ const snapshot = luvio.storeLookup({
1095
+ recordId: key,
1096
+ node: select$2(),
1097
+ variables: {},
1098
+ });
1099
+ if (process.env.NODE_ENV !== 'production') {
1100
+ if (snapshot.state !== 'Fulfilled') {
1101
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1102
+ }
1103
+ }
1104
+ deepFreeze(snapshot.data);
1105
+ return snapshot;
1106
+ }
1107
+ function createResourceRequest$1(config) {
1108
+ const headers = {};
1109
+ return {
1110
+ baseUri: '/services/data/v63.0',
1111
+ basePath: '/connect/catalog/catalog-item/' + config.urlParams.catalogItemId + '',
1112
+ method: 'patch',
1113
+ body: config.body,
1114
+ urlParams: config.urlParams,
1115
+ queryParams: {},
1116
+ headers,
1117
+ priority: 'normal',
1118
+ };
1119
+ }
1120
+
1121
+ const adapterName$1 = 'updateCatalogItem';
1122
+ const updateCatalogItem_ConfigPropertyMetadata = [
1123
+ generateParamConfigMetadata('catalogItemId', true, 0 /* UrlParameter */, 0 /* String */),
1124
+ generateParamConfigMetadata('catalogItemUpdateInput', true, 2 /* Body */, 4 /* Unsupported */),
1125
+ ];
1126
+ const updateCatalogItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, updateCatalogItem_ConfigPropertyMetadata);
1127
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(updateCatalogItem_ConfigPropertyMetadata);
1128
+ function typeCheckConfig$1(untrustedConfig) {
1129
+ const config = {};
1130
+ typeCheckConfig$4(untrustedConfig, config, updateCatalogItem_ConfigPropertyMetadata);
1131
+ const untrustedConfig_catalogItemUpdateInput = untrustedConfig.catalogItemUpdateInput;
1132
+ const referenceCatalogItemUpdateInputRepresentationValidationError = validate$2(untrustedConfig_catalogItemUpdateInput);
1133
+ if (referenceCatalogItemUpdateInputRepresentationValidationError === null) {
1134
+ config.catalogItemUpdateInput = untrustedConfig_catalogItemUpdateInput;
1135
+ }
1136
+ return config;
1137
+ }
1138
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1139
+ if (!untrustedIsObject(untrustedConfig)) {
1140
+ return null;
1141
+ }
1142
+ if (process.env.NODE_ENV !== 'production') {
1143
+ validateConfig(untrustedConfig, configPropertyNames);
1144
+ }
1145
+ const config = typeCheckConfig$1(untrustedConfig);
1146
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1147
+ return null;
1148
+ }
1149
+ return config;
1150
+ }
1151
+ function buildNetworkSnapshot$1(luvio, config, options) {
1152
+ const resourceParams = createResourceParams$1(config);
1153
+ const request = createResourceRequest$1(resourceParams);
1154
+ return luvio.dispatchResourceRequest(request, options)
1155
+ .then((response) => {
1156
+ return luvio.handleSuccessResponse(() => {
1157
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1158
+ return luvio.storeBroadcast().then(() => snapshot);
1159
+ }, () => {
1160
+ const cache = new StoreKeyMap();
1161
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1162
+ return cache;
1163
+ });
1164
+ }, (response) => {
1165
+ deepFreeze(response);
1166
+ throw response;
1167
+ });
1168
+ }
1169
+ const updateCatalogItemAdapterFactory = (luvio) => {
1170
+ return function updateCatalogItem(untrustedConfig) {
1171
+ const config = validateAdapterConfig$1(untrustedConfig, updateCatalogItem_ConfigPropertyNames);
1172
+ // Invalid or incomplete config
1173
+ if (config === null) {
1174
+ throw new Error('Invalid config for "updateCatalogItem"');
1175
+ }
1176
+ return buildNetworkSnapshot$1(luvio, config);
1177
+ };
1178
+ };
1179
+
139
1180
  function validate$1(obj, path = 'ServiceAutomationOutputRecordRepresentation') {
140
1181
  const v_error = (() => {
141
1182
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -289,14 +1330,14 @@ const getAllServiceAutomationDep_ConfigPropertyMetadata = [
289
1330
  generateParamConfigMetadata('limit', true, 2 /* Body */, 3 /* Integer */),
290
1331
  ];
291
1332
  const getAllServiceAutomationDep_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getAllServiceAutomationDep_ConfigPropertyMetadata);
292
- const createResourceParams = /*#__PURE__*/ createResourceParams$1(getAllServiceAutomationDep_ConfigPropertyMetadata);
1333
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(getAllServiceAutomationDep_ConfigPropertyMetadata);
293
1334
  function keyBuilder(luvio, config) {
294
1335
  const resourceParams = createResourceParams(config);
295
1336
  return keyBuilder$1(luvio, resourceParams);
296
1337
  }
297
1338
  function typeCheckConfig(untrustedConfig) {
298
1339
  const config = {};
299
- typeCheckConfig$1(untrustedConfig, config, getAllServiceAutomationDep_ConfigPropertyMetadata);
1340
+ typeCheckConfig$4(untrustedConfig, config, getAllServiceAutomationDep_ConfigPropertyMetadata);
300
1341
  const untrustedConfig_filters = untrustedConfig.filters;
301
1342
  if (ArrayIsArray$1(untrustedConfig_filters)) {
302
1343
  const untrustedConfig_filters_array = [];
@@ -359,7 +1400,7 @@ function buildNetworkSnapshot(luvio, config, options) {
359
1400
  });
360
1401
  }
361
1402
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
362
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
1403
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
363
1404
  }
364
1405
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
365
1406
  const { luvio, config } = context;
@@ -384,4 +1425,4 @@ const getAllServiceAutomationDepAdapterFactory = (luvio) => function ecm__getAll
384
1425
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
385
1426
  };
386
1427
 
387
- export { getAllServiceAutomationDepAdapterFactory };
1428
+ export { createCatalogItemAdapterFactory, getAllServiceAutomationDepAdapterFactory, getCatalogItemAdapterFactory, updateCatalogItemAdapterFactory };