@salesforce/lds-adapters-cdp-personalization-service 1.303.0 → 1.304.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/cdp-personalization-service.js +743 -28
- package/dist/es/es2018/types/src/generated/types/CriteriaRepresentation.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/FilterRepresentation.d.ts +66 -0
- package/dist/es/es2018/types/src/generated/types/FiltersWrapRepresentation.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationDecisionRepresentation.d.ts +14 -4
- package/dist/es/es2018/types/src/generated/types/PersonalizationPointRepresentation.d.ts +12 -3
- package/dist/es/es2018/types/src/generated/types/SubjectRepresentation.d.ts +37 -0
- package/package.json +3 -3
- package/sfdc/index.js +744 -29
- package/src/raml/api.raml +116 -1
- package/src/raml/luvio.raml +2 -0
|
@@ -72,6 +72,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
72
72
|
const keyPrefix = 'personalization-service';
|
|
73
73
|
|
|
74
74
|
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
const { stringify: JSONStringify } = JSON;
|
|
75
76
|
function equalsArray(a, b, equalsItem) {
|
|
76
77
|
const aLength = a.length;
|
|
77
78
|
const bLength = b.length;
|
|
@@ -91,7 +92,7 @@ function createLink(ref) {
|
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
function validate$
|
|
95
|
+
function validate$b(obj, path = 'PersonalizationAttributeValueInputRepresentation') {
|
|
95
96
|
const v_error = (() => {
|
|
96
97
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
97
98
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -178,7 +179,7 @@ function validate$7(obj, path = 'PersonalizationAttributeValueInputRepresentatio
|
|
|
178
179
|
return v_error === undefined ? null : v_error;
|
|
179
180
|
}
|
|
180
181
|
|
|
181
|
-
function validate$
|
|
182
|
+
function validate$a(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
182
183
|
const v_error = (() => {
|
|
183
184
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
184
185
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -191,7 +192,7 @@ function validate$6(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
|
191
192
|
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
192
193
|
const obj_attributeValues_item = obj_attributeValues[i];
|
|
193
194
|
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
194
|
-
const referencepath_attributeValues_itemValidationError = validate$
|
|
195
|
+
const referencepath_attributeValues_itemValidationError = validate$b(obj_attributeValues_item, path_attributeValues_item);
|
|
195
196
|
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
196
197
|
let message = 'Object doesn\'t match PersonalizationAttributeValueInputRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
197
198
|
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -332,8 +333,8 @@ function validate$6(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
|
332
333
|
return v_error === undefined ? null : v_error;
|
|
333
334
|
}
|
|
334
335
|
|
|
335
|
-
const VERSION$
|
|
336
|
-
function validate$
|
|
336
|
+
const VERSION$6 = "52ea9c14b7a747a28cedbcff0e7ab169";
|
|
337
|
+
function validate$9(obj, path = 'PersonalizationAttributeValueRepresentation') {
|
|
337
338
|
const v_error = (() => {
|
|
338
339
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
339
340
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -419,10 +420,10 @@ function validate$5(obj, path = 'PersonalizationAttributeValueRepresentation') {
|
|
|
419
420
|
})();
|
|
420
421
|
return v_error === undefined ? null : v_error;
|
|
421
422
|
}
|
|
422
|
-
const select$
|
|
423
|
+
const select$b = function PersonalizationAttributeValueRepresentationSelect() {
|
|
423
424
|
return {
|
|
424
425
|
kind: 'Fragment',
|
|
425
|
-
version: VERSION$
|
|
426
|
+
version: VERSION$6,
|
|
426
427
|
private: [],
|
|
427
428
|
selections: [
|
|
428
429
|
{
|
|
@@ -440,7 +441,7 @@ const select$9 = function PersonalizationAttributeValueRepresentationSelect() {
|
|
|
440
441
|
]
|
|
441
442
|
};
|
|
442
443
|
};
|
|
443
|
-
function equals$
|
|
444
|
+
function equals$6(existing, incoming) {
|
|
444
445
|
const existing_attributeEnum = existing.attributeEnum;
|
|
445
446
|
const incoming_attributeEnum = incoming.attributeEnum;
|
|
446
447
|
if (!(existing_attributeEnum === incoming_attributeEnum)) {
|
|
@@ -459,7 +460,656 @@ function equals$4(existing, incoming) {
|
|
|
459
460
|
return true;
|
|
460
461
|
}
|
|
461
462
|
|
|
462
|
-
|
|
463
|
+
function validate$8(obj, path = 'FiltersWrapRepresentation') {
|
|
464
|
+
const v_error = (() => {
|
|
465
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
466
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
467
|
+
}
|
|
468
|
+
if (obj.filters !== undefined) {
|
|
469
|
+
const obj_filters = obj.filters;
|
|
470
|
+
const path_filters = path + '.filters';
|
|
471
|
+
if (!ArrayIsArray(obj_filters)) {
|
|
472
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
|
|
473
|
+
}
|
|
474
|
+
for (let i = 0; i < obj_filters.length; i++) {
|
|
475
|
+
const obj_filters_item = obj_filters[i];
|
|
476
|
+
const path_filters_item = path_filters + '[' + i + ']';
|
|
477
|
+
if (typeof obj_filters_item !== 'object') {
|
|
478
|
+
return new TypeError('Expected "object" but received "' + typeof obj_filters_item + '" (at "' + path_filters_item + '")');
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (obj.operator !== undefined) {
|
|
483
|
+
const obj_operator = obj.operator;
|
|
484
|
+
const path_operator = path + '.operator';
|
|
485
|
+
let obj_operator_union0 = null;
|
|
486
|
+
const obj_operator_union0_error = (() => {
|
|
487
|
+
if (typeof obj_operator !== 'string') {
|
|
488
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
489
|
+
}
|
|
490
|
+
})();
|
|
491
|
+
if (obj_operator_union0_error != null) {
|
|
492
|
+
obj_operator_union0 = obj_operator_union0_error.message;
|
|
493
|
+
}
|
|
494
|
+
let obj_operator_union1 = null;
|
|
495
|
+
const obj_operator_union1_error = (() => {
|
|
496
|
+
if (obj_operator !== null) {
|
|
497
|
+
return new TypeError('Expected "null" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
498
|
+
}
|
|
499
|
+
})();
|
|
500
|
+
if (obj_operator_union1_error != null) {
|
|
501
|
+
obj_operator_union1 = obj_operator_union1_error.message;
|
|
502
|
+
}
|
|
503
|
+
if (obj_operator_union0 && obj_operator_union1) {
|
|
504
|
+
let message = 'Object doesn\'t match union (at "' + path_operator + '")';
|
|
505
|
+
message += '\n' + obj_operator_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
506
|
+
message += '\n' + obj_operator_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
507
|
+
return new TypeError(message);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (obj.type !== undefined) {
|
|
511
|
+
const obj_type = obj.type;
|
|
512
|
+
const path_type = path + '.type';
|
|
513
|
+
let obj_type_union0 = null;
|
|
514
|
+
const obj_type_union0_error = (() => {
|
|
515
|
+
if (typeof obj_type !== 'string') {
|
|
516
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
517
|
+
}
|
|
518
|
+
})();
|
|
519
|
+
if (obj_type_union0_error != null) {
|
|
520
|
+
obj_type_union0 = obj_type_union0_error.message;
|
|
521
|
+
}
|
|
522
|
+
let obj_type_union1 = null;
|
|
523
|
+
const obj_type_union1_error = (() => {
|
|
524
|
+
if (obj_type !== null) {
|
|
525
|
+
return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
526
|
+
}
|
|
527
|
+
})();
|
|
528
|
+
if (obj_type_union1_error != null) {
|
|
529
|
+
obj_type_union1 = obj_type_union1_error.message;
|
|
530
|
+
}
|
|
531
|
+
if (obj_type_union0 && obj_type_union1) {
|
|
532
|
+
let message = 'Object doesn\'t match union (at "' + path_type + '")';
|
|
533
|
+
message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
534
|
+
message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
535
|
+
return new TypeError(message);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
})();
|
|
539
|
+
return v_error === undefined ? null : v_error;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function validate$7(obj, path = 'SubjectRepresentation') {
|
|
543
|
+
const v_error = (() => {
|
|
544
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
545
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
546
|
+
}
|
|
547
|
+
const obj_fieldApiName = obj.fieldApiName;
|
|
548
|
+
const path_fieldApiName = path + '.fieldApiName';
|
|
549
|
+
if (typeof obj_fieldApiName !== 'string') {
|
|
550
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldApiName + '" (at "' + path_fieldApiName + '")');
|
|
551
|
+
}
|
|
552
|
+
if (obj.fieldLabel !== undefined) {
|
|
553
|
+
const obj_fieldLabel = obj.fieldLabel;
|
|
554
|
+
const path_fieldLabel = path + '.fieldLabel';
|
|
555
|
+
if (typeof obj_fieldLabel !== 'string') {
|
|
556
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldLabel + '" (at "' + path_fieldLabel + '")');
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
const obj_objectApiName = obj.objectApiName;
|
|
560
|
+
const path_objectApiName = path + '.objectApiName';
|
|
561
|
+
if (typeof obj_objectApiName !== 'string') {
|
|
562
|
+
return new TypeError('Expected "string" but received "' + typeof obj_objectApiName + '" (at "' + path_objectApiName + '")');
|
|
563
|
+
}
|
|
564
|
+
if (obj.objectLabel !== undefined) {
|
|
565
|
+
const obj_objectLabel = obj.objectLabel;
|
|
566
|
+
const path_objectLabel = path + '.objectLabel';
|
|
567
|
+
if (typeof obj_objectLabel !== 'string') {
|
|
568
|
+
return new TypeError('Expected "string" but received "' + typeof obj_objectLabel + '" (at "' + path_objectLabel + '")');
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
})();
|
|
572
|
+
return v_error === undefined ? null : v_error;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const VERSION$5 = "437fc3300d85b1cb5bc34ec53413937d";
|
|
576
|
+
function validate$6(obj, path = 'FilterRepresentation') {
|
|
577
|
+
const v_error = (() => {
|
|
578
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
579
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
580
|
+
}
|
|
581
|
+
if (obj.aggregateFunction !== undefined) {
|
|
582
|
+
const obj_aggregateFunction = obj.aggregateFunction;
|
|
583
|
+
const path_aggregateFunction = path + '.aggregateFunction';
|
|
584
|
+
let obj_aggregateFunction_union0 = null;
|
|
585
|
+
const obj_aggregateFunction_union0_error = (() => {
|
|
586
|
+
if (typeof obj_aggregateFunction !== 'string') {
|
|
587
|
+
return new TypeError('Expected "string" but received "' + typeof obj_aggregateFunction + '" (at "' + path_aggregateFunction + '")');
|
|
588
|
+
}
|
|
589
|
+
})();
|
|
590
|
+
if (obj_aggregateFunction_union0_error != null) {
|
|
591
|
+
obj_aggregateFunction_union0 = obj_aggregateFunction_union0_error.message;
|
|
592
|
+
}
|
|
593
|
+
let obj_aggregateFunction_union1 = null;
|
|
594
|
+
const obj_aggregateFunction_union1_error = (() => {
|
|
595
|
+
if (obj_aggregateFunction !== null) {
|
|
596
|
+
return new TypeError('Expected "null" but received "' + typeof obj_aggregateFunction + '" (at "' + path_aggregateFunction + '")');
|
|
597
|
+
}
|
|
598
|
+
})();
|
|
599
|
+
if (obj_aggregateFunction_union1_error != null) {
|
|
600
|
+
obj_aggregateFunction_union1 = obj_aggregateFunction_union1_error.message;
|
|
601
|
+
}
|
|
602
|
+
if (obj_aggregateFunction_union0 && obj_aggregateFunction_union1) {
|
|
603
|
+
let message = 'Object doesn\'t match union (at "' + path_aggregateFunction + '")';
|
|
604
|
+
message += '\n' + obj_aggregateFunction_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
605
|
+
message += '\n' + obj_aggregateFunction_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
606
|
+
return new TypeError(message);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
if (obj.comparison !== undefined) {
|
|
610
|
+
const obj_comparison = obj.comparison;
|
|
611
|
+
const path_comparison = path + '.comparison';
|
|
612
|
+
let obj_comparison_union0 = null;
|
|
613
|
+
const obj_comparison_union0_error = (() => {
|
|
614
|
+
const referencepath_comparisonValidationError = validate$6(obj_comparison, path_comparison);
|
|
615
|
+
if (referencepath_comparisonValidationError !== null) {
|
|
616
|
+
let message = 'Object doesn\'t match FilterRepresentation (at "' + path_comparison + '")\n';
|
|
617
|
+
message += referencepath_comparisonValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
618
|
+
return new TypeError(message);
|
|
619
|
+
}
|
|
620
|
+
})();
|
|
621
|
+
if (obj_comparison_union0_error != null) {
|
|
622
|
+
obj_comparison_union0 = obj_comparison_union0_error.message;
|
|
623
|
+
}
|
|
624
|
+
let obj_comparison_union1 = null;
|
|
625
|
+
const obj_comparison_union1_error = (() => {
|
|
626
|
+
if (obj_comparison !== null) {
|
|
627
|
+
return new TypeError('Expected "null" but received "' + typeof obj_comparison + '" (at "' + path_comparison + '")');
|
|
628
|
+
}
|
|
629
|
+
})();
|
|
630
|
+
if (obj_comparison_union1_error != null) {
|
|
631
|
+
obj_comparison_union1 = obj_comparison_union1_error.message;
|
|
632
|
+
}
|
|
633
|
+
if (obj_comparison_union0 && obj_comparison_union1) {
|
|
634
|
+
let message = 'Object doesn\'t match union (at "' + path_comparison + '")';
|
|
635
|
+
message += '\n' + obj_comparison_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
636
|
+
message += '\n' + obj_comparison_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
637
|
+
return new TypeError(message);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
if (obj.filter !== undefined) {
|
|
641
|
+
const obj_filter = obj.filter;
|
|
642
|
+
const path_filter = path + '.filter';
|
|
643
|
+
let obj_filter_union0 = null;
|
|
644
|
+
const obj_filter_union0_error = (() => {
|
|
645
|
+
const referencepath_filterValidationError = validate$8(obj_filter, path_filter);
|
|
646
|
+
if (referencepath_filterValidationError !== null) {
|
|
647
|
+
let message = 'Object doesn\'t match FiltersWrapRepresentation (at "' + path_filter + '")\n';
|
|
648
|
+
message += referencepath_filterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
649
|
+
return new TypeError(message);
|
|
650
|
+
}
|
|
651
|
+
})();
|
|
652
|
+
if (obj_filter_union0_error != null) {
|
|
653
|
+
obj_filter_union0 = obj_filter_union0_error.message;
|
|
654
|
+
}
|
|
655
|
+
let obj_filter_union1 = null;
|
|
656
|
+
const obj_filter_union1_error = (() => {
|
|
657
|
+
if (obj_filter !== null) {
|
|
658
|
+
return new TypeError('Expected "null" but received "' + typeof obj_filter + '" (at "' + path_filter + '")');
|
|
659
|
+
}
|
|
660
|
+
})();
|
|
661
|
+
if (obj_filter_union1_error != null) {
|
|
662
|
+
obj_filter_union1 = obj_filter_union1_error.message;
|
|
663
|
+
}
|
|
664
|
+
if (obj_filter_union0 && obj_filter_union1) {
|
|
665
|
+
let message = 'Object doesn\'t match union (at "' + path_filter + '")';
|
|
666
|
+
message += '\n' + obj_filter_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
667
|
+
message += '\n' + obj_filter_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
668
|
+
return new TypeError(message);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (obj.filters !== undefined) {
|
|
672
|
+
const obj_filters = obj.filters;
|
|
673
|
+
const path_filters = path + '.filters';
|
|
674
|
+
if (!ArrayIsArray(obj_filters)) {
|
|
675
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
|
|
676
|
+
}
|
|
677
|
+
for (let i = 0; i < obj_filters.length; i++) {
|
|
678
|
+
const obj_filters_item = obj_filters[i];
|
|
679
|
+
const path_filters_item = path_filters + '[' + i + ']';
|
|
680
|
+
let obj_filters_item_union0 = null;
|
|
681
|
+
const obj_filters_item_union0_error = (() => {
|
|
682
|
+
const referencepath_filters_itemValidationError = validate$6(obj_filters_item, path_filters_item);
|
|
683
|
+
if (referencepath_filters_itemValidationError !== null) {
|
|
684
|
+
let message = 'Object doesn\'t match FilterRepresentation (at "' + path_filters_item + '")\n';
|
|
685
|
+
message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
686
|
+
return new TypeError(message);
|
|
687
|
+
}
|
|
688
|
+
})();
|
|
689
|
+
if (obj_filters_item_union0_error != null) {
|
|
690
|
+
obj_filters_item_union0 = obj_filters_item_union0_error.message;
|
|
691
|
+
}
|
|
692
|
+
let obj_filters_item_union1 = null;
|
|
693
|
+
const obj_filters_item_union1_error = (() => {
|
|
694
|
+
if (obj_filters_item !== null) {
|
|
695
|
+
return new TypeError('Expected "null" but received "' + typeof obj_filters_item + '" (at "' + path_filters_item + '")');
|
|
696
|
+
}
|
|
697
|
+
})();
|
|
698
|
+
if (obj_filters_item_union1_error != null) {
|
|
699
|
+
obj_filters_item_union1 = obj_filters_item_union1_error.message;
|
|
700
|
+
}
|
|
701
|
+
if (obj_filters_item_union0 && obj_filters_item_union1) {
|
|
702
|
+
let message = 'Object doesn\'t match union (at "' + path_filters_item + '")';
|
|
703
|
+
message += '\n' + obj_filters_item_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
704
|
+
message += '\n' + obj_filters_item_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
705
|
+
return new TypeError(message);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
if (obj.firstBoundValue !== undefined) {
|
|
710
|
+
const obj_firstBoundValue = obj.firstBoundValue;
|
|
711
|
+
const path_firstBoundValue = path + '.firstBoundValue';
|
|
712
|
+
let obj_firstBoundValue_union0 = null;
|
|
713
|
+
const obj_firstBoundValue_union0_error = (() => {
|
|
714
|
+
if (typeof obj_firstBoundValue !== 'string') {
|
|
715
|
+
return new TypeError('Expected "string" but received "' + typeof obj_firstBoundValue + '" (at "' + path_firstBoundValue + '")');
|
|
716
|
+
}
|
|
717
|
+
})();
|
|
718
|
+
if (obj_firstBoundValue_union0_error != null) {
|
|
719
|
+
obj_firstBoundValue_union0 = obj_firstBoundValue_union0_error.message;
|
|
720
|
+
}
|
|
721
|
+
let obj_firstBoundValue_union1 = null;
|
|
722
|
+
const obj_firstBoundValue_union1_error = (() => {
|
|
723
|
+
if (obj_firstBoundValue !== null) {
|
|
724
|
+
return new TypeError('Expected "null" but received "' + typeof obj_firstBoundValue + '" (at "' + path_firstBoundValue + '")');
|
|
725
|
+
}
|
|
726
|
+
})();
|
|
727
|
+
if (obj_firstBoundValue_union1_error != null) {
|
|
728
|
+
obj_firstBoundValue_union1 = obj_firstBoundValue_union1_error.message;
|
|
729
|
+
}
|
|
730
|
+
if (obj_firstBoundValue_union0 && obj_firstBoundValue_union1) {
|
|
731
|
+
let message = 'Object doesn\'t match union (at "' + path_firstBoundValue + '")';
|
|
732
|
+
message += '\n' + obj_firstBoundValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
733
|
+
message += '\n' + obj_firstBoundValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
734
|
+
return new TypeError(message);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
if (obj.operator !== undefined) {
|
|
738
|
+
const obj_operator = obj.operator;
|
|
739
|
+
const path_operator = path + '.operator';
|
|
740
|
+
let obj_operator_union0 = null;
|
|
741
|
+
const obj_operator_union0_error = (() => {
|
|
742
|
+
if (typeof obj_operator !== 'string') {
|
|
743
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
744
|
+
}
|
|
745
|
+
})();
|
|
746
|
+
if (obj_operator_union0_error != null) {
|
|
747
|
+
obj_operator_union0 = obj_operator_union0_error.message;
|
|
748
|
+
}
|
|
749
|
+
let obj_operator_union1 = null;
|
|
750
|
+
const obj_operator_union1_error = (() => {
|
|
751
|
+
if (obj_operator !== null) {
|
|
752
|
+
return new TypeError('Expected "null" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
753
|
+
}
|
|
754
|
+
})();
|
|
755
|
+
if (obj_operator_union1_error != null) {
|
|
756
|
+
obj_operator_union1 = obj_operator_union1_error.message;
|
|
757
|
+
}
|
|
758
|
+
if (obj_operator_union0 && obj_operator_union1) {
|
|
759
|
+
let message = 'Object doesn\'t match union (at "' + path_operator + '")';
|
|
760
|
+
message += '\n' + obj_operator_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
761
|
+
message += '\n' + obj_operator_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
762
|
+
return new TypeError(message);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
if (obj.path !== undefined) {
|
|
766
|
+
const obj_path = obj.path;
|
|
767
|
+
const path_path = path + '.path';
|
|
768
|
+
if (!ArrayIsArray(obj_path)) {
|
|
769
|
+
return new TypeError('Expected "array" but received "' + typeof obj_path + '" (at "' + path_path + '")');
|
|
770
|
+
}
|
|
771
|
+
for (let i = 0; i < obj_path.length; i++) {
|
|
772
|
+
const obj_path_item = obj_path[i];
|
|
773
|
+
const path_path_item = path_path + '[' + i + ']';
|
|
774
|
+
if (!ArrayIsArray(obj_path_item)) {
|
|
775
|
+
return new TypeError('Expected "array" but received "' + typeof obj_path_item + '" (at "' + path_path_item + '")');
|
|
776
|
+
}
|
|
777
|
+
for (let i = 0; i < obj_path_item.length; i++) {
|
|
778
|
+
const obj_path_item_item = obj_path_item[i];
|
|
779
|
+
const path_path_item_item = path_path_item + '[' + i + ']';
|
|
780
|
+
const referencepath_path_item_itemValidationError = validate$7(obj_path_item_item, path_path_item_item);
|
|
781
|
+
if (referencepath_path_item_itemValidationError !== null) {
|
|
782
|
+
let message = 'Object doesn\'t match SubjectRepresentation (at "' + path_path_item_item + '")\n';
|
|
783
|
+
message += referencepath_path_item_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
784
|
+
return new TypeError(message);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
if (obj.ruleTimeZone !== undefined) {
|
|
790
|
+
const obj_ruleTimeZone = obj.ruleTimeZone;
|
|
791
|
+
const path_ruleTimeZone = path + '.ruleTimeZone';
|
|
792
|
+
let obj_ruleTimeZone_union0 = null;
|
|
793
|
+
const obj_ruleTimeZone_union0_error = (() => {
|
|
794
|
+
if (typeof obj_ruleTimeZone !== 'string') {
|
|
795
|
+
return new TypeError('Expected "string" but received "' + typeof obj_ruleTimeZone + '" (at "' + path_ruleTimeZone + '")');
|
|
796
|
+
}
|
|
797
|
+
})();
|
|
798
|
+
if (obj_ruleTimeZone_union0_error != null) {
|
|
799
|
+
obj_ruleTimeZone_union0 = obj_ruleTimeZone_union0_error.message;
|
|
800
|
+
}
|
|
801
|
+
let obj_ruleTimeZone_union1 = null;
|
|
802
|
+
const obj_ruleTimeZone_union1_error = (() => {
|
|
803
|
+
if (obj_ruleTimeZone !== null) {
|
|
804
|
+
return new TypeError('Expected "null" but received "' + typeof obj_ruleTimeZone + '" (at "' + path_ruleTimeZone + '")');
|
|
805
|
+
}
|
|
806
|
+
})();
|
|
807
|
+
if (obj_ruleTimeZone_union1_error != null) {
|
|
808
|
+
obj_ruleTimeZone_union1 = obj_ruleTimeZone_union1_error.message;
|
|
809
|
+
}
|
|
810
|
+
if (obj_ruleTimeZone_union0 && obj_ruleTimeZone_union1) {
|
|
811
|
+
let message = 'Object doesn\'t match union (at "' + path_ruleTimeZone + '")';
|
|
812
|
+
message += '\n' + obj_ruleTimeZone_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
813
|
+
message += '\n' + obj_ruleTimeZone_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
814
|
+
return new TypeError(message);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (obj.secondBoundValue !== undefined) {
|
|
818
|
+
const obj_secondBoundValue = obj.secondBoundValue;
|
|
819
|
+
const path_secondBoundValue = path + '.secondBoundValue';
|
|
820
|
+
let obj_secondBoundValue_union0 = null;
|
|
821
|
+
const obj_secondBoundValue_union0_error = (() => {
|
|
822
|
+
if (typeof obj_secondBoundValue !== 'string') {
|
|
823
|
+
return new TypeError('Expected "string" but received "' + typeof obj_secondBoundValue + '" (at "' + path_secondBoundValue + '")');
|
|
824
|
+
}
|
|
825
|
+
})();
|
|
826
|
+
if (obj_secondBoundValue_union0_error != null) {
|
|
827
|
+
obj_secondBoundValue_union0 = obj_secondBoundValue_union0_error.message;
|
|
828
|
+
}
|
|
829
|
+
let obj_secondBoundValue_union1 = null;
|
|
830
|
+
const obj_secondBoundValue_union1_error = (() => {
|
|
831
|
+
if (obj_secondBoundValue !== null) {
|
|
832
|
+
return new TypeError('Expected "null" but received "' + typeof obj_secondBoundValue + '" (at "' + path_secondBoundValue + '")');
|
|
833
|
+
}
|
|
834
|
+
})();
|
|
835
|
+
if (obj_secondBoundValue_union1_error != null) {
|
|
836
|
+
obj_secondBoundValue_union1 = obj_secondBoundValue_union1_error.message;
|
|
837
|
+
}
|
|
838
|
+
if (obj_secondBoundValue_union0 && obj_secondBoundValue_union1) {
|
|
839
|
+
let message = 'Object doesn\'t match union (at "' + path_secondBoundValue + '")';
|
|
840
|
+
message += '\n' + obj_secondBoundValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
841
|
+
message += '\n' + obj_secondBoundValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
842
|
+
return new TypeError(message);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
if (obj.subject !== undefined) {
|
|
846
|
+
const obj_subject = obj.subject;
|
|
847
|
+
const path_subject = path + '.subject';
|
|
848
|
+
let obj_subject_union0 = null;
|
|
849
|
+
const obj_subject_union0_error = (() => {
|
|
850
|
+
const referencepath_subjectValidationError = validate$7(obj_subject, path_subject);
|
|
851
|
+
if (referencepath_subjectValidationError !== null) {
|
|
852
|
+
let message = 'Object doesn\'t match SubjectRepresentation (at "' + path_subject + '")\n';
|
|
853
|
+
message += referencepath_subjectValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
854
|
+
return new TypeError(message);
|
|
855
|
+
}
|
|
856
|
+
})();
|
|
857
|
+
if (obj_subject_union0_error != null) {
|
|
858
|
+
obj_subject_union0 = obj_subject_union0_error.message;
|
|
859
|
+
}
|
|
860
|
+
let obj_subject_union1 = null;
|
|
861
|
+
const obj_subject_union1_error = (() => {
|
|
862
|
+
if (obj_subject !== null) {
|
|
863
|
+
return new TypeError('Expected "null" but received "' + typeof obj_subject + '" (at "' + path_subject + '")');
|
|
864
|
+
}
|
|
865
|
+
})();
|
|
866
|
+
if (obj_subject_union1_error != null) {
|
|
867
|
+
obj_subject_union1 = obj_subject_union1_error.message;
|
|
868
|
+
}
|
|
869
|
+
if (obj_subject_union0 && obj_subject_union1) {
|
|
870
|
+
let message = 'Object doesn\'t match union (at "' + path_subject + '")';
|
|
871
|
+
message += '\n' + obj_subject_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
872
|
+
message += '\n' + obj_subject_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
873
|
+
return new TypeError(message);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
if (obj.type !== undefined) {
|
|
877
|
+
const obj_type = obj.type;
|
|
878
|
+
const path_type = path + '.type';
|
|
879
|
+
let obj_type_union0 = null;
|
|
880
|
+
const obj_type_union0_error = (() => {
|
|
881
|
+
if (typeof obj_type !== 'string') {
|
|
882
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
883
|
+
}
|
|
884
|
+
})();
|
|
885
|
+
if (obj_type_union0_error != null) {
|
|
886
|
+
obj_type_union0 = obj_type_union0_error.message;
|
|
887
|
+
}
|
|
888
|
+
let obj_type_union1 = null;
|
|
889
|
+
const obj_type_union1_error = (() => {
|
|
890
|
+
if (obj_type !== null) {
|
|
891
|
+
return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
892
|
+
}
|
|
893
|
+
})();
|
|
894
|
+
if (obj_type_union1_error != null) {
|
|
895
|
+
obj_type_union1 = obj_type_union1_error.message;
|
|
896
|
+
}
|
|
897
|
+
if (obj_type_union0 && obj_type_union1) {
|
|
898
|
+
let message = 'Object doesn\'t match union (at "' + path_type + '")';
|
|
899
|
+
message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
900
|
+
message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
901
|
+
return new TypeError(message);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
if (obj.value !== undefined) {
|
|
905
|
+
const obj_value = obj.value;
|
|
906
|
+
const path_value = path + '.value';
|
|
907
|
+
let obj_value_union0 = null;
|
|
908
|
+
const obj_value_union0_error = (() => {
|
|
909
|
+
if (typeof obj_value !== 'number' || (typeof obj_value === 'number' && Math.floor(obj_value) !== obj_value)) {
|
|
910
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
911
|
+
}
|
|
912
|
+
})();
|
|
913
|
+
if (obj_value_union0_error != null) {
|
|
914
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
915
|
+
}
|
|
916
|
+
let obj_value_union1 = null;
|
|
917
|
+
const obj_value_union1_error = (() => {
|
|
918
|
+
if (obj_value !== null) {
|
|
919
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
920
|
+
}
|
|
921
|
+
})();
|
|
922
|
+
if (obj_value_union1_error != null) {
|
|
923
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
924
|
+
}
|
|
925
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
926
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
927
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
928
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
929
|
+
return new TypeError(message);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
if (obj.values !== undefined) {
|
|
933
|
+
const obj_values = obj.values;
|
|
934
|
+
const path_values = path + '.values';
|
|
935
|
+
if (!ArrayIsArray(obj_values)) {
|
|
936
|
+
return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
|
|
937
|
+
}
|
|
938
|
+
for (let i = 0; i < obj_values.length; i++) {
|
|
939
|
+
const obj_values_item = obj_values[i];
|
|
940
|
+
const path_values_item = path_values + '[' + i + ']';
|
|
941
|
+
if (typeof obj_values_item !== 'string') {
|
|
942
|
+
return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
})();
|
|
947
|
+
return v_error === undefined ? null : v_error;
|
|
948
|
+
}
|
|
949
|
+
const RepresentationType$4 = 'FilterRepresentation';
|
|
950
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
951
|
+
return input;
|
|
952
|
+
}
|
|
953
|
+
const select$a = function FilterRepresentationSelect() {
|
|
954
|
+
return {
|
|
955
|
+
kind: 'Fragment',
|
|
956
|
+
version: VERSION$5,
|
|
957
|
+
private: [],
|
|
958
|
+
opaque: true
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
function equals$5(existing, incoming) {
|
|
962
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
963
|
+
return false;
|
|
964
|
+
}
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
const ingest$4 = function FilterRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
968
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
969
|
+
const validateError = validate$6(input);
|
|
970
|
+
if (validateError !== null) {
|
|
971
|
+
throw validateError;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
const key = path.fullPath;
|
|
975
|
+
const ttlToUse = path.ttl;
|
|
976
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "personalization-service", VERSION$5, RepresentationType$4, equals$5);
|
|
977
|
+
return createLink(key);
|
|
978
|
+
};
|
|
979
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
980
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
981
|
+
const rootKey = fullPathFactory();
|
|
982
|
+
rootKeySet.set(rootKey, {
|
|
983
|
+
namespace: keyPrefix,
|
|
984
|
+
representationName: RepresentationType$4,
|
|
985
|
+
mergeable: false
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const VERSION$4 = "ea475f10b4c028f8b97a44af1cf0be14";
|
|
990
|
+
function validate$5(obj, path = 'CriteriaRepresentation') {
|
|
991
|
+
const v_error = (() => {
|
|
992
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
993
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
994
|
+
}
|
|
995
|
+
const obj_filters = obj.filters;
|
|
996
|
+
const path_filters = path + '.filters';
|
|
997
|
+
if (!ArrayIsArray(obj_filters)) {
|
|
998
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
|
|
999
|
+
}
|
|
1000
|
+
for (let i = 0; i < obj_filters.length; i++) {
|
|
1001
|
+
const obj_filters_item = obj_filters[i];
|
|
1002
|
+
const path_filters_item = path_filters + '[' + i + ']';
|
|
1003
|
+
if (typeof obj_filters_item !== 'object') {
|
|
1004
|
+
return new TypeError('Expected "object" but received "' + typeof obj_filters_item + '" (at "' + path_filters_item + '")');
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
const obj_operator = obj.operator;
|
|
1008
|
+
const path_operator = path + '.operator';
|
|
1009
|
+
if (typeof obj_operator !== 'string') {
|
|
1010
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
1011
|
+
}
|
|
1012
|
+
const obj_type = obj.type;
|
|
1013
|
+
const path_type = path + '.type';
|
|
1014
|
+
if (typeof obj_type !== 'string') {
|
|
1015
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1016
|
+
}
|
|
1017
|
+
})();
|
|
1018
|
+
return v_error === undefined ? null : v_error;
|
|
1019
|
+
}
|
|
1020
|
+
const RepresentationType$3 = 'CriteriaRepresentation';
|
|
1021
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1022
|
+
const input_filters = input.filters;
|
|
1023
|
+
const input_filters_id = path.fullPath + '__filters';
|
|
1024
|
+
for (let i = 0; i < input_filters.length; i++) {
|
|
1025
|
+
const input_filters_item = input_filters[i];
|
|
1026
|
+
let input_filters_item_id = input_filters_id + '__' + i;
|
|
1027
|
+
input_filters[i] = ingest$4(input_filters_item, {
|
|
1028
|
+
fullPath: input_filters_item_id,
|
|
1029
|
+
propertyName: i,
|
|
1030
|
+
parent: {
|
|
1031
|
+
data: input,
|
|
1032
|
+
key: path.fullPath,
|
|
1033
|
+
existing: existing,
|
|
1034
|
+
},
|
|
1035
|
+
ttl: path.ttl
|
|
1036
|
+
}, luvio, store, timestamp);
|
|
1037
|
+
}
|
|
1038
|
+
return input;
|
|
1039
|
+
}
|
|
1040
|
+
const select$9 = function CriteriaRepresentationSelect() {
|
|
1041
|
+
return {
|
|
1042
|
+
kind: 'Fragment',
|
|
1043
|
+
version: VERSION$4,
|
|
1044
|
+
private: [],
|
|
1045
|
+
selections: [
|
|
1046
|
+
{
|
|
1047
|
+
name: 'filters',
|
|
1048
|
+
kind: 'Link',
|
|
1049
|
+
plural: true,
|
|
1050
|
+
fragment: select$a()
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
name: 'operator',
|
|
1054
|
+
kind: 'Scalar'
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: 'type',
|
|
1058
|
+
kind: 'Scalar'
|
|
1059
|
+
}
|
|
1060
|
+
]
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
function equals$4(existing, incoming) {
|
|
1064
|
+
const existing_operator = existing.operator;
|
|
1065
|
+
const incoming_operator = incoming.operator;
|
|
1066
|
+
if (!(existing_operator === incoming_operator)) {
|
|
1067
|
+
return false;
|
|
1068
|
+
}
|
|
1069
|
+
const existing_type = existing.type;
|
|
1070
|
+
const incoming_type = incoming.type;
|
|
1071
|
+
if (!(existing_type === incoming_type)) {
|
|
1072
|
+
return false;
|
|
1073
|
+
}
|
|
1074
|
+
const existing_filters = existing.filters;
|
|
1075
|
+
const incoming_filters = incoming.filters;
|
|
1076
|
+
const equals_filters_items = equalsArray(existing_filters, incoming_filters, (existing_filters_item, incoming_filters_item) => {
|
|
1077
|
+
if (!(existing_filters_item.__ref === incoming_filters_item.__ref)) {
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
if (equals_filters_items === false) {
|
|
1082
|
+
return false;
|
|
1083
|
+
}
|
|
1084
|
+
return true;
|
|
1085
|
+
}
|
|
1086
|
+
const ingest$3 = function CriteriaRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1087
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1088
|
+
const validateError = validate$5(input);
|
|
1089
|
+
if (validateError !== null) {
|
|
1090
|
+
throw validateError;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
const key = path.fullPath;
|
|
1094
|
+
const ttlToUse = path.ttl;
|
|
1095
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "personalization-service", VERSION$4, RepresentationType$3, equals$4);
|
|
1096
|
+
return createLink(key);
|
|
1097
|
+
};
|
|
1098
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1099
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1100
|
+
const rootKey = fullPathFactory();
|
|
1101
|
+
rootKeySet.set(rootKey, {
|
|
1102
|
+
namespace: keyPrefix,
|
|
1103
|
+
representationName: RepresentationType$3,
|
|
1104
|
+
mergeable: false
|
|
1105
|
+
});
|
|
1106
|
+
const input_filters_length = input.filters.length;
|
|
1107
|
+
for (let i = 0; i < input_filters_length; i++) {
|
|
1108
|
+
getTypeCacheKeys$4(rootKeySet, luvio, input.filters[i], () => '');
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
const VERSION$3 = "4c6e23e63e764c028a88f2f6c2f7c6a3";
|
|
463
1113
|
function validate$4(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
464
1114
|
const v_error = (() => {
|
|
465
1115
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -473,7 +1123,7 @@ function validate$4(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
|
473
1123
|
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
474
1124
|
const obj_attributeValues_item = obj_attributeValues[i];
|
|
475
1125
|
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
476
|
-
const referencepath_attributeValues_itemValidationError = validate$
|
|
1126
|
+
const referencepath_attributeValues_itemValidationError = validate$9(obj_attributeValues_item, path_attributeValues_item);
|
|
477
1127
|
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
478
1128
|
let message = 'Object doesn\'t match PersonalizationAttributeValueRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
479
1129
|
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -536,8 +1186,8 @@ function validate$4(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
|
536
1186
|
const path_criteria = path + '.criteria';
|
|
537
1187
|
let obj_criteria_union0 = null;
|
|
538
1188
|
const obj_criteria_union0_error = (() => {
|
|
539
|
-
if (typeof obj_criteria !== '
|
|
540
|
-
return new TypeError('Expected "
|
|
1189
|
+
if (typeof obj_criteria !== 'object') {
|
|
1190
|
+
return new TypeError('Expected "object" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
541
1191
|
}
|
|
542
1192
|
})();
|
|
543
1193
|
if (obj_criteria_union0_error != null) {
|
|
@@ -769,8 +1419,26 @@ function validate$4(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
|
769
1419
|
})();
|
|
770
1420
|
return v_error === undefined ? null : v_error;
|
|
771
1421
|
}
|
|
1422
|
+
const RepresentationType$2 = 'PersonalizationDecisionRepresentation';
|
|
1423
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1424
|
+
const input_criteria = input.criteria;
|
|
1425
|
+
const input_criteria_id = path.fullPath + '__criteria';
|
|
1426
|
+
if (input_criteria !== null && typeof input_criteria === 'object') {
|
|
1427
|
+
input.criteria = ingest$3(input_criteria, {
|
|
1428
|
+
fullPath: input_criteria_id,
|
|
1429
|
+
propertyName: 'criteria',
|
|
1430
|
+
parent: {
|
|
1431
|
+
data: input,
|
|
1432
|
+
key: path.fullPath,
|
|
1433
|
+
existing: existing,
|
|
1434
|
+
},
|
|
1435
|
+
ttl: path.ttl
|
|
1436
|
+
}, luvio, store, timestamp);
|
|
1437
|
+
}
|
|
1438
|
+
return input;
|
|
1439
|
+
}
|
|
772
1440
|
const select$8 = function PersonalizationDecisionRepresentationSelect() {
|
|
773
|
-
const { selections: PersonalizationAttributeValueRepresentation__selections, opaque: PersonalizationAttributeValueRepresentation__opaque, } = select$
|
|
1441
|
+
const { selections: PersonalizationAttributeValueRepresentation__selections, opaque: PersonalizationAttributeValueRepresentation__opaque, } = select$b();
|
|
774
1442
|
return {
|
|
775
1443
|
kind: 'Fragment',
|
|
776
1444
|
version: VERSION$3,
|
|
@@ -792,7 +1460,9 @@ const select$8 = function PersonalizationDecisionRepresentationSelect() {
|
|
|
792
1460
|
},
|
|
793
1461
|
{
|
|
794
1462
|
name: 'criteria',
|
|
795
|
-
kind: '
|
|
1463
|
+
kind: 'Link',
|
|
1464
|
+
nullable: true,
|
|
1465
|
+
fragment: select$9()
|
|
796
1466
|
},
|
|
797
1467
|
{
|
|
798
1468
|
name: 'description',
|
|
@@ -833,7 +1503,7 @@ function equals$3(existing, incoming) {
|
|
|
833
1503
|
const existing_attributeValues = existing.attributeValues;
|
|
834
1504
|
const incoming_attributeValues = incoming.attributeValues;
|
|
835
1505
|
const equals_attributeValues_items = equalsArray(existing_attributeValues, incoming_attributeValues, (existing_attributeValues_item, incoming_attributeValues_item) => {
|
|
836
|
-
if (!(equals$
|
|
1506
|
+
if (!(equals$6(existing_attributeValues_item, incoming_attributeValues_item))) {
|
|
837
1507
|
return false;
|
|
838
1508
|
}
|
|
839
1509
|
});
|
|
@@ -852,7 +1522,12 @@ function equals$3(existing, incoming) {
|
|
|
852
1522
|
}
|
|
853
1523
|
const existing_criteria = existing.criteria;
|
|
854
1524
|
const incoming_criteria = incoming.criteria;
|
|
855
|
-
if (!(existing_criteria === incoming_criteria
|
|
1525
|
+
if (!(existing_criteria === incoming_criteria
|
|
1526
|
+
|| (existing_criteria != null &&
|
|
1527
|
+
incoming_criteria != null &&
|
|
1528
|
+
existing_criteria.__ref != null &&
|
|
1529
|
+
incoming_criteria.__ref != null &&
|
|
1530
|
+
existing_criteria.__ref === incoming_criteria.__ref))) {
|
|
856
1531
|
return false;
|
|
857
1532
|
}
|
|
858
1533
|
const existing_description = existing.description;
|
|
@@ -897,9 +1572,33 @@ function equals$3(existing, incoming) {
|
|
|
897
1572
|
}
|
|
898
1573
|
return true;
|
|
899
1574
|
}
|
|
1575
|
+
const ingest$2 = function PersonalizationDecisionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1576
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1577
|
+
const validateError = validate$4(input);
|
|
1578
|
+
if (validateError !== null) {
|
|
1579
|
+
throw validateError;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
const key = path.fullPath;
|
|
1583
|
+
const ttlToUse = path.ttl;
|
|
1584
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "personalization-service", VERSION$3, RepresentationType$2, equals$3);
|
|
1585
|
+
return createLink(key);
|
|
1586
|
+
};
|
|
1587
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1588
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1589
|
+
const rootKey = fullPathFactory();
|
|
1590
|
+
rootKeySet.set(rootKey, {
|
|
1591
|
+
namespace: keyPrefix,
|
|
1592
|
+
representationName: RepresentationType$2,
|
|
1593
|
+
mergeable: false
|
|
1594
|
+
});
|
|
1595
|
+
if (input.criteria !== null && typeof input.criteria === 'object') {
|
|
1596
|
+
getTypeCacheKeys$3(rootKeySet, luvio, input.criteria, () => rootKey + "__" + "criteria");
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
900
1599
|
|
|
901
1600
|
const TTL$1 = 600;
|
|
902
|
-
const VERSION$2 = "
|
|
1601
|
+
const VERSION$2 = "da1bfa46416530ff1aeab78ba84646bb";
|
|
903
1602
|
function validate$3(obj, path = 'PersonalizationPointRepresentation') {
|
|
904
1603
|
const v_error = (() => {
|
|
905
1604
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -1017,11 +1716,8 @@ function validate$3(obj, path = 'PersonalizationPointRepresentation') {
|
|
|
1017
1716
|
for (let i = 0; i < obj_decisions.length; i++) {
|
|
1018
1717
|
const obj_decisions_item = obj_decisions[i];
|
|
1019
1718
|
const path_decisions_item = path_decisions + '[' + i + ']';
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
let message = 'Object doesn\'t match PersonalizationDecisionRepresentation (at "' + path_decisions_item + '")\n';
|
|
1023
|
-
message += referencepath_decisions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1024
|
-
return new TypeError(message);
|
|
1719
|
+
if (typeof obj_decisions_item !== 'object') {
|
|
1720
|
+
return new TypeError('Expected "object" but received "' + typeof obj_decisions_item + '" (at "' + path_decisions_item + '")');
|
|
1025
1721
|
}
|
|
1026
1722
|
}
|
|
1027
1723
|
const obj_description = obj.description;
|
|
@@ -1308,10 +2004,25 @@ function keyBuilderFromType$1(luvio, object) {
|
|
|
1308
2004
|
return keyBuilder$7(luvio, keyParams);
|
|
1309
2005
|
}
|
|
1310
2006
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2007
|
+
const input_decisions = input.decisions;
|
|
2008
|
+
const input_decisions_id = path.fullPath + '__decisions';
|
|
2009
|
+
for (let i = 0; i < input_decisions.length; i++) {
|
|
2010
|
+
const input_decisions_item = input_decisions[i];
|
|
2011
|
+
let input_decisions_item_id = input_decisions_id + '__' + i;
|
|
2012
|
+
input_decisions[i] = ingest$2(input_decisions_item, {
|
|
2013
|
+
fullPath: input_decisions_item_id,
|
|
2014
|
+
propertyName: i,
|
|
2015
|
+
parent: {
|
|
2016
|
+
data: input,
|
|
2017
|
+
key: path.fullPath,
|
|
2018
|
+
existing: existing,
|
|
2019
|
+
},
|
|
2020
|
+
ttl: path.ttl
|
|
2021
|
+
}, luvio, store, timestamp);
|
|
2022
|
+
}
|
|
1311
2023
|
return input;
|
|
1312
2024
|
}
|
|
1313
2025
|
const select$7 = function PersonalizationPointRepresentationSelect() {
|
|
1314
|
-
const { selections: PersonalizationDecisionRepresentation__selections, opaque: PersonalizationDecisionRepresentation__opaque, } = select$8();
|
|
1315
2026
|
return {
|
|
1316
2027
|
kind: 'Fragment',
|
|
1317
2028
|
version: VERSION$2,
|
|
@@ -1335,9 +2046,9 @@ const select$7 = function PersonalizationPointRepresentationSelect() {
|
|
|
1335
2046
|
},
|
|
1336
2047
|
{
|
|
1337
2048
|
name: 'decisions',
|
|
1338
|
-
kind: '
|
|
2049
|
+
kind: 'Link',
|
|
1339
2050
|
plural: true,
|
|
1340
|
-
|
|
2051
|
+
fragment: select$8()
|
|
1341
2052
|
},
|
|
1342
2053
|
{
|
|
1343
2054
|
name: 'description',
|
|
@@ -1424,7 +2135,7 @@ function equals$2(existing, incoming) {
|
|
|
1424
2135
|
const existing_decisions = existing.decisions;
|
|
1425
2136
|
const incoming_decisions = incoming.decisions;
|
|
1426
2137
|
const equals_decisions_items = equalsArray(existing_decisions, incoming_decisions, (existing_decisions_item, incoming_decisions_item) => {
|
|
1427
|
-
if (!(
|
|
2138
|
+
if (!(existing_decisions_item.__ref === incoming_decisions_item.__ref)) {
|
|
1428
2139
|
return false;
|
|
1429
2140
|
}
|
|
1430
2141
|
});
|
|
@@ -1503,6 +2214,10 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
1503
2214
|
representationName: RepresentationType$1,
|
|
1504
2215
|
mergeable: false
|
|
1505
2216
|
});
|
|
2217
|
+
const input_decisions_length = input.decisions.length;
|
|
2218
|
+
for (let i = 0; i < input_decisions_length; i++) {
|
|
2219
|
+
getTypeCacheKeys$2(rootKeySet, luvio, input.decisions[i], () => '');
|
|
2220
|
+
}
|
|
1506
2221
|
}
|
|
1507
2222
|
|
|
1508
2223
|
function select$6(luvio, params) {
|
|
@@ -1600,7 +2315,7 @@ function typeCheckConfig$6(untrustedConfig) {
|
|
|
1600
2315
|
const untrustedConfig_decisions_array = [];
|
|
1601
2316
|
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
1602
2317
|
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
1603
|
-
const referencePersonalizationDecisionInputRepresentationValidationError = validate$
|
|
2318
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$a(untrustedConfig_decisions_item);
|
|
1604
2319
|
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
1605
2320
|
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
1606
2321
|
}
|
|
@@ -1992,7 +2707,7 @@ function typeCheckConfig$3(untrustedConfig) {
|
|
|
1992
2707
|
const untrustedConfig_decisions_array = [];
|
|
1993
2708
|
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
1994
2709
|
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
1995
|
-
const referencePersonalizationDecisionInputRepresentationValidationError = validate$
|
|
2710
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$a(untrustedConfig_decisions_item);
|
|
1996
2711
|
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
1997
2712
|
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
1998
2713
|
}
|