@salesforce/lds-adapters-cdp-data-transform 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 (33) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/cdp-data-transform.js +2250 -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/createDataTransform.d.ts +32 -0
  5. package/dist/es/es2018/types/src/generated/adapters/deleteDataTransform.d.ts +14 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getDataTransform.d.ts +30 -0
  7. package/dist/es/es2018/types/src/generated/adapters/updateDataTransform.d.ts +33 -0
  8. package/dist/es/es2018/types/src/generated/adapters/validateDataTransforms.d.ts +43 -0
  9. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +5 -0
  10. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +9 -0
  11. package/dist/es/es2018/types/src/generated/resources/deleteSsotDataTransformsByDataTransformNameOrId.d.ts +12 -0
  12. package/dist/es/es2018/types/src/generated/resources/getSsotDataTransformsByDataTransformNameOrId.d.ts +19 -0
  13. package/dist/es/es2018/types/src/generated/resources/postSsotDataTransforms.d.ts +31 -0
  14. package/dist/es/es2018/types/src/generated/resources/postSsotDataTransformsValidation.d.ts +31 -0
  15. package/dist/es/es2018/types/src/generated/resources/putSsotDataTransformsByDataTransformNameOrId.d.ts +34 -0
  16. package/dist/es/es2018/types/src/generated/types/BaseActionRepresentation.d.ts +31 -0
  17. package/dist/es/es2018/types/src/generated/types/CdpAssetBaseRepresentation.d.ts +67 -0
  18. package/dist/es/es2018/types/src/generated/types/CdpErrorRepresentation.d.ts +31 -0
  19. package/dist/es/es2018/types/src/generated/types/CdpUserRepresentation.d.ts +34 -0
  20. package/dist/es/es2018/types/src/generated/types/DataObjectFieldRepresentation.d.ts +40 -0
  21. package/dist/es/es2018/types/src/generated/types/DataObjectRepresentation.d.ts +46 -0
  22. package/dist/es/es2018/types/src/generated/types/DataTransformDefinitionRepresentation.d.ts +44 -0
  23. package/dist/es/es2018/types/src/generated/types/DataTransformInputRepresentation.d.ts +70 -0
  24. package/dist/es/es2018/types/src/generated/types/DataTransformRepresentation.d.ts +97 -0
  25. package/dist/es/es2018/types/src/generated/types/DataTransformValidationRepresentation.d.ts +33 -0
  26. package/dist/es/es2018/types/src/generated/types/ScheduleRepresentation.d.ts +31 -0
  27. package/dist/es/es2018/types/src/generated/types/TransformValidationIssueRepresentation.d.ts +34 -0
  28. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  29. package/package.json +66 -0
  30. package/sfdc/index.d.ts +1 -0
  31. package/sfdc/index.js +2347 -0
  32. package/src/raml/api.raml +451 -0
  33. package/src/raml/luvio.raml +48 -0
@@ -0,0 +1,2250 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$5, StoreKeyMap, createResourceParams as createResourceParams$5 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
+ const { stringify: JSONStringify$1 } = JSON;
12
+ const { isArray: ArrayIsArray$1 } = Array;
13
+ /**
14
+ * Validates an adapter config is well-formed.
15
+ * @param config The config to validate.
16
+ * @param adapter The adapter validation configuration.
17
+ * @param oneOf The keys the config must contain at least one of.
18
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
19
+ */
20
+ function validateConfig(config, adapter, oneOf) {
21
+ const { displayName } = adapter;
22
+ const { required, optional, unsupported } = adapter.parameters;
23
+ if (config === undefined ||
24
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
25
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
26
+ }
27
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
28
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
29
+ }
30
+ if (unsupported !== undefined &&
31
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
32
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
33
+ }
34
+ const supported = required.concat(optional);
35
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
36
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
37
+ }
38
+ }
39
+ function untrustedIsObject(untrusted) {
40
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
41
+ }
42
+ function areRequiredParametersPresent(config, configPropertyNames) {
43
+ return configPropertyNames.parameters.required.every(req => req in config);
44
+ }
45
+ const snapshotRefreshOptions = {
46
+ overrides: {
47
+ headers: {
48
+ 'Cache-Control': 'no-cache',
49
+ },
50
+ }
51
+ };
52
+ /**
53
+ * A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
54
+ * This is needed because insertion order for JSON.stringify(object) affects output:
55
+ * JSON.stringify({a: 1, b: 2})
56
+ * "{"a":1,"b":2}"
57
+ * JSON.stringify({b: 2, a: 1})
58
+ * "{"b":2,"a":1}"
59
+ * @param data Data to be JSON-stringified.
60
+ * @returns JSON.stringified value with consistent ordering of keys.
61
+ */
62
+ function stableJSONStringify(node) {
63
+ // This is for Date values.
64
+ if (node && node.toJSON && typeof node.toJSON === 'function') {
65
+ // eslint-disable-next-line no-param-reassign
66
+ node = node.toJSON();
67
+ }
68
+ if (node === undefined) {
69
+ return;
70
+ }
71
+ if (typeof node === 'number') {
72
+ return isFinite(node) ? '' + node : 'null';
73
+ }
74
+ if (typeof node !== 'object') {
75
+ return JSONStringify$1(node);
76
+ }
77
+ let i;
78
+ let out;
79
+ if (ArrayIsArray$1(node)) {
80
+ out = '[';
81
+ for (i = 0; i < node.length; i++) {
82
+ if (i) {
83
+ out += ',';
84
+ }
85
+ out += stableJSONStringify(node[i]) || 'null';
86
+ }
87
+ return out + ']';
88
+ }
89
+ if (node === null) {
90
+ return 'null';
91
+ }
92
+ const keys = ObjectKeys$1(node).sort();
93
+ out = '';
94
+ for (i = 0; i < keys.length; i++) {
95
+ const key = keys[i];
96
+ const value = stableJSONStringify(node[key]);
97
+ if (!value) {
98
+ continue;
99
+ }
100
+ if (out) {
101
+ out += ',';
102
+ }
103
+ out += JSONStringify$1(key) + ':' + value;
104
+ }
105
+ return '{' + out + '}';
106
+ }
107
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
108
+ return {
109
+ name,
110
+ required,
111
+ resourceType,
112
+ typeCheckShape,
113
+ isArrayShape,
114
+ coerceFn,
115
+ };
116
+ }
117
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
118
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
119
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
120
+ return {
121
+ displayName,
122
+ parameters: {
123
+ required,
124
+ optional,
125
+ }
126
+ };
127
+ }
128
+ const keyPrefix = 'data-transform';
129
+
130
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
131
+ const { isArray: ArrayIsArray } = Array;
132
+ const { stringify: JSONStringify } = JSON;
133
+ function equalsArray(a, b, equalsItem) {
134
+ const aLength = a.length;
135
+ const bLength = b.length;
136
+ if (aLength !== bLength) {
137
+ return false;
138
+ }
139
+ for (let i = 0; i < aLength; i++) {
140
+ if (equalsItem(a[i], b[i]) === false) {
141
+ return false;
142
+ }
143
+ }
144
+ return true;
145
+ }
146
+ function equalsObject(a, b, equalsProp) {
147
+ const aKeys = ObjectKeys(a).sort();
148
+ const bKeys = ObjectKeys(b).sort();
149
+ const aKeysLength = aKeys.length;
150
+ const bKeysLength = bKeys.length;
151
+ if (aKeysLength !== bKeysLength) {
152
+ return false;
153
+ }
154
+ for (let i = 0; i < aKeys.length; i++) {
155
+ const key = aKeys[i];
156
+ if (key !== bKeys[i]) {
157
+ return false;
158
+ }
159
+ if (equalsProp(a[key], b[key]) === false) {
160
+ return false;
161
+ }
162
+ }
163
+ return true;
164
+ }
165
+ function createLink(ref) {
166
+ return {
167
+ __ref: serializeStructuredKey(ref),
168
+ };
169
+ }
170
+
171
+ function validate$a(obj, path = 'TransformValidationIssueRepresentation') {
172
+ const v_error = (() => {
173
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
174
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
175
+ }
176
+ if (obj.errorCode !== undefined) {
177
+ const obj_errorCode = obj.errorCode;
178
+ const path_errorCode = path + '.errorCode';
179
+ if (typeof obj_errorCode !== 'string') {
180
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
181
+ }
182
+ }
183
+ if (obj.errorMessage !== undefined) {
184
+ const obj_errorMessage = obj.errorMessage;
185
+ const path_errorMessage = path + '.errorMessage';
186
+ if (typeof obj_errorMessage !== 'string') {
187
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
188
+ }
189
+ }
190
+ const obj_errorSeverity = obj.errorSeverity;
191
+ const path_errorSeverity = path + '.errorSeverity';
192
+ if (typeof obj_errorSeverity !== 'string') {
193
+ return new TypeError('Expected "string" but received "' + typeof obj_errorSeverity + '" (at "' + path_errorSeverity + '")');
194
+ }
195
+ })();
196
+ return v_error === undefined ? null : v_error;
197
+ }
198
+
199
+ const VERSION$8 = "efb82c29d2d2d9ec860406b7caae554d";
200
+ function validate$9(obj, path = 'CdpUserRepresentation') {
201
+ const v_error = (() => {
202
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
203
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
204
+ }
205
+ const obj_id = obj.id;
206
+ const path_id = path + '.id';
207
+ if (typeof obj_id !== 'string') {
208
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
209
+ }
210
+ if (obj.name !== undefined) {
211
+ const obj_name = obj.name;
212
+ const path_name = path + '.name';
213
+ if (typeof obj_name !== 'string') {
214
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
215
+ }
216
+ }
217
+ if (obj.profilePhotoUrl !== undefined) {
218
+ const obj_profilePhotoUrl = obj.profilePhotoUrl;
219
+ const path_profilePhotoUrl = path + '.profilePhotoUrl';
220
+ if (typeof obj_profilePhotoUrl !== 'string') {
221
+ return new TypeError('Expected "string" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
222
+ }
223
+ }
224
+ })();
225
+ return v_error === undefined ? null : v_error;
226
+ }
227
+ const select$c = function CdpUserRepresentationSelect() {
228
+ return {
229
+ kind: 'Fragment',
230
+ version: VERSION$8,
231
+ private: [],
232
+ selections: [
233
+ {
234
+ name: 'id',
235
+ kind: 'Scalar'
236
+ },
237
+ {
238
+ name: 'name',
239
+ kind: 'Scalar',
240
+ required: false
241
+ },
242
+ {
243
+ name: 'profilePhotoUrl',
244
+ kind: 'Scalar',
245
+ required: false
246
+ }
247
+ ]
248
+ };
249
+ };
250
+ function equals$9(existing, incoming) {
251
+ const existing_id = existing.id;
252
+ const incoming_id = incoming.id;
253
+ if (!(existing_id === incoming_id)) {
254
+ return false;
255
+ }
256
+ const existing_name = existing.name;
257
+ const incoming_name = incoming.name;
258
+ // if at least one of these optionals is defined
259
+ if (existing_name !== undefined || incoming_name !== undefined) {
260
+ // if one of these is not defined we know the other is defined and therefore
261
+ // not equal
262
+ if (existing_name === undefined || incoming_name === undefined) {
263
+ return false;
264
+ }
265
+ if (!(existing_name === incoming_name)) {
266
+ return false;
267
+ }
268
+ }
269
+ const existing_profilePhotoUrl = existing.profilePhotoUrl;
270
+ const incoming_profilePhotoUrl = incoming.profilePhotoUrl;
271
+ // if at least one of these optionals is defined
272
+ if (existing_profilePhotoUrl !== undefined || incoming_profilePhotoUrl !== undefined) {
273
+ // if one of these is not defined we know the other is defined and therefore
274
+ // not equal
275
+ if (existing_profilePhotoUrl === undefined || incoming_profilePhotoUrl === undefined) {
276
+ return false;
277
+ }
278
+ if (!(existing_profilePhotoUrl === incoming_profilePhotoUrl)) {
279
+ return false;
280
+ }
281
+ }
282
+ return true;
283
+ }
284
+
285
+ const VERSION$7 = "3fd0683a6603c98784b3d4aeb83ea69b";
286
+ function validate$8(obj, path = 'BaseActionRepresentation') {
287
+ const v_error = (() => {
288
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
289
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
290
+ }
291
+ const obj_refreshStatusAction = obj.refreshStatusAction;
292
+ const path_refreshStatusAction = path + '.refreshStatusAction';
293
+ if (typeof obj_refreshStatusAction !== 'string') {
294
+ return new TypeError('Expected "string" but received "' + typeof obj_refreshStatusAction + '" (at "' + path_refreshStatusAction + '")');
295
+ }
296
+ const obj_retryAction = obj.retryAction;
297
+ const path_retryAction = path + '.retryAction';
298
+ if (typeof obj_retryAction !== 'string') {
299
+ return new TypeError('Expected "string" but received "' + typeof obj_retryAction + '" (at "' + path_retryAction + '")');
300
+ }
301
+ })();
302
+ return v_error === undefined ? null : v_error;
303
+ }
304
+ const select$b = function BaseActionRepresentationSelect() {
305
+ return {
306
+ kind: 'Fragment',
307
+ version: VERSION$7,
308
+ private: [],
309
+ selections: [
310
+ {
311
+ name: 'refreshStatusAction',
312
+ kind: 'Scalar'
313
+ },
314
+ {
315
+ name: 'retryAction',
316
+ kind: 'Scalar'
317
+ }
318
+ ]
319
+ };
320
+ };
321
+ function equals$8(existing, incoming) {
322
+ const existing_refreshStatusAction = existing.refreshStatusAction;
323
+ const incoming_refreshStatusAction = incoming.refreshStatusAction;
324
+ if (!(existing_refreshStatusAction === incoming_refreshStatusAction)) {
325
+ return false;
326
+ }
327
+ const existing_retryAction = existing.retryAction;
328
+ const incoming_retryAction = incoming.retryAction;
329
+ if (!(existing_retryAction === incoming_retryAction)) {
330
+ return false;
331
+ }
332
+ return true;
333
+ }
334
+
335
+ const VERSION$6 = "2acfba62fd425f0dc2a8b2bcadde2466";
336
+ function validate$7(obj, path = 'CdpErrorRepresentation') {
337
+ const v_error = (() => {
338
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
339
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
340
+ }
341
+ const obj_errorCode = obj.errorCode;
342
+ const path_errorCode = path + '.errorCode';
343
+ if (typeof obj_errorCode !== 'string') {
344
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
345
+ }
346
+ const obj_message = obj.message;
347
+ const path_message = path + '.message';
348
+ if (typeof obj_message !== 'string') {
349
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
350
+ }
351
+ })();
352
+ return v_error === undefined ? null : v_error;
353
+ }
354
+ const select$a = function CdpErrorRepresentationSelect() {
355
+ return {
356
+ kind: 'Fragment',
357
+ version: VERSION$6,
358
+ private: [],
359
+ selections: [
360
+ {
361
+ name: 'errorCode',
362
+ kind: 'Scalar'
363
+ },
364
+ {
365
+ name: 'message',
366
+ kind: 'Scalar'
367
+ }
368
+ ]
369
+ };
370
+ };
371
+ function equals$7(existing, incoming) {
372
+ const existing_errorCode = existing.errorCode;
373
+ const incoming_errorCode = incoming.errorCode;
374
+ if (!(existing_errorCode === incoming_errorCode)) {
375
+ return false;
376
+ }
377
+ const existing_message = existing.message;
378
+ const incoming_message = incoming.message;
379
+ if (!(existing_message === incoming_message)) {
380
+ return false;
381
+ }
382
+ return true;
383
+ }
384
+
385
+ const VERSION$5 = "9570db02ffdff852b102fde54128dc2f";
386
+ function validate$6(obj, path = 'ScheduleRepresentation') {
387
+ const v_error = (() => {
388
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
389
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
390
+ }
391
+ const obj_schedule = obj.schedule;
392
+ const path_schedule = path + '.schedule';
393
+ if (typeof obj_schedule !== 'string') {
394
+ return new TypeError('Expected "string" but received "' + typeof obj_schedule + '" (at "' + path_schedule + '")');
395
+ }
396
+ const obj_url = obj.url;
397
+ const path_url = path + '.url';
398
+ if (typeof obj_url !== 'string') {
399
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
400
+ }
401
+ })();
402
+ return v_error === undefined ? null : v_error;
403
+ }
404
+ const select$9 = function ScheduleRepresentationSelect() {
405
+ return {
406
+ kind: 'Fragment',
407
+ version: VERSION$5,
408
+ private: [],
409
+ selections: [
410
+ {
411
+ name: 'schedule',
412
+ kind: 'Scalar'
413
+ },
414
+ {
415
+ name: 'url',
416
+ kind: 'Scalar'
417
+ }
418
+ ]
419
+ };
420
+ };
421
+ function equals$6(existing, incoming) {
422
+ const existing_schedule = existing.schedule;
423
+ const incoming_schedule = incoming.schedule;
424
+ if (!(existing_schedule === incoming_schedule)) {
425
+ return false;
426
+ }
427
+ const existing_url = existing.url;
428
+ const incoming_url = incoming.url;
429
+ if (!(existing_url === incoming_url)) {
430
+ return false;
431
+ }
432
+ return true;
433
+ }
434
+
435
+ const VERSION$4 = "6ef7bcc16bd2f432497fc85ead97bca0";
436
+ function validate$5(obj, path = 'DataTransformDefinitionRepresentation') {
437
+ const v_error = (() => {
438
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
439
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
440
+ }
441
+ const obj_outputDataObjects = obj.outputDataObjects;
442
+ const path_outputDataObjects = path + '.outputDataObjects';
443
+ if (!ArrayIsArray(obj_outputDataObjects)) {
444
+ return new TypeError('Expected "array" but received "' + typeof obj_outputDataObjects + '" (at "' + path_outputDataObjects + '")');
445
+ }
446
+ for (let i = 0; i < obj_outputDataObjects.length; i++) {
447
+ const obj_outputDataObjects_item = obj_outputDataObjects[i];
448
+ const path_outputDataObjects_item = path_outputDataObjects + '[' + i + ']';
449
+ if (typeof obj_outputDataObjects_item !== 'object' || Array.isArray(obj_outputDataObjects_item)) {
450
+ return new TypeError('Expected "object" but received "' + typeof obj_outputDataObjects_item + '" (at "' + path_outputDataObjects_item + '")');
451
+ }
452
+ }
453
+ const obj_type = obj.type;
454
+ const path_type = path + '.type';
455
+ if (typeof obj_type !== 'string') {
456
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
457
+ }
458
+ const obj_version = obj.version;
459
+ const path_version = path + '.version';
460
+ if (typeof obj_version !== 'string') {
461
+ return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
462
+ }
463
+ })();
464
+ return v_error === undefined ? null : v_error;
465
+ }
466
+ const RepresentationType$4 = 'DataTransformDefinitionRepresentation';
467
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
468
+ const input_outputDataObjects = input.outputDataObjects;
469
+ const input_outputDataObjects_id = path.fullPath + '__outputDataObjects';
470
+ for (let i = 0; i < input_outputDataObjects.length; i++) {
471
+ const input_outputDataObjects_item = input_outputDataObjects[i];
472
+ let input_outputDataObjects_item_id = input_outputDataObjects_id + '__' + i;
473
+ input_outputDataObjects[i] = ingest$1(input_outputDataObjects_item, {
474
+ fullPath: input_outputDataObjects_item_id,
475
+ propertyName: i,
476
+ parent: {
477
+ data: input,
478
+ key: path.fullPath,
479
+ existing: existing,
480
+ },
481
+ ttl: path.ttl
482
+ }, luvio, store, timestamp);
483
+ }
484
+ return input;
485
+ }
486
+ const select$8 = function DataTransformDefinitionRepresentationSelect() {
487
+ return {
488
+ kind: 'Fragment',
489
+ version: VERSION$4,
490
+ private: [],
491
+ selections: [
492
+ {
493
+ name: 'outputDataObjects',
494
+ kind: 'Link',
495
+ plural: true,
496
+ fragment: select$5()
497
+ },
498
+ {
499
+ name: 'type',
500
+ kind: 'Scalar'
501
+ },
502
+ {
503
+ name: 'version',
504
+ kind: 'Scalar'
505
+ }
506
+ ]
507
+ };
508
+ };
509
+ function equals$5(existing, incoming) {
510
+ const existing_type = existing.type;
511
+ const incoming_type = incoming.type;
512
+ if (!(existing_type === incoming_type)) {
513
+ return false;
514
+ }
515
+ const existing_version = existing.version;
516
+ const incoming_version = incoming.version;
517
+ if (!(existing_version === incoming_version)) {
518
+ return false;
519
+ }
520
+ const existing_outputDataObjects = existing.outputDataObjects;
521
+ const incoming_outputDataObjects = incoming.outputDataObjects;
522
+ const equals_outputDataObjects_items = equalsArray(existing_outputDataObjects, incoming_outputDataObjects, (existing_outputDataObjects_item, incoming_outputDataObjects_item) => {
523
+ if (!(existing_outputDataObjects_item.__ref === incoming_outputDataObjects_item.__ref)) {
524
+ return false;
525
+ }
526
+ });
527
+ if (equals_outputDataObjects_items === false) {
528
+ return false;
529
+ }
530
+ return true;
531
+ }
532
+ const ingest$3 = function DataTransformDefinitionRepresentationIngest(input, path, luvio, store, timestamp) {
533
+ if (process.env.NODE_ENV !== 'production') {
534
+ const validateError = validate$5(input);
535
+ if (validateError !== null) {
536
+ throw validateError;
537
+ }
538
+ }
539
+ const key = path.fullPath;
540
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
541
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "data-transform", VERSION$4, RepresentationType$4, equals$5);
542
+ return createLink(key);
543
+ };
544
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
545
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
546
+ const rootKey = fullPathFactory();
547
+ rootKeySet.set(rootKey, {
548
+ namespace: keyPrefix,
549
+ representationName: RepresentationType$4,
550
+ mergeable: false
551
+ });
552
+ const input_outputDataObjects_length = input.outputDataObjects.length;
553
+ for (let i = 0; i < input_outputDataObjects_length; i++) {
554
+ getTypeCacheKeys$1(rootKeySet, luvio, input.outputDataObjects[i]);
555
+ }
556
+ }
557
+
558
+ const VERSION$3 = "3a9081497eeed505968a3ef0ca548f46";
559
+ function validate$4(obj, path = 'DataTransformRepresentation') {
560
+ const validateCdpAssetBaseRepresentation_validateError = validate$3(obj, path);
561
+ if (validateCdpAssetBaseRepresentation_validateError !== null) {
562
+ return validateCdpAssetBaseRepresentation_validateError;
563
+ }
564
+ const v_error = (() => {
565
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
566
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
567
+ }
568
+ const obj_actionUrls = obj.actionUrls;
569
+ const path_actionUrls = path + '.actionUrls';
570
+ const referencepath_actionUrlsValidationError = validate$8(obj_actionUrls, path_actionUrls);
571
+ if (referencepath_actionUrlsValidationError !== null) {
572
+ let message = 'Object doesn\'t match BaseActionRepresentation (at "' + path_actionUrls + '")\n';
573
+ message += referencepath_actionUrlsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
574
+ return new TypeError(message);
575
+ }
576
+ if (obj.capabilities !== undefined) {
577
+ const obj_capabilities = obj.capabilities;
578
+ const path_capabilities = path + '.capabilities';
579
+ if (typeof obj_capabilities !== 'object' || ArrayIsArray(obj_capabilities) || obj_capabilities === null) {
580
+ return new TypeError('Expected "object" but received "' + typeof obj_capabilities + '" (at "' + path_capabilities + '")');
581
+ }
582
+ const obj_capabilities_keys = ObjectKeys(obj_capabilities);
583
+ for (let i = 0; i < obj_capabilities_keys.length; i++) {
584
+ const key = obj_capabilities_keys[i];
585
+ const obj_capabilities_prop = obj_capabilities[key];
586
+ const path_capabilities_prop = path_capabilities + '["' + key + '"]';
587
+ if (typeof obj_capabilities_prop !== 'boolean') {
588
+ return new TypeError('Expected "boolean" but received "' + typeof obj_capabilities_prop + '" (at "' + path_capabilities_prop + '")');
589
+ }
590
+ }
591
+ }
592
+ const obj_creationType = obj.creationType;
593
+ const path_creationType = path + '.creationType';
594
+ if (typeof obj_creationType !== 'string') {
595
+ return new TypeError('Expected "string" but received "' + typeof obj_creationType + '" (at "' + path_creationType + '")');
596
+ }
597
+ if (obj.dataSpaceName !== undefined) {
598
+ const obj_dataSpaceName = obj.dataSpaceName;
599
+ const path_dataSpaceName = path + '.dataSpaceName';
600
+ if (typeof obj_dataSpaceName !== 'string') {
601
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
602
+ }
603
+ }
604
+ const obj_definition = obj.definition;
605
+ const path_definition = path + '.definition';
606
+ if (typeof obj_definition !== 'object' || Array.isArray(obj_definition)) {
607
+ return new TypeError('Expected "object" but received "' + typeof obj_definition + '" (at "' + path_definition + '")');
608
+ }
609
+ if (obj.description !== undefined) {
610
+ const obj_description = obj.description;
611
+ const path_description = path + '.description';
612
+ if (typeof obj_description !== 'string') {
613
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
614
+ }
615
+ }
616
+ if (obj.lastRunDate !== undefined) {
617
+ const obj_lastRunDate = obj.lastRunDate;
618
+ const path_lastRunDate = path + '.lastRunDate';
619
+ if (typeof obj_lastRunDate !== 'string') {
620
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunDate + '" (at "' + path_lastRunDate + '")');
621
+ }
622
+ }
623
+ if (obj.lastRunErrorCode !== undefined) {
624
+ const obj_lastRunErrorCode = obj.lastRunErrorCode;
625
+ const path_lastRunErrorCode = path + '.lastRunErrorCode';
626
+ const referencepath_lastRunErrorCodeValidationError = validate$7(obj_lastRunErrorCode, path_lastRunErrorCode);
627
+ if (referencepath_lastRunErrorCodeValidationError !== null) {
628
+ let message = 'Object doesn\'t match CdpErrorRepresentation (at "' + path_lastRunErrorCode + '")\n';
629
+ message += referencepath_lastRunErrorCodeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
630
+ return new TypeError(message);
631
+ }
632
+ }
633
+ if (obj.lastRunErrorMessage !== undefined) {
634
+ const obj_lastRunErrorMessage = obj.lastRunErrorMessage;
635
+ const path_lastRunErrorMessage = path + '.lastRunErrorMessage';
636
+ if (typeof obj_lastRunErrorMessage !== 'string') {
637
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunErrorMessage + '" (at "' + path_lastRunErrorMessage + '")');
638
+ }
639
+ }
640
+ if (obj.lastRunStatus !== undefined) {
641
+ const obj_lastRunStatus = obj.lastRunStatus;
642
+ const path_lastRunStatus = path + '.lastRunStatus';
643
+ if (typeof obj_lastRunStatus !== 'string') {
644
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunStatus + '" (at "' + path_lastRunStatus + '")');
645
+ }
646
+ }
647
+ if (obj.schedule !== undefined) {
648
+ const obj_schedule = obj.schedule;
649
+ const path_schedule = path + '.schedule';
650
+ const referencepath_scheduleValidationError = validate$6(obj_schedule, path_schedule);
651
+ if (referencepath_scheduleValidationError !== null) {
652
+ let message = 'Object doesn\'t match ScheduleRepresentation (at "' + path_schedule + '")\n';
653
+ message += referencepath_scheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
654
+ return new TypeError(message);
655
+ }
656
+ }
657
+ const obj_status = obj.status;
658
+ const path_status = path + '.status';
659
+ if (typeof obj_status !== 'string') {
660
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
661
+ }
662
+ if (obj.tags !== undefined) {
663
+ const obj_tags = obj.tags;
664
+ const path_tags = path + '.tags';
665
+ if (typeof obj_tags !== 'object' || ArrayIsArray(obj_tags) || obj_tags === null) {
666
+ return new TypeError('Expected "object" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
667
+ }
668
+ const obj_tags_keys = ObjectKeys(obj_tags);
669
+ for (let i = 0; i < obj_tags_keys.length; i++) {
670
+ const key = obj_tags_keys[i];
671
+ const obj_tags_prop = obj_tags[key];
672
+ const path_tags_prop = path_tags + '["' + key + '"]';
673
+ if (typeof obj_tags_prop !== 'string') {
674
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_prop + '" (at "' + path_tags_prop + '")');
675
+ }
676
+ }
677
+ }
678
+ const obj_type = obj.type;
679
+ const path_type = path + '.type';
680
+ if (typeof obj_type !== 'string') {
681
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
682
+ }
683
+ if (obj.version !== undefined) {
684
+ obj.version;
685
+ }
686
+ })();
687
+ return v_error === undefined ? null : v_error;
688
+ }
689
+ const RepresentationType$3 = 'DataTransformRepresentation';
690
+ function keyBuilder$6(luvio, config) {
691
+ return keyBuilder$5(luvio, config);
692
+ }
693
+ function keyBuilderFromType$2(luvio, object) {
694
+ return keyBuilderFromType$1(luvio, object);
695
+ }
696
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
697
+ const input_definition = input.definition;
698
+ const input_definition_id = path.fullPath + '__definition';
699
+ input.definition = ingest$3(input_definition, {
700
+ fullPath: input_definition_id,
701
+ propertyName: 'definition',
702
+ parent: {
703
+ data: input,
704
+ key: path.fullPath,
705
+ existing: existing,
706
+ },
707
+ ttl: path.ttl
708
+ }, luvio, store, timestamp);
709
+ return input;
710
+ }
711
+ const select$7 = function DataTransformRepresentationSelect() {
712
+ const { selections: CdpAssetBaseRepresentationSelections } = select$6();
713
+ const { selections: BaseActionRepresentation__selections, opaque: BaseActionRepresentation__opaque, } = select$b();
714
+ const { selections: CdpErrorRepresentation__selections, opaque: CdpErrorRepresentation__opaque, } = select$a();
715
+ const { selections: ScheduleRepresentation__selections, opaque: ScheduleRepresentation__opaque, } = select$9();
716
+ return {
717
+ kind: 'Fragment',
718
+ version: VERSION$3,
719
+ private: [],
720
+ selections: [
721
+ ...CdpAssetBaseRepresentationSelections,
722
+ {
723
+ name: 'actionUrls',
724
+ kind: 'Object',
725
+ selections: BaseActionRepresentation__selections
726
+ },
727
+ {
728
+ name: 'capabilities',
729
+ kind: 'Scalar',
730
+ map: true,
731
+ required: false
732
+ },
733
+ {
734
+ name: 'creationType',
735
+ kind: 'Scalar'
736
+ },
737
+ {
738
+ name: 'dataSpaceName',
739
+ kind: 'Scalar',
740
+ required: false
741
+ },
742
+ {
743
+ name: 'definition',
744
+ kind: 'Link',
745
+ fragment: select$8()
746
+ },
747
+ {
748
+ name: 'description',
749
+ kind: 'Scalar',
750
+ required: false
751
+ },
752
+ {
753
+ name: 'lastRunDate',
754
+ kind: 'Scalar',
755
+ required: false
756
+ },
757
+ {
758
+ name: 'lastRunErrorCode',
759
+ kind: 'Object',
760
+ selections: CdpErrorRepresentation__selections,
761
+ required: false
762
+ },
763
+ {
764
+ name: 'lastRunErrorMessage',
765
+ kind: 'Scalar',
766
+ required: false
767
+ },
768
+ {
769
+ name: 'lastRunStatus',
770
+ kind: 'Scalar',
771
+ required: false
772
+ },
773
+ {
774
+ name: 'schedule',
775
+ kind: 'Object',
776
+ selections: ScheduleRepresentation__selections,
777
+ required: false
778
+ },
779
+ {
780
+ name: 'status',
781
+ kind: 'Scalar'
782
+ },
783
+ {
784
+ name: 'tags',
785
+ kind: 'Scalar',
786
+ map: true,
787
+ required: false
788
+ },
789
+ {
790
+ name: 'type',
791
+ kind: 'Scalar'
792
+ },
793
+ {
794
+ name: 'version',
795
+ kind: 'Scalar',
796
+ required: false
797
+ }
798
+ ]
799
+ };
800
+ };
801
+ function equals$4(existing, incoming) {
802
+ if (equals$3(existing, incoming) === false) {
803
+ return false;
804
+ }
805
+ const existing_creationType = existing.creationType;
806
+ const incoming_creationType = incoming.creationType;
807
+ if (!(existing_creationType === incoming_creationType)) {
808
+ return false;
809
+ }
810
+ const existing_dataSpaceName = existing.dataSpaceName;
811
+ const incoming_dataSpaceName = incoming.dataSpaceName;
812
+ // if at least one of these optionals is defined
813
+ if (existing_dataSpaceName !== undefined || incoming_dataSpaceName !== undefined) {
814
+ // if one of these is not defined we know the other is defined and therefore
815
+ // not equal
816
+ if (existing_dataSpaceName === undefined || incoming_dataSpaceName === undefined) {
817
+ return false;
818
+ }
819
+ if (!(existing_dataSpaceName === incoming_dataSpaceName)) {
820
+ return false;
821
+ }
822
+ }
823
+ const existing_description = existing.description;
824
+ const incoming_description = incoming.description;
825
+ // if at least one of these optionals is defined
826
+ if (existing_description !== undefined || incoming_description !== undefined) {
827
+ // if one of these is not defined we know the other is defined and therefore
828
+ // not equal
829
+ if (existing_description === undefined || incoming_description === undefined) {
830
+ return false;
831
+ }
832
+ if (!(existing_description === incoming_description)) {
833
+ return false;
834
+ }
835
+ }
836
+ const existing_lastRunDate = existing.lastRunDate;
837
+ const incoming_lastRunDate = incoming.lastRunDate;
838
+ // if at least one of these optionals is defined
839
+ if (existing_lastRunDate !== undefined || incoming_lastRunDate !== undefined) {
840
+ // if one of these is not defined we know the other is defined and therefore
841
+ // not equal
842
+ if (existing_lastRunDate === undefined || incoming_lastRunDate === undefined) {
843
+ return false;
844
+ }
845
+ if (!(existing_lastRunDate === incoming_lastRunDate)) {
846
+ return false;
847
+ }
848
+ }
849
+ const existing_lastRunErrorMessage = existing.lastRunErrorMessage;
850
+ const incoming_lastRunErrorMessage = incoming.lastRunErrorMessage;
851
+ // if at least one of these optionals is defined
852
+ if (existing_lastRunErrorMessage !== undefined || incoming_lastRunErrorMessage !== undefined) {
853
+ // if one of these is not defined we know the other is defined and therefore
854
+ // not equal
855
+ if (existing_lastRunErrorMessage === undefined || incoming_lastRunErrorMessage === undefined) {
856
+ return false;
857
+ }
858
+ if (!(existing_lastRunErrorMessage === incoming_lastRunErrorMessage)) {
859
+ return false;
860
+ }
861
+ }
862
+ const existing_lastRunStatus = existing.lastRunStatus;
863
+ const incoming_lastRunStatus = incoming.lastRunStatus;
864
+ // if at least one of these optionals is defined
865
+ if (existing_lastRunStatus !== undefined || incoming_lastRunStatus !== undefined) {
866
+ // if one of these is not defined we know the other is defined and therefore
867
+ // not equal
868
+ if (existing_lastRunStatus === undefined || incoming_lastRunStatus === undefined) {
869
+ return false;
870
+ }
871
+ if (!(existing_lastRunStatus === incoming_lastRunStatus)) {
872
+ return false;
873
+ }
874
+ }
875
+ const existing_status = existing.status;
876
+ const incoming_status = incoming.status;
877
+ if (!(existing_status === incoming_status)) {
878
+ return false;
879
+ }
880
+ const existing_type = existing.type;
881
+ const incoming_type = incoming.type;
882
+ if (!(existing_type === incoming_type)) {
883
+ return false;
884
+ }
885
+ const existing_version = existing.version;
886
+ const incoming_version = incoming.version;
887
+ // if at least one of these optionals is defined
888
+ if (existing_version !== undefined || incoming_version !== undefined) {
889
+ // if one of these is not defined we know the other is defined and therefore
890
+ // not equal
891
+ if (existing_version === undefined || incoming_version === undefined) {
892
+ return false;
893
+ }
894
+ if (!(existing_version === incoming_version)) {
895
+ return false;
896
+ }
897
+ }
898
+ const existing_actionUrls = existing.actionUrls;
899
+ const incoming_actionUrls = incoming.actionUrls;
900
+ if (!(equals$8(existing_actionUrls, incoming_actionUrls))) {
901
+ return false;
902
+ }
903
+ const existing_capabilities = existing.capabilities;
904
+ const incoming_capabilities = incoming.capabilities;
905
+ // if at least one of these optionals is defined
906
+ if (existing_capabilities !== undefined || incoming_capabilities !== undefined) {
907
+ // if one of these is not defined we know the other is defined and therefore
908
+ // not equal
909
+ if (existing_capabilities === undefined || incoming_capabilities === undefined) {
910
+ return false;
911
+ }
912
+ const equals_capabilities_props = equalsObject(existing_capabilities, incoming_capabilities, (existing_capabilities_prop, incoming_capabilities_prop) => {
913
+ if (!(existing_capabilities_prop === incoming_capabilities_prop)) {
914
+ return false;
915
+ }
916
+ });
917
+ if (equals_capabilities_props === false) {
918
+ return false;
919
+ }
920
+ }
921
+ const existing_definition = existing.definition;
922
+ const incoming_definition = incoming.definition;
923
+ if (!(existing_definition.__ref === incoming_definition.__ref)) {
924
+ return false;
925
+ }
926
+ const existing_lastRunErrorCode = existing.lastRunErrorCode;
927
+ const incoming_lastRunErrorCode = incoming.lastRunErrorCode;
928
+ // if at least one of these optionals is defined
929
+ if (existing_lastRunErrorCode !== undefined || incoming_lastRunErrorCode !== undefined) {
930
+ // if one of these is not defined we know the other is defined and therefore
931
+ // not equal
932
+ if (existing_lastRunErrorCode === undefined || incoming_lastRunErrorCode === undefined) {
933
+ return false;
934
+ }
935
+ if (!(equals$7(existing_lastRunErrorCode, incoming_lastRunErrorCode))) {
936
+ return false;
937
+ }
938
+ }
939
+ const existing_schedule = existing.schedule;
940
+ const incoming_schedule = incoming.schedule;
941
+ // if at least one of these optionals is defined
942
+ if (existing_schedule !== undefined || incoming_schedule !== undefined) {
943
+ // if one of these is not defined we know the other is defined and therefore
944
+ // not equal
945
+ if (existing_schedule === undefined || incoming_schedule === undefined) {
946
+ return false;
947
+ }
948
+ if (!(equals$6(existing_schedule, incoming_schedule))) {
949
+ return false;
950
+ }
951
+ }
952
+ const existing_tags = existing.tags;
953
+ const incoming_tags = incoming.tags;
954
+ // if at least one of these optionals is defined
955
+ if (existing_tags !== undefined || incoming_tags !== undefined) {
956
+ // if one of these is not defined we know the other is defined and therefore
957
+ // not equal
958
+ if (existing_tags === undefined || incoming_tags === undefined) {
959
+ return false;
960
+ }
961
+ const equals_tags_props = equalsObject(existing_tags, incoming_tags, (existing_tags_prop, incoming_tags_prop) => {
962
+ if (!(existing_tags_prop === incoming_tags_prop)) {
963
+ return false;
964
+ }
965
+ });
966
+ if (equals_tags_props === false) {
967
+ return false;
968
+ }
969
+ }
970
+ return true;
971
+ }
972
+ const ingest$2 = function DataTransformRepresentationIngest(input, path, luvio, store, timestamp) {
973
+ if (process.env.NODE_ENV !== 'production') {
974
+ const validateError = validate$4(input);
975
+ if (validateError !== null) {
976
+ throw validateError;
977
+ }
978
+ }
979
+ const key = keyBuilderFromType$2(luvio, input);
980
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
981
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "data-transform", VERSION$3, RepresentationType$3, equals$4);
982
+ return createLink(key);
983
+ };
984
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
985
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
986
+ const rootKey = keyBuilderFromType$2(luvio, input);
987
+ rootKeySet.set(rootKey, {
988
+ namespace: keyPrefix,
989
+ representationName: RepresentationType$2,
990
+ mergeable: false
991
+ });
992
+ getTypeCacheKeys$3(rootKeySet, luvio, input.definition, () => rootKey + "__" + "definition");
993
+ }
994
+
995
+ var DiscriminatorValues;
996
+ (function (DiscriminatorValues) {
997
+ DiscriminatorValues["type"] = "type";
998
+ })(DiscriminatorValues || (DiscriminatorValues = {}));
999
+ const VERSION$2 = "e45ed0cf1759f7e1fe67049f806edc26";
1000
+ function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
1001
+ const v_error = (() => {
1002
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1003
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1004
+ }
1005
+ if (obj.createdBy !== undefined) {
1006
+ const obj_createdBy = obj.createdBy;
1007
+ const path_createdBy = path + '.createdBy';
1008
+ const referencepath_createdByValidationError = validate$9(obj_createdBy, path_createdBy);
1009
+ if (referencepath_createdByValidationError !== null) {
1010
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
1011
+ message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1012
+ return new TypeError(message);
1013
+ }
1014
+ }
1015
+ if (obj.createdDate !== undefined) {
1016
+ const obj_createdDate = obj.createdDate;
1017
+ const path_createdDate = path + '.createdDate';
1018
+ if (typeof obj_createdDate !== 'string') {
1019
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1020
+ }
1021
+ }
1022
+ const obj_id = obj.id;
1023
+ const path_id = path + '.id';
1024
+ if (typeof obj_id !== 'string') {
1025
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1026
+ }
1027
+ if (obj.label !== undefined) {
1028
+ const obj_label = obj.label;
1029
+ const path_label = path + '.label';
1030
+ if (typeof obj_label !== 'string') {
1031
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1032
+ }
1033
+ }
1034
+ if (obj.lastModifiedBy !== undefined) {
1035
+ const obj_lastModifiedBy = obj.lastModifiedBy;
1036
+ const path_lastModifiedBy = path + '.lastModifiedBy';
1037
+ const referencepath_lastModifiedByValidationError = validate$9(obj_lastModifiedBy, path_lastModifiedBy);
1038
+ if (referencepath_lastModifiedByValidationError !== null) {
1039
+ let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
1040
+ message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1041
+ return new TypeError(message);
1042
+ }
1043
+ }
1044
+ if (obj.lastModifiedDate !== undefined) {
1045
+ const obj_lastModifiedDate = obj.lastModifiedDate;
1046
+ const path_lastModifiedDate = path + '.lastModifiedDate';
1047
+ if (typeof obj_lastModifiedDate !== 'string') {
1048
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
1049
+ }
1050
+ }
1051
+ const obj_name = obj.name;
1052
+ const path_name = path + '.name';
1053
+ if (typeof obj_name !== 'string') {
1054
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1055
+ }
1056
+ if (obj.namespace !== undefined) {
1057
+ const obj_namespace = obj.namespace;
1058
+ const path_namespace = path + '.namespace';
1059
+ if (typeof obj_namespace !== 'string') {
1060
+ return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
1061
+ }
1062
+ }
1063
+ if (obj.url !== undefined) {
1064
+ const obj_url = obj.url;
1065
+ const path_url = path + '.url';
1066
+ if (typeof obj_url !== 'string') {
1067
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
1068
+ }
1069
+ }
1070
+ })();
1071
+ return v_error === undefined ? null : v_error;
1072
+ }
1073
+ const RepresentationType$2 = 'CdpAssetBaseRepresentation';
1074
+ function keyBuilder$5(luvio, config) {
1075
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.name;
1076
+ }
1077
+ function keyBuilderFromType$1(luvio, object) {
1078
+ const keyParams = {
1079
+ name: object.name
1080
+ };
1081
+ return keyBuilder$5(luvio, keyParams);
1082
+ }
1083
+ const select$6 = function CdpAssetBaseRepresentationSelect() {
1084
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$c();
1085
+ return {
1086
+ kind: 'Fragment',
1087
+ version: VERSION$2,
1088
+ private: [],
1089
+ selections: [
1090
+ {
1091
+ name: 'createdBy',
1092
+ kind: 'Object',
1093
+ selections: CdpUserRepresentation__selections,
1094
+ required: false
1095
+ },
1096
+ {
1097
+ name: 'createdDate',
1098
+ kind: 'Scalar',
1099
+ required: false
1100
+ },
1101
+ {
1102
+ name: 'id',
1103
+ kind: 'Scalar'
1104
+ },
1105
+ {
1106
+ name: 'label',
1107
+ kind: 'Scalar',
1108
+ required: false
1109
+ },
1110
+ {
1111
+ name: 'lastModifiedBy',
1112
+ kind: 'Object',
1113
+ selections: CdpUserRepresentation__selections,
1114
+ required: false
1115
+ },
1116
+ {
1117
+ name: 'lastModifiedDate',
1118
+ kind: 'Scalar',
1119
+ required: false
1120
+ },
1121
+ {
1122
+ name: 'name',
1123
+ kind: 'Scalar'
1124
+ },
1125
+ {
1126
+ name: 'namespace',
1127
+ kind: 'Scalar',
1128
+ required: false
1129
+ },
1130
+ {
1131
+ name: 'url',
1132
+ kind: 'Scalar',
1133
+ required: false
1134
+ }
1135
+ ]
1136
+ };
1137
+ };
1138
+ function equals$3(existing, incoming) {
1139
+ const existing_createdDate = existing.createdDate;
1140
+ const incoming_createdDate = incoming.createdDate;
1141
+ // if at least one of these optionals is defined
1142
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
1143
+ // if one of these is not defined we know the other is defined and therefore
1144
+ // not equal
1145
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
1146
+ return false;
1147
+ }
1148
+ if (!(existing_createdDate === incoming_createdDate)) {
1149
+ return false;
1150
+ }
1151
+ }
1152
+ const existing_id = existing.id;
1153
+ const incoming_id = incoming.id;
1154
+ if (!(existing_id === incoming_id)) {
1155
+ return false;
1156
+ }
1157
+ const existing_label = existing.label;
1158
+ const incoming_label = incoming.label;
1159
+ // if at least one of these optionals is defined
1160
+ if (existing_label !== undefined || incoming_label !== undefined) {
1161
+ // if one of these is not defined we know the other is defined and therefore
1162
+ // not equal
1163
+ if (existing_label === undefined || incoming_label === undefined) {
1164
+ return false;
1165
+ }
1166
+ if (!(existing_label === incoming_label)) {
1167
+ return false;
1168
+ }
1169
+ }
1170
+ const existing_lastModifiedDate = existing.lastModifiedDate;
1171
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
1172
+ // if at least one of these optionals is defined
1173
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
1174
+ // if one of these is not defined we know the other is defined and therefore
1175
+ // not equal
1176
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
1177
+ return false;
1178
+ }
1179
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
1180
+ return false;
1181
+ }
1182
+ }
1183
+ const existing_name = existing.name;
1184
+ const incoming_name = incoming.name;
1185
+ if (!(existing_name === incoming_name)) {
1186
+ return false;
1187
+ }
1188
+ const existing_namespace = existing.namespace;
1189
+ const incoming_namespace = incoming.namespace;
1190
+ // if at least one of these optionals is defined
1191
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
1192
+ // if one of these is not defined we know the other is defined and therefore
1193
+ // not equal
1194
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
1195
+ return false;
1196
+ }
1197
+ if (!(existing_namespace === incoming_namespace)) {
1198
+ return false;
1199
+ }
1200
+ }
1201
+ const existing_url = existing.url;
1202
+ const incoming_url = incoming.url;
1203
+ // if at least one of these optionals is defined
1204
+ if (existing_url !== undefined || incoming_url !== undefined) {
1205
+ // if one of these is not defined we know the other is defined and therefore
1206
+ // not equal
1207
+ if (existing_url === undefined || incoming_url === undefined) {
1208
+ return false;
1209
+ }
1210
+ if (!(existing_url === incoming_url)) {
1211
+ return false;
1212
+ }
1213
+ }
1214
+ const existing_createdBy = existing.createdBy;
1215
+ const incoming_createdBy = incoming.createdBy;
1216
+ // if at least one of these optionals is defined
1217
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
1218
+ // if one of these is not defined we know the other is defined and therefore
1219
+ // not equal
1220
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
1221
+ return false;
1222
+ }
1223
+ if (!(equals$9(existing_createdBy, incoming_createdBy))) {
1224
+ return false;
1225
+ }
1226
+ }
1227
+ const existing_lastModifiedBy = existing.lastModifiedBy;
1228
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
1229
+ // if at least one of these optionals is defined
1230
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
1231
+ // if one of these is not defined we know the other is defined and therefore
1232
+ // not equal
1233
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
1234
+ return false;
1235
+ }
1236
+ if (!(equals$9(existing_lastModifiedBy, incoming_lastModifiedBy))) {
1237
+ return false;
1238
+ }
1239
+ }
1240
+ return true;
1241
+ }
1242
+
1243
+ function validate$2(obj, path = 'DataObjectFieldRepresentation') {
1244
+ const v_error = (() => {
1245
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1246
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1247
+ }
1248
+ const obj_isPrimaryKey = obj.isPrimaryKey;
1249
+ const path_isPrimaryKey = path + '.isPrimaryKey';
1250
+ if (typeof obj_isPrimaryKey !== 'boolean') {
1251
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPrimaryKey + '" (at "' + path_isPrimaryKey + '")');
1252
+ }
1253
+ if (obj.keyQualifierField !== undefined) {
1254
+ const obj_keyQualifierField = obj.keyQualifierField;
1255
+ const path_keyQualifierField = path + '.keyQualifierField';
1256
+ if (typeof obj_keyQualifierField !== 'string') {
1257
+ return new TypeError('Expected "string" but received "' + typeof obj_keyQualifierField + '" (at "' + path_keyQualifierField + '")');
1258
+ }
1259
+ }
1260
+ const obj_label = obj.label;
1261
+ const path_label = path + '.label';
1262
+ if (typeof obj_label !== 'string') {
1263
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1264
+ }
1265
+ const obj_name = obj.name;
1266
+ const path_name = path + '.name';
1267
+ if (typeof obj_name !== 'string') {
1268
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1269
+ }
1270
+ const obj_type = obj.type;
1271
+ const path_type = path + '.type';
1272
+ if (typeof obj_type !== 'string') {
1273
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1274
+ }
1275
+ })();
1276
+ return v_error === undefined ? null : v_error;
1277
+ }
1278
+ function equals$2(existing, incoming) {
1279
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1280
+ return false;
1281
+ }
1282
+ return true;
1283
+ }
1284
+
1285
+ const VERSION$1 = "8242b57b93fc99780862de37f9209bc2";
1286
+ function validate$1(obj, path = 'DataObjectRepresentation') {
1287
+ const validateCdpAssetBaseRepresentation_validateError = validate$3(obj, path);
1288
+ if (validateCdpAssetBaseRepresentation_validateError !== null) {
1289
+ return validateCdpAssetBaseRepresentation_validateError;
1290
+ }
1291
+ const v_error = (() => {
1292
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1293
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1294
+ }
1295
+ if (obj.category !== undefined) {
1296
+ const obj_category = obj.category;
1297
+ const path_category = path + '.category';
1298
+ if (typeof obj_category !== 'string') {
1299
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
1300
+ }
1301
+ }
1302
+ if (obj.eventDateTimeFieldName !== undefined) {
1303
+ const obj_eventDateTimeFieldName = obj.eventDateTimeFieldName;
1304
+ const path_eventDateTimeFieldName = path + '.eventDateTimeFieldName';
1305
+ if (typeof obj_eventDateTimeFieldName !== 'string') {
1306
+ return new TypeError('Expected "string" but received "' + typeof obj_eventDateTimeFieldName + '" (at "' + path_eventDateTimeFieldName + '")');
1307
+ }
1308
+ }
1309
+ if (obj.fields !== undefined) {
1310
+ const obj_fields = obj.fields;
1311
+ const path_fields = path + '.fields';
1312
+ if (!ArrayIsArray(obj_fields)) {
1313
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
1314
+ }
1315
+ for (let i = 0; i < obj_fields.length; i++) {
1316
+ const obj_fields_item = obj_fields[i];
1317
+ const path_fields_item = path_fields + '[' + i + ']';
1318
+ const referencepath_fields_itemValidationError = validate$2(obj_fields_item, path_fields_item);
1319
+ if (referencepath_fields_itemValidationError !== null) {
1320
+ let message = 'Object doesn\'t match DataObjectFieldRepresentation (at "' + path_fields_item + '")\n';
1321
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1322
+ return new TypeError(message);
1323
+ }
1324
+ }
1325
+ }
1326
+ if (obj.recordModifiedFieldName !== undefined) {
1327
+ const obj_recordModifiedFieldName = obj.recordModifiedFieldName;
1328
+ const path_recordModifiedFieldName = path + '.recordModifiedFieldName';
1329
+ if (typeof obj_recordModifiedFieldName !== 'string') {
1330
+ return new TypeError('Expected "string" but received "' + typeof obj_recordModifiedFieldName + '" (at "' + path_recordModifiedFieldName + '")');
1331
+ }
1332
+ }
1333
+ if (obj.type !== undefined) {
1334
+ const obj_type = obj.type;
1335
+ const path_type = path + '.type';
1336
+ if (typeof obj_type !== 'string') {
1337
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1338
+ }
1339
+ }
1340
+ })();
1341
+ return v_error === undefined ? null : v_error;
1342
+ }
1343
+ const RepresentationType$1 = 'DataObjectRepresentation';
1344
+ function keyBuilderFromType(luvio, object) {
1345
+ return keyBuilderFromType$1(luvio, object);
1346
+ }
1347
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1348
+ return input;
1349
+ }
1350
+ const select$5 = function DataObjectRepresentationSelect() {
1351
+ return {
1352
+ kind: 'Fragment',
1353
+ version: VERSION$1,
1354
+ private: [],
1355
+ opaque: true
1356
+ };
1357
+ };
1358
+ function equals$1(existing, incoming) {
1359
+ if (equals$3(existing, incoming) === false) {
1360
+ return false;
1361
+ }
1362
+ const existing_category = existing.category;
1363
+ const incoming_category = incoming.category;
1364
+ // if at least one of these optionals is defined
1365
+ if (existing_category !== undefined || incoming_category !== undefined) {
1366
+ // if one of these is not defined we know the other is defined and therefore
1367
+ // not equal
1368
+ if (existing_category === undefined || incoming_category === undefined) {
1369
+ return false;
1370
+ }
1371
+ if (!(existing_category === incoming_category)) {
1372
+ return false;
1373
+ }
1374
+ }
1375
+ const existing_eventDateTimeFieldName = existing.eventDateTimeFieldName;
1376
+ const incoming_eventDateTimeFieldName = incoming.eventDateTimeFieldName;
1377
+ // if at least one of these optionals is defined
1378
+ if (existing_eventDateTimeFieldName !== undefined || incoming_eventDateTimeFieldName !== undefined) {
1379
+ // if one of these is not defined we know the other is defined and therefore
1380
+ // not equal
1381
+ if (existing_eventDateTimeFieldName === undefined || incoming_eventDateTimeFieldName === undefined) {
1382
+ return false;
1383
+ }
1384
+ if (!(existing_eventDateTimeFieldName === incoming_eventDateTimeFieldName)) {
1385
+ return false;
1386
+ }
1387
+ }
1388
+ const existing_recordModifiedFieldName = existing.recordModifiedFieldName;
1389
+ const incoming_recordModifiedFieldName = incoming.recordModifiedFieldName;
1390
+ // if at least one of these optionals is defined
1391
+ if (existing_recordModifiedFieldName !== undefined || incoming_recordModifiedFieldName !== undefined) {
1392
+ // if one of these is not defined we know the other is defined and therefore
1393
+ // not equal
1394
+ if (existing_recordModifiedFieldName === undefined || incoming_recordModifiedFieldName === undefined) {
1395
+ return false;
1396
+ }
1397
+ if (!(existing_recordModifiedFieldName === incoming_recordModifiedFieldName)) {
1398
+ return false;
1399
+ }
1400
+ }
1401
+ const existing_type = existing.type;
1402
+ const incoming_type = incoming.type;
1403
+ // if at least one of these optionals is defined
1404
+ if (existing_type !== undefined || incoming_type !== undefined) {
1405
+ // if one of these is not defined we know the other is defined and therefore
1406
+ // not equal
1407
+ if (existing_type === undefined || incoming_type === undefined) {
1408
+ return false;
1409
+ }
1410
+ if (!(existing_type === incoming_type)) {
1411
+ return false;
1412
+ }
1413
+ }
1414
+ const existing_fields = existing.fields;
1415
+ const incoming_fields = incoming.fields;
1416
+ // if at least one of these optionals is defined
1417
+ if (existing_fields !== undefined || incoming_fields !== undefined) {
1418
+ // if one of these is not defined we know the other is defined and therefore
1419
+ // not equal
1420
+ if (existing_fields === undefined || incoming_fields === undefined) {
1421
+ return false;
1422
+ }
1423
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
1424
+ if (!(equals$2(existing_fields_item, incoming_fields_item))) {
1425
+ return false;
1426
+ }
1427
+ });
1428
+ if (equals_fields_items === false) {
1429
+ return false;
1430
+ }
1431
+ }
1432
+ return true;
1433
+ }
1434
+ const ingest$1 = function DataObjectRepresentationIngest(input, path, luvio, store, timestamp) {
1435
+ if (process.env.NODE_ENV !== 'production') {
1436
+ const validateError = validate$1(input);
1437
+ if (validateError !== null) {
1438
+ throw validateError;
1439
+ }
1440
+ }
1441
+ const key = keyBuilderFromType(luvio, input);
1442
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1443
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "data-transform", VERSION$1, RepresentationType$1, equals$1);
1444
+ return createLink(key);
1445
+ };
1446
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1447
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1448
+ const rootKey = keyBuilderFromType(luvio, input);
1449
+ rootKeySet.set(rootKey, {
1450
+ namespace: keyPrefix,
1451
+ representationName: RepresentationType$2,
1452
+ mergeable: false
1453
+ });
1454
+ }
1455
+
1456
+ const VERSION = "21a4cd3206473ce28645099a11735bc6";
1457
+ function validate(obj, path = 'DataTransformValidationRepresentation') {
1458
+ const v_error = (() => {
1459
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1460
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1461
+ }
1462
+ if (obj.issues !== undefined) {
1463
+ const obj_issues = obj.issues;
1464
+ const path_issues = path + '.issues';
1465
+ if (!ArrayIsArray(obj_issues)) {
1466
+ return new TypeError('Expected "array" but received "' + typeof obj_issues + '" (at "' + path_issues + '")');
1467
+ }
1468
+ for (let i = 0; i < obj_issues.length; i++) {
1469
+ const obj_issues_item = obj_issues[i];
1470
+ const path_issues_item = path_issues + '[' + i + ']';
1471
+ const referencepath_issues_itemValidationError = validate$a(obj_issues_item, path_issues_item);
1472
+ if (referencepath_issues_itemValidationError !== null) {
1473
+ let message = 'Object doesn\'t match TransformValidationIssueRepresentation (at "' + path_issues_item + '")\n';
1474
+ message += referencepath_issues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1475
+ return new TypeError(message);
1476
+ }
1477
+ }
1478
+ }
1479
+ if (obj.outputDataObjects !== undefined) {
1480
+ const obj_outputDataObjects = obj.outputDataObjects;
1481
+ const path_outputDataObjects = path + '.outputDataObjects';
1482
+ if (!ArrayIsArray(obj_outputDataObjects)) {
1483
+ return new TypeError('Expected "array" but received "' + typeof obj_outputDataObjects + '" (at "' + path_outputDataObjects + '")');
1484
+ }
1485
+ for (let i = 0; i < obj_outputDataObjects.length; i++) {
1486
+ const obj_outputDataObjects_item = obj_outputDataObjects[i];
1487
+ const path_outputDataObjects_item = path_outputDataObjects + '[' + i + ']';
1488
+ const referencepath_outputDataObjects_itemValidationError = validate$1(obj_outputDataObjects_item, path_outputDataObjects_item);
1489
+ if (referencepath_outputDataObjects_itemValidationError !== null) {
1490
+ let message = 'Object doesn\'t match DataObjectRepresentation (at "' + path_outputDataObjects_item + '")\n';
1491
+ message += referencepath_outputDataObjects_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1492
+ return new TypeError(message);
1493
+ }
1494
+ }
1495
+ }
1496
+ })();
1497
+ return v_error === undefined ? null : v_error;
1498
+ }
1499
+ const RepresentationType = 'DataTransformValidationRepresentation';
1500
+ function normalize(input, existing, path, luvio, store, timestamp) {
1501
+ return input;
1502
+ }
1503
+ const select$4 = function DataTransformValidationRepresentationSelect() {
1504
+ return {
1505
+ kind: 'Fragment',
1506
+ version: VERSION,
1507
+ private: [],
1508
+ opaque: true
1509
+ };
1510
+ };
1511
+ function equals(existing, incoming) {
1512
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1513
+ return false;
1514
+ }
1515
+ return true;
1516
+ }
1517
+ const ingest = function DataTransformValidationRepresentationIngest(input, path, luvio, store, timestamp) {
1518
+ if (process.env.NODE_ENV !== 'production') {
1519
+ const validateError = validate(input);
1520
+ if (validateError !== null) {
1521
+ throw validateError;
1522
+ }
1523
+ }
1524
+ const key = path.fullPath;
1525
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1526
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "data-transform", VERSION, RepresentationType, equals);
1527
+ return createLink(key);
1528
+ };
1529
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1530
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1531
+ const rootKey = fullPathFactory();
1532
+ rootKeySet.set(rootKey, {
1533
+ namespace: keyPrefix,
1534
+ representationName: RepresentationType,
1535
+ mergeable: false
1536
+ });
1537
+ }
1538
+
1539
+ function select$3(luvio, params) {
1540
+ return select$4();
1541
+ }
1542
+ function keyBuilder$4(luvio, params) {
1543
+ return keyPrefix + '::DataTransformValidationRepresentation:(' + stableJSONStringify(params.body.capabilities) + '::' + 'creationType:' + params.body.creationType + '::' + (params.body.currencyIsoCode === undefined ? 'currencyIsoCode' : 'currencyIsoCode:' + params.body.currencyIsoCode) + '::' + (params.body.dataSpaceName === undefined ? 'dataSpaceName' : 'dataSpaceName:' + params.body.dataSpaceName) + '::' + stableJSONStringify(params.body.definition) + '::' + (params.body.description === undefined ? 'description' : 'description:' + params.body.description) + '::' + (params.body.label === undefined ? 'label' : 'label:' + params.body.label) + '::' + (params.body.name === undefined ? 'name' : 'name:' + params.body.name) + '::' + (params.body.primarySource === undefined ? 'primarySource' : 'primarySource:' + params.body.primarySource) + '::' + stableJSONStringify(params.body.tags) + '::' + 'type:' + params.body.type + ')';
1544
+ }
1545
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1546
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
1547
+ }
1548
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
1549
+ const { body } = response;
1550
+ const key = keyBuilder$4(luvio, resourceParams);
1551
+ luvio.storeIngest(key, ingest, body);
1552
+ const snapshot = luvio.storeLookup({
1553
+ recordId: key,
1554
+ node: select$3(),
1555
+ variables: {},
1556
+ }, snapshotRefresh);
1557
+ if (process.env.NODE_ENV !== 'production') {
1558
+ if (snapshot.state !== 'Fulfilled') {
1559
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1560
+ }
1561
+ }
1562
+ deepFreeze(snapshot.data);
1563
+ return snapshot;
1564
+ }
1565
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1566
+ const key = keyBuilder$4(luvio, params);
1567
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1568
+ luvio.storeIngestError(key, errorSnapshot);
1569
+ return errorSnapshot;
1570
+ }
1571
+ function createResourceRequest$4(config) {
1572
+ const headers = {};
1573
+ return {
1574
+ baseUri: '/services/data/v66.0',
1575
+ basePath: '/ssot/data-transforms-validation',
1576
+ method: 'post',
1577
+ body: config.body,
1578
+ urlParams: {},
1579
+ queryParams: {},
1580
+ headers,
1581
+ priority: 'normal',
1582
+ };
1583
+ }
1584
+
1585
+ const adapterName$4 = 'validateDataTransforms';
1586
+ const validateDataTransforms_ConfigPropertyMetadata = [
1587
+ generateParamConfigMetadata('capabilities', false, 2 /* Body */, 4 /* Unsupported */),
1588
+ generateParamConfigMetadata('creationType', true, 2 /* Body */, 0 /* String */),
1589
+ generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
1590
+ generateParamConfigMetadata('dataSpaceName', false, 2 /* Body */, 0 /* String */),
1591
+ generateParamConfigMetadata('definition', true, 2 /* Body */, 4 /* Unsupported */),
1592
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1593
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1594
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
1595
+ generateParamConfigMetadata('primarySource', false, 2 /* Body */, 0 /* String */),
1596
+ generateParamConfigMetadata('tags', false, 2 /* Body */, 4 /* Unsupported */),
1597
+ generateParamConfigMetadata('type', true, 2 /* Body */, 0 /* String */),
1598
+ ];
1599
+ const validateDataTransforms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, validateDataTransforms_ConfigPropertyMetadata);
1600
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(validateDataTransforms_ConfigPropertyMetadata);
1601
+ function keyBuilder$3(luvio, config) {
1602
+ const resourceParams = createResourceParams$4(config);
1603
+ return keyBuilder$4(luvio, resourceParams);
1604
+ }
1605
+ function typeCheckConfig$4(untrustedConfig) {
1606
+ const config = {};
1607
+ typeCheckConfig$5(untrustedConfig, config, validateDataTransforms_ConfigPropertyMetadata);
1608
+ const untrustedConfig_capabilities = untrustedConfig.capabilities;
1609
+ if (untrustedIsObject(untrustedConfig_capabilities)) {
1610
+ const untrustedConfig_capabilities_object = {};
1611
+ const untrustedConfig_capabilities_keys = Object.keys(untrustedConfig_capabilities);
1612
+ for (let i = 0, arrayLength = untrustedConfig_capabilities_keys.length; i < arrayLength; i++) {
1613
+ const key = untrustedConfig_capabilities_keys[i];
1614
+ const untrustedConfig_capabilities_prop = untrustedConfig_capabilities[key];
1615
+ if (typeof untrustedConfig_capabilities_prop === 'boolean') {
1616
+ if (untrustedConfig_capabilities_object !== undefined) {
1617
+ untrustedConfig_capabilities_object[key] = untrustedConfig_capabilities_prop;
1618
+ }
1619
+ }
1620
+ }
1621
+ if (untrustedConfig_capabilities_object !== undefined && Object.keys(untrustedConfig_capabilities_object).length >= 0) {
1622
+ config.capabilities = untrustedConfig_capabilities_object;
1623
+ }
1624
+ }
1625
+ const untrustedConfig_definition = untrustedConfig.definition;
1626
+ if (untrustedIsObject(untrustedConfig_definition)) {
1627
+ const untrustedConfig_definition_object = {};
1628
+ const untrustedConfig_definition_keys = Object.keys(untrustedConfig_definition);
1629
+ for (let i = 0, arrayLength = untrustedConfig_definition_keys.length; i < arrayLength; i++) {
1630
+ const key = untrustedConfig_definition_keys[i];
1631
+ const untrustedConfig_definition_prop = untrustedConfig_definition[key];
1632
+ if (untrustedConfig_definition_object !== undefined) {
1633
+ untrustedConfig_definition_object[key] = untrustedConfig_definition_prop;
1634
+ }
1635
+ }
1636
+ if (untrustedConfig_definition_object !== undefined && Object.keys(untrustedConfig_definition_object).length >= 0) {
1637
+ config.definition = untrustedConfig_definition_object;
1638
+ }
1639
+ }
1640
+ const untrustedConfig_tags = untrustedConfig.tags;
1641
+ if (untrustedIsObject(untrustedConfig_tags)) {
1642
+ const untrustedConfig_tags_object = {};
1643
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
1644
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
1645
+ const key = untrustedConfig_tags_keys[i];
1646
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
1647
+ if (typeof untrustedConfig_tags_prop === 'string') {
1648
+ if (untrustedConfig_tags_object !== undefined) {
1649
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
1650
+ }
1651
+ }
1652
+ }
1653
+ if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
1654
+ config.tags = untrustedConfig_tags_object;
1655
+ }
1656
+ }
1657
+ return config;
1658
+ }
1659
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1660
+ if (!untrustedIsObject(untrustedConfig)) {
1661
+ return null;
1662
+ }
1663
+ if (process.env.NODE_ENV !== 'production') {
1664
+ validateConfig(untrustedConfig, configPropertyNames);
1665
+ }
1666
+ const config = typeCheckConfig$4(untrustedConfig);
1667
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1668
+ return null;
1669
+ }
1670
+ return config;
1671
+ }
1672
+ function adapterFragment$1(luvio, config) {
1673
+ createResourceParams$4(config);
1674
+ return select$3();
1675
+ }
1676
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1677
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
1678
+ config,
1679
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1680
+ });
1681
+ return luvio.storeBroadcast().then(() => snapshot);
1682
+ }
1683
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1684
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1685
+ config,
1686
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1687
+ });
1688
+ return luvio.storeBroadcast().then(() => snapshot);
1689
+ }
1690
+ function buildNetworkSnapshot$4(luvio, config, options) {
1691
+ const resourceParams = createResourceParams$4(config);
1692
+ const request = createResourceRequest$4(resourceParams);
1693
+ return luvio.dispatchResourceRequest(request, options)
1694
+ .then((response) => {
1695
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1696
+ const cache = new StoreKeyMap();
1697
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1698
+ return cache;
1699
+ });
1700
+ }, (response) => {
1701
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1702
+ });
1703
+ }
1704
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1705
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, 'get', false);
1706
+ }
1707
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1708
+ const { luvio, config } = context;
1709
+ const selector = {
1710
+ recordId: keyBuilder$3(luvio, config),
1711
+ node: adapterFragment$1(luvio, config),
1712
+ variables: {},
1713
+ };
1714
+ const cacheSnapshot = storeLookup(selector, {
1715
+ config,
1716
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1717
+ });
1718
+ return cacheSnapshot;
1719
+ }
1720
+ const validateDataTransformsAdapterFactory = (luvio) => function dataTransform__validateDataTransforms(untrustedConfig, requestContext) {
1721
+ const config = validateAdapterConfig$4(untrustedConfig, validateDataTransforms_ConfigPropertyNames);
1722
+ // Invalid or incomplete config
1723
+ if (config === null) {
1724
+ return null;
1725
+ }
1726
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1727
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1728
+ };
1729
+
1730
+ function select$2(luvio, params) {
1731
+ return select$7();
1732
+ }
1733
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1734
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1735
+ }
1736
+ function ingestSuccess$2(luvio, resourceParams, response) {
1737
+ const { body } = response;
1738
+ const key = keyBuilderFromType$2(luvio, body);
1739
+ luvio.storeIngest(key, ingest$2, body);
1740
+ const snapshot = luvio.storeLookup({
1741
+ recordId: key,
1742
+ node: select$2(),
1743
+ variables: {},
1744
+ });
1745
+ if (process.env.NODE_ENV !== 'production') {
1746
+ if (snapshot.state !== 'Fulfilled') {
1747
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1748
+ }
1749
+ }
1750
+ deepFreeze(snapshot.data);
1751
+ return snapshot;
1752
+ }
1753
+ function createResourceRequest$3(config) {
1754
+ const headers = {};
1755
+ return {
1756
+ baseUri: '/services/data/v66.0',
1757
+ basePath: '/ssot/data-transforms',
1758
+ method: 'post',
1759
+ body: config.body,
1760
+ urlParams: {},
1761
+ queryParams: config.queryParams,
1762
+ headers,
1763
+ priority: 'normal',
1764
+ };
1765
+ }
1766
+
1767
+ const adapterName$3 = 'createDataTransform';
1768
+ const createDataTransform_ConfigPropertyMetadata = [
1769
+ generateParamConfigMetadata('filterGroup', false, 1 /* QueryParameter */, 0 /* String */),
1770
+ generateParamConfigMetadata('capabilities', false, 2 /* Body */, 4 /* Unsupported */),
1771
+ generateParamConfigMetadata('creationType', true, 2 /* Body */, 0 /* String */),
1772
+ generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
1773
+ generateParamConfigMetadata('dataSpaceName', false, 2 /* Body */, 0 /* String */),
1774
+ generateParamConfigMetadata('definition', true, 2 /* Body */, 4 /* Unsupported */),
1775
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1776
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1777
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
1778
+ generateParamConfigMetadata('primarySource', false, 2 /* Body */, 0 /* String */),
1779
+ generateParamConfigMetadata('tags', false, 2 /* Body */, 4 /* Unsupported */),
1780
+ generateParamConfigMetadata('type', true, 2 /* Body */, 0 /* String */),
1781
+ ];
1782
+ const createDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createDataTransform_ConfigPropertyMetadata);
1783
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(createDataTransform_ConfigPropertyMetadata);
1784
+ function typeCheckConfig$3(untrustedConfig) {
1785
+ const config = {};
1786
+ typeCheckConfig$5(untrustedConfig, config, createDataTransform_ConfigPropertyMetadata);
1787
+ const untrustedConfig_capabilities = untrustedConfig.capabilities;
1788
+ if (untrustedIsObject(untrustedConfig_capabilities)) {
1789
+ const untrustedConfig_capabilities_object = {};
1790
+ const untrustedConfig_capabilities_keys = Object.keys(untrustedConfig_capabilities);
1791
+ for (let i = 0, arrayLength = untrustedConfig_capabilities_keys.length; i < arrayLength; i++) {
1792
+ const key = untrustedConfig_capabilities_keys[i];
1793
+ const untrustedConfig_capabilities_prop = untrustedConfig_capabilities[key];
1794
+ if (typeof untrustedConfig_capabilities_prop === 'boolean') {
1795
+ if (untrustedConfig_capabilities_object !== undefined) {
1796
+ untrustedConfig_capabilities_object[key] = untrustedConfig_capabilities_prop;
1797
+ }
1798
+ }
1799
+ }
1800
+ if (untrustedConfig_capabilities_object !== undefined && Object.keys(untrustedConfig_capabilities_object).length >= 0) {
1801
+ config.capabilities = untrustedConfig_capabilities_object;
1802
+ }
1803
+ }
1804
+ const untrustedConfig_definition = untrustedConfig.definition;
1805
+ if (untrustedIsObject(untrustedConfig_definition)) {
1806
+ const untrustedConfig_definition_object = {};
1807
+ const untrustedConfig_definition_keys = Object.keys(untrustedConfig_definition);
1808
+ for (let i = 0, arrayLength = untrustedConfig_definition_keys.length; i < arrayLength; i++) {
1809
+ const key = untrustedConfig_definition_keys[i];
1810
+ const untrustedConfig_definition_prop = untrustedConfig_definition[key];
1811
+ if (untrustedConfig_definition_object !== undefined) {
1812
+ untrustedConfig_definition_object[key] = untrustedConfig_definition_prop;
1813
+ }
1814
+ }
1815
+ if (untrustedConfig_definition_object !== undefined && Object.keys(untrustedConfig_definition_object).length >= 0) {
1816
+ config.definition = untrustedConfig_definition_object;
1817
+ }
1818
+ }
1819
+ const untrustedConfig_tags = untrustedConfig.tags;
1820
+ if (untrustedIsObject(untrustedConfig_tags)) {
1821
+ const untrustedConfig_tags_object = {};
1822
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
1823
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
1824
+ const key = untrustedConfig_tags_keys[i];
1825
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
1826
+ if (typeof untrustedConfig_tags_prop === 'string') {
1827
+ if (untrustedConfig_tags_object !== undefined) {
1828
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
1829
+ }
1830
+ }
1831
+ }
1832
+ if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
1833
+ config.tags = untrustedConfig_tags_object;
1834
+ }
1835
+ }
1836
+ return config;
1837
+ }
1838
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1839
+ if (!untrustedIsObject(untrustedConfig)) {
1840
+ return null;
1841
+ }
1842
+ if (process.env.NODE_ENV !== 'production') {
1843
+ validateConfig(untrustedConfig, configPropertyNames);
1844
+ }
1845
+ const config = typeCheckConfig$3(untrustedConfig);
1846
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1847
+ return null;
1848
+ }
1849
+ return config;
1850
+ }
1851
+ function buildNetworkSnapshot$3(luvio, config, options) {
1852
+ const resourceParams = createResourceParams$3(config);
1853
+ const request = createResourceRequest$3(resourceParams);
1854
+ return luvio.dispatchResourceRequest(request, options)
1855
+ .then((response) => {
1856
+ return luvio.handleSuccessResponse(() => {
1857
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1858
+ return luvio.storeBroadcast().then(() => snapshot);
1859
+ }, () => {
1860
+ const cache = new StoreKeyMap();
1861
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1862
+ return cache;
1863
+ });
1864
+ }, (response) => {
1865
+ deepFreeze(response);
1866
+ throw response;
1867
+ });
1868
+ }
1869
+ const createDataTransformAdapterFactory = (luvio) => {
1870
+ return function createDataTransform(untrustedConfig) {
1871
+ const config = validateAdapterConfig$3(untrustedConfig, createDataTransform_ConfigPropertyNames);
1872
+ // Invalid or incomplete config
1873
+ if (config === null) {
1874
+ throw new Error('Invalid config for "createDataTransform"');
1875
+ }
1876
+ return buildNetworkSnapshot$3(luvio, config);
1877
+ };
1878
+ };
1879
+
1880
+ function select$1(luvio, params) {
1881
+ return select$7();
1882
+ }
1883
+ function keyBuilder$2(luvio, params) {
1884
+ return keyBuilder$6(luvio, {
1885
+ name: params.urlParams.dataTransformNameOrId
1886
+ });
1887
+ }
1888
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1889
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1890
+ }
1891
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1892
+ const { body } = response;
1893
+ const key = keyBuilder$2(luvio, resourceParams);
1894
+ luvio.storeIngest(key, ingest$2, body);
1895
+ const snapshot = luvio.storeLookup({
1896
+ recordId: key,
1897
+ node: select$1(),
1898
+ variables: {},
1899
+ }, snapshotRefresh);
1900
+ if (process.env.NODE_ENV !== 'production') {
1901
+ if (snapshot.state !== 'Fulfilled') {
1902
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1903
+ }
1904
+ }
1905
+ deepFreeze(snapshot.data);
1906
+ return snapshot;
1907
+ }
1908
+ function ingestError(luvio, params, error, snapshotRefresh) {
1909
+ const key = keyBuilder$2(luvio, params);
1910
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1911
+ luvio.storeIngestError(key, errorSnapshot);
1912
+ return errorSnapshot;
1913
+ }
1914
+ function createResourceRequest$2(config) {
1915
+ const headers = {};
1916
+ return {
1917
+ baseUri: '/services/data/v66.0',
1918
+ basePath: '/ssot/data-transforms/' + config.urlParams.dataTransformNameOrId + '',
1919
+ method: 'get',
1920
+ body: null,
1921
+ urlParams: config.urlParams,
1922
+ queryParams: config.queryParams,
1923
+ headers,
1924
+ priority: 'normal',
1925
+ };
1926
+ }
1927
+
1928
+ const adapterName$2 = 'getDataTransform';
1929
+ const getDataTransform_ConfigPropertyMetadata = [
1930
+ generateParamConfigMetadata('dataTransformNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1931
+ generateParamConfigMetadata('filterGroup', false, 1 /* QueryParameter */, 0 /* String */),
1932
+ ];
1933
+ const getDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDataTransform_ConfigPropertyMetadata);
1934
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(getDataTransform_ConfigPropertyMetadata);
1935
+ function keyBuilder$1(luvio, config) {
1936
+ const resourceParams = createResourceParams$2(config);
1937
+ return keyBuilder$2(luvio, resourceParams);
1938
+ }
1939
+ function typeCheckConfig$2(untrustedConfig) {
1940
+ const config = {};
1941
+ typeCheckConfig$5(untrustedConfig, config, getDataTransform_ConfigPropertyMetadata);
1942
+ return config;
1943
+ }
1944
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1945
+ if (!untrustedIsObject(untrustedConfig)) {
1946
+ return null;
1947
+ }
1948
+ if (process.env.NODE_ENV !== 'production') {
1949
+ validateConfig(untrustedConfig, configPropertyNames);
1950
+ }
1951
+ const config = typeCheckConfig$2(untrustedConfig);
1952
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1953
+ return null;
1954
+ }
1955
+ return config;
1956
+ }
1957
+ function adapterFragment(luvio, config) {
1958
+ createResourceParams$2(config);
1959
+ return select$1();
1960
+ }
1961
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1962
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1963
+ config,
1964
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1965
+ });
1966
+ return luvio.storeBroadcast().then(() => snapshot);
1967
+ }
1968
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1969
+ const snapshot = ingestError(luvio, resourceParams, response, {
1970
+ config,
1971
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1972
+ });
1973
+ return luvio.storeBroadcast().then(() => snapshot);
1974
+ }
1975
+ function buildNetworkSnapshot$2(luvio, config, options) {
1976
+ const resourceParams = createResourceParams$2(config);
1977
+ const request = createResourceRequest$2(resourceParams);
1978
+ return luvio.dispatchResourceRequest(request, options)
1979
+ .then((response) => {
1980
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1981
+ const cache = new StoreKeyMap();
1982
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1983
+ return cache;
1984
+ });
1985
+ }, (response) => {
1986
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1987
+ });
1988
+ }
1989
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1990
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
1991
+ }
1992
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1993
+ const { luvio, config } = context;
1994
+ const selector = {
1995
+ recordId: keyBuilder$1(luvio, config),
1996
+ node: adapterFragment(luvio, config),
1997
+ variables: {},
1998
+ };
1999
+ const cacheSnapshot = storeLookup(selector, {
2000
+ config,
2001
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2002
+ });
2003
+ return cacheSnapshot;
2004
+ }
2005
+ const getDataTransformAdapterFactory = (luvio) => function dataTransform__getDataTransform(untrustedConfig, requestContext) {
2006
+ const config = validateAdapterConfig$2(untrustedConfig, getDataTransform_ConfigPropertyNames);
2007
+ // Invalid or incomplete config
2008
+ if (config === null) {
2009
+ return null;
2010
+ }
2011
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2012
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2013
+ };
2014
+
2015
+ function keyBuilder(luvio, params) {
2016
+ return keyBuilder$6(luvio, {
2017
+ name: params.urlParams.dataTransformNameOrId
2018
+ });
2019
+ }
2020
+ function getResponseCacheKeys$1(cacheKeyMap, luvio, resourceParams) {
2021
+ const key = keyBuilder(luvio, resourceParams);
2022
+ cacheKeyMap.set(key, {
2023
+ namespace: keyPrefix,
2024
+ representationName: RepresentationType$3,
2025
+ mergeable: false
2026
+ });
2027
+ }
2028
+ function evictSuccess(luvio, resourceParams) {
2029
+ const key = keyBuilder(luvio, resourceParams);
2030
+ luvio.storeEvict(key);
2031
+ }
2032
+ function createResourceRequest$1(config) {
2033
+ const headers = {};
2034
+ return {
2035
+ baseUri: '/services/data/v66.0',
2036
+ basePath: '/ssot/data-transforms/' + config.urlParams.dataTransformNameOrId + '',
2037
+ method: 'delete',
2038
+ body: null,
2039
+ urlParams: config.urlParams,
2040
+ queryParams: {},
2041
+ headers,
2042
+ priority: 'normal',
2043
+ };
2044
+ }
2045
+
2046
+ const adapterName$1 = 'deleteDataTransform';
2047
+ const deleteDataTransform_ConfigPropertyMetadata = [
2048
+ generateParamConfigMetadata('dataTransformNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
2049
+ ];
2050
+ const deleteDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, deleteDataTransform_ConfigPropertyMetadata);
2051
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(deleteDataTransform_ConfigPropertyMetadata);
2052
+ function typeCheckConfig$1(untrustedConfig) {
2053
+ const config = {};
2054
+ typeCheckConfig$5(untrustedConfig, config, deleteDataTransform_ConfigPropertyMetadata);
2055
+ return config;
2056
+ }
2057
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
2058
+ if (!untrustedIsObject(untrustedConfig)) {
2059
+ return null;
2060
+ }
2061
+ if (process.env.NODE_ENV !== 'production') {
2062
+ validateConfig(untrustedConfig, configPropertyNames);
2063
+ }
2064
+ const config = typeCheckConfig$1(untrustedConfig);
2065
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2066
+ return null;
2067
+ }
2068
+ return config;
2069
+ }
2070
+ function buildNetworkSnapshot$1(luvio, config, options) {
2071
+ const resourceParams = createResourceParams$1(config);
2072
+ const request = createResourceRequest$1(resourceParams);
2073
+ return luvio.dispatchResourceRequest(request, options)
2074
+ .then(() => {
2075
+ return luvio.handleSuccessResponse(() => {
2076
+ evictSuccess(luvio, resourceParams);
2077
+ return luvio.storeBroadcast();
2078
+ }, () => {
2079
+ const cache = new StoreKeyMap();
2080
+ getResponseCacheKeys$1(cache, luvio, resourceParams);
2081
+ return cache;
2082
+ });
2083
+ }, (response) => {
2084
+ deepFreeze(response);
2085
+ throw response;
2086
+ });
2087
+ }
2088
+ const deleteDataTransformAdapterFactory = (luvio) => {
2089
+ return function dataTransformdeleteDataTransform(untrustedConfig) {
2090
+ const config = validateAdapterConfig$1(untrustedConfig, deleteDataTransform_ConfigPropertyNames);
2091
+ // Invalid or incomplete config
2092
+ if (config === null) {
2093
+ throw new Error(`Invalid config for "${adapterName$1}"`);
2094
+ }
2095
+ return buildNetworkSnapshot$1(luvio, config);
2096
+ };
2097
+ };
2098
+
2099
+ function select(luvio, params) {
2100
+ return select$7();
2101
+ }
2102
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
2103
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2104
+ }
2105
+ function ingestSuccess(luvio, resourceParams, response) {
2106
+ const { body } = response;
2107
+ const key = keyBuilderFromType$2(luvio, body);
2108
+ luvio.storeIngest(key, ingest$2, body);
2109
+ const snapshot = luvio.storeLookup({
2110
+ recordId: key,
2111
+ node: select(),
2112
+ variables: {},
2113
+ });
2114
+ if (process.env.NODE_ENV !== 'production') {
2115
+ if (snapshot.state !== 'Fulfilled') {
2116
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2117
+ }
2118
+ }
2119
+ deepFreeze(snapshot.data);
2120
+ return snapshot;
2121
+ }
2122
+ function createResourceRequest(config) {
2123
+ const headers = {};
2124
+ return {
2125
+ baseUri: '/services/data/v66.0',
2126
+ basePath: '/ssot/data-transforms/' + config.urlParams.dataTransformNameOrId + '',
2127
+ method: 'put',
2128
+ body: config.body,
2129
+ urlParams: config.urlParams,
2130
+ queryParams: config.queryParams,
2131
+ headers,
2132
+ priority: 'normal',
2133
+ };
2134
+ }
2135
+
2136
+ const adapterName = 'updateDataTransform';
2137
+ const updateDataTransform_ConfigPropertyMetadata = [
2138
+ generateParamConfigMetadata('dataTransformNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
2139
+ generateParamConfigMetadata('filterGroup', false, 1 /* QueryParameter */, 0 /* String */),
2140
+ generateParamConfigMetadata('capabilities', false, 2 /* Body */, 4 /* Unsupported */),
2141
+ generateParamConfigMetadata('creationType', true, 2 /* Body */, 0 /* String */),
2142
+ generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
2143
+ generateParamConfigMetadata('dataSpaceName', false, 2 /* Body */, 0 /* String */),
2144
+ generateParamConfigMetadata('definition', true, 2 /* Body */, 4 /* Unsupported */),
2145
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
2146
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
2147
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
2148
+ generateParamConfigMetadata('primarySource', false, 2 /* Body */, 0 /* String */),
2149
+ generateParamConfigMetadata('tags', false, 2 /* Body */, 4 /* Unsupported */),
2150
+ generateParamConfigMetadata('type', true, 2 /* Body */, 0 /* String */),
2151
+ ];
2152
+ const updateDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateDataTransform_ConfigPropertyMetadata);
2153
+ const createResourceParams = /*#__PURE__*/ createResourceParams$5(updateDataTransform_ConfigPropertyMetadata);
2154
+ function typeCheckConfig(untrustedConfig) {
2155
+ const config = {};
2156
+ typeCheckConfig$5(untrustedConfig, config, updateDataTransform_ConfigPropertyMetadata);
2157
+ const untrustedConfig_capabilities = untrustedConfig.capabilities;
2158
+ if (untrustedIsObject(untrustedConfig_capabilities)) {
2159
+ const untrustedConfig_capabilities_object = {};
2160
+ const untrustedConfig_capabilities_keys = Object.keys(untrustedConfig_capabilities);
2161
+ for (let i = 0, arrayLength = untrustedConfig_capabilities_keys.length; i < arrayLength; i++) {
2162
+ const key = untrustedConfig_capabilities_keys[i];
2163
+ const untrustedConfig_capabilities_prop = untrustedConfig_capabilities[key];
2164
+ if (typeof untrustedConfig_capabilities_prop === 'boolean') {
2165
+ if (untrustedConfig_capabilities_object !== undefined) {
2166
+ untrustedConfig_capabilities_object[key] = untrustedConfig_capabilities_prop;
2167
+ }
2168
+ }
2169
+ }
2170
+ if (untrustedConfig_capabilities_object !== undefined && Object.keys(untrustedConfig_capabilities_object).length >= 0) {
2171
+ config.capabilities = untrustedConfig_capabilities_object;
2172
+ }
2173
+ }
2174
+ const untrustedConfig_definition = untrustedConfig.definition;
2175
+ if (untrustedIsObject(untrustedConfig_definition)) {
2176
+ const untrustedConfig_definition_object = {};
2177
+ const untrustedConfig_definition_keys = Object.keys(untrustedConfig_definition);
2178
+ for (let i = 0, arrayLength = untrustedConfig_definition_keys.length; i < arrayLength; i++) {
2179
+ const key = untrustedConfig_definition_keys[i];
2180
+ const untrustedConfig_definition_prop = untrustedConfig_definition[key];
2181
+ if (untrustedConfig_definition_object !== undefined) {
2182
+ untrustedConfig_definition_object[key] = untrustedConfig_definition_prop;
2183
+ }
2184
+ }
2185
+ if (untrustedConfig_definition_object !== undefined && Object.keys(untrustedConfig_definition_object).length >= 0) {
2186
+ config.definition = untrustedConfig_definition_object;
2187
+ }
2188
+ }
2189
+ const untrustedConfig_tags = untrustedConfig.tags;
2190
+ if (untrustedIsObject(untrustedConfig_tags)) {
2191
+ const untrustedConfig_tags_object = {};
2192
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
2193
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
2194
+ const key = untrustedConfig_tags_keys[i];
2195
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
2196
+ if (typeof untrustedConfig_tags_prop === 'string') {
2197
+ if (untrustedConfig_tags_object !== undefined) {
2198
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
2199
+ }
2200
+ }
2201
+ }
2202
+ if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
2203
+ config.tags = untrustedConfig_tags_object;
2204
+ }
2205
+ }
2206
+ return config;
2207
+ }
2208
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2209
+ if (!untrustedIsObject(untrustedConfig)) {
2210
+ return null;
2211
+ }
2212
+ if (process.env.NODE_ENV !== 'production') {
2213
+ validateConfig(untrustedConfig, configPropertyNames);
2214
+ }
2215
+ const config = typeCheckConfig(untrustedConfig);
2216
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2217
+ return null;
2218
+ }
2219
+ return config;
2220
+ }
2221
+ function buildNetworkSnapshot(luvio, config, options) {
2222
+ const resourceParams = createResourceParams(config);
2223
+ const request = createResourceRequest(resourceParams);
2224
+ return luvio.dispatchResourceRequest(request, options)
2225
+ .then((response) => {
2226
+ return luvio.handleSuccessResponse(() => {
2227
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
2228
+ return luvio.storeBroadcast().then(() => snapshot);
2229
+ }, () => {
2230
+ const cache = new StoreKeyMap();
2231
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
2232
+ return cache;
2233
+ });
2234
+ }, (response) => {
2235
+ deepFreeze(response);
2236
+ throw response;
2237
+ });
2238
+ }
2239
+ const updateDataTransformAdapterFactory = (luvio) => {
2240
+ return function updateDataTransform(untrustedConfig) {
2241
+ const config = validateAdapterConfig(untrustedConfig, updateDataTransform_ConfigPropertyNames);
2242
+ // Invalid or incomplete config
2243
+ if (config === null) {
2244
+ throw new Error('Invalid config for "updateDataTransform"');
2245
+ }
2246
+ return buildNetworkSnapshot(luvio, config);
2247
+ };
2248
+ };
2249
+
2250
+ export { createDataTransformAdapterFactory, deleteDataTransformAdapterFactory, getDataTransformAdapterFactory, updateDataTransformAdapterFactory, validateDataTransformsAdapterFactory };