@salesforce/lds-adapters-cdp-data-transform 1.354.0-dev5 → 1.354.0-dev7

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 (20) hide show
  1. package/dist/es/es2018/cdp-data-transform.js +1448 -110
  2. package/dist/es/es2018/types/src/generated/adapters/createDataTransform.d.ts +32 -0
  3. package/dist/es/es2018/types/src/generated/adapters/deleteDataTransform.d.ts +14 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getDataTransform.d.ts +30 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -1
  7. package/dist/es/es2018/types/src/generated/resources/deleteSsotDataTransformsByDataTransformNameOrId.d.ts +12 -0
  8. package/dist/es/es2018/types/src/generated/resources/getSsotDataTransformsByDataTransformNameOrId.d.ts +19 -0
  9. package/dist/es/es2018/types/src/generated/resources/postSsotDataTransforms.d.ts +31 -0
  10. package/dist/es/es2018/types/src/generated/types/BaseActionRepresentation.d.ts +31 -0
  11. package/dist/es/es2018/types/src/generated/types/CdpAssetBaseRepresentation.d.ts +20 -6
  12. package/dist/es/es2018/types/src/generated/types/CdpErrorRepresentation.d.ts +31 -0
  13. package/dist/es/es2018/types/src/generated/types/DataObjectRepresentation.d.ts +9 -5
  14. package/dist/es/es2018/types/src/generated/types/DataTransformDefinitionRepresentation.d.ts +44 -0
  15. package/dist/es/es2018/types/src/generated/types/DataTransformRepresentation.d.ts +97 -0
  16. package/dist/es/es2018/types/src/generated/types/ScheduleRepresentation.d.ts +31 -0
  17. package/package.json +3 -3
  18. package/sfdc/index.js +1603 -205
  19. package/src/raml/api.raml +173 -1
  20. package/src/raml/luvio.raml +18 -0
@@ -4,10 +4,10 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$4, StoreKeyMap, createResourceParams as createResourceParams$4 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys, create: ObjectCreate } = Object;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
11
  const { stringify: JSONStringify$1 } = JSON;
12
12
  const { isArray: ArrayIsArray$1 } = Array;
13
13
  /**
@@ -32,7 +32,7 @@ function validateConfig(config, adapter, oneOf) {
32
32
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
33
33
  }
34
34
  const supported = required.concat(optional);
35
- if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
36
36
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
37
37
  }
38
38
  }
@@ -89,7 +89,7 @@ function stableJSONStringify(node) {
89
89
  if (node === null) {
90
90
  return 'null';
91
91
  }
92
- const keys = ObjectKeys(node).sort();
92
+ const keys = ObjectKeys$1(node).sort();
93
93
  out = '';
94
94
  for (i = 0; i < keys.length; i++) {
95
95
  const key = keys[i];
@@ -127,15 +127,48 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
127
127
  }
128
128
  const keyPrefix = 'data-transform';
129
129
 
130
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
130
131
  const { isArray: ArrayIsArray } = Array;
131
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
+ }
132
165
  function createLink(ref) {
133
166
  return {
134
167
  __ref: serializeStructuredKey(ref),
135
168
  };
136
169
  }
137
170
 
138
- function validate$5(obj, path = 'TransformValidationIssueRepresentation') {
171
+ function validate$a(obj, path = 'TransformValidationIssueRepresentation') {
139
172
  const v_error = (() => {
140
173
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
141
174
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -163,7 +196,8 @@ function validate$5(obj, path = 'TransformValidationIssueRepresentation') {
163
196
  return v_error === undefined ? null : v_error;
164
197
  }
165
198
 
166
- function validate$4(obj, path = 'CdpUserRepresentation') {
199
+ const VERSION$8 = "efb82c29d2d2d9ec860406b7caae554d";
200
+ function validate$9(obj, path = 'CdpUserRepresentation') {
167
201
  const v_error = (() => {
168
202
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
169
203
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -190,7 +224,680 @@ function validate$4(obj, path = 'CdpUserRepresentation') {
190
224
  })();
191
225
  return v_error === undefined ? null : v_error;
192
226
  }
227
+ const select$b = 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$a = 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$9 = 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$8 = 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') {
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$7 = 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$4()
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 = "924b289e2a40b63f6d1307278d60bd26";
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
+ const obj_dataSpaceName = obj.dataSpaceName;
598
+ const path_dataSpaceName = path + '.dataSpaceName';
599
+ if (typeof obj_dataSpaceName !== 'string') {
600
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
601
+ }
602
+ const obj_definition = obj.definition;
603
+ const path_definition = path + '.definition';
604
+ if (typeof obj_definition !== 'object') {
605
+ return new TypeError('Expected "object" but received "' + typeof obj_definition + '" (at "' + path_definition + '")');
606
+ }
607
+ const obj_description = obj.description;
608
+ const path_description = path + '.description';
609
+ if (typeof obj_description !== 'string') {
610
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
611
+ }
612
+ const obj_lastRunDate = obj.lastRunDate;
613
+ const path_lastRunDate = path + '.lastRunDate';
614
+ if (typeof obj_lastRunDate !== 'string') {
615
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunDate + '" (at "' + path_lastRunDate + '")');
616
+ }
617
+ const obj_lastRunErrorCode = obj.lastRunErrorCode;
618
+ const path_lastRunErrorCode = path + '.lastRunErrorCode';
619
+ const referencepath_lastRunErrorCodeValidationError = validate$7(obj_lastRunErrorCode, path_lastRunErrorCode);
620
+ if (referencepath_lastRunErrorCodeValidationError !== null) {
621
+ let message = 'Object doesn\'t match CdpErrorRepresentation (at "' + path_lastRunErrorCode + '")\n';
622
+ message += referencepath_lastRunErrorCodeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
623
+ return new TypeError(message);
624
+ }
625
+ const obj_lastRunErrorMessage = obj.lastRunErrorMessage;
626
+ const path_lastRunErrorMessage = path + '.lastRunErrorMessage';
627
+ if (typeof obj_lastRunErrorMessage !== 'string') {
628
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunErrorMessage + '" (at "' + path_lastRunErrorMessage + '")');
629
+ }
630
+ const obj_lastRunStatus = obj.lastRunStatus;
631
+ const path_lastRunStatus = path + '.lastRunStatus';
632
+ if (typeof obj_lastRunStatus !== 'string') {
633
+ return new TypeError('Expected "string" but received "' + typeof obj_lastRunStatus + '" (at "' + path_lastRunStatus + '")');
634
+ }
635
+ const obj_schedule = obj.schedule;
636
+ const path_schedule = path + '.schedule';
637
+ const referencepath_scheduleValidationError = validate$6(obj_schedule, path_schedule);
638
+ if (referencepath_scheduleValidationError !== null) {
639
+ let message = 'Object doesn\'t match ScheduleRepresentation (at "' + path_schedule + '")\n';
640
+ message += referencepath_scheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
641
+ return new TypeError(message);
642
+ }
643
+ const obj_status = obj.status;
644
+ const path_status = path + '.status';
645
+ if (typeof obj_status !== 'string') {
646
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
647
+ }
648
+ const obj_tags = obj.tags;
649
+ const path_tags = path + '.tags';
650
+ if (typeof obj_tags !== 'object' || ArrayIsArray(obj_tags) || obj_tags === null) {
651
+ return new TypeError('Expected "object" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
652
+ }
653
+ const obj_tags_keys = ObjectKeys(obj_tags);
654
+ for (let i = 0; i < obj_tags_keys.length; i++) {
655
+ const key = obj_tags_keys[i];
656
+ const obj_tags_prop = obj_tags[key];
657
+ const path_tags_prop = path_tags + '["' + key + '"]';
658
+ if (typeof obj_tags_prop !== 'string') {
659
+ return new TypeError('Expected "string" but received "' + typeof obj_tags_prop + '" (at "' + path_tags_prop + '")');
660
+ }
661
+ }
662
+ const obj_type = obj.type;
663
+ const path_type = path + '.type';
664
+ if (typeof obj_type !== 'string') {
665
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
666
+ }
667
+ obj.version;
668
+ })();
669
+ return v_error === undefined ? null : v_error;
670
+ }
671
+ const RepresentationType$3 = 'DataTransformRepresentation';
672
+ function keyBuilder$6(luvio, config) {
673
+ return keyBuilder$5(luvio, config);
674
+ }
675
+ function keyBuilderFromType$2(luvio, object) {
676
+ return keyBuilderFromType$1(luvio, object);
677
+ }
678
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
679
+ const input_definition = input.definition;
680
+ const input_definition_id = path.fullPath + '__definition';
681
+ input.definition = ingest$3(input_definition, {
682
+ fullPath: input_definition_id,
683
+ propertyName: 'definition',
684
+ parent: {
685
+ data: input,
686
+ key: path.fullPath,
687
+ existing: existing,
688
+ },
689
+ ttl: path.ttl
690
+ }, luvio, store, timestamp);
691
+ return input;
692
+ }
693
+ const select$6 = function DataTransformRepresentationSelect() {
694
+ const { selections: CdpAssetBaseRepresentationSelections } = select$5();
695
+ const { selections: BaseActionRepresentation__selections, opaque: BaseActionRepresentation__opaque, } = select$a();
696
+ const { selections: CdpErrorRepresentation__selections, opaque: CdpErrorRepresentation__opaque, } = select$9();
697
+ const { selections: ScheduleRepresentation__selections, opaque: ScheduleRepresentation__opaque, } = select$8();
698
+ return {
699
+ kind: 'Fragment',
700
+ version: VERSION$3,
701
+ private: [],
702
+ selections: [
703
+ ...CdpAssetBaseRepresentationSelections,
704
+ {
705
+ name: 'actionUrls',
706
+ kind: 'Object',
707
+ selections: BaseActionRepresentation__selections
708
+ },
709
+ {
710
+ name: 'capabilities',
711
+ kind: 'Scalar',
712
+ map: true,
713
+ required: false
714
+ },
715
+ {
716
+ name: 'creationType',
717
+ kind: 'Scalar'
718
+ },
719
+ {
720
+ name: 'dataSpaceName',
721
+ kind: 'Scalar'
722
+ },
723
+ {
724
+ name: 'definition',
725
+ kind: 'Link',
726
+ fragment: select$7()
727
+ },
728
+ {
729
+ name: 'description',
730
+ kind: 'Scalar'
731
+ },
732
+ {
733
+ name: 'lastRunDate',
734
+ kind: 'Scalar'
735
+ },
736
+ {
737
+ name: 'lastRunErrorCode',
738
+ kind: 'Object',
739
+ selections: CdpErrorRepresentation__selections
740
+ },
741
+ {
742
+ name: 'lastRunErrorMessage',
743
+ kind: 'Scalar'
744
+ },
745
+ {
746
+ name: 'lastRunStatus',
747
+ kind: 'Scalar'
748
+ },
749
+ {
750
+ name: 'schedule',
751
+ kind: 'Object',
752
+ selections: ScheduleRepresentation__selections
753
+ },
754
+ {
755
+ name: 'status',
756
+ kind: 'Scalar'
757
+ },
758
+ {
759
+ name: 'tags',
760
+ kind: 'Scalar',
761
+ map: true
762
+ },
763
+ {
764
+ name: 'type',
765
+ kind: 'Scalar'
766
+ },
767
+ {
768
+ name: 'version',
769
+ kind: 'Scalar'
770
+ }
771
+ ]
772
+ };
773
+ };
774
+ function equals$4(existing, incoming) {
775
+ if (equals$3(existing, incoming) === false) {
776
+ return false;
777
+ }
778
+ const existing_creationType = existing.creationType;
779
+ const incoming_creationType = incoming.creationType;
780
+ if (!(existing_creationType === incoming_creationType)) {
781
+ return false;
782
+ }
783
+ const existing_dataSpaceName = existing.dataSpaceName;
784
+ const incoming_dataSpaceName = incoming.dataSpaceName;
785
+ if (!(existing_dataSpaceName === incoming_dataSpaceName)) {
786
+ return false;
787
+ }
788
+ const existing_description = existing.description;
789
+ const incoming_description = incoming.description;
790
+ if (!(existing_description === incoming_description)) {
791
+ return false;
792
+ }
793
+ const existing_lastRunDate = existing.lastRunDate;
794
+ const incoming_lastRunDate = incoming.lastRunDate;
795
+ if (!(existing_lastRunDate === incoming_lastRunDate)) {
796
+ return false;
797
+ }
798
+ const existing_lastRunErrorMessage = existing.lastRunErrorMessage;
799
+ const incoming_lastRunErrorMessage = incoming.lastRunErrorMessage;
800
+ if (!(existing_lastRunErrorMessage === incoming_lastRunErrorMessage)) {
801
+ return false;
802
+ }
803
+ const existing_lastRunStatus = existing.lastRunStatus;
804
+ const incoming_lastRunStatus = incoming.lastRunStatus;
805
+ if (!(existing_lastRunStatus === incoming_lastRunStatus)) {
806
+ return false;
807
+ }
808
+ const existing_status = existing.status;
809
+ const incoming_status = incoming.status;
810
+ if (!(existing_status === incoming_status)) {
811
+ return false;
812
+ }
813
+ const existing_type = existing.type;
814
+ const incoming_type = incoming.type;
815
+ if (!(existing_type === incoming_type)) {
816
+ return false;
817
+ }
818
+ const existing_version = existing.version;
819
+ const incoming_version = incoming.version;
820
+ if (!(existing_version === incoming_version)) {
821
+ return false;
822
+ }
823
+ const existing_actionUrls = existing.actionUrls;
824
+ const incoming_actionUrls = incoming.actionUrls;
825
+ if (!(equals$8(existing_actionUrls, incoming_actionUrls))) {
826
+ return false;
827
+ }
828
+ const existing_capabilities = existing.capabilities;
829
+ const incoming_capabilities = incoming.capabilities;
830
+ // if at least one of these optionals is defined
831
+ if (existing_capabilities !== undefined || incoming_capabilities !== undefined) {
832
+ // if one of these is not defined we know the other is defined and therefore
833
+ // not equal
834
+ if (existing_capabilities === undefined || incoming_capabilities === undefined) {
835
+ return false;
836
+ }
837
+ const equals_capabilities_props = equalsObject(existing_capabilities, incoming_capabilities, (existing_capabilities_prop, incoming_capabilities_prop) => {
838
+ if (!(existing_capabilities_prop === incoming_capabilities_prop)) {
839
+ return false;
840
+ }
841
+ });
842
+ if (equals_capabilities_props === false) {
843
+ return false;
844
+ }
845
+ }
846
+ const existing_definition = existing.definition;
847
+ const incoming_definition = incoming.definition;
848
+ if (!(existing_definition.__ref === incoming_definition.__ref)) {
849
+ return false;
850
+ }
851
+ const existing_lastRunErrorCode = existing.lastRunErrorCode;
852
+ const incoming_lastRunErrorCode = incoming.lastRunErrorCode;
853
+ if (!(equals$7(existing_lastRunErrorCode, incoming_lastRunErrorCode))) {
854
+ return false;
855
+ }
856
+ const existing_schedule = existing.schedule;
857
+ const incoming_schedule = incoming.schedule;
858
+ if (!(equals$6(existing_schedule, incoming_schedule))) {
859
+ return false;
860
+ }
861
+ const existing_tags = existing.tags;
862
+ const incoming_tags = incoming.tags;
863
+ const equals_tags_props = equalsObject(existing_tags, incoming_tags, (existing_tags_prop, incoming_tags_prop) => {
864
+ if (!(existing_tags_prop === incoming_tags_prop)) {
865
+ return false;
866
+ }
867
+ });
868
+ if (equals_tags_props === false) {
869
+ return false;
870
+ }
871
+ return true;
872
+ }
873
+ const ingest$2 = function DataTransformRepresentationIngest(input, path, luvio, store, timestamp) {
874
+ if (process.env.NODE_ENV !== 'production') {
875
+ const validateError = validate$4(input);
876
+ if (validateError !== null) {
877
+ throw validateError;
878
+ }
879
+ }
880
+ const key = keyBuilderFromType$2(luvio, input);
881
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
882
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "data-transform", VERSION$3, RepresentationType$3, equals$4);
883
+ return createLink(key);
884
+ };
885
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
886
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
887
+ const rootKey = keyBuilderFromType$2(luvio, input);
888
+ rootKeySet.set(rootKey, {
889
+ namespace: keyPrefix,
890
+ representationName: RepresentationType$2,
891
+ mergeable: false
892
+ });
893
+ getTypeCacheKeys$3(rootKeySet, luvio, input.definition, () => rootKey + "__" + "definition");
894
+ }
193
895
 
896
+ var DiscriminatorValues;
897
+ (function (DiscriminatorValues) {
898
+ DiscriminatorValues["type"] = "type";
899
+ })(DiscriminatorValues || (DiscriminatorValues = {}));
900
+ const VERSION$2 = "e45ed0cf1759f7e1fe67049f806edc26";
194
901
  function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
195
902
  const v_error = (() => {
196
903
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -199,7 +906,7 @@ function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
199
906
  if (obj.createdBy !== undefined) {
200
907
  const obj_createdBy = obj.createdBy;
201
908
  const path_createdBy = path + '.createdBy';
202
- const referencepath_createdByValidationError = validate$4(obj_createdBy, path_createdBy);
909
+ const referencepath_createdByValidationError = validate$9(obj_createdBy, path_createdBy);
203
910
  if (referencepath_createdByValidationError !== null) {
204
911
  let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
205
912
  message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -228,7 +935,7 @@ function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
228
935
  if (obj.lastModifiedBy !== undefined) {
229
936
  const obj_lastModifiedBy = obj.lastModifiedBy;
230
937
  const path_lastModifiedBy = path + '.lastModifiedBy';
231
- const referencepath_lastModifiedByValidationError = validate$4(obj_lastModifiedBy, path_lastModifiedBy);
938
+ const referencepath_lastModifiedByValidationError = validate$9(obj_lastModifiedBy, path_lastModifiedBy);
232
939
  if (referencepath_lastModifiedByValidationError !== null) {
233
940
  let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
234
941
  message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -242,12 +949,10 @@ function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
242
949
  return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
243
950
  }
244
951
  }
245
- if (obj.name !== undefined) {
246
- const obj_name = obj.name;
247
- const path_name = path + '.name';
248
- if (typeof obj_name !== 'string') {
249
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
250
- }
952
+ const obj_name = obj.name;
953
+ const path_name = path + '.name';
954
+ if (typeof obj_name !== 'string') {
955
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
251
956
  }
252
957
  if (obj.namespace !== undefined) {
253
958
  const obj_namespace = obj.namespace;
@@ -266,6 +971,175 @@ function validate$3(obj, path = 'CdpAssetBaseRepresentation') {
266
971
  })();
267
972
  return v_error === undefined ? null : v_error;
268
973
  }
974
+ const RepresentationType$2 = 'CdpAssetBaseRepresentation';
975
+ function keyBuilder$5(luvio, config) {
976
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.name;
977
+ }
978
+ function keyBuilderFromType$1(luvio, object) {
979
+ const keyParams = {
980
+ name: object.name
981
+ };
982
+ return keyBuilder$5(luvio, keyParams);
983
+ }
984
+ const select$5 = function CdpAssetBaseRepresentationSelect() {
985
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$b();
986
+ return {
987
+ kind: 'Fragment',
988
+ version: VERSION$2,
989
+ private: [],
990
+ selections: [
991
+ {
992
+ name: 'createdBy',
993
+ kind: 'Object',
994
+ selections: CdpUserRepresentation__selections,
995
+ required: false
996
+ },
997
+ {
998
+ name: 'createdDate',
999
+ kind: 'Scalar',
1000
+ required: false
1001
+ },
1002
+ {
1003
+ name: 'id',
1004
+ kind: 'Scalar'
1005
+ },
1006
+ {
1007
+ name: 'label',
1008
+ kind: 'Scalar',
1009
+ required: false
1010
+ },
1011
+ {
1012
+ name: 'lastModifiedBy',
1013
+ kind: 'Object',
1014
+ selections: CdpUserRepresentation__selections,
1015
+ required: false
1016
+ },
1017
+ {
1018
+ name: 'lastModifiedDate',
1019
+ kind: 'Scalar',
1020
+ required: false
1021
+ },
1022
+ {
1023
+ name: 'name',
1024
+ kind: 'Scalar'
1025
+ },
1026
+ {
1027
+ name: 'namespace',
1028
+ kind: 'Scalar',
1029
+ required: false
1030
+ },
1031
+ {
1032
+ name: 'url',
1033
+ kind: 'Scalar',
1034
+ required: false
1035
+ }
1036
+ ]
1037
+ };
1038
+ };
1039
+ function equals$3(existing, incoming) {
1040
+ const existing_createdDate = existing.createdDate;
1041
+ const incoming_createdDate = incoming.createdDate;
1042
+ // if at least one of these optionals is defined
1043
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
1044
+ // if one of these is not defined we know the other is defined and therefore
1045
+ // not equal
1046
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
1047
+ return false;
1048
+ }
1049
+ if (!(existing_createdDate === incoming_createdDate)) {
1050
+ return false;
1051
+ }
1052
+ }
1053
+ const existing_id = existing.id;
1054
+ const incoming_id = incoming.id;
1055
+ if (!(existing_id === incoming_id)) {
1056
+ return false;
1057
+ }
1058
+ const existing_label = existing.label;
1059
+ const incoming_label = incoming.label;
1060
+ // if at least one of these optionals is defined
1061
+ if (existing_label !== undefined || incoming_label !== undefined) {
1062
+ // if one of these is not defined we know the other is defined and therefore
1063
+ // not equal
1064
+ if (existing_label === undefined || incoming_label === undefined) {
1065
+ return false;
1066
+ }
1067
+ if (!(existing_label === incoming_label)) {
1068
+ return false;
1069
+ }
1070
+ }
1071
+ const existing_lastModifiedDate = existing.lastModifiedDate;
1072
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
1073
+ // if at least one of these optionals is defined
1074
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
1075
+ // if one of these is not defined we know the other is defined and therefore
1076
+ // not equal
1077
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
1078
+ return false;
1079
+ }
1080
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
1081
+ return false;
1082
+ }
1083
+ }
1084
+ const existing_name = existing.name;
1085
+ const incoming_name = incoming.name;
1086
+ if (!(existing_name === incoming_name)) {
1087
+ return false;
1088
+ }
1089
+ const existing_namespace = existing.namespace;
1090
+ const incoming_namespace = incoming.namespace;
1091
+ // if at least one of these optionals is defined
1092
+ if (existing_namespace !== undefined || incoming_namespace !== undefined) {
1093
+ // if one of these is not defined we know the other is defined and therefore
1094
+ // not equal
1095
+ if (existing_namespace === undefined || incoming_namespace === undefined) {
1096
+ return false;
1097
+ }
1098
+ if (!(existing_namespace === incoming_namespace)) {
1099
+ return false;
1100
+ }
1101
+ }
1102
+ const existing_url = existing.url;
1103
+ const incoming_url = incoming.url;
1104
+ // if at least one of these optionals is defined
1105
+ if (existing_url !== undefined || incoming_url !== undefined) {
1106
+ // if one of these is not defined we know the other is defined and therefore
1107
+ // not equal
1108
+ if (existing_url === undefined || incoming_url === undefined) {
1109
+ return false;
1110
+ }
1111
+ if (!(existing_url === incoming_url)) {
1112
+ return false;
1113
+ }
1114
+ }
1115
+ const existing_createdBy = existing.createdBy;
1116
+ const incoming_createdBy = incoming.createdBy;
1117
+ // if at least one of these optionals is defined
1118
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
1119
+ // if one of these is not defined we know the other is defined and therefore
1120
+ // not equal
1121
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
1122
+ return false;
1123
+ }
1124
+ if (!(equals$9(existing_createdBy, incoming_createdBy))) {
1125
+ return false;
1126
+ }
1127
+ }
1128
+ const existing_lastModifiedBy = existing.lastModifiedBy;
1129
+ const incoming_lastModifiedBy = incoming.lastModifiedBy;
1130
+ // if at least one of these optionals is defined
1131
+ if (existing_lastModifiedBy !== undefined || incoming_lastModifiedBy !== undefined) {
1132
+ // if one of these is not defined we know the other is defined and therefore
1133
+ // not equal
1134
+ if (existing_lastModifiedBy === undefined || incoming_lastModifiedBy === undefined) {
1135
+ return false;
1136
+ }
1137
+ if (!(equals$9(existing_lastModifiedBy, incoming_lastModifiedBy))) {
1138
+ return false;
1139
+ }
1140
+ }
1141
+ return true;
1142
+ }
269
1143
 
270
1144
  function validate$2(obj, path = 'DataObjectFieldRepresentation') {
271
1145
  const v_error = (() => {
@@ -300,7 +1174,14 @@ function validate$2(obj, path = 'DataObjectFieldRepresentation') {
300
1174
  })();
301
1175
  return v_error === undefined ? null : v_error;
302
1176
  }
1177
+ function equals$2(existing, incoming) {
1178
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1179
+ return false;
1180
+ }
1181
+ return true;
1182
+ }
303
1183
 
1184
+ const VERSION$1 = "225283ac9b2f9ab35452025c5c47ac83";
304
1185
  function validate$1(obj, path = 'DataObjectRepresentation') {
305
1186
  const validateCdpAssetBaseRepresentation_validateError = validate$3(obj, path);
306
1187
  if (validateCdpAssetBaseRepresentation_validateError !== null) {
@@ -352,6 +1233,94 @@ function validate$1(obj, path = 'DataObjectRepresentation') {
352
1233
  })();
353
1234
  return v_error === undefined ? null : v_error;
354
1235
  }
1236
+ const RepresentationType$1 = 'DataObjectRepresentation';
1237
+ function keyBuilderFromType(luvio, object) {
1238
+ return keyBuilderFromType$1(luvio, object);
1239
+ }
1240
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1241
+ return input;
1242
+ }
1243
+ const select$4 = function DataObjectRepresentationSelect() {
1244
+ return {
1245
+ kind: 'Fragment',
1246
+ version: VERSION$1,
1247
+ private: [],
1248
+ opaque: true
1249
+ };
1250
+ };
1251
+ function equals$1(existing, incoming) {
1252
+ if (equals$3(existing, incoming) === false) {
1253
+ return false;
1254
+ }
1255
+ const existing_category = existing.category;
1256
+ const incoming_category = incoming.category;
1257
+ if (!(existing_category === incoming_category)) {
1258
+ return false;
1259
+ }
1260
+ const existing_eventDateTimeFieldName = existing.eventDateTimeFieldName;
1261
+ const incoming_eventDateTimeFieldName = incoming.eventDateTimeFieldName;
1262
+ // if at least one of these optionals is defined
1263
+ if (existing_eventDateTimeFieldName !== undefined || incoming_eventDateTimeFieldName !== undefined) {
1264
+ // if one of these is not defined we know the other is defined and therefore
1265
+ // not equal
1266
+ if (existing_eventDateTimeFieldName === undefined || incoming_eventDateTimeFieldName === undefined) {
1267
+ return false;
1268
+ }
1269
+ if (!(existing_eventDateTimeFieldName === incoming_eventDateTimeFieldName)) {
1270
+ return false;
1271
+ }
1272
+ }
1273
+ const existing_recordModifiedFieldName = existing.recordModifiedFieldName;
1274
+ const incoming_recordModifiedFieldName = incoming.recordModifiedFieldName;
1275
+ // if at least one of these optionals is defined
1276
+ if (existing_recordModifiedFieldName !== undefined || incoming_recordModifiedFieldName !== undefined) {
1277
+ // if one of these is not defined we know the other is defined and therefore
1278
+ // not equal
1279
+ if (existing_recordModifiedFieldName === undefined || incoming_recordModifiedFieldName === undefined) {
1280
+ return false;
1281
+ }
1282
+ if (!(existing_recordModifiedFieldName === incoming_recordModifiedFieldName)) {
1283
+ return false;
1284
+ }
1285
+ }
1286
+ const existing_type = existing.type;
1287
+ const incoming_type = incoming.type;
1288
+ if (!(existing_type === incoming_type)) {
1289
+ return false;
1290
+ }
1291
+ const existing_fields = existing.fields;
1292
+ const incoming_fields = incoming.fields;
1293
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
1294
+ if (!(equals$2(existing_fields_item, incoming_fields_item))) {
1295
+ return false;
1296
+ }
1297
+ });
1298
+ if (equals_fields_items === false) {
1299
+ return false;
1300
+ }
1301
+ return true;
1302
+ }
1303
+ const ingest$1 = function DataObjectRepresentationIngest(input, path, luvio, store, timestamp) {
1304
+ if (process.env.NODE_ENV !== 'production') {
1305
+ const validateError = validate$1(input);
1306
+ if (validateError !== null) {
1307
+ throw validateError;
1308
+ }
1309
+ }
1310
+ const key = keyBuilderFromType(luvio, input);
1311
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1312
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "data-transform", VERSION$1, RepresentationType$1, equals$1);
1313
+ return createLink(key);
1314
+ };
1315
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1316
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1317
+ const rootKey = keyBuilderFromType(luvio, input);
1318
+ rootKeySet.set(rootKey, {
1319
+ namespace: keyPrefix,
1320
+ representationName: RepresentationType$2,
1321
+ mergeable: false
1322
+ });
1323
+ }
355
1324
 
356
1325
  const VERSION = "21a4cd3206473ce28645099a11735bc6";
357
1326
  function validate(obj, path = 'DataTransformValidationRepresentation') {
@@ -368,7 +1337,7 @@ function validate(obj, path = 'DataTransformValidationRepresentation') {
368
1337
  for (let i = 0; i < obj_issues.length; i++) {
369
1338
  const obj_issues_item = obj_issues[i];
370
1339
  const path_issues_item = path_issues + '[' + i + ']';
371
- const referencepath_issues_itemValidationError = validate$5(obj_issues_item, path_issues_item);
1340
+ const referencepath_issues_itemValidationError = validate$a(obj_issues_item, path_issues_item);
372
1341
  if (referencepath_issues_itemValidationError !== null) {
373
1342
  let message = 'Object doesn\'t match TransformValidationIssueRepresentation (at "' + path_issues_item + '")\n';
374
1343
  message += referencepath_issues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -376,84 +1345,272 @@ function validate(obj, path = 'DataTransformValidationRepresentation') {
376
1345
  }
377
1346
  }
378
1347
  }
379
- if (obj.outputDataObjects !== undefined) {
380
- const obj_outputDataObjects = obj.outputDataObjects;
381
- const path_outputDataObjects = path + '.outputDataObjects';
382
- if (!ArrayIsArray(obj_outputDataObjects)) {
383
- return new TypeError('Expected "array" but received "' + typeof obj_outputDataObjects + '" (at "' + path_outputDataObjects + '")');
1348
+ if (obj.outputDataObjects !== undefined) {
1349
+ const obj_outputDataObjects = obj.outputDataObjects;
1350
+ const path_outputDataObjects = path + '.outputDataObjects';
1351
+ if (!ArrayIsArray(obj_outputDataObjects)) {
1352
+ return new TypeError('Expected "array" but received "' + typeof obj_outputDataObjects + '" (at "' + path_outputDataObjects + '")');
1353
+ }
1354
+ for (let i = 0; i < obj_outputDataObjects.length; i++) {
1355
+ const obj_outputDataObjects_item = obj_outputDataObjects[i];
1356
+ const path_outputDataObjects_item = path_outputDataObjects + '[' + i + ']';
1357
+ const referencepath_outputDataObjects_itemValidationError = validate$1(obj_outputDataObjects_item, path_outputDataObjects_item);
1358
+ if (referencepath_outputDataObjects_itemValidationError !== null) {
1359
+ let message = 'Object doesn\'t match DataObjectRepresentation (at "' + path_outputDataObjects_item + '")\n';
1360
+ message += referencepath_outputDataObjects_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1361
+ return new TypeError(message);
1362
+ }
1363
+ }
1364
+ }
1365
+ })();
1366
+ return v_error === undefined ? null : v_error;
1367
+ }
1368
+ const RepresentationType = 'DataTransformValidationRepresentation';
1369
+ function normalize(input, existing, path, luvio, store, timestamp) {
1370
+ return input;
1371
+ }
1372
+ const select$3 = function DataTransformValidationRepresentationSelect() {
1373
+ return {
1374
+ kind: 'Fragment',
1375
+ version: VERSION,
1376
+ private: [],
1377
+ opaque: true
1378
+ };
1379
+ };
1380
+ function equals(existing, incoming) {
1381
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1382
+ return false;
1383
+ }
1384
+ return true;
1385
+ }
1386
+ const ingest = function DataTransformValidationRepresentationIngest(input, path, luvio, store, timestamp) {
1387
+ if (process.env.NODE_ENV !== 'production') {
1388
+ const validateError = validate(input);
1389
+ if (validateError !== null) {
1390
+ throw validateError;
1391
+ }
1392
+ }
1393
+ const key = path.fullPath;
1394
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
1395
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "data-transform", VERSION, RepresentationType, equals);
1396
+ return createLink(key);
1397
+ };
1398
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1399
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1400
+ const rootKey = fullPathFactory();
1401
+ rootKeySet.set(rootKey, {
1402
+ namespace: keyPrefix,
1403
+ representationName: RepresentationType,
1404
+ mergeable: false
1405
+ });
1406
+ }
1407
+
1408
+ function select$2(luvio, params) {
1409
+ return select$3();
1410
+ }
1411
+ function keyBuilder$4(luvio, params) {
1412
+ 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 + ')';
1413
+ }
1414
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1415
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
1416
+ }
1417
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1418
+ const { body } = response;
1419
+ const key = keyBuilder$4(luvio, resourceParams);
1420
+ luvio.storeIngest(key, ingest, body);
1421
+ const snapshot = luvio.storeLookup({
1422
+ recordId: key,
1423
+ node: select$2(),
1424
+ variables: {},
1425
+ }, snapshotRefresh);
1426
+ if (process.env.NODE_ENV !== 'production') {
1427
+ if (snapshot.state !== 'Fulfilled') {
1428
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1429
+ }
1430
+ }
1431
+ deepFreeze(snapshot.data);
1432
+ return snapshot;
1433
+ }
1434
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1435
+ const key = keyBuilder$4(luvio, params);
1436
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1437
+ luvio.storeIngestError(key, errorSnapshot);
1438
+ return errorSnapshot;
1439
+ }
1440
+ function createResourceRequest$3(config) {
1441
+ const headers = {};
1442
+ return {
1443
+ baseUri: '/services/data/v62.0',
1444
+ basePath: '/ssot/data-transforms-validation',
1445
+ method: 'post',
1446
+ body: config.body,
1447
+ urlParams: {},
1448
+ queryParams: {},
1449
+ headers,
1450
+ priority: 'normal',
1451
+ };
1452
+ }
1453
+
1454
+ const adapterName$3 = 'validateDataTransforms';
1455
+ const validateDataTransforms_ConfigPropertyMetadata = [
1456
+ generateParamConfigMetadata('capabilities', false, 2 /* Body */, 4 /* Unsupported */),
1457
+ generateParamConfigMetadata('creationType', true, 2 /* Body */, 0 /* String */),
1458
+ generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
1459
+ generateParamConfigMetadata('dataSpaceName', false, 2 /* Body */, 0 /* String */),
1460
+ generateParamConfigMetadata('definition', true, 2 /* Body */, 4 /* Unsupported */),
1461
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1462
+ generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1463
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
1464
+ generateParamConfigMetadata('primarySource', false, 2 /* Body */, 0 /* String */),
1465
+ generateParamConfigMetadata('tags', false, 2 /* Body */, 4 /* Unsupported */),
1466
+ generateParamConfigMetadata('type', true, 2 /* Body */, 0 /* String */),
1467
+ ];
1468
+ const validateDataTransforms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, validateDataTransforms_ConfigPropertyMetadata);
1469
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(validateDataTransforms_ConfigPropertyMetadata);
1470
+ function keyBuilder$3(luvio, config) {
1471
+ const resourceParams = createResourceParams$3(config);
1472
+ return keyBuilder$4(luvio, resourceParams);
1473
+ }
1474
+ function typeCheckConfig$3(untrustedConfig) {
1475
+ const config = {};
1476
+ typeCheckConfig$4(untrustedConfig, config, validateDataTransforms_ConfigPropertyMetadata);
1477
+ const untrustedConfig_capabilities = untrustedConfig.capabilities;
1478
+ if (untrustedIsObject(untrustedConfig_capabilities)) {
1479
+ const untrustedConfig_capabilities_object = {};
1480
+ const untrustedConfig_capabilities_keys = Object.keys(untrustedConfig_capabilities);
1481
+ for (let i = 0, arrayLength = untrustedConfig_capabilities_keys.length; i < arrayLength; i++) {
1482
+ const key = untrustedConfig_capabilities_keys[i];
1483
+ const untrustedConfig_capabilities_prop = untrustedConfig_capabilities[key];
1484
+ if (typeof untrustedConfig_capabilities_prop === 'boolean') {
1485
+ if (untrustedConfig_capabilities_object !== undefined) {
1486
+ untrustedConfig_capabilities_object[key] = untrustedConfig_capabilities_prop;
1487
+ }
1488
+ }
1489
+ }
1490
+ if (untrustedConfig_capabilities_object !== undefined && Object.keys(untrustedConfig_capabilities_object).length >= 0) {
1491
+ config.capabilities = untrustedConfig_capabilities_object;
1492
+ }
1493
+ }
1494
+ const untrustedConfig_definition = untrustedConfig.definition;
1495
+ if (untrustedIsObject(untrustedConfig_definition)) {
1496
+ const untrustedConfig_definition_object = {};
1497
+ const untrustedConfig_definition_keys = Object.keys(untrustedConfig_definition);
1498
+ for (let i = 0, arrayLength = untrustedConfig_definition_keys.length; i < arrayLength; i++) {
1499
+ const key = untrustedConfig_definition_keys[i];
1500
+ const untrustedConfig_definition_prop = untrustedConfig_definition[key];
1501
+ if (untrustedConfig_definition_object !== undefined) {
1502
+ untrustedConfig_definition_object[key] = untrustedConfig_definition_prop;
384
1503
  }
385
- for (let i = 0; i < obj_outputDataObjects.length; i++) {
386
- const obj_outputDataObjects_item = obj_outputDataObjects[i];
387
- const path_outputDataObjects_item = path_outputDataObjects + '[' + i + ']';
388
- const referencepath_outputDataObjects_itemValidationError = validate$1(obj_outputDataObjects_item, path_outputDataObjects_item);
389
- if (referencepath_outputDataObjects_itemValidationError !== null) {
390
- let message = 'Object doesn\'t match DataObjectRepresentation (at "' + path_outputDataObjects_item + '")\n';
391
- message += referencepath_outputDataObjects_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
392
- return new TypeError(message);
1504
+ }
1505
+ if (untrustedConfig_definition_object !== undefined && Object.keys(untrustedConfig_definition_object).length >= 0) {
1506
+ config.definition = untrustedConfig_definition_object;
1507
+ }
1508
+ }
1509
+ const untrustedConfig_tags = untrustedConfig.tags;
1510
+ if (untrustedIsObject(untrustedConfig_tags)) {
1511
+ const untrustedConfig_tags_object = {};
1512
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
1513
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
1514
+ const key = untrustedConfig_tags_keys[i];
1515
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
1516
+ if (typeof untrustedConfig_tags_prop === 'string') {
1517
+ if (untrustedConfig_tags_object !== undefined) {
1518
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
393
1519
  }
394
1520
  }
395
1521
  }
396
- })();
397
- return v_error === undefined ? null : v_error;
398
- }
399
- const RepresentationType = 'DataTransformValidationRepresentation';
400
- function normalize(input, existing, path, luvio, store, timestamp) {
401
- return input;
402
- }
403
- const select$1 = function DataTransformValidationRepresentationSelect() {
404
- return {
405
- kind: 'Fragment',
406
- version: VERSION,
407
- private: [],
408
- opaque: true
409
- };
410
- };
411
- function equals(existing, incoming) {
412
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
413
- return false;
1522
+ if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
1523
+ config.tags = untrustedConfig_tags_object;
1524
+ }
414
1525
  }
415
- return true;
1526
+ return config;
416
1527
  }
417
- const ingest = function DataTransformValidationRepresentationIngest(input, path, luvio, store, timestamp) {
1528
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1529
+ if (!untrustedIsObject(untrustedConfig)) {
1530
+ return null;
1531
+ }
418
1532
  if (process.env.NODE_ENV !== 'production') {
419
- const validateError = validate(input);
420
- if (validateError !== null) {
421
- throw validateError;
422
- }
1533
+ validateConfig(untrustedConfig, configPropertyNames);
423
1534
  }
424
- const key = path.fullPath;
425
- const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
426
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "data-transform", VERSION, RepresentationType, equals);
427
- return createLink(key);
428
- };
429
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
430
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
431
- const rootKey = fullPathFactory();
432
- rootKeySet.set(rootKey, {
433
- namespace: keyPrefix,
434
- representationName: RepresentationType,
435
- mergeable: false
1535
+ const config = typeCheckConfig$3(untrustedConfig);
1536
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1537
+ return null;
1538
+ }
1539
+ return config;
1540
+ }
1541
+ function adapterFragment$1(luvio, config) {
1542
+ createResourceParams$3(config);
1543
+ return select$2();
1544
+ }
1545
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1546
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1547
+ config,
1548
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
436
1549
  });
1550
+ return luvio.storeBroadcast().then(() => snapshot);
437
1551
  }
438
-
439
- function select(luvio, params) {
440
- return select$1();
1552
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1553
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1554
+ config,
1555
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1556
+ });
1557
+ return luvio.storeBroadcast().then(() => snapshot);
441
1558
  }
442
- function keyBuilder$1(luvio, params) {
443
- 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 + ')';
1559
+ function buildNetworkSnapshot$3(luvio, config, options) {
1560
+ const resourceParams = createResourceParams$3(config);
1561
+ const request = createResourceRequest$3(resourceParams);
1562
+ return luvio.dispatchResourceRequest(request, options)
1563
+ .then((response) => {
1564
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1565
+ const cache = new StoreKeyMap();
1566
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1567
+ return cache;
1568
+ });
1569
+ }, (response) => {
1570
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1571
+ });
444
1572
  }
445
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
446
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
1573
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1574
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, 'get', false);
447
1575
  }
448
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1576
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1577
+ const { luvio, config } = context;
1578
+ const selector = {
1579
+ recordId: keyBuilder$3(luvio, config),
1580
+ node: adapterFragment$1(luvio, config),
1581
+ variables: {},
1582
+ };
1583
+ const cacheSnapshot = storeLookup(selector, {
1584
+ config,
1585
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1586
+ });
1587
+ return cacheSnapshot;
1588
+ }
1589
+ const validateDataTransformsAdapterFactory = (luvio) => function dataTransform__validateDataTransforms(untrustedConfig, requestContext) {
1590
+ const config = validateAdapterConfig$3(untrustedConfig, validateDataTransforms_ConfigPropertyNames);
1591
+ // Invalid or incomplete config
1592
+ if (config === null) {
1593
+ return null;
1594
+ }
1595
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1596
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1597
+ };
1598
+
1599
+ function select$1(luvio, params) {
1600
+ return select$6();
1601
+ }
1602
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1603
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1604
+ }
1605
+ function ingestSuccess$1(luvio, resourceParams, response) {
449
1606
  const { body } = response;
450
- const key = keyBuilder$1(luvio, resourceParams);
451
- luvio.storeIngest(key, ingest, body);
1607
+ const key = keyBuilderFromType$2(luvio, body);
1608
+ luvio.storeIngest(key, ingest$2, body);
452
1609
  const snapshot = luvio.storeLookup({
453
1610
  recordId: key,
454
- node: select(),
1611
+ node: select$1(),
455
1612
  variables: {},
456
- }, snapshotRefresh);
1613
+ });
457
1614
  if (process.env.NODE_ENV !== 'production') {
458
1615
  if (snapshot.state !== 'Fulfilled') {
459
1616
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -462,28 +1619,23 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
462
1619
  deepFreeze(snapshot.data);
463
1620
  return snapshot;
464
1621
  }
465
- function ingestError(luvio, params, error, snapshotRefresh) {
466
- const key = keyBuilder$1(luvio, params);
467
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
468
- luvio.storeIngestError(key, errorSnapshot);
469
- return errorSnapshot;
470
- }
471
- function createResourceRequest(config) {
1622
+ function createResourceRequest$2(config) {
472
1623
  const headers = {};
473
1624
  return {
474
1625
  baseUri: '/services/data/v62.0',
475
- basePath: '/ssot/data-transforms-validation',
1626
+ basePath: '/ssot/data-transforms',
476
1627
  method: 'post',
477
1628
  body: config.body,
478
1629
  urlParams: {},
479
- queryParams: {},
1630
+ queryParams: config.queryParams,
480
1631
  headers,
481
1632
  priority: 'normal',
482
1633
  };
483
1634
  }
484
1635
 
485
- const adapterName = 'validateDataTransforms';
486
- const validateDataTransforms_ConfigPropertyMetadata = [
1636
+ const adapterName$2 = 'createDataTransform';
1637
+ const createDataTransform_ConfigPropertyMetadata = [
1638
+ generateParamConfigMetadata('filterGroup', false, 1 /* QueryParameter */, 0 /* String */),
487
1639
  generateParamConfigMetadata('capabilities', false, 2 /* Body */, 4 /* Unsupported */),
488
1640
  generateParamConfigMetadata('creationType', true, 2 /* Body */, 0 /* String */),
489
1641
  generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
@@ -496,15 +1648,11 @@ const validateDataTransforms_ConfigPropertyMetadata = [
496
1648
  generateParamConfigMetadata('tags', false, 2 /* Body */, 4 /* Unsupported */),
497
1649
  generateParamConfigMetadata('type', true, 2 /* Body */, 0 /* String */),
498
1650
  ];
499
- const validateDataTransforms_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, validateDataTransforms_ConfigPropertyMetadata);
500
- const createResourceParams = /*#__PURE__*/ createResourceParams$1(validateDataTransforms_ConfigPropertyMetadata);
501
- function keyBuilder(luvio, config) {
502
- const resourceParams = createResourceParams(config);
503
- return keyBuilder$1(luvio, resourceParams);
504
- }
505
- function typeCheckConfig(untrustedConfig) {
1651
+ const createDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createDataTransform_ConfigPropertyMetadata);
1652
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(createDataTransform_ConfigPropertyMetadata);
1653
+ function typeCheckConfig$2(untrustedConfig) {
506
1654
  const config = {};
507
- typeCheckConfig$1(untrustedConfig, config, validateDataTransforms_ConfigPropertyMetadata);
1655
+ typeCheckConfig$4(untrustedConfig, config, createDataTransform_ConfigPropertyMetadata);
508
1656
  const untrustedConfig_capabilities = untrustedConfig.capabilities;
509
1657
  if (untrustedIsObject(untrustedConfig_capabilities)) {
510
1658
  const untrustedConfig_capabilities_object = {};
@@ -556,45 +1704,151 @@ function typeCheckConfig(untrustedConfig) {
556
1704
  }
557
1705
  return config;
558
1706
  }
559
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1707
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
560
1708
  if (!untrustedIsObject(untrustedConfig)) {
561
1709
  return null;
562
1710
  }
563
1711
  if (process.env.NODE_ENV !== 'production') {
564
1712
  validateConfig(untrustedConfig, configPropertyNames);
565
1713
  }
566
- const config = typeCheckConfig(untrustedConfig);
1714
+ const config = typeCheckConfig$2(untrustedConfig);
1715
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1716
+ return null;
1717
+ }
1718
+ return config;
1719
+ }
1720
+ function buildNetworkSnapshot$2(luvio, config, options) {
1721
+ const resourceParams = createResourceParams$2(config);
1722
+ const request = createResourceRequest$2(resourceParams);
1723
+ return luvio.dispatchResourceRequest(request, options)
1724
+ .then((response) => {
1725
+ return luvio.handleSuccessResponse(() => {
1726
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1727
+ return luvio.storeBroadcast().then(() => snapshot);
1728
+ }, () => {
1729
+ const cache = new StoreKeyMap();
1730
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1731
+ return cache;
1732
+ });
1733
+ }, (response) => {
1734
+ deepFreeze(response);
1735
+ throw response;
1736
+ });
1737
+ }
1738
+ const createDataTransformAdapterFactory = (luvio) => {
1739
+ return function createDataTransform(untrustedConfig) {
1740
+ const config = validateAdapterConfig$2(untrustedConfig, createDataTransform_ConfigPropertyNames);
1741
+ // Invalid or incomplete config
1742
+ if (config === null) {
1743
+ throw new Error('Invalid config for "createDataTransform"');
1744
+ }
1745
+ return buildNetworkSnapshot$2(luvio, config);
1746
+ };
1747
+ };
1748
+
1749
+ function select(luvio, params) {
1750
+ return select$6();
1751
+ }
1752
+ function keyBuilder$2(luvio, params) {
1753
+ return keyBuilder$6(luvio, {
1754
+ name: params.urlParams.dataTransformNameOrId
1755
+ });
1756
+ }
1757
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1758
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1759
+ }
1760
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1761
+ const { body } = response;
1762
+ const key = keyBuilder$2(luvio, resourceParams);
1763
+ luvio.storeIngest(key, ingest$2, body);
1764
+ const snapshot = luvio.storeLookup({
1765
+ recordId: key,
1766
+ node: select(),
1767
+ variables: {},
1768
+ }, snapshotRefresh);
1769
+ if (process.env.NODE_ENV !== 'production') {
1770
+ if (snapshot.state !== 'Fulfilled') {
1771
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1772
+ }
1773
+ }
1774
+ deepFreeze(snapshot.data);
1775
+ return snapshot;
1776
+ }
1777
+ function ingestError(luvio, params, error, snapshotRefresh) {
1778
+ const key = keyBuilder$2(luvio, params);
1779
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1780
+ luvio.storeIngestError(key, errorSnapshot);
1781
+ return errorSnapshot;
1782
+ }
1783
+ function createResourceRequest$1(config) {
1784
+ const headers = {};
1785
+ return {
1786
+ baseUri: '/services/data/v62.0',
1787
+ basePath: '/ssot/data-transforms/' + config.urlParams.dataTransformNameOrId + '',
1788
+ method: 'get',
1789
+ body: null,
1790
+ urlParams: config.urlParams,
1791
+ queryParams: config.queryParams,
1792
+ headers,
1793
+ priority: 'normal',
1794
+ };
1795
+ }
1796
+
1797
+ const adapterName$1 = 'getDataTransform';
1798
+ const getDataTransform_ConfigPropertyMetadata = [
1799
+ generateParamConfigMetadata('dataTransformNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1800
+ generateParamConfigMetadata('filterGroup', false, 1 /* QueryParameter */, 0 /* String */),
1801
+ ];
1802
+ const getDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getDataTransform_ConfigPropertyMetadata);
1803
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getDataTransform_ConfigPropertyMetadata);
1804
+ function keyBuilder$1(luvio, config) {
1805
+ const resourceParams = createResourceParams$1(config);
1806
+ return keyBuilder$2(luvio, resourceParams);
1807
+ }
1808
+ function typeCheckConfig$1(untrustedConfig) {
1809
+ const config = {};
1810
+ typeCheckConfig$4(untrustedConfig, config, getDataTransform_ConfigPropertyMetadata);
1811
+ return config;
1812
+ }
1813
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1814
+ if (!untrustedIsObject(untrustedConfig)) {
1815
+ return null;
1816
+ }
1817
+ if (process.env.NODE_ENV !== 'production') {
1818
+ validateConfig(untrustedConfig, configPropertyNames);
1819
+ }
1820
+ const config = typeCheckConfig$1(untrustedConfig);
567
1821
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
568
1822
  return null;
569
1823
  }
570
1824
  return config;
571
1825
  }
572
1826
  function adapterFragment(luvio, config) {
573
- createResourceParams(config);
1827
+ createResourceParams$1(config);
574
1828
  return select();
575
1829
  }
576
1830
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
577
1831
  const snapshot = ingestSuccess(luvio, resourceParams, response, {
578
1832
  config,
579
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1833
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
580
1834
  });
581
1835
  return luvio.storeBroadcast().then(() => snapshot);
582
1836
  }
583
1837
  function onFetchResponseError(luvio, config, resourceParams, response) {
584
1838
  const snapshot = ingestError(luvio, resourceParams, response, {
585
1839
  config,
586
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1840
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
587
1841
  });
588
1842
  return luvio.storeBroadcast().then(() => snapshot);
589
1843
  }
590
- function buildNetworkSnapshot(luvio, config, options) {
591
- const resourceParams = createResourceParams(config);
592
- const request = createResourceRequest(resourceParams);
1844
+ function buildNetworkSnapshot$1(luvio, config, options) {
1845
+ const resourceParams = createResourceParams$1(config);
1846
+ const request = createResourceRequest$1(resourceParams);
593
1847
  return luvio.dispatchResourceRequest(request, options)
594
1848
  .then((response) => {
595
1849
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
596
1850
  const cache = new StoreKeyMap();
597
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1851
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
598
1852
  return cache;
599
1853
  });
600
1854
  }, (response) => {
@@ -602,23 +1856,23 @@ function buildNetworkSnapshot(luvio, config, options) {
602
1856
  });
603
1857
  }
604
1858
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
605
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
1859
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
606
1860
  }
607
1861
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
608
1862
  const { luvio, config } = context;
609
1863
  const selector = {
610
- recordId: keyBuilder(luvio, config),
1864
+ recordId: keyBuilder$1(luvio, config),
611
1865
  node: adapterFragment(luvio, config),
612
1866
  variables: {},
613
1867
  };
614
1868
  const cacheSnapshot = storeLookup(selector, {
615
1869
  config,
616
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1870
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
617
1871
  });
618
1872
  return cacheSnapshot;
619
1873
  }
620
- const validateDataTransformsAdapterFactory = (luvio) => function dataTransform__validateDataTransforms(untrustedConfig, requestContext) {
621
- const config = validateAdapterConfig(untrustedConfig, validateDataTransforms_ConfigPropertyNames);
1874
+ const getDataTransformAdapterFactory = (luvio) => function dataTransform__getDataTransform(untrustedConfig, requestContext) {
1875
+ const config = validateAdapterConfig$1(untrustedConfig, getDataTransform_ConfigPropertyNames);
622
1876
  // Invalid or incomplete config
623
1877
  if (config === null) {
624
1878
  return null;
@@ -627,4 +1881,88 @@ const validateDataTransformsAdapterFactory = (luvio) => function dataTransform__
627
1881
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
628
1882
  };
629
1883
 
630
- export { validateDataTransformsAdapterFactory };
1884
+ function keyBuilder(luvio, params) {
1885
+ return keyBuilder$6(luvio, {
1886
+ name: params.urlParams.dataTransformNameOrId
1887
+ });
1888
+ }
1889
+ function getResponseCacheKeys(cacheKeyMap, luvio, resourceParams) {
1890
+ const key = keyBuilder(luvio, resourceParams);
1891
+ cacheKeyMap.set(key, {
1892
+ namespace: keyPrefix,
1893
+ representationName: RepresentationType$3,
1894
+ mergeable: false
1895
+ });
1896
+ }
1897
+ function evictSuccess(luvio, resourceParams) {
1898
+ const key = keyBuilder(luvio, resourceParams);
1899
+ luvio.storeEvict(key);
1900
+ }
1901
+ function createResourceRequest(config) {
1902
+ const headers = {};
1903
+ return {
1904
+ baseUri: '/services/data/v62.0',
1905
+ basePath: '/ssot/data-transforms/' + config.urlParams.dataTransformNameOrId + '',
1906
+ method: 'delete',
1907
+ body: null,
1908
+ urlParams: config.urlParams,
1909
+ queryParams: {},
1910
+ headers,
1911
+ priority: 'normal',
1912
+ };
1913
+ }
1914
+
1915
+ const adapterName = 'deleteDataTransform';
1916
+ const deleteDataTransform_ConfigPropertyMetadata = [
1917
+ generateParamConfigMetadata('dataTransformNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1918
+ ];
1919
+ const deleteDataTransform_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, deleteDataTransform_ConfigPropertyMetadata);
1920
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(deleteDataTransform_ConfigPropertyMetadata);
1921
+ function typeCheckConfig(untrustedConfig) {
1922
+ const config = {};
1923
+ typeCheckConfig$4(untrustedConfig, config, deleteDataTransform_ConfigPropertyMetadata);
1924
+ return config;
1925
+ }
1926
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1927
+ if (!untrustedIsObject(untrustedConfig)) {
1928
+ return null;
1929
+ }
1930
+ if (process.env.NODE_ENV !== 'production') {
1931
+ validateConfig(untrustedConfig, configPropertyNames);
1932
+ }
1933
+ const config = typeCheckConfig(untrustedConfig);
1934
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1935
+ return null;
1936
+ }
1937
+ return config;
1938
+ }
1939
+ function buildNetworkSnapshot(luvio, config, options) {
1940
+ const resourceParams = createResourceParams(config);
1941
+ const request = createResourceRequest(resourceParams);
1942
+ return luvio.dispatchResourceRequest(request, options)
1943
+ .then(() => {
1944
+ return luvio.handleSuccessResponse(() => {
1945
+ evictSuccess(luvio, resourceParams);
1946
+ return luvio.storeBroadcast();
1947
+ }, () => {
1948
+ const cache = new StoreKeyMap();
1949
+ getResponseCacheKeys(cache, luvio, resourceParams);
1950
+ return cache;
1951
+ });
1952
+ }, (response) => {
1953
+ deepFreeze(response);
1954
+ throw response;
1955
+ });
1956
+ }
1957
+ const deleteDataTransformAdapterFactory = (luvio) => {
1958
+ return function dataTransformdeleteDataTransform(untrustedConfig) {
1959
+ const config = validateAdapterConfig(untrustedConfig, deleteDataTransform_ConfigPropertyNames);
1960
+ // Invalid or incomplete config
1961
+ if (config === null) {
1962
+ throw new Error(`Invalid config for "${adapterName}"`);
1963
+ }
1964
+ return buildNetworkSnapshot(luvio, config);
1965
+ };
1966
+ };
1967
+
1968
+ export { createDataTransformAdapterFactory, deleteDataTransformAdapterFactory, getDataTransformAdapterFactory, validateDataTransformsAdapterFactory };