@salesforce/lds-adapters-cdp-communication-capping 0.1.0-dev1

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 (24) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/cdp-communication-capping.js +1919 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getCommunicationCappingRepresentation.d.ts +27 -0
  5. package/dist/es/es2018/types/src/generated/adapters/triggerDMOCICreation.d.ts +15 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -0
  8. package/dist/es/es2018/types/src/generated/resources/getSsotCommunicationCappingsByIdOrName.d.ts +15 -0
  9. package/dist/es/es2018/types/src/generated/resources/postSsotCommunicationCappingsActionsRetryByIdOrName.d.ts +12 -0
  10. package/dist/es/es2018/types/src/generated/types/CdpErrorRepresentation.d.ts +31 -0
  11. package/dist/es/es2018/types/src/generated/types/CdpUserRepresentation.d.ts +34 -0
  12. package/dist/es/es2018/types/src/generated/types/CommunicationCappingActionResponseRepresentation.d.ts +41 -0
  13. package/dist/es/es2018/types/src/generated/types/CommunicationCappingRepresentation.d.ts +67 -0
  14. package/dist/es/es2018/types/src/generated/types/DataSpaceFilterConditionRepresentation.d.ts +37 -0
  15. package/dist/es/es2018/types/src/generated/types/DataSpaceFilterRepresentation.d.ts +32 -0
  16. package/dist/es/es2018/types/src/generated/types/DataSpaceRepresentation.d.ts +57 -0
  17. package/dist/es/es2018/types/src/generated/types/DimensionRepresentation.d.ts +63 -0
  18. package/dist/es/es2018/types/src/generated/types/DimensionValueRepresentation.d.ts +53 -0
  19. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  20. package/package.json +66 -0
  21. package/sfdc/index.d.ts +1 -0
  22. package/sfdc/index.js +1963 -0
  23. package/src/raml/api.raml +290 -0
  24. package/src/raml/luvio.raml +24 -0
@@ -0,0 +1,1919 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
59
+ };
60
+ }
61
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
62
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
63
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
64
+ return {
65
+ displayName,
66
+ parameters: {
67
+ required,
68
+ optional,
69
+ }
70
+ };
71
+ }
72
+ const keyPrefix = 'communication-capping';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ function equalsArray(a, b, equalsItem) {
76
+ const aLength = a.length;
77
+ const bLength = b.length;
78
+ if (aLength !== bLength) {
79
+ return false;
80
+ }
81
+ for (let i = 0; i < aLength; i++) {
82
+ if (equalsItem(a[i], b[i]) === false) {
83
+ return false;
84
+ }
85
+ }
86
+ return true;
87
+ }
88
+ function createLink(ref) {
89
+ return {
90
+ __ref: serializeStructuredKey(ref),
91
+ };
92
+ }
93
+
94
+ const VERSION$8 = "efb82c29d2d2d9ec860406b7caae554d";
95
+ function validate$8(obj, path = 'CdpUserRepresentation') {
96
+ const v_error = (() => {
97
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
98
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
99
+ }
100
+ const obj_id = obj.id;
101
+ const path_id = path + '.id';
102
+ if (typeof obj_id !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
104
+ }
105
+ if (obj.name !== undefined) {
106
+ const obj_name = obj.name;
107
+ const path_name = path + '.name';
108
+ if (typeof obj_name !== 'string') {
109
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
110
+ }
111
+ }
112
+ if (obj.profilePhotoUrl !== undefined) {
113
+ const obj_profilePhotoUrl = obj.profilePhotoUrl;
114
+ const path_profilePhotoUrl = path + '.profilePhotoUrl';
115
+ if (typeof obj_profilePhotoUrl !== 'string') {
116
+ return new TypeError('Expected "string" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
117
+ }
118
+ }
119
+ })();
120
+ return v_error === undefined ? null : v_error;
121
+ }
122
+ const select$a = function CdpUserRepresentationSelect() {
123
+ return {
124
+ kind: 'Fragment',
125
+ version: VERSION$8,
126
+ private: [],
127
+ selections: [
128
+ {
129
+ name: 'id',
130
+ kind: 'Scalar'
131
+ },
132
+ {
133
+ name: 'name',
134
+ kind: 'Scalar',
135
+ required: false
136
+ },
137
+ {
138
+ name: 'profilePhotoUrl',
139
+ kind: 'Scalar',
140
+ required: false
141
+ }
142
+ ]
143
+ };
144
+ };
145
+ function equals$8(existing, incoming) {
146
+ const existing_id = existing.id;
147
+ const incoming_id = incoming.id;
148
+ if (!(existing_id === incoming_id)) {
149
+ return false;
150
+ }
151
+ const existing_name = existing.name;
152
+ const incoming_name = incoming.name;
153
+ // if at least one of these optionals is defined
154
+ if (existing_name !== undefined || incoming_name !== undefined) {
155
+ // if one of these is not defined we know the other is defined and therefore
156
+ // not equal
157
+ if (existing_name === undefined || incoming_name === undefined) {
158
+ return false;
159
+ }
160
+ if (!(existing_name === incoming_name)) {
161
+ return false;
162
+ }
163
+ }
164
+ const existing_profilePhotoUrl = existing.profilePhotoUrl;
165
+ const incoming_profilePhotoUrl = incoming.profilePhotoUrl;
166
+ // if at least one of these optionals is defined
167
+ if (existing_profilePhotoUrl !== undefined || incoming_profilePhotoUrl !== undefined) {
168
+ // if one of these is not defined we know the other is defined and therefore
169
+ // not equal
170
+ if (existing_profilePhotoUrl === undefined || incoming_profilePhotoUrl === undefined) {
171
+ return false;
172
+ }
173
+ if (!(existing_profilePhotoUrl === incoming_profilePhotoUrl)) {
174
+ return false;
175
+ }
176
+ }
177
+ return true;
178
+ }
179
+
180
+ const VERSION$7 = "1b02d2d39dcce31092d19e19e432ad9b";
181
+ function validate$7(obj, path = 'DataSpaceFilterConditionRepresentation') {
182
+ const v_error = (() => {
183
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
184
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
185
+ }
186
+ const obj_fieldName = obj.fieldName;
187
+ const path_fieldName = path + '.fieldName';
188
+ if (typeof obj_fieldName !== 'string') {
189
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
190
+ }
191
+ const obj_filterValue = obj.filterValue;
192
+ const path_filterValue = path + '.filterValue';
193
+ if (typeof obj_filterValue !== 'string') {
194
+ return new TypeError('Expected "string" but received "' + typeof obj_filterValue + '" (at "' + path_filterValue + '")');
195
+ }
196
+ const obj_operator = obj.operator;
197
+ const path_operator = path + '.operator';
198
+ if (typeof obj_operator !== 'string') {
199
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
200
+ }
201
+ const obj_tableName = obj.tableName;
202
+ const path_tableName = path + '.tableName';
203
+ if (typeof obj_tableName !== 'string') {
204
+ return new TypeError('Expected "string" but received "' + typeof obj_tableName + '" (at "' + path_tableName + '")');
205
+ }
206
+ })();
207
+ return v_error === undefined ? null : v_error;
208
+ }
209
+ const select$9 = function DataSpaceFilterConditionRepresentationSelect() {
210
+ return {
211
+ kind: 'Fragment',
212
+ version: VERSION$7,
213
+ private: [],
214
+ selections: [
215
+ {
216
+ name: 'fieldName',
217
+ kind: 'Scalar'
218
+ },
219
+ {
220
+ name: 'filterValue',
221
+ kind: 'Scalar'
222
+ },
223
+ {
224
+ name: 'operator',
225
+ kind: 'Scalar'
226
+ },
227
+ {
228
+ name: 'tableName',
229
+ kind: 'Scalar'
230
+ }
231
+ ]
232
+ };
233
+ };
234
+ function equals$7(existing, incoming) {
235
+ const existing_fieldName = existing.fieldName;
236
+ const incoming_fieldName = incoming.fieldName;
237
+ if (!(existing_fieldName === incoming_fieldName)) {
238
+ return false;
239
+ }
240
+ const existing_filterValue = existing.filterValue;
241
+ const incoming_filterValue = incoming.filterValue;
242
+ if (!(existing_filterValue === incoming_filterValue)) {
243
+ return false;
244
+ }
245
+ const existing_operator = existing.operator;
246
+ const incoming_operator = incoming.operator;
247
+ if (!(existing_operator === incoming_operator)) {
248
+ return false;
249
+ }
250
+ const existing_tableName = existing.tableName;
251
+ const incoming_tableName = incoming.tableName;
252
+ if (!(existing_tableName === incoming_tableName)) {
253
+ return false;
254
+ }
255
+ return true;
256
+ }
257
+
258
+ const VERSION$6 = "6e8261106b2978c3a4b64b6d4ef48591";
259
+ function validate$6(obj, path = 'DataSpaceFilterRepresentation') {
260
+ const v_error = (() => {
261
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
262
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
263
+ }
264
+ const obj_conditions = obj.conditions;
265
+ const path_conditions = path + '.conditions';
266
+ if (!ArrayIsArray(obj_conditions)) {
267
+ return new TypeError('Expected "array" but received "' + typeof obj_conditions + '" (at "' + path_conditions + '")');
268
+ }
269
+ for (let i = 0; i < obj_conditions.length; i++) {
270
+ const obj_conditions_item = obj_conditions[i];
271
+ const path_conditions_item = path_conditions + '[' + i + ']';
272
+ const referencepath_conditions_itemValidationError = validate$7(obj_conditions_item, path_conditions_item);
273
+ if (referencepath_conditions_itemValidationError !== null) {
274
+ let message = 'Object doesn\'t match DataSpaceFilterConditionRepresentation (at "' + path_conditions_item + '")\n';
275
+ message += referencepath_conditions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
276
+ return new TypeError(message);
277
+ }
278
+ }
279
+ const obj_conjunctiveOperator = obj.conjunctiveOperator;
280
+ const path_conjunctiveOperator = path + '.conjunctiveOperator';
281
+ if (typeof obj_conjunctiveOperator !== 'string') {
282
+ return new TypeError('Expected "string" but received "' + typeof obj_conjunctiveOperator + '" (at "' + path_conjunctiveOperator + '")');
283
+ }
284
+ })();
285
+ return v_error === undefined ? null : v_error;
286
+ }
287
+ const select$8 = function DataSpaceFilterRepresentationSelect() {
288
+ const { selections: DataSpaceFilterConditionRepresentation__selections, opaque: DataSpaceFilterConditionRepresentation__opaque, } = select$9();
289
+ return {
290
+ kind: 'Fragment',
291
+ version: VERSION$6,
292
+ private: [],
293
+ selections: [
294
+ {
295
+ name: 'conditions',
296
+ kind: 'Object',
297
+ plural: true,
298
+ selections: DataSpaceFilterConditionRepresentation__selections
299
+ },
300
+ {
301
+ name: 'conjunctiveOperator',
302
+ kind: 'Scalar'
303
+ }
304
+ ]
305
+ };
306
+ };
307
+ function equals$6(existing, incoming) {
308
+ const existing_conjunctiveOperator = existing.conjunctiveOperator;
309
+ const incoming_conjunctiveOperator = incoming.conjunctiveOperator;
310
+ if (!(existing_conjunctiveOperator === incoming_conjunctiveOperator)) {
311
+ return false;
312
+ }
313
+ const existing_conditions = existing.conditions;
314
+ const incoming_conditions = incoming.conditions;
315
+ const equals_conditions_items = equalsArray(existing_conditions, incoming_conditions, (existing_conditions_item, incoming_conditions_item) => {
316
+ if (!(equals$7(existing_conditions_item, incoming_conditions_item))) {
317
+ return false;
318
+ }
319
+ });
320
+ if (equals_conditions_items === false) {
321
+ return false;
322
+ }
323
+ return true;
324
+ }
325
+
326
+ const VERSION$5 = "6002273606e3a05e27583192e1479933";
327
+ function validate$5(obj, path = 'DataSpaceRepresentation') {
328
+ const v_error = (() => {
329
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
330
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
331
+ }
332
+ if (obj.createdBy !== undefined) {
333
+ const obj_createdBy = obj.createdBy;
334
+ const path_createdBy = path + '.createdBy';
335
+ const referencepath_createdByValidationError = validate$8(obj_createdBy, path_createdBy);
336
+ if (referencepath_createdByValidationError !== null) {
337
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
338
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
339
+ return new TypeError(message);
340
+ }
341
+ }
342
+ if (obj.createdDate !== undefined) {
343
+ const obj_createdDate = obj.createdDate;
344
+ const path_createdDate = path + '.createdDate';
345
+ if (typeof obj_createdDate !== 'string') {
346
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
347
+ }
348
+ }
349
+ if (obj.filter !== undefined) {
350
+ const obj_filter = obj.filter;
351
+ const path_filter = path + '.filter';
352
+ const referencepath_filterValidationError = validate$6(obj_filter, path_filter);
353
+ if (referencepath_filterValidationError !== null) {
354
+ let message = 'Object doesn\'t match DataSpaceFilterRepresentation (at "' + path_filter + '")\n';
355
+ message += referencepath_filterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
356
+ return new TypeError(message);
357
+ }
358
+ }
359
+ const obj_id = obj.id;
360
+ const path_id = path + '.id';
361
+ if (typeof obj_id !== 'string') {
362
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
363
+ }
364
+ if (obj.label !== undefined) {
365
+ const obj_label = obj.label;
366
+ const path_label = path + '.label';
367
+ if (typeof obj_label !== 'string') {
368
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
369
+ }
370
+ }
371
+ if (obj.lastModifiedBy !== undefined) {
372
+ const obj_lastModifiedBy = obj.lastModifiedBy;
373
+ const path_lastModifiedBy = path + '.lastModifiedBy';
374
+ const referencepath_lastModifiedByValidationError = validate$8(obj_lastModifiedBy, path_lastModifiedBy);
375
+ if (referencepath_lastModifiedByValidationError !== null) {
376
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
377
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
378
+ return new TypeError(message);
379
+ }
380
+ }
381
+ if (obj.lastModifiedDate !== undefined) {
382
+ const obj_lastModifiedDate = obj.lastModifiedDate;
383
+ const path_lastModifiedDate = path + '.lastModifiedDate';
384
+ if (typeof obj_lastModifiedDate !== 'string') {
385
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
386
+ }
387
+ }
388
+ const obj_name = obj.name;
389
+ const path_name = path + '.name';
390
+ if (typeof obj_name !== 'string') {
391
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
392
+ }
393
+ if (obj.namespace !== undefined) {
394
+ const obj_namespace = obj.namespace;
395
+ const path_namespace = path + '.namespace';
396
+ if (typeof obj_namespace !== 'string') {
397
+ return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
398
+ }
399
+ }
400
+ if (obj.url !== undefined) {
401
+ const obj_url = obj.url;
402
+ const path_url = path + '.url';
403
+ if (typeof obj_url !== 'string') {
404
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
405
+ }
406
+ }
407
+ })();
408
+ return v_error === undefined ? null : v_error;
409
+ }
410
+ const select$7 = function DataSpaceRepresentationSelect() {
411
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$a();
412
+ const { selections: DataSpaceFilterRepresentation__selections, opaque: DataSpaceFilterRepresentation__opaque, } = select$8();
413
+ return {
414
+ kind: 'Fragment',
415
+ version: VERSION$5,
416
+ private: [],
417
+ selections: [
418
+ {
419
+ name: 'createdBy',
420
+ kind: 'Object',
421
+ selections: CdpUserRepresentation__selections,
422
+ required: false
423
+ },
424
+ {
425
+ name: 'createdDate',
426
+ kind: 'Scalar',
427
+ required: false
428
+ },
429
+ {
430
+ name: 'filter',
431
+ kind: 'Object',
432
+ selections: DataSpaceFilterRepresentation__selections,
433
+ required: false
434
+ },
435
+ {
436
+ name: 'id',
437
+ kind: 'Scalar'
438
+ },
439
+ {
440
+ name: 'label',
441
+ kind: 'Scalar',
442
+ required: false
443
+ },
444
+ {
445
+ name: 'lastModifiedBy',
446
+ kind: 'Object',
447
+ selections: CdpUserRepresentation__selections,
448
+ required: false
449
+ },
450
+ {
451
+ name: 'lastModifiedDate',
452
+ kind: 'Scalar',
453
+ required: false
454
+ },
455
+ {
456
+ name: 'name',
457
+ kind: 'Scalar'
458
+ },
459
+ {
460
+ name: 'namespace',
461
+ kind: 'Scalar',
462
+ required: false
463
+ },
464
+ {
465
+ name: 'url',
466
+ kind: 'Scalar',
467
+ required: false
468
+ }
469
+ ]
470
+ };
471
+ };
472
+ function equals$5(existing, incoming) {
473
+ const existing_createdDate = existing.createdDate;
474
+ const incoming_createdDate = incoming.createdDate;
475
+ // if at least one of these optionals is defined
476
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
477
+ // if one of these is not defined we know the other is defined and therefore
478
+ // not equal
479
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
480
+ return false;
481
+ }
482
+ if (!(existing_createdDate === incoming_createdDate)) {
483
+ return false;
484
+ }
485
+ }
486
+ const existing_id = existing.id;
487
+ const incoming_id = incoming.id;
488
+ if (!(existing_id === incoming_id)) {
489
+ return false;
490
+ }
491
+ const existing_label = existing.label;
492
+ const incoming_label = incoming.label;
493
+ // if at least one of these optionals is defined
494
+ if (existing_label !== undefined || incoming_label !== undefined) {
495
+ // if one of these is not defined we know the other is defined and therefore
496
+ // not equal
497
+ if (existing_label === undefined || incoming_label === undefined) {
498
+ return false;
499
+ }
500
+ if (!(existing_label === incoming_label)) {
501
+ return false;
502
+ }
503
+ }
504
+ const existing_lastModifiedDate = existing.lastModifiedDate;
505
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
506
+ // if at least one of these optionals is defined
507
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
508
+ // if one of these is not defined we know the other is defined and therefore
509
+ // not equal
510
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
511
+ return false;
512
+ }
513
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
514
+ return false;
515
+ }
516
+ }
517
+ const existing_name = existing.name;
518
+ const incoming_name = incoming.name;
519
+ if (!(existing_name === incoming_name)) {
520
+ return false;
521
+ }
522
+ const existing_namespace = existing.namespace;
523
+ const incoming_namespace = incoming.namespace;
524
+ // if at least one of these optionals is defined
525
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
526
+ // if one of these is not defined we know the other is defined and therefore
527
+ // not equal
528
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
529
+ return false;
530
+ }
531
+ if (!(existing_namespace === incoming_namespace)) {
532
+ return false;
533
+ }
534
+ }
535
+ const existing_url = existing.url;
536
+ const incoming_url = incoming.url;
537
+ // if at least one of these optionals is defined
538
+ if (existing_url !== undefined || incoming_url !== undefined) {
539
+ // if one of these is not defined we know the other is defined and therefore
540
+ // not equal
541
+ if (existing_url === undefined || incoming_url === undefined) {
542
+ return false;
543
+ }
544
+ if (!(existing_url === incoming_url)) {
545
+ return false;
546
+ }
547
+ }
548
+ const existing_createdBy = existing.createdBy;
549
+ const incoming_createdBy = incoming.createdBy;
550
+ // if at least one of these optionals is defined
551
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
552
+ // if one of these is not defined we know the other is defined and therefore
553
+ // not equal
554
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
555
+ return false;
556
+ }
557
+ if (!(equals$8(existing_createdBy, incoming_createdBy))) {
558
+ return false;
559
+ }
560
+ }
561
+ const existing_filter = existing.filter;
562
+ const incoming_filter = incoming.filter;
563
+ // if at least one of these optionals is defined
564
+ if (existing_filter !== undefined || incoming_filter !== undefined) {
565
+ // if one of these is not defined we know the other is defined and therefore
566
+ // not equal
567
+ if (existing_filter === undefined || incoming_filter === undefined) {
568
+ return false;
569
+ }
570
+ if (!(equals$6(existing_filter, incoming_filter))) {
571
+ return false;
572
+ }
573
+ }
574
+ const existing_lastModifiedBy = existing.lastModifiedBy;
575
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
576
+ // if at least one of these optionals is defined
577
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
578
+ // if one of these is not defined we know the other is defined and therefore
579
+ // not equal
580
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
581
+ return false;
582
+ }
583
+ if (!(equals$8(existing_lastModifiedBy, incoming_lastModifiedBy))) {
584
+ return false;
585
+ }
586
+ }
587
+ return true;
588
+ }
589
+
590
+ const VERSION$4 = "dccce114624f015d60102d3fe03103c6";
591
+ function validate$4(obj, path = 'DimensionValueRepresentation') {
592
+ const v_error = (() => {
593
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
594
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
595
+ }
596
+ if (obj.createdBy !== undefined) {
597
+ const obj_createdBy = obj.createdBy;
598
+ const path_createdBy = path + '.createdBy';
599
+ const referencepath_createdByValidationError = validate$8(obj_createdBy, path_createdBy);
600
+ if (referencepath_createdByValidationError !== null) {
601
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
602
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
603
+ return new TypeError(message);
604
+ }
605
+ }
606
+ if (obj.createdDate !== undefined) {
607
+ const obj_createdDate = obj.createdDate;
608
+ const path_createdDate = path + '.createdDate';
609
+ if (typeof obj_createdDate !== 'string') {
610
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
611
+ }
612
+ }
613
+ const obj_id = obj.id;
614
+ const path_id = path + '.id';
615
+ if (typeof obj_id !== 'string') {
616
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
617
+ }
618
+ if (obj.label !== undefined) {
619
+ const obj_label = obj.label;
620
+ const path_label = path + '.label';
621
+ if (typeof obj_label !== 'string') {
622
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
623
+ }
624
+ }
625
+ if (obj.lastModifiedBy !== undefined) {
626
+ const obj_lastModifiedBy = obj.lastModifiedBy;
627
+ const path_lastModifiedBy = path + '.lastModifiedBy';
628
+ const referencepath_lastModifiedByValidationError = validate$8(obj_lastModifiedBy, path_lastModifiedBy);
629
+ if (referencepath_lastModifiedByValidationError !== null) {
630
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
631
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
632
+ return new TypeError(message);
633
+ }
634
+ }
635
+ if (obj.lastModifiedDate !== undefined) {
636
+ const obj_lastModifiedDate = obj.lastModifiedDate;
637
+ const path_lastModifiedDate = path + '.lastModifiedDate';
638
+ if (typeof obj_lastModifiedDate !== 'string') {
639
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
640
+ }
641
+ }
642
+ const obj_name = obj.name;
643
+ const path_name = path + '.name';
644
+ if (typeof obj_name !== 'string') {
645
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
646
+ }
647
+ if (obj.namespace !== undefined) {
648
+ const obj_namespace = obj.namespace;
649
+ const path_namespace = path + '.namespace';
650
+ if (typeof obj_namespace !== 'string') {
651
+ return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
652
+ }
653
+ }
654
+ if (obj.url !== undefined) {
655
+ const obj_url = obj.url;
656
+ const path_url = path + '.url';
657
+ if (typeof obj_url !== 'string') {
658
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
659
+ }
660
+ }
661
+ })();
662
+ return v_error === undefined ? null : v_error;
663
+ }
664
+ const select$6 = function DimensionValueRepresentationSelect() {
665
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$a();
666
+ return {
667
+ kind: 'Fragment',
668
+ version: VERSION$4,
669
+ private: [],
670
+ selections: [
671
+ {
672
+ name: 'createdBy',
673
+ kind: 'Object',
674
+ selections: CdpUserRepresentation__selections,
675
+ required: false
676
+ },
677
+ {
678
+ name: 'createdDate',
679
+ kind: 'Scalar',
680
+ required: false
681
+ },
682
+ {
683
+ name: 'id',
684
+ kind: 'Scalar'
685
+ },
686
+ {
687
+ name: 'label',
688
+ kind: 'Scalar',
689
+ required: false
690
+ },
691
+ {
692
+ name: 'lastModifiedBy',
693
+ kind: 'Object',
694
+ selections: CdpUserRepresentation__selections,
695
+ required: false
696
+ },
697
+ {
698
+ name: 'lastModifiedDate',
699
+ kind: 'Scalar',
700
+ required: false
701
+ },
702
+ {
703
+ name: 'name',
704
+ kind: 'Scalar'
705
+ },
706
+ {
707
+ name: 'namespace',
708
+ kind: 'Scalar',
709
+ required: false
710
+ },
711
+ {
712
+ name: 'url',
713
+ kind: 'Scalar',
714
+ required: false
715
+ }
716
+ ]
717
+ };
718
+ };
719
+ function equals$4(existing, incoming) {
720
+ const existing_createdDate = existing.createdDate;
721
+ const incoming_createdDate = incoming.createdDate;
722
+ // if at least one of these optionals is defined
723
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
724
+ // if one of these is not defined we know the other is defined and therefore
725
+ // not equal
726
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
727
+ return false;
728
+ }
729
+ if (!(existing_createdDate === incoming_createdDate)) {
730
+ return false;
731
+ }
732
+ }
733
+ const existing_id = existing.id;
734
+ const incoming_id = incoming.id;
735
+ if (!(existing_id === incoming_id)) {
736
+ return false;
737
+ }
738
+ const existing_label = existing.label;
739
+ const incoming_label = incoming.label;
740
+ // if at least one of these optionals is defined
741
+ if (existing_label !== undefined || incoming_label !== undefined) {
742
+ // if one of these is not defined we know the other is defined and therefore
743
+ // not equal
744
+ if (existing_label === undefined || incoming_label === undefined) {
745
+ return false;
746
+ }
747
+ if (!(existing_label === incoming_label)) {
748
+ return false;
749
+ }
750
+ }
751
+ const existing_lastModifiedDate = existing.lastModifiedDate;
752
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
753
+ // if at least one of these optionals is defined
754
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
755
+ // if one of these is not defined we know the other is defined and therefore
756
+ // not equal
757
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
758
+ return false;
759
+ }
760
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
761
+ return false;
762
+ }
763
+ }
764
+ const existing_name = existing.name;
765
+ const incoming_name = incoming.name;
766
+ if (!(existing_name === incoming_name)) {
767
+ return false;
768
+ }
769
+ const existing_namespace = existing.namespace;
770
+ const incoming_namespace = incoming.namespace;
771
+ // if at least one of these optionals is defined
772
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
773
+ // if one of these is not defined we know the other is defined and therefore
774
+ // not equal
775
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
776
+ return false;
777
+ }
778
+ if (!(existing_namespace === incoming_namespace)) {
779
+ return false;
780
+ }
781
+ }
782
+ const existing_url = existing.url;
783
+ const incoming_url = incoming.url;
784
+ // if at least one of these optionals is defined
785
+ if (existing_url !== undefined || incoming_url !== undefined) {
786
+ // if one of these is not defined we know the other is defined and therefore
787
+ // not equal
788
+ if (existing_url === undefined || incoming_url === undefined) {
789
+ return false;
790
+ }
791
+ if (!(existing_url === incoming_url)) {
792
+ return false;
793
+ }
794
+ }
795
+ const existing_createdBy = existing.createdBy;
796
+ const incoming_createdBy = incoming.createdBy;
797
+ // if at least one of these optionals is defined
798
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
799
+ // if one of these is not defined we know the other is defined and therefore
800
+ // not equal
801
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
802
+ return false;
803
+ }
804
+ if (!(equals$8(existing_createdBy, incoming_createdBy))) {
805
+ return false;
806
+ }
807
+ }
808
+ const existing_lastModifiedBy = existing.lastModifiedBy;
809
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
810
+ // if at least one of these optionals is defined
811
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
812
+ // if one of these is not defined we know the other is defined and therefore
813
+ // not equal
814
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
815
+ return false;
816
+ }
817
+ if (!(equals$8(existing_lastModifiedBy, incoming_lastModifiedBy))) {
818
+ return false;
819
+ }
820
+ }
821
+ return true;
822
+ }
823
+
824
+ const VERSION$3 = "70b4d3fed31252306834619fcba6a447";
825
+ function validate$3(obj, path = 'DimensionRepresentation') {
826
+ const v_error = (() => {
827
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
828
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
829
+ }
830
+ if (obj.createdBy !== undefined) {
831
+ const obj_createdBy = obj.createdBy;
832
+ const path_createdBy = path + '.createdBy';
833
+ const referencepath_createdByValidationError = validate$8(obj_createdBy, path_createdBy);
834
+ if (referencepath_createdByValidationError !== null) {
835
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
836
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
837
+ return new TypeError(message);
838
+ }
839
+ }
840
+ if (obj.createdDate !== undefined) {
841
+ const obj_createdDate = obj.createdDate;
842
+ const path_createdDate = path + '.createdDate';
843
+ if (typeof obj_createdDate !== 'string') {
844
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
845
+ }
846
+ }
847
+ const obj_hierarchyOrder = obj.hierarchyOrder;
848
+ const path_hierarchyOrder = path + '.hierarchyOrder';
849
+ if (typeof obj_hierarchyOrder !== 'number' || (typeof obj_hierarchyOrder === 'number' && Math.floor(obj_hierarchyOrder) !== obj_hierarchyOrder)) {
850
+ return new TypeError('Expected "integer" but received "' + typeof obj_hierarchyOrder + '" (at "' + path_hierarchyOrder + '")');
851
+ }
852
+ const obj_id = obj.id;
853
+ const path_id = path + '.id';
854
+ if (typeof obj_id !== 'string') {
855
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
856
+ }
857
+ if (obj.label !== undefined) {
858
+ const obj_label = obj.label;
859
+ const path_label = path + '.label';
860
+ if (typeof obj_label !== 'string') {
861
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
862
+ }
863
+ }
864
+ if (obj.lastModifiedBy !== undefined) {
865
+ const obj_lastModifiedBy = obj.lastModifiedBy;
866
+ const path_lastModifiedBy = path + '.lastModifiedBy';
867
+ const referencepath_lastModifiedByValidationError = validate$8(obj_lastModifiedBy, path_lastModifiedBy);
868
+ if (referencepath_lastModifiedByValidationError !== null) {
869
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
870
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
871
+ return new TypeError(message);
872
+ }
873
+ }
874
+ if (obj.lastModifiedDate !== undefined) {
875
+ const obj_lastModifiedDate = obj.lastModifiedDate;
876
+ const path_lastModifiedDate = path + '.lastModifiedDate';
877
+ if (typeof obj_lastModifiedDate !== 'string') {
878
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
879
+ }
880
+ }
881
+ const obj_name = obj.name;
882
+ const path_name = path + '.name';
883
+ if (typeof obj_name !== 'string') {
884
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
885
+ }
886
+ if (obj.namespace !== undefined) {
887
+ const obj_namespace = obj.namespace;
888
+ const path_namespace = path + '.namespace';
889
+ if (typeof obj_namespace !== 'string') {
890
+ return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
891
+ }
892
+ }
893
+ const obj_type = obj.type;
894
+ const path_type = path + '.type';
895
+ if (typeof obj_type !== 'string') {
896
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
897
+ }
898
+ if (obj.url !== undefined) {
899
+ const obj_url = obj.url;
900
+ const path_url = path + '.url';
901
+ if (typeof obj_url !== 'string') {
902
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
903
+ }
904
+ }
905
+ if (obj.values !== undefined) {
906
+ const obj_values = obj.values;
907
+ const path_values = path + '.values';
908
+ if (!ArrayIsArray(obj_values)) {
909
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
910
+ }
911
+ for (let i = 0; i < obj_values.length; i++) {
912
+ const obj_values_item = obj_values[i];
913
+ const path_values_item = path_values + '[' + i + ']';
914
+ const referencepath_values_itemValidationError = validate$4(obj_values_item, path_values_item);
915
+ if (referencepath_values_itemValidationError !== null) {
916
+ let message = 'Object doesn\'t match DimensionValueRepresentation (at "' + path_values_item + '")\n';
917
+ message += referencepath_values_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
918
+ return new TypeError(message);
919
+ }
920
+ }
921
+ }
922
+ })();
923
+ return v_error === undefined ? null : v_error;
924
+ }
925
+ const select$5 = function DimensionRepresentationSelect() {
926
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$a();
927
+ const { selections: DimensionValueRepresentation__selections, opaque: DimensionValueRepresentation__opaque, } = select$6();
928
+ return {
929
+ kind: 'Fragment',
930
+ version: VERSION$3,
931
+ private: [],
932
+ selections: [
933
+ {
934
+ name: 'createdBy',
935
+ kind: 'Object',
936
+ selections: CdpUserRepresentation__selections,
937
+ required: false
938
+ },
939
+ {
940
+ name: 'createdDate',
941
+ kind: 'Scalar',
942
+ required: false
943
+ },
944
+ {
945
+ name: 'hierarchyOrder',
946
+ kind: 'Scalar'
947
+ },
948
+ {
949
+ name: 'id',
950
+ kind: 'Scalar'
951
+ },
952
+ {
953
+ name: 'label',
954
+ kind: 'Scalar',
955
+ required: false
956
+ },
957
+ {
958
+ name: 'lastModifiedBy',
959
+ kind: 'Object',
960
+ selections: CdpUserRepresentation__selections,
961
+ required: false
962
+ },
963
+ {
964
+ name: 'lastModifiedDate',
965
+ kind: 'Scalar',
966
+ required: false
967
+ },
968
+ {
969
+ name: 'name',
970
+ kind: 'Scalar'
971
+ },
972
+ {
973
+ name: 'namespace',
974
+ kind: 'Scalar',
975
+ required: false
976
+ },
977
+ {
978
+ name: 'type',
979
+ kind: 'Scalar'
980
+ },
981
+ {
982
+ name: 'url',
983
+ kind: 'Scalar',
984
+ required: false
985
+ },
986
+ {
987
+ name: 'values',
988
+ kind: 'Object',
989
+ plural: true,
990
+ selections: DimensionValueRepresentation__selections,
991
+ required: false
992
+ }
993
+ ]
994
+ };
995
+ };
996
+ function equals$3(existing, incoming) {
997
+ const existing_hierarchyOrder = existing.hierarchyOrder;
998
+ const incoming_hierarchyOrder = incoming.hierarchyOrder;
999
+ if (!(existing_hierarchyOrder === incoming_hierarchyOrder)) {
1000
+ return false;
1001
+ }
1002
+ const existing_createdDate = existing.createdDate;
1003
+ const incoming_createdDate = incoming.createdDate;
1004
+ // if at least one of these optionals is defined
1005
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
1006
+ // if one of these is not defined we know the other is defined and therefore
1007
+ // not equal
1008
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
1009
+ return false;
1010
+ }
1011
+ if (!(existing_createdDate === incoming_createdDate)) {
1012
+ return false;
1013
+ }
1014
+ }
1015
+ const existing_id = existing.id;
1016
+ const incoming_id = incoming.id;
1017
+ if (!(existing_id === incoming_id)) {
1018
+ return false;
1019
+ }
1020
+ const existing_label = existing.label;
1021
+ const incoming_label = incoming.label;
1022
+ // if at least one of these optionals is defined
1023
+ if (existing_label !== undefined || incoming_label !== undefined) {
1024
+ // if one of these is not defined we know the other is defined and therefore
1025
+ // not equal
1026
+ if (existing_label === undefined || incoming_label === undefined) {
1027
+ return false;
1028
+ }
1029
+ if (!(existing_label === incoming_label)) {
1030
+ return false;
1031
+ }
1032
+ }
1033
+ const existing_lastModifiedDate = existing.lastModifiedDate;
1034
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
1035
+ // if at least one of these optionals is defined
1036
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
1037
+ // if one of these is not defined we know the other is defined and therefore
1038
+ // not equal
1039
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
1040
+ return false;
1041
+ }
1042
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
1043
+ return false;
1044
+ }
1045
+ }
1046
+ const existing_name = existing.name;
1047
+ const incoming_name = incoming.name;
1048
+ if (!(existing_name === incoming_name)) {
1049
+ return false;
1050
+ }
1051
+ const existing_namespace = existing.namespace;
1052
+ const incoming_namespace = incoming.namespace;
1053
+ // if at least one of these optionals is defined
1054
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
1055
+ // if one of these is not defined we know the other is defined and therefore
1056
+ // not equal
1057
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
1058
+ return false;
1059
+ }
1060
+ if (!(existing_namespace === incoming_namespace)) {
1061
+ return false;
1062
+ }
1063
+ }
1064
+ const existing_type = existing.type;
1065
+ const incoming_type = incoming.type;
1066
+ if (!(existing_type === incoming_type)) {
1067
+ return false;
1068
+ }
1069
+ const existing_url = existing.url;
1070
+ const incoming_url = incoming.url;
1071
+ // if at least one of these optionals is defined
1072
+ if (existing_url !== undefined || incoming_url !== undefined) {
1073
+ // if one of these is not defined we know the other is defined and therefore
1074
+ // not equal
1075
+ if (existing_url === undefined || incoming_url === undefined) {
1076
+ return false;
1077
+ }
1078
+ if (!(existing_url === incoming_url)) {
1079
+ return false;
1080
+ }
1081
+ }
1082
+ const existing_createdBy = existing.createdBy;
1083
+ const incoming_createdBy = incoming.createdBy;
1084
+ // if at least one of these optionals is defined
1085
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
1086
+ // if one of these is not defined we know the other is defined and therefore
1087
+ // not equal
1088
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
1089
+ return false;
1090
+ }
1091
+ if (!(equals$8(existing_createdBy, incoming_createdBy))) {
1092
+ return false;
1093
+ }
1094
+ }
1095
+ const existing_lastModifiedBy = existing.lastModifiedBy;
1096
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
1097
+ // if at least one of these optionals is defined
1098
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
1099
+ // if one of these is not defined we know the other is defined and therefore
1100
+ // not equal
1101
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
1102
+ return false;
1103
+ }
1104
+ if (!(equals$8(existing_lastModifiedBy, incoming_lastModifiedBy))) {
1105
+ return false;
1106
+ }
1107
+ }
1108
+ const existing_values = existing.values;
1109
+ const incoming_values = incoming.values;
1110
+ // if at least one of these optionals is defined
1111
+ if (existing_values !== undefined || incoming_values !== undefined) {
1112
+ // if one of these is not defined we know the other is defined and therefore
1113
+ // not equal
1114
+ if (existing_values === undefined || incoming_values === undefined) {
1115
+ return false;
1116
+ }
1117
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
1118
+ if (!(equals$4(existing_values_item, incoming_values_item))) {
1119
+ return false;
1120
+ }
1121
+ });
1122
+ if (equals_values_items === false) {
1123
+ return false;
1124
+ }
1125
+ }
1126
+ return true;
1127
+ }
1128
+
1129
+ const VERSION$2 = "505be48e54ab7a0b752593e9294c3abd";
1130
+ function validate$2(obj, path = 'CommunicationCappingRepresentation') {
1131
+ const v_error = (() => {
1132
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1133
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1134
+ }
1135
+ if (obj.createdBy !== undefined) {
1136
+ const obj_createdBy = obj.createdBy;
1137
+ const path_createdBy = path + '.createdBy';
1138
+ const referencepath_createdByValidationError = validate$8(obj_createdBy, path_createdBy);
1139
+ if (referencepath_createdByValidationError !== null) {
1140
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
1141
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1142
+ return new TypeError(message);
1143
+ }
1144
+ }
1145
+ if (obj.createdDate !== undefined) {
1146
+ const obj_createdDate = obj.createdDate;
1147
+ const path_createdDate = path + '.createdDate';
1148
+ if (typeof obj_createdDate !== 'string') {
1149
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1150
+ }
1151
+ }
1152
+ const obj_dataspacesInfo = obj.dataspacesInfo;
1153
+ const path_dataspacesInfo = path + '.dataspacesInfo';
1154
+ if (!ArrayIsArray(obj_dataspacesInfo)) {
1155
+ return new TypeError('Expected "array" but received "' + typeof obj_dataspacesInfo + '" (at "' + path_dataspacesInfo + '")');
1156
+ }
1157
+ for (let i = 0; i < obj_dataspacesInfo.length; i++) {
1158
+ const obj_dataspacesInfo_item = obj_dataspacesInfo[i];
1159
+ const path_dataspacesInfo_item = path_dataspacesInfo + '[' + i + ']';
1160
+ const referencepath_dataspacesInfo_itemValidationError = validate$5(obj_dataspacesInfo_item, path_dataspacesInfo_item);
1161
+ if (referencepath_dataspacesInfo_itemValidationError !== null) {
1162
+ let message = 'Object doesn\'t match DataSpaceRepresentation (at "' + path_dataspacesInfo_item + '")\n';
1163
+ message += referencepath_dataspacesInfo_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1164
+ return new TypeError(message);
1165
+ }
1166
+ }
1167
+ if (obj.description !== undefined) {
1168
+ const obj_description = obj.description;
1169
+ const path_description = path + '.description';
1170
+ let obj_description_union0 = null;
1171
+ const obj_description_union0_error = (() => {
1172
+ if (typeof obj_description !== 'string') {
1173
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1174
+ }
1175
+ })();
1176
+ if (obj_description_union0_error != null) {
1177
+ obj_description_union0 = obj_description_union0_error.message;
1178
+ }
1179
+ let obj_description_union1 = null;
1180
+ const obj_description_union1_error = (() => {
1181
+ if (obj_description !== null) {
1182
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1183
+ }
1184
+ })();
1185
+ if (obj_description_union1_error != null) {
1186
+ obj_description_union1 = obj_description_union1_error.message;
1187
+ }
1188
+ if (obj_description_union0 && obj_description_union1) {
1189
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
1190
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1191
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1192
+ return new TypeError(message);
1193
+ }
1194
+ }
1195
+ const obj_dimensions = obj.dimensions;
1196
+ const path_dimensions = path + '.dimensions';
1197
+ if (!ArrayIsArray(obj_dimensions)) {
1198
+ return new TypeError('Expected "array" but received "' + typeof obj_dimensions + '" (at "' + path_dimensions + '")');
1199
+ }
1200
+ for (let i = 0; i < obj_dimensions.length; i++) {
1201
+ const obj_dimensions_item = obj_dimensions[i];
1202
+ const path_dimensions_item = path_dimensions + '[' + i + ']';
1203
+ const referencepath_dimensions_itemValidationError = validate$3(obj_dimensions_item, path_dimensions_item);
1204
+ if (referencepath_dimensions_itemValidationError !== null) {
1205
+ let message = 'Object doesn\'t match DimensionRepresentation (at "' + path_dimensions_item + '")\n';
1206
+ message += referencepath_dimensions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1207
+ return new TypeError(message);
1208
+ }
1209
+ }
1210
+ const obj_id = obj.id;
1211
+ const path_id = path + '.id';
1212
+ if (typeof obj_id !== 'string') {
1213
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1214
+ }
1215
+ if (obj.label !== undefined) {
1216
+ const obj_label = obj.label;
1217
+ const path_label = path + '.label';
1218
+ if (typeof obj_label !== 'string') {
1219
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1220
+ }
1221
+ }
1222
+ if (obj.lastModifiedBy !== undefined) {
1223
+ const obj_lastModifiedBy = obj.lastModifiedBy;
1224
+ const path_lastModifiedBy = path + '.lastModifiedBy';
1225
+ const referencepath_lastModifiedByValidationError = validate$8(obj_lastModifiedBy, path_lastModifiedBy);
1226
+ if (referencepath_lastModifiedByValidationError !== null) {
1227
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
1228
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1229
+ return new TypeError(message);
1230
+ }
1231
+ }
1232
+ if (obj.lastModifiedDate !== undefined) {
1233
+ const obj_lastModifiedDate = obj.lastModifiedDate;
1234
+ const path_lastModifiedDate = path + '.lastModifiedDate';
1235
+ if (typeof obj_lastModifiedDate !== 'string') {
1236
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
1237
+ }
1238
+ }
1239
+ const obj_name = obj.name;
1240
+ const path_name = path + '.name';
1241
+ if (typeof obj_name !== 'string') {
1242
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1243
+ }
1244
+ if (obj.namespace !== undefined) {
1245
+ const obj_namespace = obj.namespace;
1246
+ const path_namespace = path + '.namespace';
1247
+ if (typeof obj_namespace !== 'string') {
1248
+ return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
1249
+ }
1250
+ }
1251
+ if (obj.status !== undefined) {
1252
+ const obj_status = obj.status;
1253
+ const path_status = path + '.status';
1254
+ if (typeof obj_status !== 'string') {
1255
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1256
+ }
1257
+ }
1258
+ if (obj.url !== undefined) {
1259
+ const obj_url = obj.url;
1260
+ const path_url = path + '.url';
1261
+ if (typeof obj_url !== 'string') {
1262
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
1263
+ }
1264
+ }
1265
+ })();
1266
+ return v_error === undefined ? null : v_error;
1267
+ }
1268
+ const RepresentationType$1 = 'CommunicationCappingRepresentation';
1269
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1270
+ return input;
1271
+ }
1272
+ const select$4 = function CommunicationCappingRepresentationSelect() {
1273
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$a();
1274
+ const { selections: DataSpaceRepresentation__selections, opaque: DataSpaceRepresentation__opaque, } = select$7();
1275
+ const { selections: DimensionRepresentation__selections, opaque: DimensionRepresentation__opaque, } = select$5();
1276
+ return {
1277
+ kind: 'Fragment',
1278
+ version: VERSION$2,
1279
+ private: [],
1280
+ selections: [
1281
+ {
1282
+ name: 'createdBy',
1283
+ kind: 'Object',
1284
+ selections: CdpUserRepresentation__selections,
1285
+ required: false
1286
+ },
1287
+ {
1288
+ name: 'createdDate',
1289
+ kind: 'Scalar',
1290
+ required: false
1291
+ },
1292
+ {
1293
+ name: 'dataspacesInfo',
1294
+ kind: 'Object',
1295
+ plural: true,
1296
+ selections: DataSpaceRepresentation__selections
1297
+ },
1298
+ {
1299
+ name: 'description',
1300
+ kind: 'Scalar',
1301
+ required: false
1302
+ },
1303
+ {
1304
+ name: 'dimensions',
1305
+ kind: 'Object',
1306
+ plural: true,
1307
+ selections: DimensionRepresentation__selections
1308
+ },
1309
+ {
1310
+ name: 'id',
1311
+ kind: 'Scalar'
1312
+ },
1313
+ {
1314
+ name: 'label',
1315
+ kind: 'Scalar',
1316
+ required: false
1317
+ },
1318
+ {
1319
+ name: 'lastModifiedBy',
1320
+ kind: 'Object',
1321
+ selections: CdpUserRepresentation__selections,
1322
+ required: false
1323
+ },
1324
+ {
1325
+ name: 'lastModifiedDate',
1326
+ kind: 'Scalar',
1327
+ required: false
1328
+ },
1329
+ {
1330
+ name: 'name',
1331
+ kind: 'Scalar'
1332
+ },
1333
+ {
1334
+ name: 'namespace',
1335
+ kind: 'Scalar',
1336
+ required: false
1337
+ },
1338
+ {
1339
+ name: 'status',
1340
+ kind: 'Scalar',
1341
+ required: false
1342
+ },
1343
+ {
1344
+ name: 'url',
1345
+ kind: 'Scalar',
1346
+ required: false
1347
+ }
1348
+ ]
1349
+ };
1350
+ };
1351
+ function equals$2(existing, incoming) {
1352
+ const existing_createdDate = existing.createdDate;
1353
+ const incoming_createdDate = incoming.createdDate;
1354
+ // if at least one of these optionals is defined
1355
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
1356
+ // if one of these is not defined we know the other is defined and therefore
1357
+ // not equal
1358
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
1359
+ return false;
1360
+ }
1361
+ if (!(existing_createdDate === incoming_createdDate)) {
1362
+ return false;
1363
+ }
1364
+ }
1365
+ const existing_id = existing.id;
1366
+ const incoming_id = incoming.id;
1367
+ if (!(existing_id === incoming_id)) {
1368
+ return false;
1369
+ }
1370
+ const existing_label = existing.label;
1371
+ const incoming_label = incoming.label;
1372
+ // if at least one of these optionals is defined
1373
+ if (existing_label !== undefined || incoming_label !== undefined) {
1374
+ // if one of these is not defined we know the other is defined and therefore
1375
+ // not equal
1376
+ if (existing_label === undefined || incoming_label === undefined) {
1377
+ return false;
1378
+ }
1379
+ if (!(existing_label === incoming_label)) {
1380
+ return false;
1381
+ }
1382
+ }
1383
+ const existing_lastModifiedDate = existing.lastModifiedDate;
1384
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
1385
+ // if at least one of these optionals is defined
1386
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
1387
+ // if one of these is not defined we know the other is defined and therefore
1388
+ // not equal
1389
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
1390
+ return false;
1391
+ }
1392
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
1393
+ return false;
1394
+ }
1395
+ }
1396
+ const existing_name = existing.name;
1397
+ const incoming_name = incoming.name;
1398
+ if (!(existing_name === incoming_name)) {
1399
+ return false;
1400
+ }
1401
+ const existing_namespace = existing.namespace;
1402
+ const incoming_namespace = incoming.namespace;
1403
+ // if at least one of these optionals is defined
1404
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
1405
+ // if one of these is not defined we know the other is defined and therefore
1406
+ // not equal
1407
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
1408
+ return false;
1409
+ }
1410
+ if (!(existing_namespace === incoming_namespace)) {
1411
+ return false;
1412
+ }
1413
+ }
1414
+ const existing_status = existing.status;
1415
+ const incoming_status = incoming.status;
1416
+ // if at least one of these optionals is defined
1417
+ if (existing_status !== undefined || incoming_status !== undefined) {
1418
+ // if one of these is not defined we know the other is defined and therefore
1419
+ // not equal
1420
+ if (existing_status === undefined || incoming_status === undefined) {
1421
+ return false;
1422
+ }
1423
+ if (!(existing_status === incoming_status)) {
1424
+ return false;
1425
+ }
1426
+ }
1427
+ const existing_url = existing.url;
1428
+ const incoming_url = incoming.url;
1429
+ // if at least one of these optionals is defined
1430
+ if (existing_url !== undefined || incoming_url !== undefined) {
1431
+ // if one of these is not defined we know the other is defined and therefore
1432
+ // not equal
1433
+ if (existing_url === undefined || incoming_url === undefined) {
1434
+ return false;
1435
+ }
1436
+ if (!(existing_url === incoming_url)) {
1437
+ return false;
1438
+ }
1439
+ }
1440
+ const existing_createdBy = existing.createdBy;
1441
+ const incoming_createdBy = incoming.createdBy;
1442
+ // if at least one of these optionals is defined
1443
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
1444
+ // if one of these is not defined we know the other is defined and therefore
1445
+ // not equal
1446
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
1447
+ return false;
1448
+ }
1449
+ if (!(equals$8(existing_createdBy, incoming_createdBy))) {
1450
+ return false;
1451
+ }
1452
+ }
1453
+ const existing_dataspacesInfo = existing.dataspacesInfo;
1454
+ const incoming_dataspacesInfo = incoming.dataspacesInfo;
1455
+ const equals_dataspacesInfo_items = equalsArray(existing_dataspacesInfo, incoming_dataspacesInfo, (existing_dataspacesInfo_item, incoming_dataspacesInfo_item) => {
1456
+ if (!(equals$5(existing_dataspacesInfo_item, incoming_dataspacesInfo_item))) {
1457
+ return false;
1458
+ }
1459
+ });
1460
+ if (equals_dataspacesInfo_items === false) {
1461
+ return false;
1462
+ }
1463
+ const existing_description = existing.description;
1464
+ const incoming_description = incoming.description;
1465
+ // if at least one of these optionals is defined
1466
+ if (existing_description !== undefined || incoming_description !== undefined) {
1467
+ // if one of these is not defined we know the other is defined and therefore
1468
+ // not equal
1469
+ if (existing_description === undefined || incoming_description === undefined) {
1470
+ return false;
1471
+ }
1472
+ if (!(existing_description === incoming_description)) {
1473
+ return false;
1474
+ }
1475
+ }
1476
+ const existing_dimensions = existing.dimensions;
1477
+ const incoming_dimensions = incoming.dimensions;
1478
+ const equals_dimensions_items = equalsArray(existing_dimensions, incoming_dimensions, (existing_dimensions_item, incoming_dimensions_item) => {
1479
+ if (!(equals$3(existing_dimensions_item, incoming_dimensions_item))) {
1480
+ return false;
1481
+ }
1482
+ });
1483
+ if (equals_dimensions_items === false) {
1484
+ return false;
1485
+ }
1486
+ const existing_lastModifiedBy = existing.lastModifiedBy;
1487
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
1488
+ // if at least one of these optionals is defined
1489
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
1490
+ // if one of these is not defined we know the other is defined and therefore
1491
+ // not equal
1492
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
1493
+ return false;
1494
+ }
1495
+ if (!(equals$8(existing_lastModifiedBy, incoming_lastModifiedBy))) {
1496
+ return false;
1497
+ }
1498
+ }
1499
+ return true;
1500
+ }
1501
+ const ingest$1 = function CommunicationCappingRepresentationIngest(input, path, luvio, store, timestamp) {
1502
+ if (process.env.NODE_ENV !== 'production') {
1503
+ const validateError = validate$2(input);
1504
+ if (validateError !== null) {
1505
+ throw validateError;
1506
+ }
1507
+ }
1508
+ const key = path.fullPath;
1509
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
1510
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "communication-capping", VERSION$2, RepresentationType$1, equals$2);
1511
+ return createLink(key);
1512
+ };
1513
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1514
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1515
+ const rootKey = fullPathFactory();
1516
+ rootKeySet.set(rootKey, {
1517
+ namespace: keyPrefix,
1518
+ representationName: RepresentationType$1,
1519
+ mergeable: false
1520
+ });
1521
+ }
1522
+
1523
+ function select$3(luvio, params) {
1524
+ return select$4();
1525
+ }
1526
+ function keyBuilder$2(luvio, params) {
1527
+ return keyPrefix + '::CommunicationCappingRepresentation:(' + 'idOrName:' + params.urlParams.idOrName + ')';
1528
+ }
1529
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1530
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
1531
+ }
1532
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1533
+ const { body } = response;
1534
+ const key = keyBuilder$2(luvio, resourceParams);
1535
+ luvio.storeIngest(key, ingest$1, body);
1536
+ const snapshot = luvio.storeLookup({
1537
+ recordId: key,
1538
+ node: select$3(),
1539
+ variables: {},
1540
+ }, snapshotRefresh);
1541
+ if (process.env.NODE_ENV !== 'production') {
1542
+ if (snapshot.state !== 'Fulfilled') {
1543
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1544
+ }
1545
+ }
1546
+ deepFreeze(snapshot.data);
1547
+ return snapshot;
1548
+ }
1549
+ function ingestError(luvio, params, error, snapshotRefresh) {
1550
+ const key = keyBuilder$2(luvio, params);
1551
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1552
+ luvio.storeIngestError(key, errorSnapshot);
1553
+ return errorSnapshot;
1554
+ }
1555
+ function createResourceRequest$1(config) {
1556
+ const headers = {};
1557
+ return {
1558
+ baseUri: '/services/data/v66.0',
1559
+ basePath: '/ssot/communication-cappings/' + config.urlParams.idOrName + '',
1560
+ method: 'get',
1561
+ body: null,
1562
+ urlParams: config.urlParams,
1563
+ queryParams: {},
1564
+ headers,
1565
+ priority: 'normal',
1566
+ };
1567
+ }
1568
+
1569
+ const adapterName$1 = 'getCommunicationCappingRepresentation';
1570
+ const getCommunicationCappingRepresentation_ConfigPropertyMetadata = [
1571
+ generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
1572
+ ];
1573
+ const getCommunicationCappingRepresentation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getCommunicationCappingRepresentation_ConfigPropertyMetadata);
1574
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getCommunicationCappingRepresentation_ConfigPropertyMetadata);
1575
+ function keyBuilder$1(luvio, config) {
1576
+ const resourceParams = createResourceParams$1(config);
1577
+ return keyBuilder$2(luvio, resourceParams);
1578
+ }
1579
+ function typeCheckConfig$1(untrustedConfig) {
1580
+ const config = {};
1581
+ typeCheckConfig$2(untrustedConfig, config, getCommunicationCappingRepresentation_ConfigPropertyMetadata);
1582
+ return config;
1583
+ }
1584
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1585
+ if (!untrustedIsObject(untrustedConfig)) {
1586
+ return null;
1587
+ }
1588
+ if (process.env.NODE_ENV !== 'production') {
1589
+ validateConfig(untrustedConfig, configPropertyNames);
1590
+ }
1591
+ const config = typeCheckConfig$1(untrustedConfig);
1592
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1593
+ return null;
1594
+ }
1595
+ return config;
1596
+ }
1597
+ function adapterFragment(luvio, config) {
1598
+ createResourceParams$1(config);
1599
+ return select$3();
1600
+ }
1601
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1602
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1603
+ config,
1604
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1605
+ });
1606
+ return luvio.storeBroadcast().then(() => snapshot);
1607
+ }
1608
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1609
+ const snapshot = ingestError(luvio, resourceParams, response, {
1610
+ config,
1611
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1612
+ });
1613
+ return luvio.storeBroadcast().then(() => snapshot);
1614
+ }
1615
+ function buildNetworkSnapshot$1(luvio, config, options) {
1616
+ const resourceParams = createResourceParams$1(config);
1617
+ const request = createResourceRequest$1(resourceParams);
1618
+ return luvio.dispatchResourceRequest(request, options)
1619
+ .then((response) => {
1620
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1621
+ const cache = new StoreKeyMap();
1622
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1623
+ return cache;
1624
+ });
1625
+ }, (response) => {
1626
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1627
+ });
1628
+ }
1629
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1630
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1631
+ }
1632
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1633
+ const { luvio, config } = context;
1634
+ const selector = {
1635
+ recordId: keyBuilder$1(luvio, config),
1636
+ node: adapterFragment(luvio, config),
1637
+ variables: {},
1638
+ };
1639
+ const cacheSnapshot = storeLookup(selector, {
1640
+ config,
1641
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1642
+ });
1643
+ return cacheSnapshot;
1644
+ }
1645
+ const getCommunicationCappingRepresentationAdapterFactory = (luvio) => function communicationCapping__getCommunicationCappingRepresentation(untrustedConfig, requestContext) {
1646
+ const config = validateAdapterConfig$1(untrustedConfig, getCommunicationCappingRepresentation_ConfigPropertyNames);
1647
+ // Invalid or incomplete config
1648
+ if (config === null) {
1649
+ return null;
1650
+ }
1651
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1652
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1653
+ };
1654
+
1655
+ const VERSION$1 = "70c253ff0d0ce928bf7196b1a24d910f";
1656
+ function validate$1(obj, path = 'CdpErrorRepresentation') {
1657
+ const v_error = (() => {
1658
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1659
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1660
+ }
1661
+ if (obj.errorCode !== undefined) {
1662
+ const obj_errorCode = obj.errorCode;
1663
+ const path_errorCode = path + '.errorCode';
1664
+ if (typeof obj_errorCode !== 'string') {
1665
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
1666
+ }
1667
+ }
1668
+ if (obj.message !== undefined) {
1669
+ const obj_message = obj.message;
1670
+ const path_message = path + '.message';
1671
+ if (typeof obj_message !== 'string') {
1672
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1673
+ }
1674
+ }
1675
+ })();
1676
+ return v_error === undefined ? null : v_error;
1677
+ }
1678
+ const select$2 = function CdpErrorRepresentationSelect() {
1679
+ return {
1680
+ kind: 'Fragment',
1681
+ version: VERSION$1,
1682
+ private: [],
1683
+ selections: [
1684
+ {
1685
+ name: 'errorCode',
1686
+ kind: 'Scalar',
1687
+ required: false
1688
+ },
1689
+ {
1690
+ name: 'message',
1691
+ kind: 'Scalar',
1692
+ required: false
1693
+ }
1694
+ ]
1695
+ };
1696
+ };
1697
+ function equals$1(existing, incoming) {
1698
+ const existing_errorCode = existing.errorCode;
1699
+ const incoming_errorCode = incoming.errorCode;
1700
+ // if at least one of these optionals is defined
1701
+ if (existing_errorCode !== undefined || incoming_errorCode !== undefined) {
1702
+ // if one of these is not defined we know the other is defined and therefore
1703
+ // not equal
1704
+ if (existing_errorCode === undefined || incoming_errorCode === undefined) {
1705
+ return false;
1706
+ }
1707
+ if (!(existing_errorCode === incoming_errorCode)) {
1708
+ return false;
1709
+ }
1710
+ }
1711
+ const existing_message = existing.message;
1712
+ const incoming_message = incoming.message;
1713
+ // if at least one of these optionals is defined
1714
+ if (existing_message !== undefined || incoming_message !== undefined) {
1715
+ // if one of these is not defined we know the other is defined and therefore
1716
+ // not equal
1717
+ if (existing_message === undefined || incoming_message === undefined) {
1718
+ return false;
1719
+ }
1720
+ if (!(existing_message === incoming_message)) {
1721
+ return false;
1722
+ }
1723
+ }
1724
+ return true;
1725
+ }
1726
+
1727
+ const VERSION = "dff02814b99940016ea8b72cf560f333";
1728
+ function validate(obj, path = 'CommunicationCappingActionResponseRepresentation') {
1729
+ const v_error = (() => {
1730
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1731
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1732
+ }
1733
+ const obj_errors = obj.errors;
1734
+ const path_errors = path + '.errors';
1735
+ if (!ArrayIsArray(obj_errors)) {
1736
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
1737
+ }
1738
+ for (let i = 0; i < obj_errors.length; i++) {
1739
+ const obj_errors_item = obj_errors[i];
1740
+ const path_errors_item = path_errors + '[' + i + ']';
1741
+ const referencepath_errors_itemValidationError = validate$1(obj_errors_item, path_errors_item);
1742
+ if (referencepath_errors_itemValidationError !== null) {
1743
+ let message = 'Object doesn\'t match CdpErrorRepresentation (at "' + path_errors_item + '")\n';
1744
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1745
+ return new TypeError(message);
1746
+ }
1747
+ }
1748
+ const obj_success = obj.success;
1749
+ const path_success = path + '.success';
1750
+ if (typeof obj_success !== 'boolean') {
1751
+ return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
1752
+ }
1753
+ })();
1754
+ return v_error === undefined ? null : v_error;
1755
+ }
1756
+ const RepresentationType = 'CommunicationCappingActionResponseRepresentation';
1757
+ function keyBuilder(luvio, config) {
1758
+ return keyPrefix + '::' + RepresentationType + ':' + config.success;
1759
+ }
1760
+ function keyBuilderFromType(luvio, object) {
1761
+ const keyParams = {
1762
+ success: object.success
1763
+ };
1764
+ return keyBuilder(luvio, keyParams);
1765
+ }
1766
+ function normalize(input, existing, path, luvio, store, timestamp) {
1767
+ return input;
1768
+ }
1769
+ const select$1 = function CommunicationCappingActionResponseRepresentationSelect() {
1770
+ const { selections: CdpErrorRepresentation__selections, opaque: CdpErrorRepresentation__opaque, } = select$2();
1771
+ return {
1772
+ kind: 'Fragment',
1773
+ version: VERSION,
1774
+ private: [],
1775
+ selections: [
1776
+ {
1777
+ name: 'errors',
1778
+ kind: 'Object',
1779
+ plural: true,
1780
+ selections: CdpErrorRepresentation__selections
1781
+ },
1782
+ {
1783
+ name: 'success',
1784
+ kind: 'Scalar'
1785
+ }
1786
+ ]
1787
+ };
1788
+ };
1789
+ function equals(existing, incoming) {
1790
+ const existing_success = existing.success;
1791
+ const incoming_success = incoming.success;
1792
+ if (!(existing_success === incoming_success)) {
1793
+ return false;
1794
+ }
1795
+ const existing_errors = existing.errors;
1796
+ const incoming_errors = incoming.errors;
1797
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
1798
+ if (!(equals$1(existing_errors_item, incoming_errors_item))) {
1799
+ return false;
1800
+ }
1801
+ });
1802
+ if (equals_errors_items === false) {
1803
+ return false;
1804
+ }
1805
+ return true;
1806
+ }
1807
+ const ingest = function CommunicationCappingActionResponseRepresentationIngest(input, path, luvio, store, timestamp) {
1808
+ if (process.env.NODE_ENV !== 'production') {
1809
+ const validateError = validate(input);
1810
+ if (validateError !== null) {
1811
+ throw validateError;
1812
+ }
1813
+ }
1814
+ const key = keyBuilderFromType(luvio, input);
1815
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
1816
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "communication-capping", VERSION, RepresentationType, equals);
1817
+ return createLink(key);
1818
+ };
1819
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1820
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1821
+ const rootKey = keyBuilderFromType(luvio, input);
1822
+ rootKeySet.set(rootKey, {
1823
+ namespace: keyPrefix,
1824
+ representationName: RepresentationType,
1825
+ mergeable: false
1826
+ });
1827
+ }
1828
+
1829
+ function select(luvio, params) {
1830
+ return select$1();
1831
+ }
1832
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1833
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1834
+ }
1835
+ function ingestSuccess(luvio, resourceParams, response) {
1836
+ const { body } = response;
1837
+ const key = keyBuilderFromType(luvio, body);
1838
+ luvio.storeIngest(key, ingest, body);
1839
+ const snapshot = luvio.storeLookup({
1840
+ recordId: key,
1841
+ node: select(),
1842
+ variables: {},
1843
+ });
1844
+ if (process.env.NODE_ENV !== 'production') {
1845
+ if (snapshot.state !== 'Fulfilled') {
1846
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1847
+ }
1848
+ }
1849
+ deepFreeze(snapshot.data);
1850
+ return snapshot;
1851
+ }
1852
+ function createResourceRequest(config) {
1853
+ const headers = {};
1854
+ return {
1855
+ baseUri: '/services/data/v66.0',
1856
+ basePath: '/ssot/communication-cappings/' + config.urlParams.idOrName + '/actions/retry',
1857
+ method: 'post',
1858
+ body: null,
1859
+ urlParams: config.urlParams,
1860
+ queryParams: {},
1861
+ headers,
1862
+ priority: 'normal',
1863
+ };
1864
+ }
1865
+
1866
+ const adapterName = 'triggerDMOCICreation';
1867
+ const triggerDMOCICreation_ConfigPropertyMetadata = [
1868
+ generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
1869
+ ];
1870
+ const triggerDMOCICreation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, triggerDMOCICreation_ConfigPropertyMetadata);
1871
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(triggerDMOCICreation_ConfigPropertyMetadata);
1872
+ function typeCheckConfig(untrustedConfig) {
1873
+ const config = {};
1874
+ typeCheckConfig$2(untrustedConfig, config, triggerDMOCICreation_ConfigPropertyMetadata);
1875
+ return config;
1876
+ }
1877
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1878
+ if (!untrustedIsObject(untrustedConfig)) {
1879
+ return null;
1880
+ }
1881
+ if (process.env.NODE_ENV !== 'production') {
1882
+ validateConfig(untrustedConfig, configPropertyNames);
1883
+ }
1884
+ const config = typeCheckConfig(untrustedConfig);
1885
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1886
+ return null;
1887
+ }
1888
+ return config;
1889
+ }
1890
+ function buildNetworkSnapshot(luvio, config, options) {
1891
+ const resourceParams = createResourceParams(config);
1892
+ const request = createResourceRequest(resourceParams);
1893
+ return luvio.dispatchResourceRequest(request, options)
1894
+ .then((response) => {
1895
+ return luvio.handleSuccessResponse(() => {
1896
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
1897
+ return luvio.storeBroadcast().then(() => snapshot);
1898
+ }, () => {
1899
+ const cache = new StoreKeyMap();
1900
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1901
+ return cache;
1902
+ });
1903
+ }, (response) => {
1904
+ deepFreeze(response);
1905
+ throw response;
1906
+ });
1907
+ }
1908
+ const triggerDMOCICreationAdapterFactory = (luvio) => {
1909
+ return function triggerDMOCICreation(untrustedConfig) {
1910
+ const config = validateAdapterConfig(untrustedConfig, triggerDMOCICreation_ConfigPropertyNames);
1911
+ // Invalid or incomplete config
1912
+ if (config === null) {
1913
+ throw new Error('Invalid config for "triggerDMOCICreation"');
1914
+ }
1915
+ return buildNetworkSnapshot(luvio, config);
1916
+ };
1917
+ };
1918
+
1919
+ export { getCommunicationCappingRepresentationAdapterFactory, triggerDMOCICreationAdapterFactory };