@salesforce/lds-adapters-industries-decision-matrix-designer 1.124.2 → 1.124.4
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/industries-decision-matrix-designer.js +1241 -1241
- package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
- package/dist/{types → es/es2018/types}/src/generated/adapters/getColumns.d.ts +26 -26
- package/dist/{types → es/es2018/types}/src/generated/adapters/getRows.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/adapters/saveColumns.d.ts +16 -16
- package/dist/{types → es/es2018/types}/src/generated/adapters/saveRows.d.ts +17 -17
- package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +4 -4
- package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +7 -7
- package/dist/{types → es/es2018/types}/src/generated/resources/getConnectOmnistudioDecisionMatricesColumnsByMatrixId.d.ts +15 -15
- package/dist/{types → es/es2018/types}/src/generated/resources/getConnectOmnistudioDecisionMatricesVersionsRowsByMatrixIdAndVersionId.d.ts +20 -20
- package/dist/{types → es/es2018/types}/src/generated/resources/postConnectOmnistudioDecisionMatricesColumnsByMatrixId.d.ts +16 -16
- package/dist/{types → es/es2018/types}/src/generated/resources/postConnectOmnistudioDecisionMatricesVersionsRowsByMatrixIdAndVersionId.d.ts +17 -17
- package/dist/{types → es/es2018/types}/src/generated/types/Columns.d.ts +39 -39
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixColumnOutputRepresentation.d.ts +47 -47
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixColumnRepresentation.d.ts +50 -50
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixColumnsInputRepresentation.d.ts +30 -30
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixColumnsOutputRepresentation.d.ts +31 -31
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixOutputRepresentation.d.ts +48 -48
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixRowInputRepresentation.d.ts +42 -42
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixRowOutputRepresentation.d.ts +39 -39
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixRowsInputRepresentation.d.ts +33 -33
- package/dist/{types → es/es2018/types}/src/generated/types/DecisionMatrixRowsOutputRepresentation.d.ts +37 -37
- package/dist/{types → es/es2018/types}/src/generated/types/RowsInput.d.ts +39 -39
- package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
- package/package.json +5 -5
- package/sfdc/index.d.ts +1 -1
- package/sfdc/index.js +1279 -1279
- package/dist/umd/es2018/industries-decision-matrix-designer.js +0 -1295
- package/dist/umd/es5/industries-decision-matrix-designer.js +0 -1307
|
@@ -6,1279 +6,1279 @@
|
|
|
6
6
|
|
|
7
7
|
import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
|
|
8
8
|
|
|
9
|
-
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
-
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
11
|
-
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
-
/**
|
|
13
|
-
* Validates an adapter config is well-formed.
|
|
14
|
-
* @param config The config to validate.
|
|
15
|
-
* @param adapter The adapter validation configuration.
|
|
16
|
-
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
-
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
-
*/
|
|
19
|
-
function validateConfig(config, adapter, oneOf) {
|
|
20
|
-
const { displayName } = adapter;
|
|
21
|
-
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
-
if (config === undefined ||
|
|
23
|
-
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
-
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
-
}
|
|
26
|
-
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
-
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
-
}
|
|
29
|
-
if (unsupported !== undefined &&
|
|
30
|
-
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
-
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
-
}
|
|
33
|
-
const supported = required.concat(optional);
|
|
34
|
-
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
-
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function untrustedIsObject(untrusted) {
|
|
39
|
-
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
-
}
|
|
41
|
-
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
-
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
-
}
|
|
44
|
-
const snapshotRefreshOptions = {
|
|
45
|
-
overrides: {
|
|
46
|
-
headers: {
|
|
47
|
-
'Cache-Control': 'no-cache',
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
};
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
51
|
const keyPrefix = 'decision-matrix-designer';
|
|
52
52
|
|
|
53
|
-
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
54
|
-
const { isArray: ArrayIsArray } = Array;
|
|
55
|
-
const { stringify: JSONStringify } = JSON;
|
|
56
|
-
function equalsArray(a, b, equalsItem) {
|
|
57
|
-
const aLength = a.length;
|
|
58
|
-
const bLength = b.length;
|
|
59
|
-
if (aLength !== bLength) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
for (let i = 0; i < aLength; i++) {
|
|
63
|
-
if (equalsItem(a[i], b[i]) === false) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
function deepFreeze$4(value) {
|
|
70
|
-
// No need to freeze primitives
|
|
71
|
-
if (typeof value !== 'object' || value === null) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (ArrayIsArray(value)) {
|
|
75
|
-
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
76
|
-
deepFreeze$4(value[i]);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
const keys = ObjectKeys(value);
|
|
81
|
-
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
82
|
-
deepFreeze$4(value[keys[i]]);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
ObjectFreeze(value);
|
|
86
|
-
}
|
|
87
|
-
function createLink(ref) {
|
|
88
|
-
return {
|
|
89
|
-
__ref: serializeStructuredKey(ref),
|
|
90
|
-
};
|
|
53
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
54
|
+
const { isArray: ArrayIsArray } = Array;
|
|
55
|
+
const { stringify: JSONStringify } = JSON;
|
|
56
|
+
function equalsArray(a, b, equalsItem) {
|
|
57
|
+
const aLength = a.length;
|
|
58
|
+
const bLength = b.length;
|
|
59
|
+
if (aLength !== bLength) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
for (let i = 0; i < aLength; i++) {
|
|
63
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
function deepFreeze$4(value) {
|
|
70
|
+
// No need to freeze primitives
|
|
71
|
+
if (typeof value !== 'object' || value === null) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (ArrayIsArray(value)) {
|
|
75
|
+
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
76
|
+
deepFreeze$4(value[i]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const keys = ObjectKeys(value);
|
|
81
|
+
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
82
|
+
deepFreeze$4(value[keys[i]]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
ObjectFreeze(value);
|
|
86
|
+
}
|
|
87
|
+
function createLink(ref) {
|
|
88
|
+
return {
|
|
89
|
+
__ref: serializeStructuredKey(ref),
|
|
90
|
+
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function validate$6(obj, path = 'DecisionMatrixColumnOutputRepresentation') {
|
|
94
|
-
const v_error = (() => {
|
|
95
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
96
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
97
|
-
}
|
|
98
|
-
const obj_apiName = obj.apiName;
|
|
99
|
-
const path_apiName = path + '.apiName';
|
|
100
|
-
if (typeof obj_apiName !== 'string') {
|
|
101
|
-
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
102
|
-
}
|
|
103
|
-
const obj_columnType = obj.columnType;
|
|
104
|
-
const path_columnType = path + '.columnType';
|
|
105
|
-
if (typeof obj_columnType !== 'string') {
|
|
106
|
-
return new TypeError('Expected "string" but received "' + typeof obj_columnType + '" (at "' + path_columnType + '")');
|
|
107
|
-
}
|
|
108
|
-
const obj_dataType = obj.dataType;
|
|
109
|
-
const path_dataType = path + '.dataType';
|
|
110
|
-
if (typeof obj_dataType !== 'string') {
|
|
111
|
-
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
112
|
-
}
|
|
113
|
-
const obj_displaySequence = obj.displaySequence;
|
|
114
|
-
const path_displaySequence = path + '.displaySequence';
|
|
115
|
-
let obj_displaySequence_union0 = null;
|
|
116
|
-
const obj_displaySequence_union0_error = (() => {
|
|
117
|
-
if (typeof obj_displaySequence !== 'number' || (typeof obj_displaySequence === 'number' && Math.floor(obj_displaySequence) !== obj_displaySequence)) {
|
|
118
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_displaySequence + '" (at "' + path_displaySequence + '")');
|
|
119
|
-
}
|
|
120
|
-
})();
|
|
121
|
-
if (obj_displaySequence_union0_error != null) {
|
|
122
|
-
obj_displaySequence_union0 = obj_displaySequence_union0_error.message;
|
|
123
|
-
}
|
|
124
|
-
let obj_displaySequence_union1 = null;
|
|
125
|
-
const obj_displaySequence_union1_error = (() => {
|
|
126
|
-
if (obj_displaySequence !== null) {
|
|
127
|
-
return new TypeError('Expected "null" but received "' + typeof obj_displaySequence + '" (at "' + path_displaySequence + '")');
|
|
128
|
-
}
|
|
129
|
-
})();
|
|
130
|
-
if (obj_displaySequence_union1_error != null) {
|
|
131
|
-
obj_displaySequence_union1 = obj_displaySequence_union1_error.message;
|
|
132
|
-
}
|
|
133
|
-
if (obj_displaySequence_union0 && obj_displaySequence_union1) {
|
|
134
|
-
let message = 'Object doesn\'t match union (at "' + path_displaySequence + '")';
|
|
135
|
-
message += '\n' + obj_displaySequence_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
136
|
-
message += '\n' + obj_displaySequence_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
137
|
-
return new TypeError(message);
|
|
138
|
-
}
|
|
139
|
-
const obj_id = obj.id;
|
|
140
|
-
const path_id = path + '.id';
|
|
141
|
-
if (typeof obj_id !== 'string') {
|
|
142
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
143
|
-
}
|
|
144
|
-
const obj_name = obj.name;
|
|
145
|
-
const path_name = path + '.name';
|
|
146
|
-
if (typeof obj_name !== 'string') {
|
|
147
|
-
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
148
|
-
}
|
|
149
|
-
const obj_rangeValues = obj.rangeValues;
|
|
150
|
-
const path_rangeValues = path + '.rangeValues';
|
|
151
|
-
let obj_rangeValues_union0 = null;
|
|
152
|
-
const obj_rangeValues_union0_error = (() => {
|
|
153
|
-
if (typeof obj_rangeValues !== 'string') {
|
|
154
|
-
return new TypeError('Expected "string" but received "' + typeof obj_rangeValues + '" (at "' + path_rangeValues + '")');
|
|
155
|
-
}
|
|
156
|
-
})();
|
|
157
|
-
if (obj_rangeValues_union0_error != null) {
|
|
158
|
-
obj_rangeValues_union0 = obj_rangeValues_union0_error.message;
|
|
159
|
-
}
|
|
160
|
-
let obj_rangeValues_union1 = null;
|
|
161
|
-
const obj_rangeValues_union1_error = (() => {
|
|
162
|
-
if (obj_rangeValues !== null) {
|
|
163
|
-
return new TypeError('Expected "null" but received "' + typeof obj_rangeValues + '" (at "' + path_rangeValues + '")');
|
|
164
|
-
}
|
|
165
|
-
})();
|
|
166
|
-
if (obj_rangeValues_union1_error != null) {
|
|
167
|
-
obj_rangeValues_union1 = obj_rangeValues_union1_error.message;
|
|
168
|
-
}
|
|
169
|
-
if (obj_rangeValues_union0 && obj_rangeValues_union1) {
|
|
170
|
-
let message = 'Object doesn\'t match union (at "' + path_rangeValues + '")';
|
|
171
|
-
message += '\n' + obj_rangeValues_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
172
|
-
message += '\n' + obj_rangeValues_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
173
|
-
return new TypeError(message);
|
|
174
|
-
}
|
|
175
|
-
})();
|
|
176
|
-
return v_error === undefined ? null : v_error;
|
|
177
|
-
}
|
|
178
|
-
function deepFreeze$3(input) {
|
|
179
|
-
ObjectFreeze(input);
|
|
93
|
+
function validate$6(obj, path = 'DecisionMatrixColumnOutputRepresentation') {
|
|
94
|
+
const v_error = (() => {
|
|
95
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
96
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
97
|
+
}
|
|
98
|
+
const obj_apiName = obj.apiName;
|
|
99
|
+
const path_apiName = path + '.apiName';
|
|
100
|
+
if (typeof obj_apiName !== 'string') {
|
|
101
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
102
|
+
}
|
|
103
|
+
const obj_columnType = obj.columnType;
|
|
104
|
+
const path_columnType = path + '.columnType';
|
|
105
|
+
if (typeof obj_columnType !== 'string') {
|
|
106
|
+
return new TypeError('Expected "string" but received "' + typeof obj_columnType + '" (at "' + path_columnType + '")');
|
|
107
|
+
}
|
|
108
|
+
const obj_dataType = obj.dataType;
|
|
109
|
+
const path_dataType = path + '.dataType';
|
|
110
|
+
if (typeof obj_dataType !== 'string') {
|
|
111
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
112
|
+
}
|
|
113
|
+
const obj_displaySequence = obj.displaySequence;
|
|
114
|
+
const path_displaySequence = path + '.displaySequence';
|
|
115
|
+
let obj_displaySequence_union0 = null;
|
|
116
|
+
const obj_displaySequence_union0_error = (() => {
|
|
117
|
+
if (typeof obj_displaySequence !== 'number' || (typeof obj_displaySequence === 'number' && Math.floor(obj_displaySequence) !== obj_displaySequence)) {
|
|
118
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_displaySequence + '" (at "' + path_displaySequence + '")');
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
if (obj_displaySequence_union0_error != null) {
|
|
122
|
+
obj_displaySequence_union0 = obj_displaySequence_union0_error.message;
|
|
123
|
+
}
|
|
124
|
+
let obj_displaySequence_union1 = null;
|
|
125
|
+
const obj_displaySequence_union1_error = (() => {
|
|
126
|
+
if (obj_displaySequence !== null) {
|
|
127
|
+
return new TypeError('Expected "null" but received "' + typeof obj_displaySequence + '" (at "' + path_displaySequence + '")');
|
|
128
|
+
}
|
|
129
|
+
})();
|
|
130
|
+
if (obj_displaySequence_union1_error != null) {
|
|
131
|
+
obj_displaySequence_union1 = obj_displaySequence_union1_error.message;
|
|
132
|
+
}
|
|
133
|
+
if (obj_displaySequence_union0 && obj_displaySequence_union1) {
|
|
134
|
+
let message = 'Object doesn\'t match union (at "' + path_displaySequence + '")';
|
|
135
|
+
message += '\n' + obj_displaySequence_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
136
|
+
message += '\n' + obj_displaySequence_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
137
|
+
return new TypeError(message);
|
|
138
|
+
}
|
|
139
|
+
const obj_id = obj.id;
|
|
140
|
+
const path_id = path + '.id';
|
|
141
|
+
if (typeof obj_id !== 'string') {
|
|
142
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
143
|
+
}
|
|
144
|
+
const obj_name = obj.name;
|
|
145
|
+
const path_name = path + '.name';
|
|
146
|
+
if (typeof obj_name !== 'string') {
|
|
147
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
148
|
+
}
|
|
149
|
+
const obj_rangeValues = obj.rangeValues;
|
|
150
|
+
const path_rangeValues = path + '.rangeValues';
|
|
151
|
+
let obj_rangeValues_union0 = null;
|
|
152
|
+
const obj_rangeValues_union0_error = (() => {
|
|
153
|
+
if (typeof obj_rangeValues !== 'string') {
|
|
154
|
+
return new TypeError('Expected "string" but received "' + typeof obj_rangeValues + '" (at "' + path_rangeValues + '")');
|
|
155
|
+
}
|
|
156
|
+
})();
|
|
157
|
+
if (obj_rangeValues_union0_error != null) {
|
|
158
|
+
obj_rangeValues_union0 = obj_rangeValues_union0_error.message;
|
|
159
|
+
}
|
|
160
|
+
let obj_rangeValues_union1 = null;
|
|
161
|
+
const obj_rangeValues_union1_error = (() => {
|
|
162
|
+
if (obj_rangeValues !== null) {
|
|
163
|
+
return new TypeError('Expected "null" but received "' + typeof obj_rangeValues + '" (at "' + path_rangeValues + '")');
|
|
164
|
+
}
|
|
165
|
+
})();
|
|
166
|
+
if (obj_rangeValues_union1_error != null) {
|
|
167
|
+
obj_rangeValues_union1 = obj_rangeValues_union1_error.message;
|
|
168
|
+
}
|
|
169
|
+
if (obj_rangeValues_union0 && obj_rangeValues_union1) {
|
|
170
|
+
let message = 'Object doesn\'t match union (at "' + path_rangeValues + '")';
|
|
171
|
+
message += '\n' + obj_rangeValues_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
172
|
+
message += '\n' + obj_rangeValues_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
173
|
+
return new TypeError(message);
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
return v_error === undefined ? null : v_error;
|
|
177
|
+
}
|
|
178
|
+
function deepFreeze$3(input) {
|
|
179
|
+
ObjectFreeze(input);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
const TTL$2 = 1000;
|
|
183
|
-
const VERSION$2 = "5d95e8249486b2b28b41c80d3f8add99";
|
|
184
|
-
function validate$5(obj, path = 'DecisionMatrixColumnsOutputRepresentation') {
|
|
185
|
-
const v_error = (() => {
|
|
186
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
187
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
188
|
-
}
|
|
189
|
-
const obj_columns = obj.columns;
|
|
190
|
-
const path_columns = path + '.columns';
|
|
191
|
-
if (!ArrayIsArray(obj_columns)) {
|
|
192
|
-
return new TypeError('Expected "array" but received "' + typeof obj_columns + '" (at "' + path_columns + '")');
|
|
193
|
-
}
|
|
194
|
-
for (let i = 0; i < obj_columns.length; i++) {
|
|
195
|
-
const obj_columns_item = obj_columns[i];
|
|
196
|
-
const path_columns_item = path_columns + '[' + i + ']';
|
|
197
|
-
const referencepath_columns_itemValidationError = validate$6(obj_columns_item, path_columns_item);
|
|
198
|
-
if (referencepath_columns_itemValidationError !== null) {
|
|
199
|
-
let message = 'Object doesn\'t match DecisionMatrixColumnOutputRepresentation (at "' + path_columns_item + '")\n';
|
|
200
|
-
message += referencepath_columns_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
201
|
-
return new TypeError(message);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
})();
|
|
205
|
-
return v_error === undefined ? null : v_error;
|
|
206
|
-
}
|
|
207
|
-
const RepresentationType$2 = 'DecisionMatrixColumnsOutputRepresentation';
|
|
208
|
-
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
209
|
-
return input;
|
|
210
|
-
}
|
|
211
|
-
const select$6 = function DecisionMatrixColumnsOutputRepresentationSelect() {
|
|
212
|
-
return {
|
|
213
|
-
kind: 'Fragment',
|
|
214
|
-
version: VERSION$2,
|
|
215
|
-
private: [],
|
|
216
|
-
opaque: true
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
function equals$2(existing, incoming) {
|
|
220
|
-
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
|
-
function deepFreeze$2(input) {
|
|
226
|
-
const input_columns = input.columns;
|
|
227
|
-
for (let i = 0; i < input_columns.length; i++) {
|
|
228
|
-
const input_columns_item = input_columns[i];
|
|
229
|
-
deepFreeze$3(input_columns_item);
|
|
230
|
-
}
|
|
231
|
-
ObjectFreeze(input_columns);
|
|
232
|
-
ObjectFreeze(input);
|
|
233
|
-
}
|
|
234
|
-
const ingest$2 = function DecisionMatrixColumnsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
235
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
236
|
-
const validateError = validate$5(input);
|
|
237
|
-
if (validateError !== null) {
|
|
238
|
-
throw validateError;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
const key = path.fullPath;
|
|
242
|
-
const existingRecord = store.readEntry(key);
|
|
243
|
-
const ttlToUse = TTL$2;
|
|
244
|
-
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
245
|
-
fullPath: key,
|
|
246
|
-
parent: path.parent,
|
|
247
|
-
propertyName: path.propertyName,
|
|
248
|
-
ttl: ttlToUse
|
|
249
|
-
});
|
|
250
|
-
deepFreeze$2(input);
|
|
251
|
-
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
252
|
-
luvio.storePublish(key, incomingRecord);
|
|
253
|
-
}
|
|
254
|
-
{
|
|
255
|
-
const storeMetadataParams = {
|
|
256
|
-
ttl: ttlToUse,
|
|
257
|
-
namespace: "decision-matrix-designer",
|
|
258
|
-
version: VERSION$2,
|
|
259
|
-
representationName: RepresentationType$2,
|
|
260
|
-
};
|
|
261
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
262
|
-
}
|
|
263
|
-
return createLink(key);
|
|
264
|
-
};
|
|
265
|
-
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
266
|
-
const rootKeySet = new StoreKeyMap();
|
|
267
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
268
|
-
const rootKey = fullPathFactory();
|
|
269
|
-
rootKeySet.set(rootKey, {
|
|
270
|
-
namespace: keyPrefix,
|
|
271
|
-
representationName: RepresentationType$2,
|
|
272
|
-
mergeable: false
|
|
273
|
-
});
|
|
274
|
-
return rootKeySet;
|
|
182
|
+
const TTL$2 = 1000;
|
|
183
|
+
const VERSION$2 = "5d95e8249486b2b28b41c80d3f8add99";
|
|
184
|
+
function validate$5(obj, path = 'DecisionMatrixColumnsOutputRepresentation') {
|
|
185
|
+
const v_error = (() => {
|
|
186
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
187
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
188
|
+
}
|
|
189
|
+
const obj_columns = obj.columns;
|
|
190
|
+
const path_columns = path + '.columns';
|
|
191
|
+
if (!ArrayIsArray(obj_columns)) {
|
|
192
|
+
return new TypeError('Expected "array" but received "' + typeof obj_columns + '" (at "' + path_columns + '")');
|
|
193
|
+
}
|
|
194
|
+
for (let i = 0; i < obj_columns.length; i++) {
|
|
195
|
+
const obj_columns_item = obj_columns[i];
|
|
196
|
+
const path_columns_item = path_columns + '[' + i + ']';
|
|
197
|
+
const referencepath_columns_itemValidationError = validate$6(obj_columns_item, path_columns_item);
|
|
198
|
+
if (referencepath_columns_itemValidationError !== null) {
|
|
199
|
+
let message = 'Object doesn\'t match DecisionMatrixColumnOutputRepresentation (at "' + path_columns_item + '")\n';
|
|
200
|
+
message += referencepath_columns_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
201
|
+
return new TypeError(message);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
})();
|
|
205
|
+
return v_error === undefined ? null : v_error;
|
|
206
|
+
}
|
|
207
|
+
const RepresentationType$2 = 'DecisionMatrixColumnsOutputRepresentation';
|
|
208
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
209
|
+
return input;
|
|
210
|
+
}
|
|
211
|
+
const select$6 = function DecisionMatrixColumnsOutputRepresentationSelect() {
|
|
212
|
+
return {
|
|
213
|
+
kind: 'Fragment',
|
|
214
|
+
version: VERSION$2,
|
|
215
|
+
private: [],
|
|
216
|
+
opaque: true
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
function equals$2(existing, incoming) {
|
|
220
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
function deepFreeze$2(input) {
|
|
226
|
+
const input_columns = input.columns;
|
|
227
|
+
for (let i = 0; i < input_columns.length; i++) {
|
|
228
|
+
const input_columns_item = input_columns[i];
|
|
229
|
+
deepFreeze$3(input_columns_item);
|
|
230
|
+
}
|
|
231
|
+
ObjectFreeze(input_columns);
|
|
232
|
+
ObjectFreeze(input);
|
|
233
|
+
}
|
|
234
|
+
const ingest$2 = function DecisionMatrixColumnsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
235
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
236
|
+
const validateError = validate$5(input);
|
|
237
|
+
if (validateError !== null) {
|
|
238
|
+
throw validateError;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const key = path.fullPath;
|
|
242
|
+
const existingRecord = store.readEntry(key);
|
|
243
|
+
const ttlToUse = TTL$2;
|
|
244
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
245
|
+
fullPath: key,
|
|
246
|
+
parent: path.parent,
|
|
247
|
+
propertyName: path.propertyName,
|
|
248
|
+
ttl: ttlToUse
|
|
249
|
+
});
|
|
250
|
+
deepFreeze$2(input);
|
|
251
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
252
|
+
luvio.storePublish(key, incomingRecord);
|
|
253
|
+
}
|
|
254
|
+
{
|
|
255
|
+
const storeMetadataParams = {
|
|
256
|
+
ttl: ttlToUse,
|
|
257
|
+
namespace: "decision-matrix-designer",
|
|
258
|
+
version: VERSION$2,
|
|
259
|
+
representationName: RepresentationType$2,
|
|
260
|
+
};
|
|
261
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
262
|
+
}
|
|
263
|
+
return createLink(key);
|
|
264
|
+
};
|
|
265
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
266
|
+
const rootKeySet = new StoreKeyMap();
|
|
267
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
268
|
+
const rootKey = fullPathFactory();
|
|
269
|
+
rootKeySet.set(rootKey, {
|
|
270
|
+
namespace: keyPrefix,
|
|
271
|
+
representationName: RepresentationType$2,
|
|
272
|
+
mergeable: false
|
|
273
|
+
});
|
|
274
|
+
return rootKeySet;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
function select$5(luvio, params) {
|
|
278
|
-
return select$6();
|
|
279
|
-
}
|
|
280
|
-
function keyBuilder$4(luvio, params) {
|
|
281
|
-
return keyPrefix + '::DecisionMatrixColumnsOutputRepresentation:(' + 'matrixId:' + params.urlParams.matrixId + ')';
|
|
282
|
-
}
|
|
283
|
-
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
284
|
-
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
285
|
-
}
|
|
286
|
-
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
287
|
-
const { body } = response;
|
|
288
|
-
const key = keyBuilder$4(luvio, resourceParams);
|
|
289
|
-
luvio.storeIngest(key, ingest$2, body);
|
|
290
|
-
const snapshot = luvio.storeLookup({
|
|
291
|
-
recordId: key,
|
|
292
|
-
node: select$5(),
|
|
293
|
-
variables: {},
|
|
294
|
-
}, snapshotRefresh);
|
|
295
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
296
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
297
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return snapshot;
|
|
301
|
-
}
|
|
302
|
-
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
303
|
-
const key = keyBuilder$4(luvio, params);
|
|
304
|
-
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
305
|
-
const storeMetadataParams = {
|
|
306
|
-
ttl: TTL$2,
|
|
307
|
-
namespace: keyPrefix,
|
|
308
|
-
version: VERSION$2,
|
|
309
|
-
representationName: RepresentationType$2
|
|
310
|
-
};
|
|
311
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
312
|
-
return errorSnapshot;
|
|
313
|
-
}
|
|
314
|
-
function createResourceRequest$3(config) {
|
|
315
|
-
const headers = {};
|
|
316
|
-
return {
|
|
317
|
-
baseUri: '/services/data/v58.0',
|
|
318
|
-
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/columns',
|
|
319
|
-
method: 'get',
|
|
320
|
-
body: null,
|
|
321
|
-
urlParams: config.urlParams,
|
|
322
|
-
queryParams: {},
|
|
323
|
-
headers,
|
|
324
|
-
priority: 'normal',
|
|
325
|
-
};
|
|
277
|
+
function select$5(luvio, params) {
|
|
278
|
+
return select$6();
|
|
279
|
+
}
|
|
280
|
+
function keyBuilder$4(luvio, params) {
|
|
281
|
+
return keyPrefix + '::DecisionMatrixColumnsOutputRepresentation:(' + 'matrixId:' + params.urlParams.matrixId + ')';
|
|
282
|
+
}
|
|
283
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
284
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
285
|
+
}
|
|
286
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
287
|
+
const { body } = response;
|
|
288
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
289
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
290
|
+
const snapshot = luvio.storeLookup({
|
|
291
|
+
recordId: key,
|
|
292
|
+
node: select$5(),
|
|
293
|
+
variables: {},
|
|
294
|
+
}, snapshotRefresh);
|
|
295
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
296
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
297
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return snapshot;
|
|
301
|
+
}
|
|
302
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
303
|
+
const key = keyBuilder$4(luvio, params);
|
|
304
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
305
|
+
const storeMetadataParams = {
|
|
306
|
+
ttl: TTL$2,
|
|
307
|
+
namespace: keyPrefix,
|
|
308
|
+
version: VERSION$2,
|
|
309
|
+
representationName: RepresentationType$2
|
|
310
|
+
};
|
|
311
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
312
|
+
return errorSnapshot;
|
|
313
|
+
}
|
|
314
|
+
function createResourceRequest$3(config) {
|
|
315
|
+
const headers = {};
|
|
316
|
+
return {
|
|
317
|
+
baseUri: '/services/data/v58.0',
|
|
318
|
+
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/columns',
|
|
319
|
+
method: 'get',
|
|
320
|
+
body: null,
|
|
321
|
+
urlParams: config.urlParams,
|
|
322
|
+
queryParams: {},
|
|
323
|
+
headers,
|
|
324
|
+
priority: 'normal',
|
|
325
|
+
};
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
const getColumns_ConfigPropertyNames = {
|
|
329
|
-
displayName: 'getColumns',
|
|
330
|
-
parameters: {
|
|
331
|
-
required: ['matrixId'],
|
|
332
|
-
optional: []
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
function createResourceParams$3(config) {
|
|
336
|
-
const resourceParams = {
|
|
337
|
-
urlParams: {
|
|
338
|
-
matrixId: config.matrixId
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
return resourceParams;
|
|
342
|
-
}
|
|
343
|
-
function keyBuilder$3(luvio, config) {
|
|
344
|
-
const resourceParams = createResourceParams$3(config);
|
|
345
|
-
return keyBuilder$4(luvio, resourceParams);
|
|
346
|
-
}
|
|
347
|
-
function typeCheckConfig$3(untrustedConfig) {
|
|
348
|
-
const config = {};
|
|
349
|
-
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
350
|
-
if (typeof untrustedConfig_matrixId === 'string') {
|
|
351
|
-
config.matrixId = untrustedConfig_matrixId;
|
|
352
|
-
}
|
|
353
|
-
return config;
|
|
354
|
-
}
|
|
355
|
-
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
356
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
361
|
-
}
|
|
362
|
-
const config = typeCheckConfig$3(untrustedConfig);
|
|
363
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
364
|
-
return null;
|
|
365
|
-
}
|
|
366
|
-
return config;
|
|
367
|
-
}
|
|
368
|
-
function adapterFragment$1(luvio, config) {
|
|
369
|
-
createResourceParams$3(config);
|
|
370
|
-
return select$5();
|
|
371
|
-
}
|
|
372
|
-
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
373
|
-
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
374
|
-
config,
|
|
375
|
-
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
376
|
-
});
|
|
377
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
378
|
-
}
|
|
379
|
-
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
380
|
-
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
381
|
-
config,
|
|
382
|
-
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
383
|
-
});
|
|
384
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
385
|
-
}
|
|
386
|
-
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
387
|
-
const resourceParams = createResourceParams$3(config);
|
|
388
|
-
const request = createResourceRequest$3(resourceParams);
|
|
389
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
390
|
-
.then((response) => {
|
|
391
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
392
|
-
}, (response) => {
|
|
393
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
397
|
-
const { luvio, config } = context;
|
|
398
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
399
|
-
const dispatchOptions = {
|
|
400
|
-
resourceRequestContext: {
|
|
401
|
-
requestCorrelator,
|
|
402
|
-
luvioRequestMethod: undefined,
|
|
403
|
-
},
|
|
404
|
-
eventObservers
|
|
405
|
-
};
|
|
406
|
-
if (networkPriority !== 'normal') {
|
|
407
|
-
dispatchOptions.overrides = {
|
|
408
|
-
priority: networkPriority
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
412
|
-
}
|
|
413
|
-
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
414
|
-
const { luvio, config } = context;
|
|
415
|
-
const selector = {
|
|
416
|
-
recordId: keyBuilder$3(luvio, config),
|
|
417
|
-
node: adapterFragment$1(luvio, config),
|
|
418
|
-
variables: {},
|
|
419
|
-
};
|
|
420
|
-
const cacheSnapshot = storeLookup(selector, {
|
|
421
|
-
config,
|
|
422
|
-
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
423
|
-
});
|
|
424
|
-
return cacheSnapshot;
|
|
425
|
-
}
|
|
426
|
-
const getColumnsAdapterFactory = (luvio) => function decisionMatrixDesigner__getColumns(untrustedConfig, requestContext) {
|
|
427
|
-
const config = validateAdapterConfig$3(untrustedConfig, getColumns_ConfigPropertyNames);
|
|
428
|
-
// Invalid or incomplete config
|
|
429
|
-
if (config === null) {
|
|
430
|
-
return null;
|
|
431
|
-
}
|
|
432
|
-
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
433
|
-
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
328
|
+
const getColumns_ConfigPropertyNames = {
|
|
329
|
+
displayName: 'getColumns',
|
|
330
|
+
parameters: {
|
|
331
|
+
required: ['matrixId'],
|
|
332
|
+
optional: []
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
function createResourceParams$3(config) {
|
|
336
|
+
const resourceParams = {
|
|
337
|
+
urlParams: {
|
|
338
|
+
matrixId: config.matrixId
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
return resourceParams;
|
|
342
|
+
}
|
|
343
|
+
function keyBuilder$3(luvio, config) {
|
|
344
|
+
const resourceParams = createResourceParams$3(config);
|
|
345
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
346
|
+
}
|
|
347
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
348
|
+
const config = {};
|
|
349
|
+
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
350
|
+
if (typeof untrustedConfig_matrixId === 'string') {
|
|
351
|
+
config.matrixId = untrustedConfig_matrixId;
|
|
352
|
+
}
|
|
353
|
+
return config;
|
|
354
|
+
}
|
|
355
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
356
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
361
|
+
}
|
|
362
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
363
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
return config;
|
|
367
|
+
}
|
|
368
|
+
function adapterFragment$1(luvio, config) {
|
|
369
|
+
createResourceParams$3(config);
|
|
370
|
+
return select$5();
|
|
371
|
+
}
|
|
372
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
373
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
374
|
+
config,
|
|
375
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
376
|
+
});
|
|
377
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
378
|
+
}
|
|
379
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
380
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
381
|
+
config,
|
|
382
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
383
|
+
});
|
|
384
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
385
|
+
}
|
|
386
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
387
|
+
const resourceParams = createResourceParams$3(config);
|
|
388
|
+
const request = createResourceRequest$3(resourceParams);
|
|
389
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
390
|
+
.then((response) => {
|
|
391
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
392
|
+
}, (response) => {
|
|
393
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
397
|
+
const { luvio, config } = context;
|
|
398
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
399
|
+
const dispatchOptions = {
|
|
400
|
+
resourceRequestContext: {
|
|
401
|
+
requestCorrelator,
|
|
402
|
+
luvioRequestMethod: undefined,
|
|
403
|
+
},
|
|
404
|
+
eventObservers
|
|
405
|
+
};
|
|
406
|
+
if (networkPriority !== 'normal') {
|
|
407
|
+
dispatchOptions.overrides = {
|
|
408
|
+
priority: networkPriority
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
412
|
+
}
|
|
413
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
414
|
+
const { luvio, config } = context;
|
|
415
|
+
const selector = {
|
|
416
|
+
recordId: keyBuilder$3(luvio, config),
|
|
417
|
+
node: adapterFragment$1(luvio, config),
|
|
418
|
+
variables: {},
|
|
419
|
+
};
|
|
420
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
421
|
+
config,
|
|
422
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
423
|
+
});
|
|
424
|
+
return cacheSnapshot;
|
|
425
|
+
}
|
|
426
|
+
const getColumnsAdapterFactory = (luvio) => function decisionMatrixDesigner__getColumns(untrustedConfig, requestContext) {
|
|
427
|
+
const config = validateAdapterConfig$3(untrustedConfig, getColumns_ConfigPropertyNames);
|
|
428
|
+
// Invalid or incomplete config
|
|
429
|
+
if (config === null) {
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
433
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
function validate$4(obj, path = 'DecisionMatrixColumnsInputRepresentation') {
|
|
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_columns = obj.columns;
|
|
442
|
-
const path_columns = path + '.columns';
|
|
443
|
-
if (!ArrayIsArray(obj_columns)) {
|
|
444
|
-
return new TypeError('Expected "array" but received "' + typeof obj_columns + '" (at "' + path_columns + '")');
|
|
445
|
-
}
|
|
446
|
-
for (let i = 0; i < obj_columns.length; i++) {
|
|
447
|
-
const obj_columns_item = obj_columns[i];
|
|
448
|
-
const path_columns_item = path_columns + '[' + i + ']';
|
|
449
|
-
if (typeof obj_columns_item !== 'object' || ArrayIsArray(obj_columns_item) || obj_columns_item === null) {
|
|
450
|
-
return new TypeError('Expected "object" but received "' + typeof obj_columns_item + '" (at "' + path_columns_item + '")');
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
})();
|
|
454
|
-
return v_error === undefined ? null : v_error;
|
|
436
|
+
function validate$4(obj, path = 'DecisionMatrixColumnsInputRepresentation') {
|
|
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_columns = obj.columns;
|
|
442
|
+
const path_columns = path + '.columns';
|
|
443
|
+
if (!ArrayIsArray(obj_columns)) {
|
|
444
|
+
return new TypeError('Expected "array" but received "' + typeof obj_columns + '" (at "' + path_columns + '")');
|
|
445
|
+
}
|
|
446
|
+
for (let i = 0; i < obj_columns.length; i++) {
|
|
447
|
+
const obj_columns_item = obj_columns[i];
|
|
448
|
+
const path_columns_item = path_columns + '[' + i + ']';
|
|
449
|
+
if (typeof obj_columns_item !== 'object' || ArrayIsArray(obj_columns_item) || obj_columns_item === null) {
|
|
450
|
+
return new TypeError('Expected "object" but received "' + typeof obj_columns_item + '" (at "' + path_columns_item + '")');
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
})();
|
|
454
|
+
return v_error === undefined ? null : v_error;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
const TTL$1 = 1000;
|
|
458
|
-
const VERSION$1 = "60c06d14589677c0dcc40b0116fabdee";
|
|
459
|
-
function validate$3(obj, path = 'DecisionMatrixOutputRepresentation') {
|
|
460
|
-
const v_error = (() => {
|
|
461
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
462
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
463
|
-
}
|
|
464
|
-
const obj_errorFileId = obj.errorFileId;
|
|
465
|
-
const path_errorFileId = path + '.errorFileId';
|
|
466
|
-
let obj_errorFileId_union0 = null;
|
|
467
|
-
const obj_errorFileId_union0_error = (() => {
|
|
468
|
-
if (typeof obj_errorFileId !== 'string') {
|
|
469
|
-
return new TypeError('Expected "string" but received "' + typeof obj_errorFileId + '" (at "' + path_errorFileId + '")');
|
|
470
|
-
}
|
|
471
|
-
})();
|
|
472
|
-
if (obj_errorFileId_union0_error != null) {
|
|
473
|
-
obj_errorFileId_union0 = obj_errorFileId_union0_error.message;
|
|
474
|
-
}
|
|
475
|
-
let obj_errorFileId_union1 = null;
|
|
476
|
-
const obj_errorFileId_union1_error = (() => {
|
|
477
|
-
if (obj_errorFileId !== null) {
|
|
478
|
-
return new TypeError('Expected "null" but received "' + typeof obj_errorFileId + '" (at "' + path_errorFileId + '")');
|
|
479
|
-
}
|
|
480
|
-
})();
|
|
481
|
-
if (obj_errorFileId_union1_error != null) {
|
|
482
|
-
obj_errorFileId_union1 = obj_errorFileId_union1_error.message;
|
|
483
|
-
}
|
|
484
|
-
if (obj_errorFileId_union0 && obj_errorFileId_union1) {
|
|
485
|
-
let message = 'Object doesn\'t match union (at "' + path_errorFileId + '")';
|
|
486
|
-
message += '\n' + obj_errorFileId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
487
|
-
message += '\n' + obj_errorFileId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
488
|
-
return new TypeError(message);
|
|
489
|
-
}
|
|
490
|
-
const obj_errors = obj.errors;
|
|
491
|
-
const path_errors = path + '.errors';
|
|
492
|
-
if (!ArrayIsArray(obj_errors)) {
|
|
493
|
-
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
494
|
-
}
|
|
495
|
-
for (let i = 0; i < obj_errors.length; i++) {
|
|
496
|
-
const obj_errors_item = obj_errors[i];
|
|
497
|
-
const path_errors_item = path_errors + '[' + i + ']';
|
|
498
|
-
if (typeof obj_errors_item !== 'string') {
|
|
499
|
-
return new TypeError('Expected "string" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
const obj_message = obj.message;
|
|
503
|
-
const path_message = path + '.message';
|
|
504
|
-
let obj_message_union0 = null;
|
|
505
|
-
const obj_message_union0_error = (() => {
|
|
506
|
-
if (typeof obj_message !== 'string') {
|
|
507
|
-
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
508
|
-
}
|
|
509
|
-
})();
|
|
510
|
-
if (obj_message_union0_error != null) {
|
|
511
|
-
obj_message_union0 = obj_message_union0_error.message;
|
|
512
|
-
}
|
|
513
|
-
let obj_message_union1 = null;
|
|
514
|
-
const obj_message_union1_error = (() => {
|
|
515
|
-
if (obj_message !== null) {
|
|
516
|
-
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
517
|
-
}
|
|
518
|
-
})();
|
|
519
|
-
if (obj_message_union1_error != null) {
|
|
520
|
-
obj_message_union1 = obj_message_union1_error.message;
|
|
521
|
-
}
|
|
522
|
-
if (obj_message_union0 && obj_message_union1) {
|
|
523
|
-
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
524
|
-
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
525
|
-
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
526
|
-
return new TypeError(message);
|
|
527
|
-
}
|
|
528
|
-
const obj_success = obj.success;
|
|
529
|
-
const path_success = path + '.success';
|
|
530
|
-
if (typeof obj_success !== 'boolean') {
|
|
531
|
-
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
532
|
-
}
|
|
533
|
-
})();
|
|
534
|
-
return v_error === undefined ? null : v_error;
|
|
535
|
-
}
|
|
536
|
-
const RepresentationType$1 = 'DecisionMatrixOutputRepresentation';
|
|
537
|
-
function keyBuilder$2(luvio, config) {
|
|
538
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.success;
|
|
539
|
-
}
|
|
540
|
-
function keyBuilderFromType(luvio, object) {
|
|
541
|
-
const keyParams = {
|
|
542
|
-
success: object.success
|
|
543
|
-
};
|
|
544
|
-
return keyBuilder$2(luvio, keyParams);
|
|
545
|
-
}
|
|
546
|
-
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
547
|
-
return input;
|
|
548
|
-
}
|
|
549
|
-
const select$4 = function DecisionMatrixOutputRepresentationSelect() {
|
|
550
|
-
return {
|
|
551
|
-
kind: 'Fragment',
|
|
552
|
-
version: VERSION$1,
|
|
553
|
-
private: [],
|
|
554
|
-
selections: [
|
|
555
|
-
{
|
|
556
|
-
name: 'errorFileId',
|
|
557
|
-
kind: 'Scalar'
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
name: 'errors',
|
|
561
|
-
kind: 'Scalar',
|
|
562
|
-
plural: true
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
name: 'message',
|
|
566
|
-
kind: 'Scalar'
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
name: 'success',
|
|
570
|
-
kind: 'Scalar'
|
|
571
|
-
}
|
|
572
|
-
]
|
|
573
|
-
};
|
|
574
|
-
};
|
|
575
|
-
function equals$1(existing, incoming) {
|
|
576
|
-
const existing_success = existing.success;
|
|
577
|
-
const incoming_success = incoming.success;
|
|
578
|
-
if (!(existing_success === incoming_success)) {
|
|
579
|
-
return false;
|
|
580
|
-
}
|
|
581
|
-
const existing_errorFileId = existing.errorFileId;
|
|
582
|
-
const incoming_errorFileId = incoming.errorFileId;
|
|
583
|
-
if (!(existing_errorFileId === incoming_errorFileId)) {
|
|
584
|
-
return false;
|
|
585
|
-
}
|
|
586
|
-
const existing_errors = existing.errors;
|
|
587
|
-
const incoming_errors = incoming.errors;
|
|
588
|
-
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
589
|
-
if (!(existing_errors_item === incoming_errors_item)) {
|
|
590
|
-
return false;
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
if (equals_errors_items === false) {
|
|
594
|
-
return false;
|
|
595
|
-
}
|
|
596
|
-
const existing_message = existing.message;
|
|
597
|
-
const incoming_message = incoming.message;
|
|
598
|
-
if (!(existing_message === incoming_message)) {
|
|
599
|
-
return false;
|
|
600
|
-
}
|
|
601
|
-
return true;
|
|
602
|
-
}
|
|
603
|
-
const ingest$1 = function DecisionMatrixOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
604
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
605
|
-
const validateError = validate$3(input);
|
|
606
|
-
if (validateError !== null) {
|
|
607
|
-
throw validateError;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
const key = keyBuilderFromType(luvio, input);
|
|
611
|
-
const existingRecord = store.readEntry(key);
|
|
612
|
-
const ttlToUse = TTL$1;
|
|
613
|
-
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
614
|
-
fullPath: key,
|
|
615
|
-
parent: path.parent,
|
|
616
|
-
propertyName: path.propertyName,
|
|
617
|
-
ttl: ttlToUse
|
|
618
|
-
});
|
|
619
|
-
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
620
|
-
luvio.storePublish(key, incomingRecord);
|
|
621
|
-
}
|
|
622
|
-
{
|
|
623
|
-
const storeMetadataParams = {
|
|
624
|
-
ttl: ttlToUse,
|
|
625
|
-
namespace: "decision-matrix-designer",
|
|
626
|
-
version: VERSION$1,
|
|
627
|
-
representationName: RepresentationType$1,
|
|
628
|
-
};
|
|
629
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
630
|
-
}
|
|
631
|
-
return createLink(key);
|
|
632
|
-
};
|
|
633
|
-
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
634
|
-
const rootKeySet = new StoreKeyMap();
|
|
635
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
636
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
637
|
-
rootKeySet.set(rootKey, {
|
|
638
|
-
namespace: keyPrefix,
|
|
639
|
-
representationName: RepresentationType$1,
|
|
640
|
-
mergeable: false
|
|
641
|
-
});
|
|
642
|
-
return rootKeySet;
|
|
457
|
+
const TTL$1 = 1000;
|
|
458
|
+
const VERSION$1 = "60c06d14589677c0dcc40b0116fabdee";
|
|
459
|
+
function validate$3(obj, path = 'DecisionMatrixOutputRepresentation') {
|
|
460
|
+
const v_error = (() => {
|
|
461
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
462
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
463
|
+
}
|
|
464
|
+
const obj_errorFileId = obj.errorFileId;
|
|
465
|
+
const path_errorFileId = path + '.errorFileId';
|
|
466
|
+
let obj_errorFileId_union0 = null;
|
|
467
|
+
const obj_errorFileId_union0_error = (() => {
|
|
468
|
+
if (typeof obj_errorFileId !== 'string') {
|
|
469
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorFileId + '" (at "' + path_errorFileId + '")');
|
|
470
|
+
}
|
|
471
|
+
})();
|
|
472
|
+
if (obj_errorFileId_union0_error != null) {
|
|
473
|
+
obj_errorFileId_union0 = obj_errorFileId_union0_error.message;
|
|
474
|
+
}
|
|
475
|
+
let obj_errorFileId_union1 = null;
|
|
476
|
+
const obj_errorFileId_union1_error = (() => {
|
|
477
|
+
if (obj_errorFileId !== null) {
|
|
478
|
+
return new TypeError('Expected "null" but received "' + typeof obj_errorFileId + '" (at "' + path_errorFileId + '")');
|
|
479
|
+
}
|
|
480
|
+
})();
|
|
481
|
+
if (obj_errorFileId_union1_error != null) {
|
|
482
|
+
obj_errorFileId_union1 = obj_errorFileId_union1_error.message;
|
|
483
|
+
}
|
|
484
|
+
if (obj_errorFileId_union0 && obj_errorFileId_union1) {
|
|
485
|
+
let message = 'Object doesn\'t match union (at "' + path_errorFileId + '")';
|
|
486
|
+
message += '\n' + obj_errorFileId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
487
|
+
message += '\n' + obj_errorFileId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
488
|
+
return new TypeError(message);
|
|
489
|
+
}
|
|
490
|
+
const obj_errors = obj.errors;
|
|
491
|
+
const path_errors = path + '.errors';
|
|
492
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
493
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
494
|
+
}
|
|
495
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
496
|
+
const obj_errors_item = obj_errors[i];
|
|
497
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
498
|
+
if (typeof obj_errors_item !== 'string') {
|
|
499
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
const obj_message = obj.message;
|
|
503
|
+
const path_message = path + '.message';
|
|
504
|
+
let obj_message_union0 = null;
|
|
505
|
+
const obj_message_union0_error = (() => {
|
|
506
|
+
if (typeof obj_message !== 'string') {
|
|
507
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
508
|
+
}
|
|
509
|
+
})();
|
|
510
|
+
if (obj_message_union0_error != null) {
|
|
511
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
512
|
+
}
|
|
513
|
+
let obj_message_union1 = null;
|
|
514
|
+
const obj_message_union1_error = (() => {
|
|
515
|
+
if (obj_message !== null) {
|
|
516
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
517
|
+
}
|
|
518
|
+
})();
|
|
519
|
+
if (obj_message_union1_error != null) {
|
|
520
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
521
|
+
}
|
|
522
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
523
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
524
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
525
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
526
|
+
return new TypeError(message);
|
|
527
|
+
}
|
|
528
|
+
const obj_success = obj.success;
|
|
529
|
+
const path_success = path + '.success';
|
|
530
|
+
if (typeof obj_success !== 'boolean') {
|
|
531
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
532
|
+
}
|
|
533
|
+
})();
|
|
534
|
+
return v_error === undefined ? null : v_error;
|
|
535
|
+
}
|
|
536
|
+
const RepresentationType$1 = 'DecisionMatrixOutputRepresentation';
|
|
537
|
+
function keyBuilder$2(luvio, config) {
|
|
538
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.success;
|
|
539
|
+
}
|
|
540
|
+
function keyBuilderFromType(luvio, object) {
|
|
541
|
+
const keyParams = {
|
|
542
|
+
success: object.success
|
|
543
|
+
};
|
|
544
|
+
return keyBuilder$2(luvio, keyParams);
|
|
545
|
+
}
|
|
546
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
547
|
+
return input;
|
|
548
|
+
}
|
|
549
|
+
const select$4 = function DecisionMatrixOutputRepresentationSelect() {
|
|
550
|
+
return {
|
|
551
|
+
kind: 'Fragment',
|
|
552
|
+
version: VERSION$1,
|
|
553
|
+
private: [],
|
|
554
|
+
selections: [
|
|
555
|
+
{
|
|
556
|
+
name: 'errorFileId',
|
|
557
|
+
kind: 'Scalar'
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
name: 'errors',
|
|
561
|
+
kind: 'Scalar',
|
|
562
|
+
plural: true
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: 'message',
|
|
566
|
+
kind: 'Scalar'
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'success',
|
|
570
|
+
kind: 'Scalar'
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
function equals$1(existing, incoming) {
|
|
576
|
+
const existing_success = existing.success;
|
|
577
|
+
const incoming_success = incoming.success;
|
|
578
|
+
if (!(existing_success === incoming_success)) {
|
|
579
|
+
return false;
|
|
580
|
+
}
|
|
581
|
+
const existing_errorFileId = existing.errorFileId;
|
|
582
|
+
const incoming_errorFileId = incoming.errorFileId;
|
|
583
|
+
if (!(existing_errorFileId === incoming_errorFileId)) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
const existing_errors = existing.errors;
|
|
587
|
+
const incoming_errors = incoming.errors;
|
|
588
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
589
|
+
if (!(existing_errors_item === incoming_errors_item)) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
if (equals_errors_items === false) {
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
const existing_message = existing.message;
|
|
597
|
+
const incoming_message = incoming.message;
|
|
598
|
+
if (!(existing_message === incoming_message)) {
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
const ingest$1 = function DecisionMatrixOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
604
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
605
|
+
const validateError = validate$3(input);
|
|
606
|
+
if (validateError !== null) {
|
|
607
|
+
throw validateError;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const key = keyBuilderFromType(luvio, input);
|
|
611
|
+
const existingRecord = store.readEntry(key);
|
|
612
|
+
const ttlToUse = TTL$1;
|
|
613
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
614
|
+
fullPath: key,
|
|
615
|
+
parent: path.parent,
|
|
616
|
+
propertyName: path.propertyName,
|
|
617
|
+
ttl: ttlToUse
|
|
618
|
+
});
|
|
619
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
620
|
+
luvio.storePublish(key, incomingRecord);
|
|
621
|
+
}
|
|
622
|
+
{
|
|
623
|
+
const storeMetadataParams = {
|
|
624
|
+
ttl: ttlToUse,
|
|
625
|
+
namespace: "decision-matrix-designer",
|
|
626
|
+
version: VERSION$1,
|
|
627
|
+
representationName: RepresentationType$1,
|
|
628
|
+
};
|
|
629
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
630
|
+
}
|
|
631
|
+
return createLink(key);
|
|
632
|
+
};
|
|
633
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
634
|
+
const rootKeySet = new StoreKeyMap();
|
|
635
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
636
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
637
|
+
rootKeySet.set(rootKey, {
|
|
638
|
+
namespace: keyPrefix,
|
|
639
|
+
representationName: RepresentationType$1,
|
|
640
|
+
mergeable: false
|
|
641
|
+
});
|
|
642
|
+
return rootKeySet;
|
|
643
643
|
}
|
|
644
644
|
|
|
645
|
-
function select$3(luvio, params) {
|
|
646
|
-
return select$4();
|
|
647
|
-
}
|
|
648
|
-
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
649
|
-
return getTypeCacheKeys$1(luvio, response);
|
|
650
|
-
}
|
|
651
|
-
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
652
|
-
const { body } = response;
|
|
653
|
-
const key = keyBuilderFromType(luvio, body);
|
|
654
|
-
luvio.storeIngest(key, ingest$1, body);
|
|
655
|
-
const snapshot = luvio.storeLookup({
|
|
656
|
-
recordId: key,
|
|
657
|
-
node: select$3(),
|
|
658
|
-
variables: {},
|
|
659
|
-
});
|
|
660
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
661
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
662
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
return snapshot;
|
|
666
|
-
}
|
|
667
|
-
function createResourceRequest$2(config) {
|
|
668
|
-
const headers = {};
|
|
669
|
-
return {
|
|
670
|
-
baseUri: '/services/data/v58.0',
|
|
671
|
-
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/columns',
|
|
672
|
-
method: 'post',
|
|
673
|
-
body: config.body,
|
|
674
|
-
urlParams: config.urlParams,
|
|
675
|
-
queryParams: {},
|
|
676
|
-
headers,
|
|
677
|
-
priority: 'normal',
|
|
678
|
-
};
|
|
645
|
+
function select$3(luvio, params) {
|
|
646
|
+
return select$4();
|
|
647
|
+
}
|
|
648
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
649
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
650
|
+
}
|
|
651
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
652
|
+
const { body } = response;
|
|
653
|
+
const key = keyBuilderFromType(luvio, body);
|
|
654
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
655
|
+
const snapshot = luvio.storeLookup({
|
|
656
|
+
recordId: key,
|
|
657
|
+
node: select$3(),
|
|
658
|
+
variables: {},
|
|
659
|
+
});
|
|
660
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
661
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
662
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return snapshot;
|
|
666
|
+
}
|
|
667
|
+
function createResourceRequest$2(config) {
|
|
668
|
+
const headers = {};
|
|
669
|
+
return {
|
|
670
|
+
baseUri: '/services/data/v58.0',
|
|
671
|
+
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/columns',
|
|
672
|
+
method: 'post',
|
|
673
|
+
body: config.body,
|
|
674
|
+
urlParams: config.urlParams,
|
|
675
|
+
queryParams: {},
|
|
676
|
+
headers,
|
|
677
|
+
priority: 'normal',
|
|
678
|
+
};
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
-
const saveColumns_ConfigPropertyNames = {
|
|
682
|
-
displayName: 'saveColumns',
|
|
683
|
-
parameters: {
|
|
684
|
-
required: ['matrixId', 'columns'],
|
|
685
|
-
optional: []
|
|
686
|
-
}
|
|
687
|
-
};
|
|
688
|
-
function createResourceParams$2(config) {
|
|
689
|
-
const resourceParams = {
|
|
690
|
-
urlParams: {
|
|
691
|
-
matrixId: config.matrixId
|
|
692
|
-
},
|
|
693
|
-
body: {
|
|
694
|
-
columns: config.columns
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
return resourceParams;
|
|
698
|
-
}
|
|
699
|
-
function typeCheckConfig$2(untrustedConfig) {
|
|
700
|
-
const config = {};
|
|
701
|
-
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
702
|
-
if (typeof untrustedConfig_matrixId === 'string') {
|
|
703
|
-
config.matrixId = untrustedConfig_matrixId;
|
|
704
|
-
}
|
|
705
|
-
const untrustedConfig_columns = untrustedConfig.columns;
|
|
706
|
-
const referenceDecisionMatrixColumnsInputRepresentationValidationError = validate$4(untrustedConfig_columns);
|
|
707
|
-
if (referenceDecisionMatrixColumnsInputRepresentationValidationError === null) {
|
|
708
|
-
config.columns = untrustedConfig_columns;
|
|
709
|
-
}
|
|
710
|
-
return config;
|
|
711
|
-
}
|
|
712
|
-
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
713
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
714
|
-
return null;
|
|
715
|
-
}
|
|
716
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
717
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
718
|
-
}
|
|
719
|
-
const config = typeCheckConfig$2(untrustedConfig);
|
|
720
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
721
|
-
return null;
|
|
722
|
-
}
|
|
723
|
-
return config;
|
|
724
|
-
}
|
|
725
|
-
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
726
|
-
const resourceParams = createResourceParams$2(config);
|
|
727
|
-
const request = createResourceRequest$2(resourceParams);
|
|
728
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
729
|
-
.then((response) => {
|
|
730
|
-
return luvio.handleSuccessResponse(() => {
|
|
731
|
-
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
732
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
733
|
-
}, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
734
|
-
}, (response) => {
|
|
735
|
-
deepFreeze$4(response);
|
|
736
|
-
throw response;
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
const saveColumnsAdapterFactory = (luvio) => {
|
|
740
|
-
return function saveColumns(untrustedConfig) {
|
|
741
|
-
const config = validateAdapterConfig$2(untrustedConfig, saveColumns_ConfigPropertyNames);
|
|
742
|
-
// Invalid or incomplete config
|
|
743
|
-
if (config === null) {
|
|
744
|
-
throw new Error('Invalid config for "saveColumns"');
|
|
745
|
-
}
|
|
746
|
-
return buildNetworkSnapshot$2(luvio, config);
|
|
747
|
-
};
|
|
681
|
+
const saveColumns_ConfigPropertyNames = {
|
|
682
|
+
displayName: 'saveColumns',
|
|
683
|
+
parameters: {
|
|
684
|
+
required: ['matrixId', 'columns'],
|
|
685
|
+
optional: []
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
function createResourceParams$2(config) {
|
|
689
|
+
const resourceParams = {
|
|
690
|
+
urlParams: {
|
|
691
|
+
matrixId: config.matrixId
|
|
692
|
+
},
|
|
693
|
+
body: {
|
|
694
|
+
columns: config.columns
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
return resourceParams;
|
|
698
|
+
}
|
|
699
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
700
|
+
const config = {};
|
|
701
|
+
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
702
|
+
if (typeof untrustedConfig_matrixId === 'string') {
|
|
703
|
+
config.matrixId = untrustedConfig_matrixId;
|
|
704
|
+
}
|
|
705
|
+
const untrustedConfig_columns = untrustedConfig.columns;
|
|
706
|
+
const referenceDecisionMatrixColumnsInputRepresentationValidationError = validate$4(untrustedConfig_columns);
|
|
707
|
+
if (referenceDecisionMatrixColumnsInputRepresentationValidationError === null) {
|
|
708
|
+
config.columns = untrustedConfig_columns;
|
|
709
|
+
}
|
|
710
|
+
return config;
|
|
711
|
+
}
|
|
712
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
713
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
717
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
718
|
+
}
|
|
719
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
720
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
721
|
+
return null;
|
|
722
|
+
}
|
|
723
|
+
return config;
|
|
724
|
+
}
|
|
725
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
726
|
+
const resourceParams = createResourceParams$2(config);
|
|
727
|
+
const request = createResourceRequest$2(resourceParams);
|
|
728
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
729
|
+
.then((response) => {
|
|
730
|
+
return luvio.handleSuccessResponse(() => {
|
|
731
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
732
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
733
|
+
}, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
734
|
+
}, (response) => {
|
|
735
|
+
deepFreeze$4(response);
|
|
736
|
+
throw response;
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
const saveColumnsAdapterFactory = (luvio) => {
|
|
740
|
+
return function saveColumns(untrustedConfig) {
|
|
741
|
+
const config = validateAdapterConfig$2(untrustedConfig, saveColumns_ConfigPropertyNames);
|
|
742
|
+
// Invalid or incomplete config
|
|
743
|
+
if (config === null) {
|
|
744
|
+
throw new Error('Invalid config for "saveColumns"');
|
|
745
|
+
}
|
|
746
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
747
|
+
};
|
|
748
748
|
};
|
|
749
749
|
|
|
750
|
-
function validate$2(obj, path = 'DecisionMatrixRowOutputRepresentation') {
|
|
751
|
-
const v_error = (() => {
|
|
752
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
753
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
754
|
-
}
|
|
755
|
-
const obj_id = obj.id;
|
|
756
|
-
const path_id = path + '.id';
|
|
757
|
-
if (typeof obj_id !== 'string') {
|
|
758
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
759
|
-
}
|
|
760
|
-
const obj_name = obj.name;
|
|
761
|
-
const path_name = path + '.name';
|
|
762
|
-
if (typeof obj_name !== 'string') {
|
|
763
|
-
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
764
|
-
}
|
|
765
|
-
const obj_rowData = obj.rowData;
|
|
766
|
-
const path_rowData = path + '.rowData';
|
|
767
|
-
if (typeof obj_rowData !== 'object' || ArrayIsArray(obj_rowData) || obj_rowData === null) {
|
|
768
|
-
return new TypeError('Expected "object" but received "' + typeof obj_rowData + '" (at "' + path_rowData + '")');
|
|
769
|
-
}
|
|
770
|
-
const obj_rowData_keys = ObjectKeys(obj_rowData);
|
|
771
|
-
for (let i = 0; i < obj_rowData_keys.length; i++) {
|
|
772
|
-
const key = obj_rowData_keys[i];
|
|
773
|
-
const obj_rowData_prop = obj_rowData[key];
|
|
774
|
-
const path_rowData_prop = path_rowData + '["' + key + '"]';
|
|
775
|
-
let obj_rowData_prop_union0 = null;
|
|
776
|
-
const obj_rowData_prop_union0_error = (() => {
|
|
777
|
-
if (typeof obj_rowData_prop !== 'string') {
|
|
778
|
-
return new TypeError('Expected "string" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
779
|
-
}
|
|
780
|
-
})();
|
|
781
|
-
if (obj_rowData_prop_union0_error != null) {
|
|
782
|
-
obj_rowData_prop_union0 = obj_rowData_prop_union0_error.message;
|
|
783
|
-
}
|
|
784
|
-
let obj_rowData_prop_union1 = null;
|
|
785
|
-
const obj_rowData_prop_union1_error = (() => {
|
|
786
|
-
if (typeof obj_rowData_prop !== 'number') {
|
|
787
|
-
return new TypeError('Expected "number" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
788
|
-
}
|
|
789
|
-
})();
|
|
790
|
-
if (obj_rowData_prop_union1_error != null) {
|
|
791
|
-
obj_rowData_prop_union1 = obj_rowData_prop_union1_error.message;
|
|
792
|
-
}
|
|
793
|
-
let obj_rowData_prop_union2 = null;
|
|
794
|
-
const obj_rowData_prop_union2_error = (() => {
|
|
795
|
-
if (typeof obj_rowData_prop !== 'boolean') {
|
|
796
|
-
return new TypeError('Expected "boolean" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
797
|
-
}
|
|
798
|
-
})();
|
|
799
|
-
if (obj_rowData_prop_union2_error != null) {
|
|
800
|
-
obj_rowData_prop_union2 = obj_rowData_prop_union2_error.message;
|
|
801
|
-
}
|
|
802
|
-
if (obj_rowData_prop_union0 && obj_rowData_prop_union1 && obj_rowData_prop_union2) {
|
|
803
|
-
let message = 'Object doesn\'t match union (at "' + path_rowData_prop + '")';
|
|
804
|
-
message += '\n' + obj_rowData_prop_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
805
|
-
message += '\n' + obj_rowData_prop_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
806
|
-
message += '\n' + obj_rowData_prop_union2.split('\n').map((line) => '\t' + line).join('\n');
|
|
807
|
-
return new TypeError(message);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
})();
|
|
811
|
-
return v_error === undefined ? null : v_error;
|
|
812
|
-
}
|
|
813
|
-
function deepFreeze$1(input) {
|
|
814
|
-
const input_rowData = input.rowData;
|
|
815
|
-
const input_rowData_keys = Object.keys(input_rowData);
|
|
816
|
-
const input_rowData_length = input_rowData_keys.length;
|
|
817
|
-
for (let i = 0; i < input_rowData_length; i++) {
|
|
818
|
-
input_rowData_keys[i];
|
|
819
|
-
}
|
|
820
|
-
ObjectFreeze(input_rowData);
|
|
821
|
-
ObjectFreeze(input);
|
|
750
|
+
function validate$2(obj, path = 'DecisionMatrixRowOutputRepresentation') {
|
|
751
|
+
const v_error = (() => {
|
|
752
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
753
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
754
|
+
}
|
|
755
|
+
const obj_id = obj.id;
|
|
756
|
+
const path_id = path + '.id';
|
|
757
|
+
if (typeof obj_id !== 'string') {
|
|
758
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
759
|
+
}
|
|
760
|
+
const obj_name = obj.name;
|
|
761
|
+
const path_name = path + '.name';
|
|
762
|
+
if (typeof obj_name !== 'string') {
|
|
763
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
764
|
+
}
|
|
765
|
+
const obj_rowData = obj.rowData;
|
|
766
|
+
const path_rowData = path + '.rowData';
|
|
767
|
+
if (typeof obj_rowData !== 'object' || ArrayIsArray(obj_rowData) || obj_rowData === null) {
|
|
768
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rowData + '" (at "' + path_rowData + '")');
|
|
769
|
+
}
|
|
770
|
+
const obj_rowData_keys = ObjectKeys(obj_rowData);
|
|
771
|
+
for (let i = 0; i < obj_rowData_keys.length; i++) {
|
|
772
|
+
const key = obj_rowData_keys[i];
|
|
773
|
+
const obj_rowData_prop = obj_rowData[key];
|
|
774
|
+
const path_rowData_prop = path_rowData + '["' + key + '"]';
|
|
775
|
+
let obj_rowData_prop_union0 = null;
|
|
776
|
+
const obj_rowData_prop_union0_error = (() => {
|
|
777
|
+
if (typeof obj_rowData_prop !== 'string') {
|
|
778
|
+
return new TypeError('Expected "string" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
779
|
+
}
|
|
780
|
+
})();
|
|
781
|
+
if (obj_rowData_prop_union0_error != null) {
|
|
782
|
+
obj_rowData_prop_union0 = obj_rowData_prop_union0_error.message;
|
|
783
|
+
}
|
|
784
|
+
let obj_rowData_prop_union1 = null;
|
|
785
|
+
const obj_rowData_prop_union1_error = (() => {
|
|
786
|
+
if (typeof obj_rowData_prop !== 'number') {
|
|
787
|
+
return new TypeError('Expected "number" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
788
|
+
}
|
|
789
|
+
})();
|
|
790
|
+
if (obj_rowData_prop_union1_error != null) {
|
|
791
|
+
obj_rowData_prop_union1 = obj_rowData_prop_union1_error.message;
|
|
792
|
+
}
|
|
793
|
+
let obj_rowData_prop_union2 = null;
|
|
794
|
+
const obj_rowData_prop_union2_error = (() => {
|
|
795
|
+
if (typeof obj_rowData_prop !== 'boolean') {
|
|
796
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
797
|
+
}
|
|
798
|
+
})();
|
|
799
|
+
if (obj_rowData_prop_union2_error != null) {
|
|
800
|
+
obj_rowData_prop_union2 = obj_rowData_prop_union2_error.message;
|
|
801
|
+
}
|
|
802
|
+
if (obj_rowData_prop_union0 && obj_rowData_prop_union1 && obj_rowData_prop_union2) {
|
|
803
|
+
let message = 'Object doesn\'t match union (at "' + path_rowData_prop + '")';
|
|
804
|
+
message += '\n' + obj_rowData_prop_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
805
|
+
message += '\n' + obj_rowData_prop_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
806
|
+
message += '\n' + obj_rowData_prop_union2.split('\n').map((line) => '\t' + line).join('\n');
|
|
807
|
+
return new TypeError(message);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
})();
|
|
811
|
+
return v_error === undefined ? null : v_error;
|
|
812
|
+
}
|
|
813
|
+
function deepFreeze$1(input) {
|
|
814
|
+
const input_rowData = input.rowData;
|
|
815
|
+
const input_rowData_keys = Object.keys(input_rowData);
|
|
816
|
+
const input_rowData_length = input_rowData_keys.length;
|
|
817
|
+
for (let i = 0; i < input_rowData_length; i++) {
|
|
818
|
+
input_rowData_keys[i];
|
|
819
|
+
}
|
|
820
|
+
ObjectFreeze(input_rowData);
|
|
821
|
+
ObjectFreeze(input);
|
|
822
822
|
}
|
|
823
823
|
|
|
824
|
-
const TTL = 1000;
|
|
825
|
-
const VERSION = "29ed6d4f3fd86e3a72843e30d2858825";
|
|
826
|
-
function validate$1(obj, path = 'DecisionMatrixRowsOutputRepresentation') {
|
|
827
|
-
const v_error = (() => {
|
|
828
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
829
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
830
|
-
}
|
|
831
|
-
const obj_message = obj.message;
|
|
832
|
-
const path_message = path + '.message';
|
|
833
|
-
let obj_message_union0 = null;
|
|
834
|
-
const obj_message_union0_error = (() => {
|
|
835
|
-
if (typeof obj_message !== 'string') {
|
|
836
|
-
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
837
|
-
}
|
|
838
|
-
})();
|
|
839
|
-
if (obj_message_union0_error != null) {
|
|
840
|
-
obj_message_union0 = obj_message_union0_error.message;
|
|
841
|
-
}
|
|
842
|
-
let obj_message_union1 = null;
|
|
843
|
-
const obj_message_union1_error = (() => {
|
|
844
|
-
if (obj_message !== null) {
|
|
845
|
-
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
846
|
-
}
|
|
847
|
-
})();
|
|
848
|
-
if (obj_message_union1_error != null) {
|
|
849
|
-
obj_message_union1 = obj_message_union1_error.message;
|
|
850
|
-
}
|
|
851
|
-
if (obj_message_union0 && obj_message_union1) {
|
|
852
|
-
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
853
|
-
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
854
|
-
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
855
|
-
return new TypeError(message);
|
|
856
|
-
}
|
|
857
|
-
const obj_rows = obj.rows;
|
|
858
|
-
const path_rows = path + '.rows';
|
|
859
|
-
if (!ArrayIsArray(obj_rows)) {
|
|
860
|
-
return new TypeError('Expected "array" but received "' + typeof obj_rows + '" (at "' + path_rows + '")');
|
|
861
|
-
}
|
|
862
|
-
for (let i = 0; i < obj_rows.length; i++) {
|
|
863
|
-
const obj_rows_item = obj_rows[i];
|
|
864
|
-
const path_rows_item = path_rows + '[' + i + ']';
|
|
865
|
-
const referencepath_rows_itemValidationError = validate$2(obj_rows_item, path_rows_item);
|
|
866
|
-
if (referencepath_rows_itemValidationError !== null) {
|
|
867
|
-
let message = 'Object doesn\'t match DecisionMatrixRowOutputRepresentation (at "' + path_rows_item + '")\n';
|
|
868
|
-
message += referencepath_rows_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
869
|
-
return new TypeError(message);
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
const obj_totalRows = obj.totalRows;
|
|
873
|
-
const path_totalRows = path + '.totalRows';
|
|
874
|
-
let obj_totalRows_union0 = null;
|
|
875
|
-
const obj_totalRows_union0_error = (() => {
|
|
876
|
-
if (typeof obj_totalRows !== 'number' || (typeof obj_totalRows === 'number' && Math.floor(obj_totalRows) !== obj_totalRows)) {
|
|
877
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_totalRows + '" (at "' + path_totalRows + '")');
|
|
878
|
-
}
|
|
879
|
-
})();
|
|
880
|
-
if (obj_totalRows_union0_error != null) {
|
|
881
|
-
obj_totalRows_union0 = obj_totalRows_union0_error.message;
|
|
882
|
-
}
|
|
883
|
-
let obj_totalRows_union1 = null;
|
|
884
|
-
const obj_totalRows_union1_error = (() => {
|
|
885
|
-
if (obj_totalRows !== null) {
|
|
886
|
-
return new TypeError('Expected "null" but received "' + typeof obj_totalRows + '" (at "' + path_totalRows + '")');
|
|
887
|
-
}
|
|
888
|
-
})();
|
|
889
|
-
if (obj_totalRows_union1_error != null) {
|
|
890
|
-
obj_totalRows_union1 = obj_totalRows_union1_error.message;
|
|
891
|
-
}
|
|
892
|
-
if (obj_totalRows_union0 && obj_totalRows_union1) {
|
|
893
|
-
let message = 'Object doesn\'t match union (at "' + path_totalRows + '")';
|
|
894
|
-
message += '\n' + obj_totalRows_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
895
|
-
message += '\n' + obj_totalRows_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
896
|
-
return new TypeError(message);
|
|
897
|
-
}
|
|
898
|
-
})();
|
|
899
|
-
return v_error === undefined ? null : v_error;
|
|
900
|
-
}
|
|
901
|
-
const RepresentationType = 'DecisionMatrixRowsOutputRepresentation';
|
|
902
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
903
|
-
return input;
|
|
904
|
-
}
|
|
905
|
-
const select$2 = function DecisionMatrixRowsOutputRepresentationSelect() {
|
|
906
|
-
return {
|
|
907
|
-
kind: 'Fragment',
|
|
908
|
-
version: VERSION,
|
|
909
|
-
private: [],
|
|
910
|
-
opaque: true
|
|
911
|
-
};
|
|
912
|
-
};
|
|
913
|
-
function equals(existing, incoming) {
|
|
914
|
-
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
915
|
-
return false;
|
|
916
|
-
}
|
|
917
|
-
return true;
|
|
918
|
-
}
|
|
919
|
-
function deepFreeze(input) {
|
|
920
|
-
const input_rows = input.rows;
|
|
921
|
-
for (let i = 0; i < input_rows.length; i++) {
|
|
922
|
-
const input_rows_item = input_rows[i];
|
|
923
|
-
deepFreeze$1(input_rows_item);
|
|
924
|
-
}
|
|
925
|
-
ObjectFreeze(input_rows);
|
|
926
|
-
ObjectFreeze(input);
|
|
927
|
-
}
|
|
928
|
-
const ingest = function DecisionMatrixRowsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
929
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
930
|
-
const validateError = validate$1(input);
|
|
931
|
-
if (validateError !== null) {
|
|
932
|
-
throw validateError;
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
const key = path.fullPath;
|
|
936
|
-
const existingRecord = store.readEntry(key);
|
|
937
|
-
const ttlToUse = TTL;
|
|
938
|
-
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
939
|
-
fullPath: key,
|
|
940
|
-
parent: path.parent,
|
|
941
|
-
propertyName: path.propertyName,
|
|
942
|
-
ttl: ttlToUse
|
|
943
|
-
});
|
|
944
|
-
deepFreeze(input);
|
|
945
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
946
|
-
luvio.storePublish(key, incomingRecord);
|
|
947
|
-
}
|
|
948
|
-
{
|
|
949
|
-
const storeMetadataParams = {
|
|
950
|
-
ttl: ttlToUse,
|
|
951
|
-
namespace: "decision-matrix-designer",
|
|
952
|
-
version: VERSION,
|
|
953
|
-
representationName: RepresentationType,
|
|
954
|
-
};
|
|
955
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
956
|
-
}
|
|
957
|
-
return createLink(key);
|
|
958
|
-
};
|
|
959
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
960
|
-
const rootKeySet = new StoreKeyMap();
|
|
961
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
962
|
-
const rootKey = fullPathFactory();
|
|
963
|
-
rootKeySet.set(rootKey, {
|
|
964
|
-
namespace: keyPrefix,
|
|
965
|
-
representationName: RepresentationType,
|
|
966
|
-
mergeable: false
|
|
967
|
-
});
|
|
968
|
-
return rootKeySet;
|
|
824
|
+
const TTL = 1000;
|
|
825
|
+
const VERSION = "29ed6d4f3fd86e3a72843e30d2858825";
|
|
826
|
+
function validate$1(obj, path = 'DecisionMatrixRowsOutputRepresentation') {
|
|
827
|
+
const v_error = (() => {
|
|
828
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
829
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
830
|
+
}
|
|
831
|
+
const obj_message = obj.message;
|
|
832
|
+
const path_message = path + '.message';
|
|
833
|
+
let obj_message_union0 = null;
|
|
834
|
+
const obj_message_union0_error = (() => {
|
|
835
|
+
if (typeof obj_message !== 'string') {
|
|
836
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
837
|
+
}
|
|
838
|
+
})();
|
|
839
|
+
if (obj_message_union0_error != null) {
|
|
840
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
841
|
+
}
|
|
842
|
+
let obj_message_union1 = null;
|
|
843
|
+
const obj_message_union1_error = (() => {
|
|
844
|
+
if (obj_message !== null) {
|
|
845
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
846
|
+
}
|
|
847
|
+
})();
|
|
848
|
+
if (obj_message_union1_error != null) {
|
|
849
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
850
|
+
}
|
|
851
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
852
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
853
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
854
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
855
|
+
return new TypeError(message);
|
|
856
|
+
}
|
|
857
|
+
const obj_rows = obj.rows;
|
|
858
|
+
const path_rows = path + '.rows';
|
|
859
|
+
if (!ArrayIsArray(obj_rows)) {
|
|
860
|
+
return new TypeError('Expected "array" but received "' + typeof obj_rows + '" (at "' + path_rows + '")');
|
|
861
|
+
}
|
|
862
|
+
for (let i = 0; i < obj_rows.length; i++) {
|
|
863
|
+
const obj_rows_item = obj_rows[i];
|
|
864
|
+
const path_rows_item = path_rows + '[' + i + ']';
|
|
865
|
+
const referencepath_rows_itemValidationError = validate$2(obj_rows_item, path_rows_item);
|
|
866
|
+
if (referencepath_rows_itemValidationError !== null) {
|
|
867
|
+
let message = 'Object doesn\'t match DecisionMatrixRowOutputRepresentation (at "' + path_rows_item + '")\n';
|
|
868
|
+
message += referencepath_rows_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
869
|
+
return new TypeError(message);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
const obj_totalRows = obj.totalRows;
|
|
873
|
+
const path_totalRows = path + '.totalRows';
|
|
874
|
+
let obj_totalRows_union0 = null;
|
|
875
|
+
const obj_totalRows_union0_error = (() => {
|
|
876
|
+
if (typeof obj_totalRows !== 'number' || (typeof obj_totalRows === 'number' && Math.floor(obj_totalRows) !== obj_totalRows)) {
|
|
877
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalRows + '" (at "' + path_totalRows + '")');
|
|
878
|
+
}
|
|
879
|
+
})();
|
|
880
|
+
if (obj_totalRows_union0_error != null) {
|
|
881
|
+
obj_totalRows_union0 = obj_totalRows_union0_error.message;
|
|
882
|
+
}
|
|
883
|
+
let obj_totalRows_union1 = null;
|
|
884
|
+
const obj_totalRows_union1_error = (() => {
|
|
885
|
+
if (obj_totalRows !== null) {
|
|
886
|
+
return new TypeError('Expected "null" but received "' + typeof obj_totalRows + '" (at "' + path_totalRows + '")');
|
|
887
|
+
}
|
|
888
|
+
})();
|
|
889
|
+
if (obj_totalRows_union1_error != null) {
|
|
890
|
+
obj_totalRows_union1 = obj_totalRows_union1_error.message;
|
|
891
|
+
}
|
|
892
|
+
if (obj_totalRows_union0 && obj_totalRows_union1) {
|
|
893
|
+
let message = 'Object doesn\'t match union (at "' + path_totalRows + '")';
|
|
894
|
+
message += '\n' + obj_totalRows_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
895
|
+
message += '\n' + obj_totalRows_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
896
|
+
return new TypeError(message);
|
|
897
|
+
}
|
|
898
|
+
})();
|
|
899
|
+
return v_error === undefined ? null : v_error;
|
|
900
|
+
}
|
|
901
|
+
const RepresentationType = 'DecisionMatrixRowsOutputRepresentation';
|
|
902
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
903
|
+
return input;
|
|
904
|
+
}
|
|
905
|
+
const select$2 = function DecisionMatrixRowsOutputRepresentationSelect() {
|
|
906
|
+
return {
|
|
907
|
+
kind: 'Fragment',
|
|
908
|
+
version: VERSION,
|
|
909
|
+
private: [],
|
|
910
|
+
opaque: true
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
function equals(existing, incoming) {
|
|
914
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
return true;
|
|
918
|
+
}
|
|
919
|
+
function deepFreeze(input) {
|
|
920
|
+
const input_rows = input.rows;
|
|
921
|
+
for (let i = 0; i < input_rows.length; i++) {
|
|
922
|
+
const input_rows_item = input_rows[i];
|
|
923
|
+
deepFreeze$1(input_rows_item);
|
|
924
|
+
}
|
|
925
|
+
ObjectFreeze(input_rows);
|
|
926
|
+
ObjectFreeze(input);
|
|
927
|
+
}
|
|
928
|
+
const ingest = function DecisionMatrixRowsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
929
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
930
|
+
const validateError = validate$1(input);
|
|
931
|
+
if (validateError !== null) {
|
|
932
|
+
throw validateError;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
const key = path.fullPath;
|
|
936
|
+
const existingRecord = store.readEntry(key);
|
|
937
|
+
const ttlToUse = TTL;
|
|
938
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
939
|
+
fullPath: key,
|
|
940
|
+
parent: path.parent,
|
|
941
|
+
propertyName: path.propertyName,
|
|
942
|
+
ttl: ttlToUse
|
|
943
|
+
});
|
|
944
|
+
deepFreeze(input);
|
|
945
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
946
|
+
luvio.storePublish(key, incomingRecord);
|
|
947
|
+
}
|
|
948
|
+
{
|
|
949
|
+
const storeMetadataParams = {
|
|
950
|
+
ttl: ttlToUse,
|
|
951
|
+
namespace: "decision-matrix-designer",
|
|
952
|
+
version: VERSION,
|
|
953
|
+
representationName: RepresentationType,
|
|
954
|
+
};
|
|
955
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
956
|
+
}
|
|
957
|
+
return createLink(key);
|
|
958
|
+
};
|
|
959
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
960
|
+
const rootKeySet = new StoreKeyMap();
|
|
961
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
962
|
+
const rootKey = fullPathFactory();
|
|
963
|
+
rootKeySet.set(rootKey, {
|
|
964
|
+
namespace: keyPrefix,
|
|
965
|
+
representationName: RepresentationType,
|
|
966
|
+
mergeable: false
|
|
967
|
+
});
|
|
968
|
+
return rootKeySet;
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
-
function select$1(luvio, params) {
|
|
972
|
-
return select$2();
|
|
973
|
-
}
|
|
974
|
-
function keyBuilder$1(luvio, params) {
|
|
975
|
-
return keyPrefix + '::DecisionMatrixRowsOutputRepresentation:(' + 'file:' + params.queryParams.file + ',' + 'filter:' + params.queryParams.filter + ',' + 'matrixId:' + params.urlParams.matrixId + ',' + 'versionId:' + params.urlParams.versionId + ')';
|
|
976
|
-
}
|
|
977
|
-
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
978
|
-
return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
979
|
-
}
|
|
980
|
-
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
981
|
-
const { body } = response;
|
|
982
|
-
const key = keyBuilder$1(luvio, resourceParams);
|
|
983
|
-
luvio.storeIngest(key, ingest, body);
|
|
984
|
-
const snapshot = luvio.storeLookup({
|
|
985
|
-
recordId: key,
|
|
986
|
-
node: select$1(),
|
|
987
|
-
variables: {},
|
|
988
|
-
}, snapshotRefresh);
|
|
989
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
990
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
991
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
return snapshot;
|
|
995
|
-
}
|
|
996
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
997
|
-
const key = keyBuilder$1(luvio, params);
|
|
998
|
-
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
999
|
-
const storeMetadataParams = {
|
|
1000
|
-
ttl: TTL,
|
|
1001
|
-
namespace: keyPrefix,
|
|
1002
|
-
version: VERSION,
|
|
1003
|
-
representationName: RepresentationType
|
|
1004
|
-
};
|
|
1005
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1006
|
-
return errorSnapshot;
|
|
1007
|
-
}
|
|
1008
|
-
function createResourceRequest$1(config) {
|
|
1009
|
-
const headers = {};
|
|
1010
|
-
return {
|
|
1011
|
-
baseUri: '/services/data/v58.0',
|
|
1012
|
-
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/versions/' + config.urlParams.versionId + '/rows',
|
|
1013
|
-
method: 'get',
|
|
1014
|
-
body: null,
|
|
1015
|
-
urlParams: config.urlParams,
|
|
1016
|
-
queryParams: config.queryParams,
|
|
1017
|
-
headers,
|
|
1018
|
-
priority: 'normal',
|
|
1019
|
-
};
|
|
971
|
+
function select$1(luvio, params) {
|
|
972
|
+
return select$2();
|
|
973
|
+
}
|
|
974
|
+
function keyBuilder$1(luvio, params) {
|
|
975
|
+
return keyPrefix + '::DecisionMatrixRowsOutputRepresentation:(' + 'file:' + params.queryParams.file + ',' + 'filter:' + params.queryParams.filter + ',' + 'matrixId:' + params.urlParams.matrixId + ',' + 'versionId:' + params.urlParams.versionId + ')';
|
|
976
|
+
}
|
|
977
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
978
|
+
return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
979
|
+
}
|
|
980
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
981
|
+
const { body } = response;
|
|
982
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
983
|
+
luvio.storeIngest(key, ingest, body);
|
|
984
|
+
const snapshot = luvio.storeLookup({
|
|
985
|
+
recordId: key,
|
|
986
|
+
node: select$1(),
|
|
987
|
+
variables: {},
|
|
988
|
+
}, snapshotRefresh);
|
|
989
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
990
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
991
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
return snapshot;
|
|
995
|
+
}
|
|
996
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
997
|
+
const key = keyBuilder$1(luvio, params);
|
|
998
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
999
|
+
const storeMetadataParams = {
|
|
1000
|
+
ttl: TTL,
|
|
1001
|
+
namespace: keyPrefix,
|
|
1002
|
+
version: VERSION,
|
|
1003
|
+
representationName: RepresentationType
|
|
1004
|
+
};
|
|
1005
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1006
|
+
return errorSnapshot;
|
|
1007
|
+
}
|
|
1008
|
+
function createResourceRequest$1(config) {
|
|
1009
|
+
const headers = {};
|
|
1010
|
+
return {
|
|
1011
|
+
baseUri: '/services/data/v58.0',
|
|
1012
|
+
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/versions/' + config.urlParams.versionId + '/rows',
|
|
1013
|
+
method: 'get',
|
|
1014
|
+
body: null,
|
|
1015
|
+
urlParams: config.urlParams,
|
|
1016
|
+
queryParams: config.queryParams,
|
|
1017
|
+
headers,
|
|
1018
|
+
priority: 'normal',
|
|
1019
|
+
};
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
const getRows_ConfigPropertyNames = {
|
|
1023
|
-
displayName: 'getRows',
|
|
1024
|
-
parameters: {
|
|
1025
|
-
required: ['matrixId', 'versionId'],
|
|
1026
|
-
optional: ['file', 'filter']
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
function createResourceParams$1(config) {
|
|
1030
|
-
const resourceParams = {
|
|
1031
|
-
urlParams: {
|
|
1032
|
-
matrixId: config.matrixId, versionId: config.versionId
|
|
1033
|
-
},
|
|
1034
|
-
queryParams: {
|
|
1035
|
-
file: config.file, filter: config.filter
|
|
1036
|
-
}
|
|
1037
|
-
};
|
|
1038
|
-
return resourceParams;
|
|
1039
|
-
}
|
|
1040
|
-
function keyBuilder(luvio, config) {
|
|
1041
|
-
const resourceParams = createResourceParams$1(config);
|
|
1042
|
-
return keyBuilder$1(luvio, resourceParams);
|
|
1043
|
-
}
|
|
1044
|
-
function typeCheckConfig$1(untrustedConfig) {
|
|
1045
|
-
const config = {};
|
|
1046
|
-
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
1047
|
-
if (typeof untrustedConfig_matrixId === 'string') {
|
|
1048
|
-
config.matrixId = untrustedConfig_matrixId;
|
|
1049
|
-
}
|
|
1050
|
-
const untrustedConfig_versionId = untrustedConfig.versionId;
|
|
1051
|
-
if (typeof untrustedConfig_versionId === 'string') {
|
|
1052
|
-
config.versionId = untrustedConfig_versionId;
|
|
1053
|
-
}
|
|
1054
|
-
const untrustedConfig_file = untrustedConfig.file;
|
|
1055
|
-
if (typeof untrustedConfig_file === 'boolean') {
|
|
1056
|
-
config.file = untrustedConfig_file;
|
|
1057
|
-
}
|
|
1058
|
-
const untrustedConfig_filter = untrustedConfig.filter;
|
|
1059
|
-
if (typeof untrustedConfig_filter === 'string') {
|
|
1060
|
-
config.filter = untrustedConfig_filter;
|
|
1061
|
-
}
|
|
1062
|
-
return config;
|
|
1063
|
-
}
|
|
1064
|
-
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1065
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1066
|
-
return null;
|
|
1067
|
-
}
|
|
1068
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1069
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1070
|
-
}
|
|
1071
|
-
const config = typeCheckConfig$1(untrustedConfig);
|
|
1072
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1073
|
-
return null;
|
|
1074
|
-
}
|
|
1075
|
-
return config;
|
|
1076
|
-
}
|
|
1077
|
-
function adapterFragment(luvio, config) {
|
|
1078
|
-
createResourceParams$1(config);
|
|
1079
|
-
return select$1();
|
|
1080
|
-
}
|
|
1081
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1082
|
-
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1083
|
-
config,
|
|
1084
|
-
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1085
|
-
});
|
|
1086
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
1087
|
-
}
|
|
1088
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1089
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1090
|
-
config,
|
|
1091
|
-
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1092
|
-
});
|
|
1093
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
1094
|
-
}
|
|
1095
|
-
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1096
|
-
const resourceParams = createResourceParams$1(config);
|
|
1097
|
-
const request = createResourceRequest$1(resourceParams);
|
|
1098
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1099
|
-
.then((response) => {
|
|
1100
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
1101
|
-
}, (response) => {
|
|
1102
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1106
|
-
const { luvio, config } = context;
|
|
1107
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1108
|
-
const dispatchOptions = {
|
|
1109
|
-
resourceRequestContext: {
|
|
1110
|
-
requestCorrelator,
|
|
1111
|
-
luvioRequestMethod: undefined,
|
|
1112
|
-
},
|
|
1113
|
-
eventObservers
|
|
1114
|
-
};
|
|
1115
|
-
if (networkPriority !== 'normal') {
|
|
1116
|
-
dispatchOptions.overrides = {
|
|
1117
|
-
priority: networkPriority
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
1121
|
-
}
|
|
1122
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1123
|
-
const { luvio, config } = context;
|
|
1124
|
-
const selector = {
|
|
1125
|
-
recordId: keyBuilder(luvio, config),
|
|
1126
|
-
node: adapterFragment(luvio, config),
|
|
1127
|
-
variables: {},
|
|
1128
|
-
};
|
|
1129
|
-
const cacheSnapshot = storeLookup(selector, {
|
|
1130
|
-
config,
|
|
1131
|
-
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1132
|
-
});
|
|
1133
|
-
return cacheSnapshot;
|
|
1134
|
-
}
|
|
1135
|
-
const getRowsAdapterFactory = (luvio) => function decisionMatrixDesigner__getRows(untrustedConfig, requestContext) {
|
|
1136
|
-
const config = validateAdapterConfig$1(untrustedConfig, getRows_ConfigPropertyNames);
|
|
1137
|
-
// Invalid or incomplete config
|
|
1138
|
-
if (config === null) {
|
|
1139
|
-
return null;
|
|
1140
|
-
}
|
|
1141
|
-
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1142
|
-
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1022
|
+
const getRows_ConfigPropertyNames = {
|
|
1023
|
+
displayName: 'getRows',
|
|
1024
|
+
parameters: {
|
|
1025
|
+
required: ['matrixId', 'versionId'],
|
|
1026
|
+
optional: ['file', 'filter']
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
function createResourceParams$1(config) {
|
|
1030
|
+
const resourceParams = {
|
|
1031
|
+
urlParams: {
|
|
1032
|
+
matrixId: config.matrixId, versionId: config.versionId
|
|
1033
|
+
},
|
|
1034
|
+
queryParams: {
|
|
1035
|
+
file: config.file, filter: config.filter
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
return resourceParams;
|
|
1039
|
+
}
|
|
1040
|
+
function keyBuilder(luvio, config) {
|
|
1041
|
+
const resourceParams = createResourceParams$1(config);
|
|
1042
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1043
|
+
}
|
|
1044
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1045
|
+
const config = {};
|
|
1046
|
+
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
1047
|
+
if (typeof untrustedConfig_matrixId === 'string') {
|
|
1048
|
+
config.matrixId = untrustedConfig_matrixId;
|
|
1049
|
+
}
|
|
1050
|
+
const untrustedConfig_versionId = untrustedConfig.versionId;
|
|
1051
|
+
if (typeof untrustedConfig_versionId === 'string') {
|
|
1052
|
+
config.versionId = untrustedConfig_versionId;
|
|
1053
|
+
}
|
|
1054
|
+
const untrustedConfig_file = untrustedConfig.file;
|
|
1055
|
+
if (typeof untrustedConfig_file === 'boolean') {
|
|
1056
|
+
config.file = untrustedConfig_file;
|
|
1057
|
+
}
|
|
1058
|
+
const untrustedConfig_filter = untrustedConfig.filter;
|
|
1059
|
+
if (typeof untrustedConfig_filter === 'string') {
|
|
1060
|
+
config.filter = untrustedConfig_filter;
|
|
1061
|
+
}
|
|
1062
|
+
return config;
|
|
1063
|
+
}
|
|
1064
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1065
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1066
|
+
return null;
|
|
1067
|
+
}
|
|
1068
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1069
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1070
|
+
}
|
|
1071
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1072
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1073
|
+
return null;
|
|
1074
|
+
}
|
|
1075
|
+
return config;
|
|
1076
|
+
}
|
|
1077
|
+
function adapterFragment(luvio, config) {
|
|
1078
|
+
createResourceParams$1(config);
|
|
1079
|
+
return select$1();
|
|
1080
|
+
}
|
|
1081
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1082
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1083
|
+
config,
|
|
1084
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1085
|
+
});
|
|
1086
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1087
|
+
}
|
|
1088
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1089
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1090
|
+
config,
|
|
1091
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1092
|
+
});
|
|
1093
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1094
|
+
}
|
|
1095
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1096
|
+
const resourceParams = createResourceParams$1(config);
|
|
1097
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1098
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1099
|
+
.then((response) => {
|
|
1100
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
1101
|
+
}, (response) => {
|
|
1102
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1106
|
+
const { luvio, config } = context;
|
|
1107
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1108
|
+
const dispatchOptions = {
|
|
1109
|
+
resourceRequestContext: {
|
|
1110
|
+
requestCorrelator,
|
|
1111
|
+
luvioRequestMethod: undefined,
|
|
1112
|
+
},
|
|
1113
|
+
eventObservers
|
|
1114
|
+
};
|
|
1115
|
+
if (networkPriority !== 'normal') {
|
|
1116
|
+
dispatchOptions.overrides = {
|
|
1117
|
+
priority: networkPriority
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
1121
|
+
}
|
|
1122
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1123
|
+
const { luvio, config } = context;
|
|
1124
|
+
const selector = {
|
|
1125
|
+
recordId: keyBuilder(luvio, config),
|
|
1126
|
+
node: adapterFragment(luvio, config),
|
|
1127
|
+
variables: {},
|
|
1128
|
+
};
|
|
1129
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1130
|
+
config,
|
|
1131
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1132
|
+
});
|
|
1133
|
+
return cacheSnapshot;
|
|
1134
|
+
}
|
|
1135
|
+
const getRowsAdapterFactory = (luvio) => function decisionMatrixDesigner__getRows(untrustedConfig, requestContext) {
|
|
1136
|
+
const config = validateAdapterConfig$1(untrustedConfig, getRows_ConfigPropertyNames);
|
|
1137
|
+
// Invalid or incomplete config
|
|
1138
|
+
if (config === null) {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1142
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1143
1143
|
};
|
|
1144
1144
|
|
|
1145
|
-
function validate(obj, path = 'DecisionMatrixRowsInputRepresentation') {
|
|
1146
|
-
const v_error = (() => {
|
|
1147
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1148
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1149
|
-
}
|
|
1150
|
-
if (obj.fileId !== undefined) {
|
|
1151
|
-
const obj_fileId = obj.fileId;
|
|
1152
|
-
const path_fileId = path + '.fileId';
|
|
1153
|
-
if (typeof obj_fileId !== 'string') {
|
|
1154
|
-
return new TypeError('Expected "string" but received "' + typeof obj_fileId + '" (at "' + path_fileId + '")');
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
if (obj.rows !== undefined) {
|
|
1158
|
-
const obj_rows = obj.rows;
|
|
1159
|
-
const path_rows = path + '.rows';
|
|
1160
|
-
if (!ArrayIsArray(obj_rows)) {
|
|
1161
|
-
return new TypeError('Expected "array" but received "' + typeof obj_rows + '" (at "' + path_rows + '")');
|
|
1162
|
-
}
|
|
1163
|
-
for (let i = 0; i < obj_rows.length; i++) {
|
|
1164
|
-
const obj_rows_item = obj_rows[i];
|
|
1165
|
-
const path_rows_item = path_rows + '[' + i + ']';
|
|
1166
|
-
if (typeof obj_rows_item !== 'object' || ArrayIsArray(obj_rows_item) || obj_rows_item === null) {
|
|
1167
|
-
return new TypeError('Expected "object" but received "' + typeof obj_rows_item + '" (at "' + path_rows_item + '")');
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
})();
|
|
1172
|
-
return v_error === undefined ? null : v_error;
|
|
1145
|
+
function validate(obj, path = 'DecisionMatrixRowsInputRepresentation') {
|
|
1146
|
+
const v_error = (() => {
|
|
1147
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1148
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1149
|
+
}
|
|
1150
|
+
if (obj.fileId !== undefined) {
|
|
1151
|
+
const obj_fileId = obj.fileId;
|
|
1152
|
+
const path_fileId = path + '.fileId';
|
|
1153
|
+
if (typeof obj_fileId !== 'string') {
|
|
1154
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileId + '" (at "' + path_fileId + '")');
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
if (obj.rows !== undefined) {
|
|
1158
|
+
const obj_rows = obj.rows;
|
|
1159
|
+
const path_rows = path + '.rows';
|
|
1160
|
+
if (!ArrayIsArray(obj_rows)) {
|
|
1161
|
+
return new TypeError('Expected "array" but received "' + typeof obj_rows + '" (at "' + path_rows + '")');
|
|
1162
|
+
}
|
|
1163
|
+
for (let i = 0; i < obj_rows.length; i++) {
|
|
1164
|
+
const obj_rows_item = obj_rows[i];
|
|
1165
|
+
const path_rows_item = path_rows + '[' + i + ']';
|
|
1166
|
+
if (typeof obj_rows_item !== 'object' || ArrayIsArray(obj_rows_item) || obj_rows_item === null) {
|
|
1167
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rows_item + '" (at "' + path_rows_item + '")');
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
})();
|
|
1172
|
+
return v_error === undefined ? null : v_error;
|
|
1173
1173
|
}
|
|
1174
1174
|
|
|
1175
|
-
function select(luvio, params) {
|
|
1176
|
-
return select$4();
|
|
1177
|
-
}
|
|
1178
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1179
|
-
return getTypeCacheKeys$1(luvio, response);
|
|
1180
|
-
}
|
|
1181
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
1182
|
-
const { body } = response;
|
|
1183
|
-
const key = keyBuilderFromType(luvio, body);
|
|
1184
|
-
luvio.storeIngest(key, ingest$1, body);
|
|
1185
|
-
const snapshot = luvio.storeLookup({
|
|
1186
|
-
recordId: key,
|
|
1187
|
-
node: select(),
|
|
1188
|
-
variables: {},
|
|
1189
|
-
});
|
|
1190
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1191
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1192
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
return snapshot;
|
|
1196
|
-
}
|
|
1197
|
-
function createResourceRequest(config) {
|
|
1198
|
-
const headers = {};
|
|
1199
|
-
return {
|
|
1200
|
-
baseUri: '/services/data/v58.0',
|
|
1201
|
-
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/versions/' + config.urlParams.versionId + '/rows',
|
|
1202
|
-
method: 'post',
|
|
1203
|
-
body: config.body,
|
|
1204
|
-
urlParams: config.urlParams,
|
|
1205
|
-
queryParams: {},
|
|
1206
|
-
headers,
|
|
1207
|
-
priority: 'normal',
|
|
1208
|
-
};
|
|
1175
|
+
function select(luvio, params) {
|
|
1176
|
+
return select$4();
|
|
1177
|
+
}
|
|
1178
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1179
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
1180
|
+
}
|
|
1181
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1182
|
+
const { body } = response;
|
|
1183
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1184
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1185
|
+
const snapshot = luvio.storeLookup({
|
|
1186
|
+
recordId: key,
|
|
1187
|
+
node: select(),
|
|
1188
|
+
variables: {},
|
|
1189
|
+
});
|
|
1190
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1191
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1192
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
return snapshot;
|
|
1196
|
+
}
|
|
1197
|
+
function createResourceRequest(config) {
|
|
1198
|
+
const headers = {};
|
|
1199
|
+
return {
|
|
1200
|
+
baseUri: '/services/data/v58.0',
|
|
1201
|
+
basePath: '/connect/omnistudio/decision-matrices/' + config.urlParams.matrixId + '/versions/' + config.urlParams.versionId + '/rows',
|
|
1202
|
+
method: 'post',
|
|
1203
|
+
body: config.body,
|
|
1204
|
+
urlParams: config.urlParams,
|
|
1205
|
+
queryParams: {},
|
|
1206
|
+
headers,
|
|
1207
|
+
priority: 'normal',
|
|
1208
|
+
};
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
-
const saveRows_ConfigPropertyNames = {
|
|
1212
|
-
displayName: 'saveRows',
|
|
1213
|
-
parameters: {
|
|
1214
|
-
required: ['matrixId', 'versionId', 'rowsInput'],
|
|
1215
|
-
optional: []
|
|
1216
|
-
}
|
|
1217
|
-
};
|
|
1218
|
-
function createResourceParams(config) {
|
|
1219
|
-
const resourceParams = {
|
|
1220
|
-
urlParams: {
|
|
1221
|
-
matrixId: config.matrixId, versionId: config.versionId
|
|
1222
|
-
},
|
|
1223
|
-
body: {
|
|
1224
|
-
rowsInput: config.rowsInput
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
|
-
return resourceParams;
|
|
1228
|
-
}
|
|
1229
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1230
|
-
const config = {};
|
|
1231
|
-
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
1232
|
-
if (typeof untrustedConfig_matrixId === 'string') {
|
|
1233
|
-
config.matrixId = untrustedConfig_matrixId;
|
|
1234
|
-
}
|
|
1235
|
-
const untrustedConfig_versionId = untrustedConfig.versionId;
|
|
1236
|
-
if (typeof untrustedConfig_versionId === 'string') {
|
|
1237
|
-
config.versionId = untrustedConfig_versionId;
|
|
1238
|
-
}
|
|
1239
|
-
const untrustedConfig_rowsInput = untrustedConfig.rowsInput;
|
|
1240
|
-
const referenceDecisionMatrixRowsInputRepresentationValidationError = validate(untrustedConfig_rowsInput);
|
|
1241
|
-
if (referenceDecisionMatrixRowsInputRepresentationValidationError === null) {
|
|
1242
|
-
config.rowsInput = untrustedConfig_rowsInput;
|
|
1243
|
-
}
|
|
1244
|
-
return config;
|
|
1245
|
-
}
|
|
1246
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1247
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1248
|
-
return null;
|
|
1249
|
-
}
|
|
1250
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1251
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1252
|
-
}
|
|
1253
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1254
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1255
|
-
return null;
|
|
1256
|
-
}
|
|
1257
|
-
return config;
|
|
1258
|
-
}
|
|
1259
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
1260
|
-
const resourceParams = createResourceParams(config);
|
|
1261
|
-
const request = createResourceRequest(resourceParams);
|
|
1262
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1263
|
-
.then((response) => {
|
|
1264
|
-
return luvio.handleSuccessResponse(() => {
|
|
1265
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1266
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
1267
|
-
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1268
|
-
}, (response) => {
|
|
1269
|
-
deepFreeze$4(response);
|
|
1270
|
-
throw response;
|
|
1271
|
-
});
|
|
1272
|
-
}
|
|
1273
|
-
const saveRowsAdapterFactory = (luvio) => {
|
|
1274
|
-
return function saveRows(untrustedConfig) {
|
|
1275
|
-
const config = validateAdapterConfig(untrustedConfig, saveRows_ConfigPropertyNames);
|
|
1276
|
-
// Invalid or incomplete config
|
|
1277
|
-
if (config === null) {
|
|
1278
|
-
throw new Error('Invalid config for "saveRows"');
|
|
1279
|
-
}
|
|
1280
|
-
return buildNetworkSnapshot(luvio, config);
|
|
1281
|
-
};
|
|
1211
|
+
const saveRows_ConfigPropertyNames = {
|
|
1212
|
+
displayName: 'saveRows',
|
|
1213
|
+
parameters: {
|
|
1214
|
+
required: ['matrixId', 'versionId', 'rowsInput'],
|
|
1215
|
+
optional: []
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
function createResourceParams(config) {
|
|
1219
|
+
const resourceParams = {
|
|
1220
|
+
urlParams: {
|
|
1221
|
+
matrixId: config.matrixId, versionId: config.versionId
|
|
1222
|
+
},
|
|
1223
|
+
body: {
|
|
1224
|
+
rowsInput: config.rowsInput
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
return resourceParams;
|
|
1228
|
+
}
|
|
1229
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1230
|
+
const config = {};
|
|
1231
|
+
const untrustedConfig_matrixId = untrustedConfig.matrixId;
|
|
1232
|
+
if (typeof untrustedConfig_matrixId === 'string') {
|
|
1233
|
+
config.matrixId = untrustedConfig_matrixId;
|
|
1234
|
+
}
|
|
1235
|
+
const untrustedConfig_versionId = untrustedConfig.versionId;
|
|
1236
|
+
if (typeof untrustedConfig_versionId === 'string') {
|
|
1237
|
+
config.versionId = untrustedConfig_versionId;
|
|
1238
|
+
}
|
|
1239
|
+
const untrustedConfig_rowsInput = untrustedConfig.rowsInput;
|
|
1240
|
+
const referenceDecisionMatrixRowsInputRepresentationValidationError = validate(untrustedConfig_rowsInput);
|
|
1241
|
+
if (referenceDecisionMatrixRowsInputRepresentationValidationError === null) {
|
|
1242
|
+
config.rowsInput = untrustedConfig_rowsInput;
|
|
1243
|
+
}
|
|
1244
|
+
return config;
|
|
1245
|
+
}
|
|
1246
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1247
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1248
|
+
return null;
|
|
1249
|
+
}
|
|
1250
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1251
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1252
|
+
}
|
|
1253
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1254
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1255
|
+
return null;
|
|
1256
|
+
}
|
|
1257
|
+
return config;
|
|
1258
|
+
}
|
|
1259
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1260
|
+
const resourceParams = createResourceParams(config);
|
|
1261
|
+
const request = createResourceRequest(resourceParams);
|
|
1262
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1263
|
+
.then((response) => {
|
|
1264
|
+
return luvio.handleSuccessResponse(() => {
|
|
1265
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1266
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1267
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1268
|
+
}, (response) => {
|
|
1269
|
+
deepFreeze$4(response);
|
|
1270
|
+
throw response;
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
const saveRowsAdapterFactory = (luvio) => {
|
|
1274
|
+
return function saveRows(untrustedConfig) {
|
|
1275
|
+
const config = validateAdapterConfig(untrustedConfig, saveRows_ConfigPropertyNames);
|
|
1276
|
+
// Invalid or incomplete config
|
|
1277
|
+
if (config === null) {
|
|
1278
|
+
throw new Error('Invalid config for "saveRows"');
|
|
1279
|
+
}
|
|
1280
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1281
|
+
};
|
|
1282
1282
|
};
|
|
1283
1283
|
|
|
1284
1284
|
export { getColumnsAdapterFactory, getRowsAdapterFactory, saveColumnsAdapterFactory, saveRowsAdapterFactory };
|