@salesforce/lds-adapters-marketing-cdp 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 (56) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/marketing-cdp.js +2423 -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/createDataGraph.d.ts +33 -0
  5. package/dist/es/es2018/types/src/generated/adapters/deleteDataGraph.d.ts +14 -0
  6. package/dist/es/es2018/types/src/generated/adapters/editDataGraph.d.ts +34 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getDataGraph.d.ts +31 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getDataGraphDependency.d.ts +29 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getDataGraphDraft.d.ts +28 -0
  10. package/dist/es/es2018/types/src/generated/adapters/retryDataGraph.d.ts +15 -0
  11. package/dist/es/es2018/types/src/generated/adapters/saveDataGraphDraft.d.ts +16 -0
  12. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +8 -0
  13. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +15 -0
  14. package/dist/es/es2018/types/src/generated/resources/deleteSsotDataGraphsByDataGraphName.d.ts +12 -0
  15. package/dist/es/es2018/types/src/generated/resources/getSsotDataGraphsByDataGraphName.d.ts +20 -0
  16. package/dist/es/es2018/types/src/generated/resources/getSsotDataGraphsDependencyByDataGraphName.d.ts +16 -0
  17. package/dist/es/es2018/types/src/generated/resources/getSsotDataGraphsDraftByDataGraphName.d.ts +16 -0
  18. package/dist/es/es2018/types/src/generated/resources/postSsotDataGraphs.d.ts +30 -0
  19. package/dist/es/es2018/types/src/generated/resources/postSsotDataGraphsDraft.d.ts +13 -0
  20. package/dist/es/es2018/types/src/generated/resources/putSsotDataGraphs.d.ts +33 -0
  21. package/dist/es/es2018/types/src/generated/resources/putSsotDataGraphsRetry.d.ts +12 -0
  22. package/dist/es/es2018/types/src/generated/types/CdpDataGraphDataRecencyInputRepresentation.d.ts +37 -0
  23. package/dist/es/es2018/types/src/generated/types/CdpDataGraphDependencyOutputRepresentation.d.ts +34 -0
  24. package/dist/es/es2018/types/src/generated/types/CdpDataGraphDraftInputRepresentation.d.ts +31 -0
  25. package/dist/es/es2018/types/src/generated/types/CdpDataGraphDraftOutputRepresentation.d.ts +38 -0
  26. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFieldInputRepresentation.d.ts +52 -0
  27. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFieldOutputRepresentation.d.ts +62 -0
  28. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFilterConditionInputRepresentation.d.ts +34 -0
  29. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFilterConditionOutputRepresentation.d.ts +34 -0
  30. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFilterCriteriaInputRepresentation.d.ts +32 -0
  31. package/dist/es/es2018/types/src/generated/types/CdpDataGraphFilterCriteriaOutputRepresentation.d.ts +32 -0
  32. package/dist/es/es2018/types/src/generated/types/CdpDataGraphInputRepresentation.d.ts +76 -0
  33. package/dist/es/es2018/types/src/generated/types/CdpDataGraphOutputRepresentation.d.ts +103 -0
  34. package/dist/es/es2018/types/src/generated/types/CdpDataGraphPathToParentInputRepresentation.d.ts +31 -0
  35. package/dist/es/es2018/types/src/generated/types/CdpDataGraphPathToParentOutputRepresentation.d.ts +31 -0
  36. package/dist/es/es2018/types/src/generated/types/CdpDataGraphRecencyCriteriaOutputRepresentation.d.ts +37 -0
  37. package/dist/es/es2018/types/src/generated/types/CdpDataGraphRelatedSegmentOutputRepresentation.d.ts +34 -0
  38. package/dist/es/es2018/types/src/generated/types/CdpDataGraphRetryInputRepresentation.d.ts +28 -0
  39. package/dist/es/es2018/types/src/generated/types/CdpDataGraphRetryOutputRepresentation.d.ts +43 -0
  40. package/dist/es/es2018/types/src/generated/types/CdpDataGraphSourceInputRepresentation.d.ts +46 -0
  41. package/dist/es/es2018/types/src/generated/types/CdpDataGraphSourceObjectOutputRepresentation.d.ts +69 -0
  42. package/dist/es/es2018/types/src/generated/types/CdpObjectBaseInputRepresentation.d.ts +40 -0
  43. package/dist/es/es2018/types/src/generated/types/CdpObjectBaseOutputRepresentation.d.ts +64 -0
  44. package/dist/es/es2018/types/src/generated/types/DataGraphFullRefreshConfigInputRepresentation.d.ts +28 -0
  45. package/dist/es/es2018/types/src/generated/types/DataGraphFullRefreshConfigOutputRepresentation.d.ts +28 -0
  46. package/dist/es/es2018/types/src/generated/types/DataGraphIncrementalRefreshConfigInputRepresentation.d.ts +28 -0
  47. package/dist/es/es2018/types/src/generated/types/DataGraphIncrementalRefreshConfigOutputRepresentation.d.ts +28 -0
  48. package/dist/es/es2018/types/src/generated/types/DataGraphScheduleInputRepresentation.d.ts +31 -0
  49. package/dist/es/es2018/types/src/generated/types/DataGraphScheduleOutputRepresentation.d.ts +31 -0
  50. package/dist/es/es2018/types/src/generated/types/DependencyOutputRepresentation.d.ts +43 -0
  51. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  52. package/package.json +75 -0
  53. package/sfdc/index.d.ts +1 -0
  54. package/sfdc/index.js +2609 -0
  55. package/src/raml/api.raml +808 -0
  56. package/src/raml/luvio.raml +74 -0
@@ -0,0 +1,2423 @@
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, StoreKeyMap, createResourceParams as createResourceParams$8, typeCheckConfig as typeCheckConfig$8, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3 } 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 = 'CDP';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ const { stringify: JSONStringify } = JSON;
76
+ function equalsArray(a, b, equalsItem) {
77
+ const aLength = a.length;
78
+ const bLength = b.length;
79
+ if (aLength !== bLength) {
80
+ return false;
81
+ }
82
+ for (let i = 0; i < aLength; i++) {
83
+ if (equalsItem(a[i], b[i]) === false) {
84
+ return false;
85
+ }
86
+ }
87
+ return true;
88
+ }
89
+ function createLink(ref) {
90
+ return {
91
+ __ref: serializeStructuredKey(ref),
92
+ };
93
+ }
94
+
95
+ function validate$h(obj, path = 'DataGraphFullRefreshConfigInputRepresentation') {
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
+ if (obj.schedule !== undefined) {
101
+ const obj_schedule = obj.schedule;
102
+ const path_schedule = path + '.schedule';
103
+ if (typeof obj_schedule !== 'object' || ArrayIsArray(obj_schedule) || obj_schedule === null) {
104
+ return new TypeError('Expected "object" but received "' + typeof obj_schedule + '" (at "' + path_schedule + '")');
105
+ }
106
+ }
107
+ })();
108
+ return v_error === undefined ? null : v_error;
109
+ }
110
+
111
+ function validate$g(obj, path = 'DataGraphIncrementalRefreshConfigInputRepresentation') {
112
+ const v_error = (() => {
113
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
114
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
115
+ }
116
+ if (obj.enabled !== undefined) {
117
+ const obj_enabled = obj.enabled;
118
+ const path_enabled = path + '.enabled';
119
+ if (typeof obj_enabled !== 'boolean') {
120
+ return new TypeError('Expected "boolean" but received "' + typeof obj_enabled + '" (at "' + path_enabled + '")');
121
+ }
122
+ }
123
+ })();
124
+ return v_error === undefined ? null : v_error;
125
+ }
126
+
127
+ function validate$f(obj, path = 'CdpObjectBaseOutputRepresentation') {
128
+ const v_error = (() => {
129
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
130
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
131
+ }
132
+ if (obj.createdBy !== undefined) {
133
+ const obj_createdBy = obj.createdBy;
134
+ const path_createdBy = path + '.createdBy';
135
+ if (typeof obj_createdBy !== 'string') {
136
+ return new TypeError('Expected "string" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
137
+ }
138
+ }
139
+ if (obj.createdDate !== undefined) {
140
+ const obj_createdDate = obj.createdDate;
141
+ const path_createdDate = path + '.createdDate';
142
+ if (typeof obj_createdDate !== 'string') {
143
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
144
+ }
145
+ }
146
+ if (obj.dataspaceName !== undefined) {
147
+ const obj_dataspaceName = obj.dataspaceName;
148
+ const path_dataspaceName = path + '.dataspaceName';
149
+ if (typeof obj_dataspaceName !== 'string') {
150
+ return new TypeError('Expected "string" but received "' + typeof obj_dataspaceName + '" (at "' + path_dataspaceName + '")');
151
+ }
152
+ }
153
+ if (obj.description !== undefined) {
154
+ const obj_description = obj.description;
155
+ const path_description = path + '.description';
156
+ if (typeof obj_description !== 'string') {
157
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
158
+ }
159
+ }
160
+ if (obj.id !== undefined) {
161
+ const obj_id = obj.id;
162
+ const path_id = path + '.id';
163
+ if (typeof obj_id !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
165
+ }
166
+ }
167
+ const obj_kind = obj.kind;
168
+ const path_kind = path + '.kind';
169
+ if (typeof obj_kind !== 'string') {
170
+ return new TypeError('Expected "string" but received "' + typeof obj_kind + '" (at "' + path_kind + '")');
171
+ }
172
+ if (obj.label !== undefined) {
173
+ const obj_label = obj.label;
174
+ const path_label = path + '.label';
175
+ if (typeof obj_label !== 'string') {
176
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
177
+ }
178
+ }
179
+ if (obj.modifiedBy !== undefined) {
180
+ const obj_modifiedBy = obj.modifiedBy;
181
+ const path_modifiedBy = path + '.modifiedBy';
182
+ if (typeof obj_modifiedBy !== 'string') {
183
+ return new TypeError('Expected "string" but received "' + typeof obj_modifiedBy + '" (at "' + path_modifiedBy + '")');
184
+ }
185
+ }
186
+ if (obj.modifiedDate !== undefined) {
187
+ const obj_modifiedDate = obj.modifiedDate;
188
+ const path_modifiedDate = path + '.modifiedDate';
189
+ if (typeof obj_modifiedDate !== 'string') {
190
+ return new TypeError('Expected "string" but received "' + typeof obj_modifiedDate + '" (at "' + path_modifiedDate + '")');
191
+ }
192
+ }
193
+ const obj_name = obj.name;
194
+ const path_name = path + '.name';
195
+ if (typeof obj_name !== 'string') {
196
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
197
+ }
198
+ })();
199
+ return v_error === undefined ? null : v_error;
200
+ }
201
+ const RepresentationType$4 = 'CdpObjectBaseOutputRepresentation';
202
+ function keyBuilder$b(luvio, config) {
203
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.name;
204
+ }
205
+ function keyBuilderFromType$4(luvio, object) {
206
+ const keyParams = {
207
+ name: object.name
208
+ };
209
+ return keyBuilder$b(luvio, keyParams);
210
+ }
211
+ function equals$9(existing, incoming) {
212
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
213
+ return false;
214
+ }
215
+ return true;
216
+ }
217
+
218
+ function validate$e(obj, path = 'DataGraphScheduleOutputRepresentation') {
219
+ const v_error = (() => {
220
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
221
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
222
+ }
223
+ if (obj.frequency !== undefined) {
224
+ const obj_frequency = obj.frequency;
225
+ const path_frequency = path + '.frequency';
226
+ if (typeof obj_frequency !== 'number' || (typeof obj_frequency === 'number' && Math.floor(obj_frequency) !== obj_frequency)) {
227
+ return new TypeError('Expected "integer" but received "' + typeof obj_frequency + '" (at "' + path_frequency + '")');
228
+ }
229
+ }
230
+ if (obj.timeGranularity !== undefined) {
231
+ const obj_timeGranularity = obj.timeGranularity;
232
+ const path_timeGranularity = path + '.timeGranularity';
233
+ if (typeof obj_timeGranularity !== 'string') {
234
+ return new TypeError('Expected "string" but received "' + typeof obj_timeGranularity + '" (at "' + path_timeGranularity + '")');
235
+ }
236
+ }
237
+ })();
238
+ return v_error === undefined ? null : v_error;
239
+ }
240
+ function equals$8(existing, incoming) {
241
+ const existing_frequency = existing.frequency;
242
+ const incoming_frequency = incoming.frequency;
243
+ // if at least one of these optionals is defined
244
+ if (existing_frequency !== undefined || incoming_frequency !== undefined) {
245
+ // if one of these is not defined we know the other is defined and therefore
246
+ // not equal
247
+ if (existing_frequency === undefined || incoming_frequency === undefined) {
248
+ return false;
249
+ }
250
+ if (!(existing_frequency === incoming_frequency)) {
251
+ return false;
252
+ }
253
+ }
254
+ const existing_timeGranularity = existing.timeGranularity;
255
+ const incoming_timeGranularity = incoming.timeGranularity;
256
+ // if at least one of these optionals is defined
257
+ if (existing_timeGranularity !== undefined || incoming_timeGranularity !== undefined) {
258
+ // if one of these is not defined we know the other is defined and therefore
259
+ // not equal
260
+ if (existing_timeGranularity === undefined || incoming_timeGranularity === undefined) {
261
+ return false;
262
+ }
263
+ if (!(existing_timeGranularity === incoming_timeGranularity)) {
264
+ return false;
265
+ }
266
+ }
267
+ return true;
268
+ }
269
+
270
+ function validate$d(obj, path = 'DataGraphFullRefreshConfigOutputRepresentation') {
271
+ const v_error = (() => {
272
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
273
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
274
+ }
275
+ if (obj.schedule !== undefined) {
276
+ const obj_schedule = obj.schedule;
277
+ const path_schedule = path + '.schedule';
278
+ const referencepath_scheduleValidationError = validate$e(obj_schedule, path_schedule);
279
+ if (referencepath_scheduleValidationError !== null) {
280
+ let message = 'Object doesn\'t match DataGraphScheduleOutputRepresentation (at "' + path_schedule + '")\n';
281
+ message += referencepath_scheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
282
+ return new TypeError(message);
283
+ }
284
+ }
285
+ })();
286
+ return v_error === undefined ? null : v_error;
287
+ }
288
+ function equals$7(existing, incoming) {
289
+ const existing_schedule = existing.schedule;
290
+ const incoming_schedule = incoming.schedule;
291
+ // if at least one of these optionals is defined
292
+ if (existing_schedule !== undefined || incoming_schedule !== undefined) {
293
+ // if one of these is not defined we know the other is defined and therefore
294
+ // not equal
295
+ if (existing_schedule === undefined || incoming_schedule === undefined) {
296
+ return false;
297
+ }
298
+ if (!(equals$8(existing_schedule, incoming_schedule))) {
299
+ return false;
300
+ }
301
+ }
302
+ return true;
303
+ }
304
+
305
+ function validate$c(obj, path = 'DataGraphIncrementalRefreshConfigOutputRepresentation') {
306
+ const v_error = (() => {
307
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
308
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
309
+ }
310
+ if (obj.enabled !== undefined) {
311
+ const obj_enabled = obj.enabled;
312
+ const path_enabled = path + '.enabled';
313
+ if (typeof obj_enabled !== 'boolean') {
314
+ return new TypeError('Expected "boolean" but received "' + typeof obj_enabled + '" (at "' + path_enabled + '")');
315
+ }
316
+ }
317
+ })();
318
+ return v_error === undefined ? null : v_error;
319
+ }
320
+ function equals$6(existing, incoming) {
321
+ const existing_enabled = existing.enabled;
322
+ const incoming_enabled = incoming.enabled;
323
+ // if at least one of these optionals is defined
324
+ if (existing_enabled !== undefined || incoming_enabled !== undefined) {
325
+ // if one of these is not defined we know the other is defined and therefore
326
+ // not equal
327
+ if (existing_enabled === undefined || incoming_enabled === undefined) {
328
+ return false;
329
+ }
330
+ if (!(existing_enabled === incoming_enabled)) {
331
+ return false;
332
+ }
333
+ }
334
+ return true;
335
+ }
336
+
337
+ function validate$b(obj, path = 'DependencyOutputRepresentation') {
338
+ const v_error = (() => {
339
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
340
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
341
+ }
342
+ const obj_developerName = obj.developerName;
343
+ const path_developerName = path + '.developerName';
344
+ if (typeof obj_developerName !== 'string') {
345
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
346
+ }
347
+ const obj_displayName = obj.displayName;
348
+ const path_displayName = path + '.displayName';
349
+ if (typeof obj_displayName !== 'string') {
350
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
351
+ }
352
+ const obj_entityType = obj.entityType;
353
+ const path_entityType = path + '.entityType';
354
+ if (typeof obj_entityType !== 'string') {
355
+ return new TypeError('Expected "string" but received "' + typeof obj_entityType + '" (at "' + path_entityType + '")');
356
+ }
357
+ const obj_entityTypePluralLabel = obj.entityTypePluralLabel;
358
+ const path_entityTypePluralLabel = path + '.entityTypePluralLabel';
359
+ if (typeof obj_entityTypePluralLabel !== 'string') {
360
+ return new TypeError('Expected "string" but received "' + typeof obj_entityTypePluralLabel + '" (at "' + path_entityTypePluralLabel + '")');
361
+ }
362
+ const obj_id = obj.id;
363
+ const path_id = path + '.id';
364
+ if (typeof obj_id !== 'string') {
365
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
366
+ }
367
+ const obj_linkable = obj.linkable;
368
+ const path_linkable = path + '.linkable';
369
+ if (typeof obj_linkable !== 'boolean') {
370
+ return new TypeError('Expected "boolean" but received "' + typeof obj_linkable + '" (at "' + path_linkable + '")');
371
+ }
372
+ })();
373
+ return v_error === undefined ? null : v_error;
374
+ }
375
+ function equals$5(existing, incoming) {
376
+ const existing_linkable = existing.linkable;
377
+ const incoming_linkable = incoming.linkable;
378
+ if (!(existing_linkable === incoming_linkable)) {
379
+ return false;
380
+ }
381
+ const existing_developerName = existing.developerName;
382
+ const incoming_developerName = incoming.developerName;
383
+ if (!(existing_developerName === incoming_developerName)) {
384
+ return false;
385
+ }
386
+ const existing_displayName = existing.displayName;
387
+ const incoming_displayName = incoming.displayName;
388
+ if (!(existing_displayName === incoming_displayName)) {
389
+ return false;
390
+ }
391
+ const existing_entityType = existing.entityType;
392
+ const incoming_entityType = incoming.entityType;
393
+ if (!(existing_entityType === incoming_entityType)) {
394
+ return false;
395
+ }
396
+ const existing_entityTypePluralLabel = existing.entityTypePluralLabel;
397
+ const incoming_entityTypePluralLabel = incoming.entityTypePluralLabel;
398
+ if (!(existing_entityTypePluralLabel === incoming_entityTypePluralLabel)) {
399
+ return false;
400
+ }
401
+ const existing_id = existing.id;
402
+ const incoming_id = incoming.id;
403
+ if (!(existing_id === incoming_id)) {
404
+ return false;
405
+ }
406
+ return true;
407
+ }
408
+
409
+ function validate$a(obj, path = 'CdpDataGraphFieldOutputRepresentation') {
410
+ const v_error = (() => {
411
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
412
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
413
+ }
414
+ if (obj.ciFieldType !== undefined) {
415
+ const obj_ciFieldType = obj.ciFieldType;
416
+ const path_ciFieldType = path + '.ciFieldType';
417
+ if (typeof obj_ciFieldType !== 'string') {
418
+ return new TypeError('Expected "string" but received "' + typeof obj_ciFieldType + '" (at "' + path_ciFieldType + '")');
419
+ }
420
+ }
421
+ if (obj.ciFormula !== undefined) {
422
+ const obj_ciFormula = obj.ciFormula;
423
+ const path_ciFormula = path + '.ciFormula';
424
+ if (typeof obj_ciFormula !== 'string') {
425
+ return new TypeError('Expected "string" but received "' + typeof obj_ciFormula + '" (at "' + path_ciFormula + '")');
426
+ }
427
+ }
428
+ if (obj.dataType !== undefined) {
429
+ const obj_dataType = obj.dataType;
430
+ const path_dataType = path + '.dataType';
431
+ if (typeof obj_dataType !== 'string') {
432
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
433
+ }
434
+ }
435
+ if (obj.dependency !== undefined) {
436
+ const obj_dependency = obj.dependency;
437
+ const path_dependency = path + '.dependency';
438
+ if (!ArrayIsArray(obj_dependency)) {
439
+ return new TypeError('Expected "array" but received "' + typeof obj_dependency + '" (at "' + path_dependency + '")');
440
+ }
441
+ for (let i = 0; i < obj_dependency.length; i++) {
442
+ const obj_dependency_item = obj_dependency[i];
443
+ const path_dependency_item = path_dependency + '[' + i + ']';
444
+ const referencepath_dependency_itemValidationError = validate$b(obj_dependency_item, path_dependency_item);
445
+ if (referencepath_dependency_itemValidationError !== null) {
446
+ let message = 'Object doesn\'t match DependencyOutputRepresentation (at "' + path_dependency_item + '")\n';
447
+ message += referencepath_dependency_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
448
+ return new TypeError(message);
449
+ }
450
+ }
451
+ }
452
+ if (obj.devName !== undefined) {
453
+ const obj_devName = obj.devName;
454
+ const path_devName = path + '.devName';
455
+ if (typeof obj_devName !== 'string') {
456
+ return new TypeError('Expected "string" but received "' + typeof obj_devName + '" (at "' + path_devName + '")');
457
+ }
458
+ }
459
+ if (obj.isDGRootKeyField !== undefined) {
460
+ const obj_isDGRootKeyField = obj.isDGRootKeyField;
461
+ const path_isDGRootKeyField = path + '.isDGRootKeyField';
462
+ if (typeof obj_isDGRootKeyField !== 'boolean') {
463
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isDGRootKeyField + '" (at "' + path_isDGRootKeyField + '")');
464
+ }
465
+ }
466
+ const obj_isKeyColumn = obj.isKeyColumn;
467
+ const path_isKeyColumn = path + '.isKeyColumn';
468
+ if (typeof obj_isKeyColumn !== 'boolean') {
469
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isKeyColumn + '" (at "' + path_isKeyColumn + '")');
470
+ }
471
+ if (obj.isProjected !== undefined) {
472
+ const obj_isProjected = obj.isProjected;
473
+ const path_isProjected = path + '.isProjected';
474
+ if (typeof obj_isProjected !== 'boolean') {
475
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isProjected + '" (at "' + path_isProjected + '")');
476
+ }
477
+ }
478
+ if (obj.keyQualifierName !== undefined) {
479
+ const obj_keyQualifierName = obj.keyQualifierName;
480
+ const path_keyQualifierName = path + '.keyQualifierName';
481
+ if (typeof obj_keyQualifierName !== 'string') {
482
+ return new TypeError('Expected "string" but received "' + typeof obj_keyQualifierName + '" (at "' + path_keyQualifierName + '")');
483
+ }
484
+ }
485
+ if (obj.sourceFieldLabel !== undefined) {
486
+ const obj_sourceFieldLabel = obj.sourceFieldLabel;
487
+ const path_sourceFieldLabel = path + '.sourceFieldLabel';
488
+ if (typeof obj_sourceFieldLabel !== 'string') {
489
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceFieldLabel + '" (at "' + path_sourceFieldLabel + '")');
490
+ }
491
+ }
492
+ const obj_sourceFieldName = obj.sourceFieldName;
493
+ const path_sourceFieldName = path + '.sourceFieldName';
494
+ if (typeof obj_sourceFieldName !== 'string') {
495
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceFieldName + '" (at "' + path_sourceFieldName + '")');
496
+ }
497
+ if (obj.usageTag !== undefined) {
498
+ const obj_usageTag = obj.usageTag;
499
+ const path_usageTag = path + '.usageTag';
500
+ if (typeof obj_usageTag !== 'string') {
501
+ return new TypeError('Expected "string" but received "' + typeof obj_usageTag + '" (at "' + path_usageTag + '")');
502
+ }
503
+ }
504
+ })();
505
+ return v_error === undefined ? null : v_error;
506
+ }
507
+
508
+ function validate$9(obj, path = 'CdpDataGraphFilterConditionOutputRepresentation') {
509
+ const v_error = (() => {
510
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
511
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
512
+ }
513
+ const obj_fieldName = obj.fieldName;
514
+ const path_fieldName = path + '.fieldName';
515
+ if (typeof obj_fieldName !== 'string') {
516
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
517
+ }
518
+ const obj_operator = obj.operator;
519
+ const path_operator = path + '.operator';
520
+ if (typeof obj_operator !== 'string') {
521
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
522
+ }
523
+ if (obj.values !== undefined) {
524
+ const obj_values = obj.values;
525
+ const path_values = path + '.values';
526
+ if (!ArrayIsArray(obj_values)) {
527
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
528
+ }
529
+ for (let i = 0; i < obj_values.length; i++) {
530
+ const obj_values_item = obj_values[i];
531
+ const path_values_item = path_values + '[' + i + ']';
532
+ if (typeof obj_values_item !== 'string') {
533
+ return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
534
+ }
535
+ }
536
+ }
537
+ })();
538
+ return v_error === undefined ? null : v_error;
539
+ }
540
+
541
+ function validate$8(obj, path = 'CdpDataGraphFilterCriteriaOutputRepresentation') {
542
+ const v_error = (() => {
543
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
544
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
545
+ }
546
+ const obj_conditions = obj.conditions;
547
+ const path_conditions = path + '.conditions';
548
+ if (!ArrayIsArray(obj_conditions)) {
549
+ return new TypeError('Expected "array" but received "' + typeof obj_conditions + '" (at "' + path_conditions + '")');
550
+ }
551
+ for (let i = 0; i < obj_conditions.length; i++) {
552
+ const obj_conditions_item = obj_conditions[i];
553
+ const path_conditions_item = path_conditions + '[' + i + ']';
554
+ const referencepath_conditions_itemValidationError = validate$9(obj_conditions_item, path_conditions_item);
555
+ if (referencepath_conditions_itemValidationError !== null) {
556
+ let message = 'Object doesn\'t match CdpDataGraphFilterConditionOutputRepresentation (at "' + path_conditions_item + '")\n';
557
+ message += referencepath_conditions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
558
+ return new TypeError(message);
559
+ }
560
+ }
561
+ const obj_operator = obj.operator;
562
+ const path_operator = path + '.operator';
563
+ if (typeof obj_operator !== 'string') {
564
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
565
+ }
566
+ })();
567
+ return v_error === undefined ? null : v_error;
568
+ }
569
+
570
+ function validate$7(obj, path = 'CdpDataGraphPathToParentOutputRepresentation') {
571
+ const v_error = (() => {
572
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
573
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
574
+ }
575
+ const obj_fieldName = obj.fieldName;
576
+ const path_fieldName = path + '.fieldName';
577
+ if (typeof obj_fieldName !== 'string') {
578
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
579
+ }
580
+ const obj_parentFieldName = obj.parentFieldName;
581
+ const path_parentFieldName = path + '.parentFieldName';
582
+ if (typeof obj_parentFieldName !== 'string') {
583
+ return new TypeError('Expected "string" but received "' + typeof obj_parentFieldName + '" (at "' + path_parentFieldName + '")');
584
+ }
585
+ })();
586
+ return v_error === undefined ? null : v_error;
587
+ }
588
+
589
+ function validate$6(obj, path = 'CdpDataGraphRecencyCriteriaOutputRepresentation') {
590
+ const v_error = (() => {
591
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
592
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
593
+ }
594
+ const obj_fieldName = obj.fieldName;
595
+ const path_fieldName = path + '.fieldName';
596
+ if (typeof obj_fieldName !== 'string') {
597
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
598
+ }
599
+ const obj_value = obj.value;
600
+ const path_value = path + '.value';
601
+ if (typeof obj_value !== 'number' || (typeof obj_value === 'number' && Math.floor(obj_value) !== obj_value)) {
602
+ return new TypeError('Expected "integer" but received "' + typeof obj_value + '" (at "' + path_value + '")');
603
+ }
604
+ const obj_valueType = obj.valueType;
605
+ const path_valueType = path + '.valueType';
606
+ if (typeof obj_valueType !== 'string') {
607
+ return new TypeError('Expected "string" but received "' + typeof obj_valueType + '" (at "' + path_valueType + '")');
608
+ }
609
+ const obj_valueUnit = obj.valueUnit;
610
+ const path_valueUnit = path + '.valueUnit';
611
+ if (typeof obj_valueUnit !== 'string') {
612
+ return new TypeError('Expected "string" but received "' + typeof obj_valueUnit + '" (at "' + path_valueUnit + '")');
613
+ }
614
+ })();
615
+ return v_error === undefined ? null : v_error;
616
+ }
617
+
618
+ function validate$5(obj, path = 'CdpDataGraphRelatedSegmentOutputRepresentation') {
619
+ const v_error = (() => {
620
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
621
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
622
+ }
623
+ if (obj.id !== undefined) {
624
+ const obj_id = obj.id;
625
+ const path_id = path + '.id';
626
+ if (typeof obj_id !== 'string') {
627
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
628
+ }
629
+ }
630
+ const obj_label = obj.label;
631
+ const path_label = path + '.label';
632
+ if (typeof obj_label !== 'string') {
633
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
634
+ }
635
+ const obj_name = obj.name;
636
+ const path_name = path + '.name';
637
+ if (typeof obj_name !== 'string') {
638
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
639
+ }
640
+ })();
641
+ return v_error === undefined ? null : v_error;
642
+ }
643
+
644
+ function validate$4(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation') {
645
+ const v_error = (() => {
646
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
647
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
648
+ }
649
+ if (obj.dependency !== undefined) {
650
+ const obj_dependency = obj.dependency;
651
+ const path_dependency = path + '.dependency';
652
+ if (!ArrayIsArray(obj_dependency)) {
653
+ return new TypeError('Expected "array" but received "' + typeof obj_dependency + '" (at "' + path_dependency + '")');
654
+ }
655
+ for (let i = 0; i < obj_dependency.length; i++) {
656
+ const obj_dependency_item = obj_dependency[i];
657
+ const path_dependency_item = path_dependency + '[' + i + ']';
658
+ const referencepath_dependency_itemValidationError = validate$b(obj_dependency_item, path_dependency_item);
659
+ if (referencepath_dependency_itemValidationError !== null) {
660
+ let message = 'Object doesn\'t match DependencyOutputRepresentation (at "' + path_dependency_item + '")\n';
661
+ message += referencepath_dependency_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
662
+ return new TypeError(message);
663
+ }
664
+ }
665
+ }
666
+ if (obj.devName !== undefined) {
667
+ const obj_devName = obj.devName;
668
+ const path_devName = path + '.devName';
669
+ if (typeof obj_devName !== 'string') {
670
+ return new TypeError('Expected "string" but received "' + typeof obj_devName + '" (at "' + path_devName + '")');
671
+ }
672
+ }
673
+ const obj_fields = obj.fields;
674
+ const path_fields = path + '.fields';
675
+ if (!ArrayIsArray(obj_fields)) {
676
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
677
+ }
678
+ for (let i = 0; i < obj_fields.length; i++) {
679
+ const obj_fields_item = obj_fields[i];
680
+ const path_fields_item = path_fields + '[' + i + ']';
681
+ const referencepath_fields_itemValidationError = validate$a(obj_fields_item, path_fields_item);
682
+ if (referencepath_fields_itemValidationError !== null) {
683
+ let message = 'Object doesn\'t match CdpDataGraphFieldOutputRepresentation (at "' + path_fields_item + '")\n';
684
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
685
+ return new TypeError(message);
686
+ }
687
+ }
688
+ if (obj.filterCriteria !== undefined) {
689
+ const obj_filterCriteria = obj.filterCriteria;
690
+ const path_filterCriteria = path + '.filterCriteria';
691
+ const referencepath_filterCriteriaValidationError = validate$8(obj_filterCriteria, path_filterCriteria);
692
+ if (referencepath_filterCriteriaValidationError !== null) {
693
+ let message = 'Object doesn\'t match CdpDataGraphFilterCriteriaOutputRepresentation (at "' + path_filterCriteria + '")\n';
694
+ message += referencepath_filterCriteriaValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
695
+ return new TypeError(message);
696
+ }
697
+ }
698
+ if (obj.fragmentDMOLabel !== undefined) {
699
+ const obj_fragmentDMOLabel = obj.fragmentDMOLabel;
700
+ const path_fragmentDMOLabel = path + '.fragmentDMOLabel';
701
+ if (typeof obj_fragmentDMOLabel !== 'string') {
702
+ return new TypeError('Expected "string" but received "' + typeof obj_fragmentDMOLabel + '" (at "' + path_fragmentDMOLabel + '")');
703
+ }
704
+ }
705
+ if (obj.fragmentDMOName !== undefined) {
706
+ const obj_fragmentDMOName = obj.fragmentDMOName;
707
+ const path_fragmentDMOName = path + '.fragmentDMOName';
708
+ if (typeof obj_fragmentDMOName !== 'string') {
709
+ return new TypeError('Expected "string" but received "' + typeof obj_fragmentDMOName + '" (at "' + path_fragmentDMOName + '")');
710
+ }
711
+ }
712
+ if (obj.jsonPath !== undefined) {
713
+ const obj_jsonPath = obj.jsonPath;
714
+ const path_jsonPath = path + '.jsonPath';
715
+ if (typeof obj_jsonPath !== 'string') {
716
+ return new TypeError('Expected "string" but received "' + typeof obj_jsonPath + '" (at "' + path_jsonPath + '")');
717
+ }
718
+ }
719
+ if (obj.path !== undefined) {
720
+ const obj_path = obj.path;
721
+ const path_path = path + '.path';
722
+ if (!ArrayIsArray(obj_path)) {
723
+ return new TypeError('Expected "array" but received "' + typeof obj_path + '" (at "' + path_path + '")');
724
+ }
725
+ for (let i = 0; i < obj_path.length; i++) {
726
+ const obj_path_item = obj_path[i];
727
+ const path_path_item = path_path + '[' + i + ']';
728
+ const referencepath_path_itemValidationError = validate$7(obj_path_item, path_path_item);
729
+ if (referencepath_path_itemValidationError !== null) {
730
+ let message = 'Object doesn\'t match CdpDataGraphPathToParentOutputRepresentation (at "' + path_path_item + '")\n';
731
+ message += referencepath_path_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
732
+ return new TypeError(message);
733
+ }
734
+ }
735
+ }
736
+ if (obj.recencyCriteria !== undefined) {
737
+ const obj_recencyCriteria = obj.recencyCriteria;
738
+ const path_recencyCriteria = path + '.recencyCriteria';
739
+ if (!ArrayIsArray(obj_recencyCriteria)) {
740
+ return new TypeError('Expected "array" but received "' + typeof obj_recencyCriteria + '" (at "' + path_recencyCriteria + '")');
741
+ }
742
+ for (let i = 0; i < obj_recencyCriteria.length; i++) {
743
+ const obj_recencyCriteria_item = obj_recencyCriteria[i];
744
+ const path_recencyCriteria_item = path_recencyCriteria + '[' + i + ']';
745
+ const referencepath_recencyCriteria_itemValidationError = validate$6(obj_recencyCriteria_item, path_recencyCriteria_item);
746
+ if (referencepath_recencyCriteria_itemValidationError !== null) {
747
+ let message = 'Object doesn\'t match CdpDataGraphRecencyCriteriaOutputRepresentation (at "' + path_recencyCriteria_item + '")\n';
748
+ message += referencepath_recencyCriteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
749
+ return new TypeError(message);
750
+ }
751
+ }
752
+ }
753
+ if (obj.referenceDeveloperName !== undefined) {
754
+ const obj_referenceDeveloperName = obj.referenceDeveloperName;
755
+ const path_referenceDeveloperName = path + '.referenceDeveloperName';
756
+ if (typeof obj_referenceDeveloperName !== 'string') {
757
+ return new TypeError('Expected "string" but received "' + typeof obj_referenceDeveloperName + '" (at "' + path_referenceDeveloperName + '")');
758
+ }
759
+ }
760
+ const obj_relatedObjects = obj.relatedObjects;
761
+ const path_relatedObjects = path + '.relatedObjects';
762
+ if (!ArrayIsArray(obj_relatedObjects)) {
763
+ return new TypeError('Expected "array" but received "' + typeof obj_relatedObjects + '" (at "' + path_relatedObjects + '")');
764
+ }
765
+ for (let i = 0; i < obj_relatedObjects.length; i++) {
766
+ const obj_relatedObjects_item = obj_relatedObjects[i];
767
+ const path_relatedObjects_item = path_relatedObjects + '[' + i + ']';
768
+ if (obj_relatedObjects_item === undefined) {
769
+ return new TypeError('Expected "defined" but received "' + typeof obj_relatedObjects_item + '" (at "' + path_relatedObjects_item + '")');
770
+ }
771
+ }
772
+ if (obj.relatedSegments !== undefined) {
773
+ const obj_relatedSegments = obj.relatedSegments;
774
+ const path_relatedSegments = path + '.relatedSegments';
775
+ if (!ArrayIsArray(obj_relatedSegments)) {
776
+ return new TypeError('Expected "array" but received "' + typeof obj_relatedSegments + '" (at "' + path_relatedSegments + '")');
777
+ }
778
+ for (let i = 0; i < obj_relatedSegments.length; i++) {
779
+ const obj_relatedSegments_item = obj_relatedSegments[i];
780
+ const path_relatedSegments_item = path_relatedSegments + '[' + i + ']';
781
+ const referencepath_relatedSegments_itemValidationError = validate$5(obj_relatedSegments_item, path_relatedSegments_item);
782
+ if (referencepath_relatedSegments_itemValidationError !== null) {
783
+ let message = 'Object doesn\'t match CdpDataGraphRelatedSegmentOutputRepresentation (at "' + path_relatedSegments_item + '")\n';
784
+ message += referencepath_relatedSegments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
785
+ return new TypeError(message);
786
+ }
787
+ }
788
+ }
789
+ if (obj.type !== undefined) {
790
+ const obj_type = obj.type;
791
+ const path_type = path + '.type';
792
+ if (typeof obj_type !== 'string') {
793
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
794
+ }
795
+ }
796
+ })();
797
+ return v_error === undefined ? null : v_error;
798
+ }
799
+ function equals$4(existing, incoming) {
800
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
801
+ return false;
802
+ }
803
+ return true;
804
+ }
805
+
806
+ const VERSION$3 = "71e8434340c0370a30fb856ebad9a123";
807
+ function validate$3(obj, path = 'CdpDataGraphOutputRepresentation') {
808
+ const validateCdpObjectBaseOutputRepresentation_validateError = validate$f(obj, path);
809
+ if (validateCdpObjectBaseOutputRepresentation_validateError !== null) {
810
+ return validateCdpObjectBaseOutputRepresentation_validateError;
811
+ }
812
+ const v_error = (() => {
813
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
814
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
815
+ }
816
+ if (obj.cacheDurationInDays !== undefined) {
817
+ const obj_cacheDurationInDays = obj.cacheDurationInDays;
818
+ const path_cacheDurationInDays = path + '.cacheDurationInDays';
819
+ if (typeof obj_cacheDurationInDays !== 'number' || (typeof obj_cacheDurationInDays === 'number' && Math.floor(obj_cacheDurationInDays) !== obj_cacheDurationInDays)) {
820
+ return new TypeError('Expected "integer" but received "' + typeof obj_cacheDurationInDays + '" (at "' + path_cacheDurationInDays + '")');
821
+ }
822
+ }
823
+ if (obj.dayZeroMappingDevName !== undefined) {
824
+ const obj_dayZeroMappingDevName = obj.dayZeroMappingDevName;
825
+ const path_dayZeroMappingDevName = path + '.dayZeroMappingDevName';
826
+ if (typeof obj_dayZeroMappingDevName !== 'string') {
827
+ return new TypeError('Expected "string" but received "' + typeof obj_dayZeroMappingDevName + '" (at "' + path_dayZeroMappingDevName + '")');
828
+ }
829
+ }
830
+ if (obj.dayZeroTransformDevName !== undefined) {
831
+ const obj_dayZeroTransformDevName = obj.dayZeroTransformDevName;
832
+ const path_dayZeroTransformDevName = path + '.dayZeroTransformDevName';
833
+ if (typeof obj_dayZeroTransformDevName !== 'string') {
834
+ return new TypeError('Expected "string" but received "' + typeof obj_dayZeroTransformDevName + '" (at "' + path_dayZeroTransformDevName + '")');
835
+ }
836
+ }
837
+ const obj_extendedProperties = obj.extendedProperties;
838
+ const path_extendedProperties = path + '.extendedProperties';
839
+ if (typeof obj_extendedProperties !== 'string') {
840
+ return new TypeError('Expected "string" but received "' + typeof obj_extendedProperties + '" (at "' + path_extendedProperties + '")');
841
+ }
842
+ if (obj.fullRefreshConfig !== undefined) {
843
+ const obj_fullRefreshConfig = obj.fullRefreshConfig;
844
+ const path_fullRefreshConfig = path + '.fullRefreshConfig';
845
+ const referencepath_fullRefreshConfigValidationError = validate$d(obj_fullRefreshConfig, path_fullRefreshConfig);
846
+ if (referencepath_fullRefreshConfigValidationError !== null) {
847
+ let message = 'Object doesn\'t match DataGraphFullRefreshConfigOutputRepresentation (at "' + path_fullRefreshConfig + '")\n';
848
+ message += referencepath_fullRefreshConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
849
+ return new TypeError(message);
850
+ }
851
+ }
852
+ if (obj.idDmoLabel !== undefined) {
853
+ const obj_idDmoLabel = obj.idDmoLabel;
854
+ const path_idDmoLabel = path + '.idDmoLabel';
855
+ if (typeof obj_idDmoLabel !== 'string') {
856
+ return new TypeError('Expected "string" but received "' + typeof obj_idDmoLabel + '" (at "' + path_idDmoLabel + '")');
857
+ }
858
+ }
859
+ if (obj.idDmoName !== undefined) {
860
+ const obj_idDmoName = obj.idDmoName;
861
+ const path_idDmoName = path + '.idDmoName';
862
+ if (typeof obj_idDmoName !== 'string') {
863
+ return new TypeError('Expected "string" but received "' + typeof obj_idDmoName + '" (at "' + path_idDmoName + '")');
864
+ }
865
+ }
866
+ if (obj.incrementalMappingDevName !== undefined) {
867
+ const obj_incrementalMappingDevName = obj.incrementalMappingDevName;
868
+ const path_incrementalMappingDevName = path + '.incrementalMappingDevName';
869
+ if (typeof obj_incrementalMappingDevName !== 'string') {
870
+ return new TypeError('Expected "string" but received "' + typeof obj_incrementalMappingDevName + '" (at "' + path_incrementalMappingDevName + '")');
871
+ }
872
+ }
873
+ if (obj.incrementalRefreshConfig !== undefined) {
874
+ const obj_incrementalRefreshConfig = obj.incrementalRefreshConfig;
875
+ const path_incrementalRefreshConfig = path + '.incrementalRefreshConfig';
876
+ const referencepath_incrementalRefreshConfigValidationError = validate$c(obj_incrementalRefreshConfig, path_incrementalRefreshConfig);
877
+ if (referencepath_incrementalRefreshConfigValidationError !== null) {
878
+ let message = 'Object doesn\'t match DataGraphIncrementalRefreshConfigOutputRepresentation (at "' + path_incrementalRefreshConfig + '")\n';
879
+ message += referencepath_incrementalRefreshConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
880
+ return new TypeError(message);
881
+ }
882
+ }
883
+ if (obj.incrementalTransformDevName !== undefined) {
884
+ const obj_incrementalTransformDevName = obj.incrementalTransformDevName;
885
+ const path_incrementalTransformDevName = path + '.incrementalTransformDevName';
886
+ if (typeof obj_incrementalTransformDevName !== 'string') {
887
+ return new TypeError('Expected "string" but received "' + typeof obj_incrementalTransformDevName + '" (at "' + path_incrementalTransformDevName + '")');
888
+ }
889
+ }
890
+ if (obj.isRealTimeToggleEnabled !== undefined) {
891
+ const obj_isRealTimeToggleEnabled = obj.isRealTimeToggleEnabled;
892
+ const path_isRealTimeToggleEnabled = path + '.isRealTimeToggleEnabled';
893
+ if (typeof obj_isRealTimeToggleEnabled !== 'boolean') {
894
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRealTimeToggleEnabled + '" (at "' + path_isRealTimeToggleEnabled + '")');
895
+ }
896
+ }
897
+ if (obj.isRecordCachingDisabled !== undefined) {
898
+ const obj_isRecordCachingDisabled = obj.isRecordCachingDisabled;
899
+ const path_isRecordCachingDisabled = path + '.isRecordCachingDisabled';
900
+ if (typeof obj_isRecordCachingDisabled !== 'boolean') {
901
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRecordCachingDisabled + '" (at "' + path_isRecordCachingDisabled + '")');
902
+ }
903
+ }
904
+ if (obj.lastRunStatus !== undefined) {
905
+ const obj_lastRunStatus = obj.lastRunStatus;
906
+ const path_lastRunStatus = path + '.lastRunStatus';
907
+ if (typeof obj_lastRunStatus !== 'string') {
908
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunStatus + '" (at "' + path_lastRunStatus + '")');
909
+ }
910
+ }
911
+ if (obj.maxRecordsCached !== undefined) {
912
+ const obj_maxRecordsCached = obj.maxRecordsCached;
913
+ const path_maxRecordsCached = path + '.maxRecordsCached';
914
+ if (typeof obj_maxRecordsCached !== 'number' || (typeof obj_maxRecordsCached === 'number' && Math.floor(obj_maxRecordsCached) !== obj_maxRecordsCached)) {
915
+ return new TypeError('Expected "integer" but received "' + typeof obj_maxRecordsCached + '" (at "' + path_maxRecordsCached + '")');
916
+ }
917
+ }
918
+ if (obj.primaryObjectLabel !== undefined) {
919
+ const obj_primaryObjectLabel = obj.primaryObjectLabel;
920
+ const path_primaryObjectLabel = path + '.primaryObjectLabel';
921
+ if (typeof obj_primaryObjectLabel !== 'string') {
922
+ return new TypeError('Expected "string" but received "' + typeof obj_primaryObjectLabel + '" (at "' + path_primaryObjectLabel + '")');
923
+ }
924
+ }
925
+ const obj_primaryObjectName = obj.primaryObjectName;
926
+ const path_primaryObjectName = path + '.primaryObjectName';
927
+ if (typeof obj_primaryObjectName !== 'string') {
928
+ return new TypeError('Expected "string" but received "' + typeof obj_primaryObjectName + '" (at "' + path_primaryObjectName + '")');
929
+ }
930
+ if (obj.sessionEnd !== undefined) {
931
+ const obj_sessionEnd = obj.sessionEnd;
932
+ const path_sessionEnd = path + '.sessionEnd';
933
+ if (typeof obj_sessionEnd !== 'number' || (typeof obj_sessionEnd === 'number' && Math.floor(obj_sessionEnd) !== obj_sessionEnd)) {
934
+ return new TypeError('Expected "integer" but received "' + typeof obj_sessionEnd + '" (at "' + path_sessionEnd + '")');
935
+ }
936
+ }
937
+ if (obj.sessionEndTimeUnit !== undefined) {
938
+ const obj_sessionEndTimeUnit = obj.sessionEndTimeUnit;
939
+ const path_sessionEndTimeUnit = path + '.sessionEndTimeUnit';
940
+ if (typeof obj_sessionEndTimeUnit !== 'string') {
941
+ return new TypeError('Expected "string" but received "' + typeof obj_sessionEndTimeUnit + '" (at "' + path_sessionEndTimeUnit + '")');
942
+ }
943
+ }
944
+ const obj_sourceObject = obj.sourceObject;
945
+ const path_sourceObject = path + '.sourceObject';
946
+ const referencepath_sourceObjectValidationError = validate$4(obj_sourceObject, path_sourceObject);
947
+ if (referencepath_sourceObjectValidationError !== null) {
948
+ let message = 'Object doesn\'t match CdpDataGraphSourceObjectOutputRepresentation (at "' + path_sourceObject + '")\n';
949
+ message += referencepath_sourceObjectValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
950
+ return new TypeError(message);
951
+ }
952
+ const obj_status = obj.status;
953
+ const path_status = path + '.status';
954
+ if (typeof obj_status !== 'string') {
955
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
956
+ }
957
+ if (obj.type !== undefined) {
958
+ const obj_type = obj.type;
959
+ const path_type = path + '.type';
960
+ if (typeof obj_type !== 'string') {
961
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
962
+ }
963
+ }
964
+ if (obj.valuesDmoLabel !== undefined) {
965
+ const obj_valuesDmoLabel = obj.valuesDmoLabel;
966
+ const path_valuesDmoLabel = path + '.valuesDmoLabel';
967
+ if (typeof obj_valuesDmoLabel !== 'string') {
968
+ return new TypeError('Expected "string" but received "' + typeof obj_valuesDmoLabel + '" (at "' + path_valuesDmoLabel + '")');
969
+ }
970
+ }
971
+ const obj_valuesDmoName = obj.valuesDmoName;
972
+ const path_valuesDmoName = path + '.valuesDmoName';
973
+ if (typeof obj_valuesDmoName !== 'string') {
974
+ return new TypeError('Expected "string" but received "' + typeof obj_valuesDmoName + '" (at "' + path_valuesDmoName + '")');
975
+ }
976
+ const obj_version = obj.version;
977
+ const path_version = path + '.version';
978
+ if (typeof obj_version !== 'string') {
979
+ return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
980
+ }
981
+ })();
982
+ return v_error === undefined ? null : v_error;
983
+ }
984
+ const RepresentationType$3 = 'CdpDataGraphOutputRepresentation';
985
+ function keyBuilder$a(luvio, config) {
986
+ return keyBuilder$b(luvio, config);
987
+ }
988
+ function keyBuilderFromType$3(luvio, object) {
989
+ return keyBuilderFromType$4(luvio, object);
990
+ }
991
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
992
+ return input;
993
+ }
994
+ const select$a = function CdpDataGraphOutputRepresentationSelect() {
995
+ return {
996
+ kind: 'Fragment',
997
+ version: VERSION$3,
998
+ private: [],
999
+ opaque: true
1000
+ };
1001
+ };
1002
+ function equals$3(existing, incoming) {
1003
+ if (equals$9(existing, incoming) === false) {
1004
+ return false;
1005
+ }
1006
+ const existing_isRealTimeToggleEnabled = existing.isRealTimeToggleEnabled;
1007
+ const incoming_isRealTimeToggleEnabled = incoming.isRealTimeToggleEnabled;
1008
+ // if at least one of these optionals is defined
1009
+ if (existing_isRealTimeToggleEnabled !== undefined || incoming_isRealTimeToggleEnabled !== undefined) {
1010
+ // if one of these is not defined we know the other is defined and therefore
1011
+ // not equal
1012
+ if (existing_isRealTimeToggleEnabled === undefined || incoming_isRealTimeToggleEnabled === undefined) {
1013
+ return false;
1014
+ }
1015
+ if (!(existing_isRealTimeToggleEnabled === incoming_isRealTimeToggleEnabled)) {
1016
+ return false;
1017
+ }
1018
+ }
1019
+ const existing_isRecordCachingDisabled = existing.isRecordCachingDisabled;
1020
+ const incoming_isRecordCachingDisabled = incoming.isRecordCachingDisabled;
1021
+ // if at least one of these optionals is defined
1022
+ if (existing_isRecordCachingDisabled !== undefined || incoming_isRecordCachingDisabled !== undefined) {
1023
+ // if one of these is not defined we know the other is defined and therefore
1024
+ // not equal
1025
+ if (existing_isRecordCachingDisabled === undefined || incoming_isRecordCachingDisabled === undefined) {
1026
+ return false;
1027
+ }
1028
+ if (!(existing_isRecordCachingDisabled === incoming_isRecordCachingDisabled)) {
1029
+ return false;
1030
+ }
1031
+ }
1032
+ const existing_cacheDurationInDays = existing.cacheDurationInDays;
1033
+ const incoming_cacheDurationInDays = incoming.cacheDurationInDays;
1034
+ // if at least one of these optionals is defined
1035
+ if (existing_cacheDurationInDays !== undefined || incoming_cacheDurationInDays !== undefined) {
1036
+ // if one of these is not defined we know the other is defined and therefore
1037
+ // not equal
1038
+ if (existing_cacheDurationInDays === undefined || incoming_cacheDurationInDays === undefined) {
1039
+ return false;
1040
+ }
1041
+ if (!(existing_cacheDurationInDays === incoming_cacheDurationInDays)) {
1042
+ return false;
1043
+ }
1044
+ }
1045
+ const existing_maxRecordsCached = existing.maxRecordsCached;
1046
+ const incoming_maxRecordsCached = incoming.maxRecordsCached;
1047
+ // if at least one of these optionals is defined
1048
+ if (existing_maxRecordsCached !== undefined || incoming_maxRecordsCached !== undefined) {
1049
+ // if one of these is not defined we know the other is defined and therefore
1050
+ // not equal
1051
+ if (existing_maxRecordsCached === undefined || incoming_maxRecordsCached === undefined) {
1052
+ return false;
1053
+ }
1054
+ if (!(existing_maxRecordsCached === incoming_maxRecordsCached)) {
1055
+ return false;
1056
+ }
1057
+ }
1058
+ const existing_sessionEnd = existing.sessionEnd;
1059
+ const incoming_sessionEnd = incoming.sessionEnd;
1060
+ // if at least one of these optionals is defined
1061
+ if (existing_sessionEnd !== undefined || incoming_sessionEnd !== undefined) {
1062
+ // if one of these is not defined we know the other is defined and therefore
1063
+ // not equal
1064
+ if (existing_sessionEnd === undefined || incoming_sessionEnd === undefined) {
1065
+ return false;
1066
+ }
1067
+ if (!(existing_sessionEnd === incoming_sessionEnd)) {
1068
+ return false;
1069
+ }
1070
+ }
1071
+ const existing_dayZeroMappingDevName = existing.dayZeroMappingDevName;
1072
+ const incoming_dayZeroMappingDevName = incoming.dayZeroMappingDevName;
1073
+ // if at least one of these optionals is defined
1074
+ if (existing_dayZeroMappingDevName !== undefined || incoming_dayZeroMappingDevName !== undefined) {
1075
+ // if one of these is not defined we know the other is defined and therefore
1076
+ // not equal
1077
+ if (existing_dayZeroMappingDevName === undefined || incoming_dayZeroMappingDevName === undefined) {
1078
+ return false;
1079
+ }
1080
+ if (!(existing_dayZeroMappingDevName === incoming_dayZeroMappingDevName)) {
1081
+ return false;
1082
+ }
1083
+ }
1084
+ const existing_dayZeroTransformDevName = existing.dayZeroTransformDevName;
1085
+ const incoming_dayZeroTransformDevName = incoming.dayZeroTransformDevName;
1086
+ // if at least one of these optionals is defined
1087
+ if (existing_dayZeroTransformDevName !== undefined || incoming_dayZeroTransformDevName !== undefined) {
1088
+ // if one of these is not defined we know the other is defined and therefore
1089
+ // not equal
1090
+ if (existing_dayZeroTransformDevName === undefined || incoming_dayZeroTransformDevName === undefined) {
1091
+ return false;
1092
+ }
1093
+ if (!(existing_dayZeroTransformDevName === incoming_dayZeroTransformDevName)) {
1094
+ return false;
1095
+ }
1096
+ }
1097
+ const existing_extendedProperties = existing.extendedProperties;
1098
+ const incoming_extendedProperties = incoming.extendedProperties;
1099
+ if (!(existing_extendedProperties === incoming_extendedProperties)) {
1100
+ return false;
1101
+ }
1102
+ const existing_idDmoLabel = existing.idDmoLabel;
1103
+ const incoming_idDmoLabel = incoming.idDmoLabel;
1104
+ // if at least one of these optionals is defined
1105
+ if (existing_idDmoLabel !== undefined || incoming_idDmoLabel !== undefined) {
1106
+ // if one of these is not defined we know the other is defined and therefore
1107
+ // not equal
1108
+ if (existing_idDmoLabel === undefined || incoming_idDmoLabel === undefined) {
1109
+ return false;
1110
+ }
1111
+ if (!(existing_idDmoLabel === incoming_idDmoLabel)) {
1112
+ return false;
1113
+ }
1114
+ }
1115
+ const existing_idDmoName = existing.idDmoName;
1116
+ const incoming_idDmoName = incoming.idDmoName;
1117
+ // if at least one of these optionals is defined
1118
+ if (existing_idDmoName !== undefined || incoming_idDmoName !== undefined) {
1119
+ // if one of these is not defined we know the other is defined and therefore
1120
+ // not equal
1121
+ if (existing_idDmoName === undefined || incoming_idDmoName === undefined) {
1122
+ return false;
1123
+ }
1124
+ if (!(existing_idDmoName === incoming_idDmoName)) {
1125
+ return false;
1126
+ }
1127
+ }
1128
+ const existing_incrementalMappingDevName = existing.incrementalMappingDevName;
1129
+ const incoming_incrementalMappingDevName = incoming.incrementalMappingDevName;
1130
+ // if at least one of these optionals is defined
1131
+ if (existing_incrementalMappingDevName !== undefined || incoming_incrementalMappingDevName !== undefined) {
1132
+ // if one of these is not defined we know the other is defined and therefore
1133
+ // not equal
1134
+ if (existing_incrementalMappingDevName === undefined || incoming_incrementalMappingDevName === undefined) {
1135
+ return false;
1136
+ }
1137
+ if (!(existing_incrementalMappingDevName === incoming_incrementalMappingDevName)) {
1138
+ return false;
1139
+ }
1140
+ }
1141
+ const existing_incrementalTransformDevName = existing.incrementalTransformDevName;
1142
+ const incoming_incrementalTransformDevName = incoming.incrementalTransformDevName;
1143
+ // if at least one of these optionals is defined
1144
+ if (existing_incrementalTransformDevName !== undefined || incoming_incrementalTransformDevName !== undefined) {
1145
+ // if one of these is not defined we know the other is defined and therefore
1146
+ // not equal
1147
+ if (existing_incrementalTransformDevName === undefined || incoming_incrementalTransformDevName === undefined) {
1148
+ return false;
1149
+ }
1150
+ if (!(existing_incrementalTransformDevName === incoming_incrementalTransformDevName)) {
1151
+ return false;
1152
+ }
1153
+ }
1154
+ const existing_lastRunStatus = existing.lastRunStatus;
1155
+ const incoming_lastRunStatus = incoming.lastRunStatus;
1156
+ // if at least one of these optionals is defined
1157
+ if (existing_lastRunStatus !== undefined || incoming_lastRunStatus !== undefined) {
1158
+ // if one of these is not defined we know the other is defined and therefore
1159
+ // not equal
1160
+ if (existing_lastRunStatus === undefined || incoming_lastRunStatus === undefined) {
1161
+ return false;
1162
+ }
1163
+ if (!(existing_lastRunStatus === incoming_lastRunStatus)) {
1164
+ return false;
1165
+ }
1166
+ }
1167
+ const existing_primaryObjectLabel = existing.primaryObjectLabel;
1168
+ const incoming_primaryObjectLabel = incoming.primaryObjectLabel;
1169
+ // if at least one of these optionals is defined
1170
+ if (existing_primaryObjectLabel !== undefined || incoming_primaryObjectLabel !== undefined) {
1171
+ // if one of these is not defined we know the other is defined and therefore
1172
+ // not equal
1173
+ if (existing_primaryObjectLabel === undefined || incoming_primaryObjectLabel === undefined) {
1174
+ return false;
1175
+ }
1176
+ if (!(existing_primaryObjectLabel === incoming_primaryObjectLabel)) {
1177
+ return false;
1178
+ }
1179
+ }
1180
+ const existing_primaryObjectName = existing.primaryObjectName;
1181
+ const incoming_primaryObjectName = incoming.primaryObjectName;
1182
+ if (!(existing_primaryObjectName === incoming_primaryObjectName)) {
1183
+ return false;
1184
+ }
1185
+ const existing_sessionEndTimeUnit = existing.sessionEndTimeUnit;
1186
+ const incoming_sessionEndTimeUnit = incoming.sessionEndTimeUnit;
1187
+ // if at least one of these optionals is defined
1188
+ if (existing_sessionEndTimeUnit !== undefined || incoming_sessionEndTimeUnit !== undefined) {
1189
+ // if one of these is not defined we know the other is defined and therefore
1190
+ // not equal
1191
+ if (existing_sessionEndTimeUnit === undefined || incoming_sessionEndTimeUnit === undefined) {
1192
+ return false;
1193
+ }
1194
+ if (!(existing_sessionEndTimeUnit === incoming_sessionEndTimeUnit)) {
1195
+ return false;
1196
+ }
1197
+ }
1198
+ const existing_status = existing.status;
1199
+ const incoming_status = incoming.status;
1200
+ if (!(existing_status === incoming_status)) {
1201
+ return false;
1202
+ }
1203
+ const existing_type = existing.type;
1204
+ const incoming_type = incoming.type;
1205
+ // if at least one of these optionals is defined
1206
+ if (existing_type !== undefined || incoming_type !== undefined) {
1207
+ // if one of these is not defined we know the other is defined and therefore
1208
+ // not equal
1209
+ if (existing_type === undefined || incoming_type === undefined) {
1210
+ return false;
1211
+ }
1212
+ if (!(existing_type === incoming_type)) {
1213
+ return false;
1214
+ }
1215
+ }
1216
+ const existing_valuesDmoLabel = existing.valuesDmoLabel;
1217
+ const incoming_valuesDmoLabel = incoming.valuesDmoLabel;
1218
+ // if at least one of these optionals is defined
1219
+ if (existing_valuesDmoLabel !== undefined || incoming_valuesDmoLabel !== undefined) {
1220
+ // if one of these is not defined we know the other is defined and therefore
1221
+ // not equal
1222
+ if (existing_valuesDmoLabel === undefined || incoming_valuesDmoLabel === undefined) {
1223
+ return false;
1224
+ }
1225
+ if (!(existing_valuesDmoLabel === incoming_valuesDmoLabel)) {
1226
+ return false;
1227
+ }
1228
+ }
1229
+ const existing_valuesDmoName = existing.valuesDmoName;
1230
+ const incoming_valuesDmoName = incoming.valuesDmoName;
1231
+ if (!(existing_valuesDmoName === incoming_valuesDmoName)) {
1232
+ return false;
1233
+ }
1234
+ const existing_version = existing.version;
1235
+ const incoming_version = incoming.version;
1236
+ if (!(existing_version === incoming_version)) {
1237
+ return false;
1238
+ }
1239
+ const existing_fullRefreshConfig = existing.fullRefreshConfig;
1240
+ const incoming_fullRefreshConfig = incoming.fullRefreshConfig;
1241
+ // if at least one of these optionals is defined
1242
+ if (existing_fullRefreshConfig !== undefined || incoming_fullRefreshConfig !== undefined) {
1243
+ // if one of these is not defined we know the other is defined and therefore
1244
+ // not equal
1245
+ if (existing_fullRefreshConfig === undefined || incoming_fullRefreshConfig === undefined) {
1246
+ return false;
1247
+ }
1248
+ if (!(equals$7(existing_fullRefreshConfig, incoming_fullRefreshConfig))) {
1249
+ return false;
1250
+ }
1251
+ }
1252
+ const existing_incrementalRefreshConfig = existing.incrementalRefreshConfig;
1253
+ const incoming_incrementalRefreshConfig = incoming.incrementalRefreshConfig;
1254
+ // if at least one of these optionals is defined
1255
+ if (existing_incrementalRefreshConfig !== undefined || incoming_incrementalRefreshConfig !== undefined) {
1256
+ // if one of these is not defined we know the other is defined and therefore
1257
+ // not equal
1258
+ if (existing_incrementalRefreshConfig === undefined || incoming_incrementalRefreshConfig === undefined) {
1259
+ return false;
1260
+ }
1261
+ if (!(equals$6(existing_incrementalRefreshConfig, incoming_incrementalRefreshConfig))) {
1262
+ return false;
1263
+ }
1264
+ }
1265
+ const existing_sourceObject = existing.sourceObject;
1266
+ const incoming_sourceObject = incoming.sourceObject;
1267
+ if (!(equals$4(existing_sourceObject, incoming_sourceObject))) {
1268
+ return false;
1269
+ }
1270
+ return true;
1271
+ }
1272
+ const ingest$3 = function CdpDataGraphOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1273
+ if (process.env.NODE_ENV !== 'production') {
1274
+ const validateError = validate$3(input);
1275
+ if (validateError !== null) {
1276
+ throw validateError;
1277
+ }
1278
+ }
1279
+ const key = keyBuilderFromType$3(luvio, input);
1280
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1281
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "CDP", VERSION$3, RepresentationType$3, equals$3);
1282
+ return createLink(key);
1283
+ };
1284
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1285
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1286
+ const rootKey = keyBuilderFromType$3(luvio, input);
1287
+ rootKeySet.set(rootKey, {
1288
+ namespace: keyPrefix,
1289
+ representationName: RepresentationType$4,
1290
+ mergeable: false
1291
+ });
1292
+ }
1293
+
1294
+ function select$9(luvio, params) {
1295
+ return select$a();
1296
+ }
1297
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
1298
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1299
+ }
1300
+ function ingestSuccess$6(luvio, resourceParams, response) {
1301
+ const { body } = response;
1302
+ const key = keyBuilderFromType$3(luvio, body);
1303
+ luvio.storeIngest(key, ingest$3, body);
1304
+ const snapshot = luvio.storeLookup({
1305
+ recordId: key,
1306
+ node: select$9(),
1307
+ variables: {},
1308
+ });
1309
+ if (process.env.NODE_ENV !== 'production') {
1310
+ if (snapshot.state !== 'Fulfilled') {
1311
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1312
+ }
1313
+ }
1314
+ deepFreeze(snapshot.data);
1315
+ return snapshot;
1316
+ }
1317
+ function createResourceRequest$7(config) {
1318
+ const headers = {};
1319
+ return {
1320
+ baseUri: '/services/data/v66.0',
1321
+ basePath: '/ssot/data-graphs',
1322
+ method: 'post',
1323
+ body: config.body,
1324
+ urlParams: {},
1325
+ queryParams: {},
1326
+ headers,
1327
+ priority: 'normal',
1328
+ };
1329
+ }
1330
+
1331
+ const adapterName$7 = 'createDataGraph';
1332
+ const createDataGraph_ConfigPropertyMetadata = [
1333
+ generateParamConfigMetadata('dataspaceName', false, 2 /* Body */, 0 /* String */),
1334
+ generateParamConfigMetadata('dataKitName', false, 2 /* Body */, 0 /* String */),
1335
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1336
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1337
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
1338
+ generateParamConfigMetadata('primaryObjectName', true, 2 /* Body */, 0 /* String */),
1339
+ generateParamConfigMetadata('sourceObject', true, 2 /* Body */, 4 /* Unsupported */),
1340
+ generateParamConfigMetadata('templateName', false, 2 /* Body */, 0 /* String */),
1341
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
1342
+ generateParamConfigMetadata('isRecordCachingDisabled', false, 2 /* Body */, 1 /* Boolean */),
1343
+ generateParamConfigMetadata('isRealTimeToggleEnabled', false, 2 /* Body */, 1 /* Boolean */),
1344
+ generateParamConfigMetadata('cacheDurationInDays', false, 2 /* Body */, 3 /* Integer */),
1345
+ generateParamConfigMetadata('maxRecordsCached', false, 2 /* Body */, 3 /* Integer */),
1346
+ generateParamConfigMetadata('sessionEnd', false, 2 /* Body */, 3 /* Integer */),
1347
+ generateParamConfigMetadata('sessionEndTimeUnit', false, 2 /* Body */, 0 /* String */),
1348
+ generateParamConfigMetadata('fullRefreshConfig', false, 2 /* Body */, 4 /* Unsupported */),
1349
+ generateParamConfigMetadata('incrementalRefreshConfig', false, 2 /* Body */, 4 /* Unsupported */),
1350
+ ];
1351
+ const createDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, createDataGraph_ConfigPropertyMetadata);
1352
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(createDataGraph_ConfigPropertyMetadata);
1353
+ function typeCheckConfig$7(untrustedConfig) {
1354
+ const config = {};
1355
+ typeCheckConfig$8(untrustedConfig, config, createDataGraph_ConfigPropertyMetadata);
1356
+ const untrustedConfig_sourceObject = untrustedConfig.sourceObject;
1357
+ config.sourceObject = untrustedConfig_sourceObject;
1358
+ const untrustedConfig_fullRefreshConfig = untrustedConfig.fullRefreshConfig;
1359
+ const referenceDataGraphFullRefreshConfigInputRepresentationValidationError = validate$h(untrustedConfig_fullRefreshConfig);
1360
+ if (referenceDataGraphFullRefreshConfigInputRepresentationValidationError === null) {
1361
+ config.fullRefreshConfig = untrustedConfig_fullRefreshConfig;
1362
+ }
1363
+ const untrustedConfig_incrementalRefreshConfig = untrustedConfig.incrementalRefreshConfig;
1364
+ const referenceDataGraphIncrementalRefreshConfigInputRepresentationValidationError = validate$g(untrustedConfig_incrementalRefreshConfig);
1365
+ if (referenceDataGraphIncrementalRefreshConfigInputRepresentationValidationError === null) {
1366
+ config.incrementalRefreshConfig = untrustedConfig_incrementalRefreshConfig;
1367
+ }
1368
+ return config;
1369
+ }
1370
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1371
+ if (!untrustedIsObject(untrustedConfig)) {
1372
+ return null;
1373
+ }
1374
+ if (process.env.NODE_ENV !== 'production') {
1375
+ validateConfig(untrustedConfig, configPropertyNames);
1376
+ }
1377
+ const config = typeCheckConfig$7(untrustedConfig);
1378
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1379
+ return null;
1380
+ }
1381
+ return config;
1382
+ }
1383
+ function buildNetworkSnapshot$7(luvio, config, options) {
1384
+ const resourceParams = createResourceParams$7(config);
1385
+ const request = createResourceRequest$7(resourceParams);
1386
+ return luvio.dispatchResourceRequest(request, options)
1387
+ .then((response) => {
1388
+ return luvio.handleSuccessResponse(() => {
1389
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
1390
+ return luvio.storeBroadcast().then(() => snapshot);
1391
+ }, () => {
1392
+ const cache = new StoreKeyMap();
1393
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
1394
+ return cache;
1395
+ });
1396
+ }, (response) => {
1397
+ deepFreeze(response);
1398
+ throw response;
1399
+ });
1400
+ }
1401
+ const createDataGraphAdapterFactory = (luvio) => {
1402
+ return function createDataGraph(untrustedConfig) {
1403
+ const config = validateAdapterConfig$7(untrustedConfig, createDataGraph_ConfigPropertyNames);
1404
+ // Invalid or incomplete config
1405
+ if (config === null) {
1406
+ throw new Error('Invalid config for "createDataGraph"');
1407
+ }
1408
+ return buildNetworkSnapshot$7(luvio, config);
1409
+ };
1410
+ };
1411
+
1412
+ function select$8(luvio, params) {
1413
+ return select$a();
1414
+ }
1415
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
1416
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1417
+ }
1418
+ function ingestSuccess$5(luvio, resourceParams, response) {
1419
+ const { body } = response;
1420
+ const key = keyBuilderFromType$3(luvio, body);
1421
+ luvio.storeIngest(key, ingest$3, body);
1422
+ const snapshot = luvio.storeLookup({
1423
+ recordId: key,
1424
+ node: select$8(),
1425
+ variables: {},
1426
+ });
1427
+ if (process.env.NODE_ENV !== 'production') {
1428
+ if (snapshot.state !== 'Fulfilled') {
1429
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1430
+ }
1431
+ }
1432
+ deepFreeze(snapshot.data);
1433
+ return snapshot;
1434
+ }
1435
+ function createResourceRequest$6(config) {
1436
+ const headers = {};
1437
+ return {
1438
+ baseUri: '/services/data/v66.0',
1439
+ basePath: '/ssot/data-graphs',
1440
+ method: 'put',
1441
+ body: config.body,
1442
+ urlParams: {},
1443
+ queryParams: config.queryParams,
1444
+ headers,
1445
+ priority: 'normal',
1446
+ };
1447
+ }
1448
+
1449
+ const adapterName$6 = 'editDataGraph';
1450
+ const editDataGraph_ConfigPropertyMetadata = [
1451
+ generateParamConfigMetadata('editScheduleOnly', false, 1 /* QueryParameter */, 1 /* Boolean */),
1452
+ generateParamConfigMetadata('dataspaceName', false, 2 /* Body */, 0 /* String */),
1453
+ generateParamConfigMetadata('dataKitName', false, 2 /* Body */, 0 /* String */),
1454
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1455
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1456
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
1457
+ generateParamConfigMetadata('primaryObjectName', true, 2 /* Body */, 0 /* String */),
1458
+ generateParamConfigMetadata('sourceObject', true, 2 /* Body */, 4 /* Unsupported */),
1459
+ generateParamConfigMetadata('templateName', false, 2 /* Body */, 0 /* String */),
1460
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
1461
+ generateParamConfigMetadata('isRecordCachingDisabled', false, 2 /* Body */, 1 /* Boolean */),
1462
+ generateParamConfigMetadata('isRealTimeToggleEnabled', false, 2 /* Body */, 1 /* Boolean */),
1463
+ generateParamConfigMetadata('cacheDurationInDays', false, 2 /* Body */, 3 /* Integer */),
1464
+ generateParamConfigMetadata('maxRecordsCached', false, 2 /* Body */, 3 /* Integer */),
1465
+ generateParamConfigMetadata('sessionEnd', false, 2 /* Body */, 3 /* Integer */),
1466
+ generateParamConfigMetadata('sessionEndTimeUnit', false, 2 /* Body */, 0 /* String */),
1467
+ generateParamConfigMetadata('fullRefreshConfig', false, 2 /* Body */, 4 /* Unsupported */),
1468
+ generateParamConfigMetadata('incrementalRefreshConfig', false, 2 /* Body */, 4 /* Unsupported */),
1469
+ ];
1470
+ const editDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, editDataGraph_ConfigPropertyMetadata);
1471
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(editDataGraph_ConfigPropertyMetadata);
1472
+ function typeCheckConfig$6(untrustedConfig) {
1473
+ const config = {};
1474
+ typeCheckConfig$8(untrustedConfig, config, editDataGraph_ConfigPropertyMetadata);
1475
+ const untrustedConfig_sourceObject = untrustedConfig.sourceObject;
1476
+ config.sourceObject = untrustedConfig_sourceObject;
1477
+ const untrustedConfig_fullRefreshConfig = untrustedConfig.fullRefreshConfig;
1478
+ const referenceDataGraphFullRefreshConfigInputRepresentationValidationError = validate$h(untrustedConfig_fullRefreshConfig);
1479
+ if (referenceDataGraphFullRefreshConfigInputRepresentationValidationError === null) {
1480
+ config.fullRefreshConfig = untrustedConfig_fullRefreshConfig;
1481
+ }
1482
+ const untrustedConfig_incrementalRefreshConfig = untrustedConfig.incrementalRefreshConfig;
1483
+ const referenceDataGraphIncrementalRefreshConfigInputRepresentationValidationError = validate$g(untrustedConfig_incrementalRefreshConfig);
1484
+ if (referenceDataGraphIncrementalRefreshConfigInputRepresentationValidationError === null) {
1485
+ config.incrementalRefreshConfig = untrustedConfig_incrementalRefreshConfig;
1486
+ }
1487
+ return config;
1488
+ }
1489
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
1490
+ if (!untrustedIsObject(untrustedConfig)) {
1491
+ return null;
1492
+ }
1493
+ if (process.env.NODE_ENV !== 'production') {
1494
+ validateConfig(untrustedConfig, configPropertyNames);
1495
+ }
1496
+ const config = typeCheckConfig$6(untrustedConfig);
1497
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1498
+ return null;
1499
+ }
1500
+ return config;
1501
+ }
1502
+ function buildNetworkSnapshot$6(luvio, config, options) {
1503
+ const resourceParams = createResourceParams$6(config);
1504
+ const request = createResourceRequest$6(resourceParams);
1505
+ return luvio.dispatchResourceRequest(request, options)
1506
+ .then((response) => {
1507
+ return luvio.handleSuccessResponse(() => {
1508
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
1509
+ return luvio.storeBroadcast().then(() => snapshot);
1510
+ }, () => {
1511
+ const cache = new StoreKeyMap();
1512
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
1513
+ return cache;
1514
+ });
1515
+ }, (response) => {
1516
+ deepFreeze(response);
1517
+ throw response;
1518
+ });
1519
+ }
1520
+ const editDataGraphAdapterFactory = (luvio) => {
1521
+ return function editDataGraph(untrustedConfig) {
1522
+ const config = validateAdapterConfig$6(untrustedConfig, editDataGraph_ConfigPropertyNames);
1523
+ // Invalid or incomplete config
1524
+ if (config === null) {
1525
+ throw new Error('Invalid config for "editDataGraph"');
1526
+ }
1527
+ return buildNetworkSnapshot$6(luvio, config);
1528
+ };
1529
+ };
1530
+
1531
+ function select$7(luvio, params) {
1532
+ return select$a();
1533
+ }
1534
+ function keyBuilder$9(luvio, params) {
1535
+ return keyBuilder$a(luvio, {
1536
+ name: params.urlParams.dataGraphName
1537
+ });
1538
+ }
1539
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
1540
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1541
+ }
1542
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1543
+ const { body } = response;
1544
+ const key = keyBuilder$9(luvio, resourceParams);
1545
+ luvio.storeIngest(key, ingest$3, body);
1546
+ const snapshot = luvio.storeLookup({
1547
+ recordId: key,
1548
+ node: select$7(),
1549
+ variables: {},
1550
+ }, snapshotRefresh);
1551
+ if (process.env.NODE_ENV !== 'production') {
1552
+ if (snapshot.state !== 'Fulfilled') {
1553
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1554
+ }
1555
+ }
1556
+ deepFreeze(snapshot.data);
1557
+ return snapshot;
1558
+ }
1559
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1560
+ const key = keyBuilder$9(luvio, params);
1561
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1562
+ luvio.storeIngestError(key, errorSnapshot);
1563
+ return errorSnapshot;
1564
+ }
1565
+ function createResourceRequest$5(config) {
1566
+ const headers = {};
1567
+ return {
1568
+ baseUri: '/services/data/v66.0',
1569
+ basePath: '/ssot/data-graphs/' + config.urlParams.dataGraphName + '',
1570
+ method: 'get',
1571
+ body: null,
1572
+ urlParams: config.urlParams,
1573
+ queryParams: config.queryParams,
1574
+ headers,
1575
+ priority: 'normal',
1576
+ };
1577
+ }
1578
+
1579
+ const adapterName$5 = 'getDataGraph';
1580
+ const getDataGraph_ConfigPropertyMetadata = [
1581
+ generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
1582
+ generateParamConfigMetadata('includeCIDetails', false, 1 /* QueryParameter */, 1 /* Boolean */),
1583
+ generateParamConfigMetadata('includeSegmentDetails', false, 1 /* QueryParameter */, 1 /* Boolean */),
1584
+ ];
1585
+ const getDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getDataGraph_ConfigPropertyMetadata);
1586
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(getDataGraph_ConfigPropertyMetadata);
1587
+ function keyBuilder$8(luvio, config) {
1588
+ const resourceParams = createResourceParams$5(config);
1589
+ return keyBuilder$9(luvio, resourceParams);
1590
+ }
1591
+ function typeCheckConfig$5(untrustedConfig) {
1592
+ const config = {};
1593
+ typeCheckConfig$8(untrustedConfig, config, getDataGraph_ConfigPropertyMetadata);
1594
+ return config;
1595
+ }
1596
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1597
+ if (!untrustedIsObject(untrustedConfig)) {
1598
+ return null;
1599
+ }
1600
+ if (process.env.NODE_ENV !== 'production') {
1601
+ validateConfig(untrustedConfig, configPropertyNames);
1602
+ }
1603
+ const config = typeCheckConfig$5(untrustedConfig);
1604
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1605
+ return null;
1606
+ }
1607
+ return config;
1608
+ }
1609
+ function adapterFragment$2(luvio, config) {
1610
+ createResourceParams$5(config);
1611
+ return select$7();
1612
+ }
1613
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1614
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
1615
+ config,
1616
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1617
+ });
1618
+ return luvio.storeBroadcast().then(() => snapshot);
1619
+ }
1620
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1621
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1622
+ config,
1623
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1624
+ });
1625
+ return luvio.storeBroadcast().then(() => snapshot);
1626
+ }
1627
+ function buildNetworkSnapshot$5(luvio, config, options) {
1628
+ const resourceParams = createResourceParams$5(config);
1629
+ const request = createResourceRequest$5(resourceParams);
1630
+ return luvio.dispatchResourceRequest(request, options)
1631
+ .then((response) => {
1632
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
1633
+ const cache = new StoreKeyMap();
1634
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
1635
+ return cache;
1636
+ });
1637
+ }, (response) => {
1638
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1639
+ });
1640
+ }
1641
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1642
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
1643
+ }
1644
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1645
+ const { luvio, config } = context;
1646
+ const selector = {
1647
+ recordId: keyBuilder$8(luvio, config),
1648
+ node: adapterFragment$2(luvio, config),
1649
+ variables: {},
1650
+ };
1651
+ const cacheSnapshot = storeLookup(selector, {
1652
+ config,
1653
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1654
+ });
1655
+ return cacheSnapshot;
1656
+ }
1657
+ const getDataGraphAdapterFactory = (luvio) => function CDP__getDataGraph(untrustedConfig, requestContext) {
1658
+ const config = validateAdapterConfig$5(untrustedConfig, getDataGraph_ConfigPropertyNames);
1659
+ // Invalid or incomplete config
1660
+ if (config === null) {
1661
+ return null;
1662
+ }
1663
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1664
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1665
+ };
1666
+
1667
+ function keyBuilder$7(luvio, params) {
1668
+ return keyBuilder$a(luvio, {
1669
+ name: params.urlParams.dataGraphName
1670
+ });
1671
+ }
1672
+ function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
1673
+ const key = keyBuilder$7(luvio, resourceParams);
1674
+ cacheKeyMap.set(key, {
1675
+ namespace: keyPrefix,
1676
+ representationName: RepresentationType$3,
1677
+ mergeable: false
1678
+ });
1679
+ }
1680
+ function evictSuccess(luvio, resourceParams) {
1681
+ const key = keyBuilder$7(luvio, resourceParams);
1682
+ luvio.storeEvict(key);
1683
+ }
1684
+ function createResourceRequest$4(config) {
1685
+ const headers = {};
1686
+ return {
1687
+ baseUri: '/services/data/v66.0',
1688
+ basePath: '/ssot/data-graphs/' + config.urlParams.dataGraphName + '',
1689
+ method: 'delete',
1690
+ body: null,
1691
+ urlParams: config.urlParams,
1692
+ queryParams: {},
1693
+ headers,
1694
+ priority: 'normal',
1695
+ };
1696
+ }
1697
+
1698
+ const adapterName$4 = 'deleteDataGraph';
1699
+ const deleteDataGraph_ConfigPropertyMetadata = [
1700
+ generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
1701
+ ];
1702
+ const deleteDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deleteDataGraph_ConfigPropertyMetadata);
1703
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(deleteDataGraph_ConfigPropertyMetadata);
1704
+ function typeCheckConfig$4(untrustedConfig) {
1705
+ const config = {};
1706
+ typeCheckConfig$8(untrustedConfig, config, deleteDataGraph_ConfigPropertyMetadata);
1707
+ return config;
1708
+ }
1709
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1710
+ if (!untrustedIsObject(untrustedConfig)) {
1711
+ return null;
1712
+ }
1713
+ if (process.env.NODE_ENV !== 'production') {
1714
+ validateConfig(untrustedConfig, configPropertyNames);
1715
+ }
1716
+ const config = typeCheckConfig$4(untrustedConfig);
1717
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1718
+ return null;
1719
+ }
1720
+ return config;
1721
+ }
1722
+ function buildNetworkSnapshot$4(luvio, config, options) {
1723
+ const resourceParams = createResourceParams$4(config);
1724
+ const request = createResourceRequest$4(resourceParams);
1725
+ return luvio.dispatchResourceRequest(request, options)
1726
+ .then(() => {
1727
+ return luvio.handleSuccessResponse(() => {
1728
+ evictSuccess(luvio, resourceParams);
1729
+ return luvio.storeBroadcast();
1730
+ }, () => {
1731
+ const cache = new StoreKeyMap();
1732
+ getResponseCacheKeys$4(cache, luvio, resourceParams);
1733
+ return cache;
1734
+ });
1735
+ }, (response) => {
1736
+ deepFreeze(response);
1737
+ throw response;
1738
+ });
1739
+ }
1740
+ const deleteDataGraphAdapterFactory = (luvio) => {
1741
+ return function CDPdeleteDataGraph(untrustedConfig) {
1742
+ const config = validateAdapterConfig$4(untrustedConfig, deleteDataGraph_ConfigPropertyNames);
1743
+ // Invalid or incomplete config
1744
+ if (config === null) {
1745
+ throw new Error(`Invalid config for "${adapterName$4}"`);
1746
+ }
1747
+ return buildNetworkSnapshot$4(luvio, config);
1748
+ };
1749
+ };
1750
+
1751
+ const VERSION$2 = "0c1f279e921d51f73cd64db1eaef780c";
1752
+ function validate$2(obj, path = 'CdpDataGraphRetryOutputRepresentation') {
1753
+ const v_error = (() => {
1754
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1755
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1756
+ }
1757
+ const obj_dataGraphName = obj.dataGraphName;
1758
+ const path_dataGraphName = path + '.dataGraphName';
1759
+ if (typeof obj_dataGraphName !== 'string') {
1760
+ return new TypeError('Expected "string" but received "' + typeof obj_dataGraphName + '" (at "' + path_dataGraphName + '")');
1761
+ }
1762
+ const obj_lastRunStatus = obj.lastRunStatus;
1763
+ const path_lastRunStatus = path + '.lastRunStatus';
1764
+ if (typeof obj_lastRunStatus !== 'string') {
1765
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunStatus + '" (at "' + path_lastRunStatus + '")');
1766
+ }
1767
+ const obj_status = obj.status;
1768
+ const path_status = path + '.status';
1769
+ if (typeof obj_status !== 'string') {
1770
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1771
+ }
1772
+ })();
1773
+ return v_error === undefined ? null : v_error;
1774
+ }
1775
+ const RepresentationType$2 = 'CdpDataGraphRetryOutputRepresentation';
1776
+ function keyBuilder$6(luvio, config) {
1777
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.name;
1778
+ }
1779
+ function keyBuilderFromType$2(luvio, object) {
1780
+ const keyParams = {
1781
+ name: object.dataGraphName
1782
+ };
1783
+ return keyBuilder$6(luvio, keyParams);
1784
+ }
1785
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1786
+ return input;
1787
+ }
1788
+ const select$6 = function CdpDataGraphRetryOutputRepresentationSelect() {
1789
+ return {
1790
+ kind: 'Fragment',
1791
+ version: VERSION$2,
1792
+ private: [],
1793
+ opaque: true
1794
+ };
1795
+ };
1796
+ function equals$2(existing, incoming) {
1797
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1798
+ return false;
1799
+ }
1800
+ return true;
1801
+ }
1802
+ const ingest$2 = function CdpDataGraphRetryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1803
+ if (process.env.NODE_ENV !== 'production') {
1804
+ const validateError = validate$2(input);
1805
+ if (validateError !== null) {
1806
+ throw validateError;
1807
+ }
1808
+ }
1809
+ const key = keyBuilderFromType$2(luvio, input);
1810
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1811
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "CDP", VERSION$2, RepresentationType$2, equals$2);
1812
+ return createLink(key);
1813
+ };
1814
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1815
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1816
+ const rootKey = keyBuilderFromType$2(luvio, input);
1817
+ rootKeySet.set(rootKey, {
1818
+ namespace: keyPrefix,
1819
+ representationName: RepresentationType$2,
1820
+ mergeable: false
1821
+ });
1822
+ }
1823
+
1824
+ function select$5(luvio, params) {
1825
+ return select$6();
1826
+ }
1827
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1828
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1829
+ }
1830
+ function ingestSuccess$3(luvio, resourceParams, response) {
1831
+ const { body } = response;
1832
+ const key = keyBuilderFromType$2(luvio, body);
1833
+ luvio.storeIngest(key, ingest$2, body);
1834
+ const snapshot = luvio.storeLookup({
1835
+ recordId: key,
1836
+ node: select$5(),
1837
+ variables: {},
1838
+ });
1839
+ if (process.env.NODE_ENV !== 'production') {
1840
+ if (snapshot.state !== 'Fulfilled') {
1841
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1842
+ }
1843
+ }
1844
+ deepFreeze(snapshot.data);
1845
+ return snapshot;
1846
+ }
1847
+ function createResourceRequest$3(config) {
1848
+ const headers = {};
1849
+ return {
1850
+ baseUri: '/services/data/v66.0',
1851
+ basePath: '/ssot/data-graphs/retry',
1852
+ method: 'put',
1853
+ body: config.body,
1854
+ urlParams: {},
1855
+ queryParams: {},
1856
+ headers,
1857
+ priority: 'normal',
1858
+ };
1859
+ }
1860
+
1861
+ const adapterName$3 = 'retryDataGraph';
1862
+ const retryDataGraph_ConfigPropertyMetadata = [
1863
+ generateParamConfigMetadata('dataGraphName', true, 2 /* Body */, 0 /* String */),
1864
+ ];
1865
+ const retryDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, retryDataGraph_ConfigPropertyMetadata);
1866
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(retryDataGraph_ConfigPropertyMetadata);
1867
+ function typeCheckConfig$3(untrustedConfig) {
1868
+ const config = {};
1869
+ typeCheckConfig$8(untrustedConfig, config, retryDataGraph_ConfigPropertyMetadata);
1870
+ return config;
1871
+ }
1872
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1873
+ if (!untrustedIsObject(untrustedConfig)) {
1874
+ return null;
1875
+ }
1876
+ if (process.env.NODE_ENV !== 'production') {
1877
+ validateConfig(untrustedConfig, configPropertyNames);
1878
+ }
1879
+ const config = typeCheckConfig$3(untrustedConfig);
1880
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1881
+ return null;
1882
+ }
1883
+ return config;
1884
+ }
1885
+ function buildNetworkSnapshot$3(luvio, config, options) {
1886
+ const resourceParams = createResourceParams$3(config);
1887
+ const request = createResourceRequest$3(resourceParams);
1888
+ return luvio.dispatchResourceRequest(request, options)
1889
+ .then((response) => {
1890
+ return luvio.handleSuccessResponse(() => {
1891
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1892
+ return luvio.storeBroadcast().then(() => snapshot);
1893
+ }, () => {
1894
+ const cache = new StoreKeyMap();
1895
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1896
+ return cache;
1897
+ });
1898
+ }, (response) => {
1899
+ deepFreeze(response);
1900
+ throw response;
1901
+ });
1902
+ }
1903
+ const retryDataGraphAdapterFactory = (luvio) => {
1904
+ return function retryDataGraph(untrustedConfig) {
1905
+ const config = validateAdapterConfig$3(untrustedConfig, retryDataGraph_ConfigPropertyNames);
1906
+ // Invalid or incomplete config
1907
+ if (config === null) {
1908
+ throw new Error('Invalid config for "retryDataGraph"');
1909
+ }
1910
+ return buildNetworkSnapshot$3(luvio, config);
1911
+ };
1912
+ };
1913
+
1914
+ const VERSION$1 = "0c15cc932d3ea4f07bf6a3b0429e3520";
1915
+ function validate$1(obj, path = 'CdpDataGraphDependencyOutputRepresentation') {
1916
+ const validateCdpObjectBaseOutputRepresentation_validateError = validate$f(obj, path);
1917
+ if (validateCdpObjectBaseOutputRepresentation_validateError !== null) {
1918
+ return validateCdpObjectBaseOutputRepresentation_validateError;
1919
+ }
1920
+ const v_error = (() => {
1921
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1922
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1923
+ }
1924
+ const obj_dependency = obj.dependency;
1925
+ const path_dependency = path + '.dependency';
1926
+ if (!ArrayIsArray(obj_dependency)) {
1927
+ return new TypeError('Expected "array" but received "' + typeof obj_dependency + '" (at "' + path_dependency + '")');
1928
+ }
1929
+ for (let i = 0; i < obj_dependency.length; i++) {
1930
+ const obj_dependency_item = obj_dependency[i];
1931
+ const path_dependency_item = path_dependency + '[' + i + ']';
1932
+ const referencepath_dependency_itemValidationError = validate$b(obj_dependency_item, path_dependency_item);
1933
+ if (referencepath_dependency_itemValidationError !== null) {
1934
+ let message = 'Object doesn\'t match DependencyOutputRepresentation (at "' + path_dependency_item + '")\n';
1935
+ message += referencepath_dependency_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1936
+ return new TypeError(message);
1937
+ }
1938
+ }
1939
+ })();
1940
+ return v_error === undefined ? null : v_error;
1941
+ }
1942
+ const RepresentationType$1 = 'CdpDataGraphDependencyOutputRepresentation';
1943
+ function keyBuilder$5(luvio, config) {
1944
+ return keyBuilder$b(luvio, config);
1945
+ }
1946
+ function keyBuilderFromType$1(luvio, object) {
1947
+ return keyBuilderFromType$4(luvio, object);
1948
+ }
1949
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1950
+ return input;
1951
+ }
1952
+ const select$4 = function CdpDataGraphDependencyOutputRepresentationSelect() {
1953
+ return {
1954
+ kind: 'Fragment',
1955
+ version: VERSION$1,
1956
+ private: [],
1957
+ opaque: true
1958
+ };
1959
+ };
1960
+ function equals$1(existing, incoming) {
1961
+ if (equals$9(existing, incoming) === false) {
1962
+ return false;
1963
+ }
1964
+ const existing_dependency = existing.dependency;
1965
+ const incoming_dependency = incoming.dependency;
1966
+ const equals_dependency_items = equalsArray(existing_dependency, incoming_dependency, (existing_dependency_item, incoming_dependency_item) => {
1967
+ if (!(equals$5(existing_dependency_item, incoming_dependency_item))) {
1968
+ return false;
1969
+ }
1970
+ });
1971
+ if (equals_dependency_items === false) {
1972
+ return false;
1973
+ }
1974
+ return true;
1975
+ }
1976
+ const ingest$1 = function CdpDataGraphDependencyOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1977
+ if (process.env.NODE_ENV !== 'production') {
1978
+ const validateError = validate$1(input);
1979
+ if (validateError !== null) {
1980
+ throw validateError;
1981
+ }
1982
+ }
1983
+ const key = keyBuilderFromType$1(luvio, input);
1984
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1985
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "CDP", VERSION$1, RepresentationType$1, equals$1);
1986
+ return createLink(key);
1987
+ };
1988
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1989
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1990
+ const rootKey = keyBuilderFromType$1(luvio, input);
1991
+ rootKeySet.set(rootKey, {
1992
+ namespace: keyPrefix,
1993
+ representationName: RepresentationType$4,
1994
+ mergeable: false
1995
+ });
1996
+ }
1997
+
1998
+ function select$3(luvio, params) {
1999
+ return select$4();
2000
+ }
2001
+ function keyBuilder$4(luvio, params) {
2002
+ return keyBuilder$5(luvio, {
2003
+ name: params.urlParams.dataGraphName
2004
+ });
2005
+ }
2006
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2007
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
2008
+ }
2009
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
2010
+ const { body } = response;
2011
+ const key = keyBuilder$4(luvio, resourceParams);
2012
+ luvio.storeIngest(key, ingest$1, body);
2013
+ const snapshot = luvio.storeLookup({
2014
+ recordId: key,
2015
+ node: select$3(),
2016
+ variables: {},
2017
+ }, snapshotRefresh);
2018
+ if (process.env.NODE_ENV !== 'production') {
2019
+ if (snapshot.state !== 'Fulfilled') {
2020
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2021
+ }
2022
+ }
2023
+ deepFreeze(snapshot.data);
2024
+ return snapshot;
2025
+ }
2026
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
2027
+ const key = keyBuilder$4(luvio, params);
2028
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2029
+ luvio.storeIngestError(key, errorSnapshot);
2030
+ return errorSnapshot;
2031
+ }
2032
+ function createResourceRequest$2(config) {
2033
+ const headers = {};
2034
+ return {
2035
+ baseUri: '/services/data/v66.0',
2036
+ basePath: '/ssot/data-graphs/dependency/' + config.urlParams.dataGraphName + '',
2037
+ method: 'get',
2038
+ body: null,
2039
+ urlParams: config.urlParams,
2040
+ queryParams: {},
2041
+ headers,
2042
+ priority: 'normal',
2043
+ };
2044
+ }
2045
+
2046
+ const adapterName$2 = 'getDataGraphDependency';
2047
+ const getDataGraphDependency_ConfigPropertyMetadata = [
2048
+ generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
2049
+ ];
2050
+ const getDataGraphDependency_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDataGraphDependency_ConfigPropertyMetadata);
2051
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getDataGraphDependency_ConfigPropertyMetadata);
2052
+ function keyBuilder$3(luvio, config) {
2053
+ const resourceParams = createResourceParams$2(config);
2054
+ return keyBuilder$4(luvio, resourceParams);
2055
+ }
2056
+ function typeCheckConfig$2(untrustedConfig) {
2057
+ const config = {};
2058
+ typeCheckConfig$8(untrustedConfig, config, getDataGraphDependency_ConfigPropertyMetadata);
2059
+ return config;
2060
+ }
2061
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2062
+ if (!untrustedIsObject(untrustedConfig)) {
2063
+ return null;
2064
+ }
2065
+ if (process.env.NODE_ENV !== 'production') {
2066
+ validateConfig(untrustedConfig, configPropertyNames);
2067
+ }
2068
+ const config = typeCheckConfig$2(untrustedConfig);
2069
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2070
+ return null;
2071
+ }
2072
+ return config;
2073
+ }
2074
+ function adapterFragment$1(luvio, config) {
2075
+ createResourceParams$2(config);
2076
+ return select$3();
2077
+ }
2078
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
2079
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
2080
+ config,
2081
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2082
+ });
2083
+ return luvio.storeBroadcast().then(() => snapshot);
2084
+ }
2085
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
2086
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
2087
+ config,
2088
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2089
+ });
2090
+ return luvio.storeBroadcast().then(() => snapshot);
2091
+ }
2092
+ function buildNetworkSnapshot$2(luvio, config, options) {
2093
+ const resourceParams = createResourceParams$2(config);
2094
+ const request = createResourceRequest$2(resourceParams);
2095
+ return luvio.dispatchResourceRequest(request, options)
2096
+ .then((response) => {
2097
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
2098
+ const cache = new StoreKeyMap();
2099
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2100
+ return cache;
2101
+ });
2102
+ }, (response) => {
2103
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
2104
+ });
2105
+ }
2106
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
2107
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
2108
+ }
2109
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2110
+ const { luvio, config } = context;
2111
+ const selector = {
2112
+ recordId: keyBuilder$3(luvio, config),
2113
+ node: adapterFragment$1(luvio, config),
2114
+ variables: {},
2115
+ };
2116
+ const cacheSnapshot = storeLookup(selector, {
2117
+ config,
2118
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2119
+ });
2120
+ return cacheSnapshot;
2121
+ }
2122
+ const getDataGraphDependencyAdapterFactory = (luvio) => function CDP__getDataGraphDependency(untrustedConfig, requestContext) {
2123
+ const config = validateAdapterConfig$2(untrustedConfig, getDataGraphDependency_ConfigPropertyNames);
2124
+ // Invalid or incomplete config
2125
+ if (config === null) {
2126
+ return null;
2127
+ }
2128
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2129
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
2130
+ };
2131
+
2132
+ const VERSION = "f772ba42e8976d22b7d5bfc77460f241";
2133
+ function validate(obj, path = 'CdpDataGraphDraftOutputRepresentation') {
2134
+ const v_error = (() => {
2135
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2136
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2137
+ }
2138
+ const obj_outputRepresentation = obj.outputRepresentation;
2139
+ const path_outputRepresentation = path + '.outputRepresentation';
2140
+ const referencepath_outputRepresentationValidationError = validate$3(obj_outputRepresentation, path_outputRepresentation);
2141
+ if (referencepath_outputRepresentationValidationError !== null) {
2142
+ let message = 'Object doesn\'t match CdpDataGraphOutputRepresentation (at "' + path_outputRepresentation + '")\n';
2143
+ message += referencepath_outputRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2144
+ return new TypeError(message);
2145
+ }
2146
+ })();
2147
+ return v_error === undefined ? null : v_error;
2148
+ }
2149
+ const RepresentationType = 'CdpDataGraphDraftOutputRepresentation';
2150
+ function keyBuilder$2(luvio, config) {
2151
+ return keyPrefix + '::' + RepresentationType + ':' + config.name;
2152
+ }
2153
+ function keyBuilderFromType(luvio, object) {
2154
+ const keyParams = {
2155
+ name: object.outputRepresentation.name
2156
+ };
2157
+ return keyBuilder$2(luvio, keyParams);
2158
+ }
2159
+ function normalize(input, existing, path, luvio, store, timestamp) {
2160
+ return input;
2161
+ }
2162
+ const select$2 = function CdpDataGraphDraftOutputRepresentationSelect() {
2163
+ return {
2164
+ kind: 'Fragment',
2165
+ version: VERSION,
2166
+ private: [],
2167
+ opaque: true
2168
+ };
2169
+ };
2170
+ function equals(existing, incoming) {
2171
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2172
+ return false;
2173
+ }
2174
+ return true;
2175
+ }
2176
+ const ingest = function CdpDataGraphDraftOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2177
+ if (process.env.NODE_ENV !== 'production') {
2178
+ const validateError = validate(input);
2179
+ if (validateError !== null) {
2180
+ throw validateError;
2181
+ }
2182
+ }
2183
+ const key = keyBuilderFromType(luvio, input);
2184
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
2185
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "CDP", VERSION, RepresentationType, equals);
2186
+ return createLink(key);
2187
+ };
2188
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
2189
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2190
+ const rootKey = keyBuilderFromType(luvio, input);
2191
+ rootKeySet.set(rootKey, {
2192
+ namespace: keyPrefix,
2193
+ representationName: RepresentationType,
2194
+ mergeable: false
2195
+ });
2196
+ }
2197
+
2198
+ function select$1(luvio, params) {
2199
+ return select$2();
2200
+ }
2201
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
2202
+ getTypeCacheKeys(storeKeyMap, luvio, response);
2203
+ }
2204
+ function ingestSuccess$1(luvio, resourceParams, response) {
2205
+ const { body } = response;
2206
+ const key = keyBuilderFromType(luvio, body);
2207
+ luvio.storeIngest(key, ingest, body);
2208
+ const snapshot = luvio.storeLookup({
2209
+ recordId: key,
2210
+ node: select$1(),
2211
+ variables: {},
2212
+ });
2213
+ if (process.env.NODE_ENV !== 'production') {
2214
+ if (snapshot.state !== 'Fulfilled') {
2215
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2216
+ }
2217
+ }
2218
+ deepFreeze(snapshot.data);
2219
+ return snapshot;
2220
+ }
2221
+ function createResourceRequest$1(config) {
2222
+ const headers = {};
2223
+ return {
2224
+ baseUri: '/services/data/v66.0',
2225
+ basePath: '/ssot/data-graphs/draft',
2226
+ method: 'post',
2227
+ body: config.body,
2228
+ urlParams: {},
2229
+ queryParams: {},
2230
+ headers,
2231
+ priority: 'normal',
2232
+ };
2233
+ }
2234
+
2235
+ const adapterName$1 = 'saveDataGraphDraft';
2236
+ const saveDataGraphDraft_ConfigPropertyMetadata = [
2237
+ generateParamConfigMetadata('dataGraphName', true, 2 /* Body */, 0 /* String */),
2238
+ generateParamConfigMetadata('jsonSchema', true, 2 /* Body */, 0 /* String */),
2239
+ ];
2240
+ const saveDataGraphDraft_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, saveDataGraphDraft_ConfigPropertyMetadata);
2241
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(saveDataGraphDraft_ConfigPropertyMetadata);
2242
+ function typeCheckConfig$1(untrustedConfig) {
2243
+ const config = {};
2244
+ typeCheckConfig$8(untrustedConfig, config, saveDataGraphDraft_ConfigPropertyMetadata);
2245
+ return config;
2246
+ }
2247
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
2248
+ if (!untrustedIsObject(untrustedConfig)) {
2249
+ return null;
2250
+ }
2251
+ if (process.env.NODE_ENV !== 'production') {
2252
+ validateConfig(untrustedConfig, configPropertyNames);
2253
+ }
2254
+ const config = typeCheckConfig$1(untrustedConfig);
2255
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2256
+ return null;
2257
+ }
2258
+ return config;
2259
+ }
2260
+ function buildNetworkSnapshot$1(luvio, config, options) {
2261
+ const resourceParams = createResourceParams$1(config);
2262
+ const request = createResourceRequest$1(resourceParams);
2263
+ return luvio.dispatchResourceRequest(request, options)
2264
+ .then((response) => {
2265
+ return luvio.handleSuccessResponse(() => {
2266
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
2267
+ return luvio.storeBroadcast().then(() => snapshot);
2268
+ }, () => {
2269
+ const cache = new StoreKeyMap();
2270
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
2271
+ return cache;
2272
+ });
2273
+ }, (response) => {
2274
+ deepFreeze(response);
2275
+ throw response;
2276
+ });
2277
+ }
2278
+ const saveDataGraphDraftAdapterFactory = (luvio) => {
2279
+ return function saveDataGraphDraft(untrustedConfig) {
2280
+ const config = validateAdapterConfig$1(untrustedConfig, saveDataGraphDraft_ConfigPropertyNames);
2281
+ // Invalid or incomplete config
2282
+ if (config === null) {
2283
+ throw new Error('Invalid config for "saveDataGraphDraft"');
2284
+ }
2285
+ return buildNetworkSnapshot$1(luvio, config);
2286
+ };
2287
+ };
2288
+
2289
+ function select(luvio, params) {
2290
+ return select$2();
2291
+ }
2292
+ function keyBuilder$1(luvio, params) {
2293
+ return keyBuilder$2(luvio, {
2294
+ name: params.urlParams.dataGraphName
2295
+ });
2296
+ }
2297
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
2298
+ getTypeCacheKeys(storeKeyMap, luvio, response);
2299
+ }
2300
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
2301
+ const { body } = response;
2302
+ const key = keyBuilder$1(luvio, resourceParams);
2303
+ luvio.storeIngest(key, ingest, body);
2304
+ const snapshot = luvio.storeLookup({
2305
+ recordId: key,
2306
+ node: select(),
2307
+ variables: {},
2308
+ }, snapshotRefresh);
2309
+ if (process.env.NODE_ENV !== 'production') {
2310
+ if (snapshot.state !== 'Fulfilled') {
2311
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2312
+ }
2313
+ }
2314
+ deepFreeze(snapshot.data);
2315
+ return snapshot;
2316
+ }
2317
+ function ingestError(luvio, params, error, snapshotRefresh) {
2318
+ const key = keyBuilder$1(luvio, params);
2319
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2320
+ luvio.storeIngestError(key, errorSnapshot);
2321
+ return errorSnapshot;
2322
+ }
2323
+ function createResourceRequest(config) {
2324
+ const headers = {};
2325
+ return {
2326
+ baseUri: '/services/data/v66.0',
2327
+ basePath: '/ssot/data-graphs/draft/' + config.urlParams.dataGraphName + '',
2328
+ method: 'get',
2329
+ body: null,
2330
+ urlParams: config.urlParams,
2331
+ queryParams: {},
2332
+ headers,
2333
+ priority: 'normal',
2334
+ };
2335
+ }
2336
+
2337
+ const adapterName = 'getDataGraphDraft';
2338
+ const getDataGraphDraft_ConfigPropertyMetadata = [
2339
+ generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
2340
+ ];
2341
+ const getDataGraphDraft_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDataGraphDraft_ConfigPropertyMetadata);
2342
+ const createResourceParams = /*#__PURE__*/ createResourceParams$8(getDataGraphDraft_ConfigPropertyMetadata);
2343
+ function keyBuilder(luvio, config) {
2344
+ const resourceParams = createResourceParams(config);
2345
+ return keyBuilder$1(luvio, resourceParams);
2346
+ }
2347
+ function typeCheckConfig(untrustedConfig) {
2348
+ const config = {};
2349
+ typeCheckConfig$8(untrustedConfig, config, getDataGraphDraft_ConfigPropertyMetadata);
2350
+ return config;
2351
+ }
2352
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2353
+ if (!untrustedIsObject(untrustedConfig)) {
2354
+ return null;
2355
+ }
2356
+ if (process.env.NODE_ENV !== 'production') {
2357
+ validateConfig(untrustedConfig, configPropertyNames);
2358
+ }
2359
+ const config = typeCheckConfig(untrustedConfig);
2360
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2361
+ return null;
2362
+ }
2363
+ return config;
2364
+ }
2365
+ function adapterFragment(luvio, config) {
2366
+ createResourceParams(config);
2367
+ return select();
2368
+ }
2369
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
2370
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
2371
+ config,
2372
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2373
+ });
2374
+ return luvio.storeBroadcast().then(() => snapshot);
2375
+ }
2376
+ function onFetchResponseError(luvio, config, resourceParams, response) {
2377
+ const snapshot = ingestError(luvio, resourceParams, response, {
2378
+ config,
2379
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2380
+ });
2381
+ return luvio.storeBroadcast().then(() => snapshot);
2382
+ }
2383
+ function buildNetworkSnapshot(luvio, config, options) {
2384
+ const resourceParams = createResourceParams(config);
2385
+ const request = createResourceRequest(resourceParams);
2386
+ return luvio.dispatchResourceRequest(request, options)
2387
+ .then((response) => {
2388
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
2389
+ const cache = new StoreKeyMap();
2390
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
2391
+ return cache;
2392
+ });
2393
+ }, (response) => {
2394
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2395
+ });
2396
+ }
2397
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2398
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2399
+ }
2400
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2401
+ const { luvio, config } = context;
2402
+ const selector = {
2403
+ recordId: keyBuilder(luvio, config),
2404
+ node: adapterFragment(luvio, config),
2405
+ variables: {},
2406
+ };
2407
+ const cacheSnapshot = storeLookup(selector, {
2408
+ config,
2409
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2410
+ });
2411
+ return cacheSnapshot;
2412
+ }
2413
+ const getDataGraphDraftAdapterFactory = (luvio) => function CDP__getDataGraphDraft(untrustedConfig, requestContext) {
2414
+ const config = validateAdapterConfig(untrustedConfig, getDataGraphDraft_ConfigPropertyNames);
2415
+ // Invalid or incomplete config
2416
+ if (config === null) {
2417
+ return null;
2418
+ }
2419
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2420
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2421
+ };
2422
+
2423
+ export { createDataGraphAdapterFactory, deleteDataGraphAdapterFactory, editDataGraphAdapterFactory, getDataGraphAdapterFactory, getDataGraphDependencyAdapterFactory, getDataGraphDraftAdapterFactory, retryDataGraphAdapterFactory, saveDataGraphDraftAdapterFactory };