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