@salesforce/lds-adapters-industries-loyalty-engine 1.100.2
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/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-loyalty-engine.js +4461 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/createProgramProcessRule.d.ts +17 -0
- package/dist/types/src/generated/adapters/executeRealtimeLoyaltyEngine.d.ts +16 -0
- package/dist/types/src/generated/adapters/getJournalExplainabilityInfo.d.ts +26 -0
- package/dist/types/src/generated/adapters/getProgramProcessRule.d.ts +28 -0
- package/dist/types/src/generated/adapters/updateProgramProcessRule.d.ts +18 -0
- package/dist/types/src/generated/artifacts/main.d.ts +5 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +8 -0
- package/dist/types/src/generated/resources/deleteConnectLoyaltyProgramsProcessesByProcessNameAndProgramName.d.ts +12 -0
- package/dist/types/src/generated/resources/deleteConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName.d.ts +13 -0
- package/dist/types/src/generated/resources/getConnectLoyaltyProgramProcessTransactionJournalsByJournalId.d.ts +15 -0
- package/dist/types/src/generated/resources/getConnectLoyaltyProgramsProcessesByProcessNameAndProgramName.d.ts +16 -0
- package/dist/types/src/generated/resources/getConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName.d.ts +17 -0
- package/dist/types/src/generated/resources/patchConnectLoyaltyProgramsProcessesByProcessNameAndProgramName.d.ts +17 -0
- package/dist/types/src/generated/resources/patchConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName.d.ts +18 -0
- package/dist/types/src/generated/resources/postConnectBatchLoyaltyProgramsByProgramName.d.ts +17 -0
- package/dist/types/src/generated/resources/postConnectFormulaLoyaltyProcessByProcessId.d.ts +15 -0
- package/dist/types/src/generated/resources/postConnectRealtimeLoyaltyProgramsByProgramName.d.ts +16 -0
- package/dist/types/src/generated/resources/putConnectLoyaltyProgramsProcessesByProcessNameAndProgramName.d.ts +17 -0
- package/dist/types/src/generated/resources/putConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName.d.ts +18 -0
- package/dist/types/src/generated/types/ActionOutputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/CreditPointsActionOutputRepresentation.d.ts +39 -0
- package/dist/types/src/generated/types/DebitPointsActionOutputRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/ExpressionRepresentation.d.ts +42 -0
- package/dist/types/src/generated/types/ExpressionValueRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/FormulaInputRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/FormulaOutputRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/FormulaSyntaxValidationInputRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/FormulaSyntaxValidationOutputRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/IssueVoucherActionOutputRepresentation.d.ts +51 -0
- package/dist/types/src/generated/types/LoyaltyEngineBatchOutputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/LoyaltyEngineInputMapRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/LoyaltyEngineInputRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/LoyaltyEngineRealtimeOutputRepresentation.d.ts +53 -0
- package/dist/types/src/generated/types/LoyaltyEngineRunSettingsRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/LoyaltyExplainabilityOutputRepresentation.d.ts +37 -0
- package/dist/types/src/generated/types/LoyaltyProcessInput.d.ts +39 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleActionParameterRepresentation.d.ts +39 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleActionRepresentation.d.ts +40 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleConditionFilterCriteriaRepresentation.d.ts +45 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleConditionGroupRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleConditionRepresentation.d.ts +40 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleRepresentation.d.ts +59 -0
- package/dist/types/src/generated/types/LoyaltyProgramProcessRuleStepRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/MemberCurrencyChangeOutputRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/MemberCurrencyChangeRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/MemberCurrencyRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/MemberPointsBalanceChangeRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/MemberPointsBalanceRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/PointsSummaryRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/ProcessResultRepresentation.d.ts +34 -0
- package/dist/types/src/generated/types/ProcessRuleActionInputRepresentation.d.ts +44 -0
- package/dist/types/src/generated/types/ProcessRuleActionParameterInputRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/ProcessRuleActionParameterRepresentation.d.ts +38 -0
- package/dist/types/src/generated/types/ProcessRuleActionRepresentation.d.ts +45 -0
- package/dist/types/src/generated/types/ProcessRuleConditionFilterCriteriaInputRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/ProcessRuleConditionFilterCriteriaRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/ProcessRuleConditionInputRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/ProcessRuleConditionRepresentation.d.ts +42 -0
- package/dist/types/src/generated/types/ProcessRuleDetailRepresentation.d.ts +78 -0
- package/dist/types/src/generated/types/ProcessRuleErrorRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/ProcessRuleInputRepresentation.d.ts +57 -0
- package/dist/types/src/generated/types/ProcessRuleStatusRepresentation.d.ts +49 -0
- package/dist/types/src/generated/types/ProcessRuleStepMappingInputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/ProcessRuleStepMappingRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/ProgramProcessRule.d.ts +39 -0
- package/dist/types/src/generated/types/SummaryRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/TransactionJournalOutputRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/TransactionJournalRepresentation.d.ts +40 -0
- package/dist/types/src/generated/types/TransactionJournalResultRepresentation.d.ts +36 -0
- package/dist/types/src/generated/types/UpdateCumulativeUsageActionOutputRepresentation.d.ts +33 -0
- package/dist/types/src/generated/types/VoucherOutputRepresentation.d.ts +53 -0
- package/dist/types/src/generated/types/VoucherResultRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-loyalty-engine.js +4473 -0
- package/dist/umd/es5/industries-loyalty-engine.js +4522 -0
- package/package.json +70 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +4513 -0
- package/src/raml/api.raml +1331 -0
- package/src/raml/luvio.raml +51 -0
|
@@ -0,0 +1,4473 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
(function (global, factory) {
|
|
8
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
9
|
+
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
10
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["industriesLoyalty-engine"] = {}, global.engine));
|
|
11
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
+
|
|
13
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
14
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
15
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an adapter config is well-formed.
|
|
18
|
+
* @param config The config to validate.
|
|
19
|
+
* @param adapter The adapter validation configuration.
|
|
20
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
+
*/
|
|
23
|
+
function validateConfig(config, adapter, oneOf) {
|
|
24
|
+
const { displayName } = adapter;
|
|
25
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
26
|
+
if (config === undefined ||
|
|
27
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
28
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
if (unsupported !== undefined &&
|
|
34
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
const supported = required.concat(optional);
|
|
38
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
39
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function untrustedIsObject(untrusted) {
|
|
43
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
+
}
|
|
45
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
47
|
+
}
|
|
48
|
+
const snapshotRefreshOptions = {
|
|
49
|
+
overrides: {
|
|
50
|
+
headers: {
|
|
51
|
+
'Cache-Control': 'no-cache',
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const keyPrefix = 'loyalty-engine';
|
|
56
|
+
|
|
57
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
58
|
+
const { isArray: ArrayIsArray } = Array;
|
|
59
|
+
const { stringify: JSONStringify } = JSON;
|
|
60
|
+
function equalsArray(a, b, equalsItem) {
|
|
61
|
+
const aLength = a.length;
|
|
62
|
+
const bLength = b.length;
|
|
63
|
+
if (aLength !== bLength) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
for (let i = 0; i < aLength; i++) {
|
|
67
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
function deepFreeze$d(value) {
|
|
74
|
+
// No need to freeze primitives
|
|
75
|
+
if (typeof value !== 'object' || value === null) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (ArrayIsArray(value)) {
|
|
79
|
+
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
80
|
+
deepFreeze$d(value[i]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const keys = ObjectKeys(value);
|
|
85
|
+
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
86
|
+
deepFreeze$d(value[keys[i]]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
ObjectFreeze(value);
|
|
90
|
+
}
|
|
91
|
+
function createLink(ref) {
|
|
92
|
+
return {
|
|
93
|
+
__ref: engine.serializeStructuredKey(ref),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const VERSION$h = "0f3cc365e055e154f05ffcc1b91bf9e3";
|
|
98
|
+
function validate$C(obj, path = 'PointsSummaryRepresentation') {
|
|
99
|
+
const v_error = (() => {
|
|
100
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
101
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
102
|
+
}
|
|
103
|
+
obj.changeInEscrowPointsBalance;
|
|
104
|
+
obj.changeInPointsBalance;
|
|
105
|
+
const obj_loyaltyProgramCurrencyName = obj.loyaltyProgramCurrencyName;
|
|
106
|
+
const path_loyaltyProgramCurrencyName = path + '.loyaltyProgramCurrencyName';
|
|
107
|
+
if (typeof obj_loyaltyProgramCurrencyName !== 'string') {
|
|
108
|
+
return new TypeError('Expected "string" but received "' + typeof obj_loyaltyProgramCurrencyName + '" (at "' + path_loyaltyProgramCurrencyName + '")');
|
|
109
|
+
}
|
|
110
|
+
const obj_loyaltyProgramCurrencyType = obj.loyaltyProgramCurrencyType;
|
|
111
|
+
const path_loyaltyProgramCurrencyType = path + '.loyaltyProgramCurrencyType';
|
|
112
|
+
if (typeof obj_loyaltyProgramCurrencyType !== 'string') {
|
|
113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_loyaltyProgramCurrencyType + '" (at "' + path_loyaltyProgramCurrencyType + '")');
|
|
114
|
+
}
|
|
115
|
+
})();
|
|
116
|
+
return v_error === undefined ? null : v_error;
|
|
117
|
+
}
|
|
118
|
+
const select$m = function PointsSummaryRepresentationSelect() {
|
|
119
|
+
return {
|
|
120
|
+
kind: 'Fragment',
|
|
121
|
+
version: VERSION$h,
|
|
122
|
+
private: [],
|
|
123
|
+
selections: [
|
|
124
|
+
{
|
|
125
|
+
name: 'changeInEscrowPointsBalance',
|
|
126
|
+
kind: 'Scalar'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'changeInPointsBalance',
|
|
130
|
+
kind: 'Scalar'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'loyaltyProgramCurrencyName',
|
|
134
|
+
kind: 'Scalar'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: 'loyaltyProgramCurrencyType',
|
|
138
|
+
kind: 'Scalar'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
function equals$j(existing, incoming) {
|
|
144
|
+
const existing_loyaltyProgramCurrencyName = existing.loyaltyProgramCurrencyName;
|
|
145
|
+
const incoming_loyaltyProgramCurrencyName = incoming.loyaltyProgramCurrencyName;
|
|
146
|
+
if (!(existing_loyaltyProgramCurrencyName === incoming_loyaltyProgramCurrencyName)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const existing_loyaltyProgramCurrencyType = existing.loyaltyProgramCurrencyType;
|
|
150
|
+
const incoming_loyaltyProgramCurrencyType = incoming.loyaltyProgramCurrencyType;
|
|
151
|
+
if (!(existing_loyaltyProgramCurrencyType === incoming_loyaltyProgramCurrencyType)) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const existing_changeInEscrowPointsBalance = existing.changeInEscrowPointsBalance;
|
|
155
|
+
const incoming_changeInEscrowPointsBalance = incoming.changeInEscrowPointsBalance;
|
|
156
|
+
if (!(existing_changeInEscrowPointsBalance === incoming_changeInEscrowPointsBalance)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
const existing_changeInPointsBalance = existing.changeInPointsBalance;
|
|
160
|
+
const incoming_changeInPointsBalance = incoming.changeInPointsBalance;
|
|
161
|
+
if (!(existing_changeInPointsBalance === incoming_changeInPointsBalance)) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
function deepFreeze$c(input) {
|
|
167
|
+
ObjectFreeze(input);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const VERSION$g = "233c2f5333b90951799790d482a7116a";
|
|
171
|
+
function validate$B(obj, path = 'SummaryRepresentation') {
|
|
172
|
+
const v_error = (() => {
|
|
173
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
174
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
175
|
+
}
|
|
176
|
+
const obj_pointsSummary = obj.pointsSummary;
|
|
177
|
+
const path_pointsSummary = path + '.pointsSummary';
|
|
178
|
+
if (!ArrayIsArray(obj_pointsSummary)) {
|
|
179
|
+
return new TypeError('Expected "array" but received "' + typeof obj_pointsSummary + '" (at "' + path_pointsSummary + '")');
|
|
180
|
+
}
|
|
181
|
+
for (let i = 0; i < obj_pointsSummary.length; i++) {
|
|
182
|
+
const obj_pointsSummary_item = obj_pointsSummary[i];
|
|
183
|
+
const path_pointsSummary_item = path_pointsSummary + '[' + i + ']';
|
|
184
|
+
const referencepath_pointsSummary_itemValidationError = validate$C(obj_pointsSummary_item, path_pointsSummary_item);
|
|
185
|
+
if (referencepath_pointsSummary_itemValidationError !== null) {
|
|
186
|
+
let message = 'Object doesn\'t match PointsSummaryRepresentation (at "' + path_pointsSummary_item + '")\n';
|
|
187
|
+
message += referencepath_pointsSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
188
|
+
return new TypeError(message);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const obj_vouchersIssuedCount = obj.vouchersIssuedCount;
|
|
192
|
+
const path_vouchersIssuedCount = path + '.vouchersIssuedCount';
|
|
193
|
+
if (typeof obj_vouchersIssuedCount !== 'number' || (typeof obj_vouchersIssuedCount === 'number' && Math.floor(obj_vouchersIssuedCount) !== obj_vouchersIssuedCount)) {
|
|
194
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_vouchersIssuedCount + '" (at "' + path_vouchersIssuedCount + '")');
|
|
195
|
+
}
|
|
196
|
+
})();
|
|
197
|
+
return v_error === undefined ? null : v_error;
|
|
198
|
+
}
|
|
199
|
+
const select$l = function SummaryRepresentationSelect() {
|
|
200
|
+
const { selections: PointsSummaryRepresentation__selections, opaque: PointsSummaryRepresentation__opaque, } = select$m();
|
|
201
|
+
return {
|
|
202
|
+
kind: 'Fragment',
|
|
203
|
+
version: VERSION$g,
|
|
204
|
+
private: [],
|
|
205
|
+
selections: [
|
|
206
|
+
{
|
|
207
|
+
name: 'pointsSummary',
|
|
208
|
+
kind: 'Object',
|
|
209
|
+
plural: true,
|
|
210
|
+
selections: PointsSummaryRepresentation__selections
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'vouchersIssuedCount',
|
|
214
|
+
kind: 'Scalar'
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
function equals$i(existing, incoming) {
|
|
220
|
+
const existing_vouchersIssuedCount = existing.vouchersIssuedCount;
|
|
221
|
+
const incoming_vouchersIssuedCount = incoming.vouchersIssuedCount;
|
|
222
|
+
if (!(existing_vouchersIssuedCount === incoming_vouchersIssuedCount)) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
const existing_pointsSummary = existing.pointsSummary;
|
|
226
|
+
const incoming_pointsSummary = incoming.pointsSummary;
|
|
227
|
+
const equals_pointsSummary_items = equalsArray(existing_pointsSummary, incoming_pointsSummary, (existing_pointsSummary_item, incoming_pointsSummary_item) => {
|
|
228
|
+
if (!(equals$j(existing_pointsSummary_item, incoming_pointsSummary_item))) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
if (equals_pointsSummary_items === false) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
function deepFreeze$b(input) {
|
|
238
|
+
const input_pointsSummary = input.pointsSummary;
|
|
239
|
+
for (let i = 0; i < input_pointsSummary.length; i++) {
|
|
240
|
+
const input_pointsSummary_item = input_pointsSummary[i];
|
|
241
|
+
deepFreeze$c(input_pointsSummary_item);
|
|
242
|
+
}
|
|
243
|
+
ObjectFreeze(input_pointsSummary);
|
|
244
|
+
ObjectFreeze(input);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function validate$A(obj, path = 'ActionOutputRepresentation') {
|
|
248
|
+
const v_error = (() => {
|
|
249
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
250
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
251
|
+
}
|
|
252
|
+
const obj_actionType = obj.actionType;
|
|
253
|
+
const path_actionType = path + '.actionType';
|
|
254
|
+
if (typeof obj_actionType !== 'string') {
|
|
255
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
|
|
256
|
+
}
|
|
257
|
+
const obj_promotionId = obj.promotionId;
|
|
258
|
+
const path_promotionId = path + '.promotionId';
|
|
259
|
+
if (typeof obj_promotionId !== 'string') {
|
|
260
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
261
|
+
}
|
|
262
|
+
const obj_stepName = obj.stepName;
|
|
263
|
+
const path_stepName = path + '.stepName';
|
|
264
|
+
if (typeof obj_stepName !== 'string') {
|
|
265
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
|
|
266
|
+
}
|
|
267
|
+
})();
|
|
268
|
+
return v_error === undefined ? null : v_error;
|
|
269
|
+
}
|
|
270
|
+
function equals$h(existing, incoming) {
|
|
271
|
+
const existing_actionType = existing.actionType;
|
|
272
|
+
const incoming_actionType = incoming.actionType;
|
|
273
|
+
if (!(existing_actionType === incoming_actionType)) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
const existing_promotionId = existing.promotionId;
|
|
277
|
+
const incoming_promotionId = incoming.promotionId;
|
|
278
|
+
if (!(existing_promotionId === incoming_promotionId)) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const existing_stepName = existing.stepName;
|
|
282
|
+
const incoming_stepName = incoming.stepName;
|
|
283
|
+
if (!(existing_stepName === incoming_stepName)) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
function deepFreeze$a(input) {
|
|
289
|
+
ObjectFreeze(input);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function validate$z(obj, path = 'DebitPointsActionOutputRepresentation') {
|
|
293
|
+
const validateActionOutputRepresentation_validateError = validate$A(obj, path);
|
|
294
|
+
if (validateActionOutputRepresentation_validateError !== null) {
|
|
295
|
+
return validateActionOutputRepresentation_validateError;
|
|
296
|
+
}
|
|
297
|
+
const v_error = (() => {
|
|
298
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
299
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
300
|
+
}
|
|
301
|
+
obj.changeInPointsBalance;
|
|
302
|
+
const obj_loyaltyProgramCurrencyName = obj.loyaltyProgramCurrencyName;
|
|
303
|
+
const path_loyaltyProgramCurrencyName = path + '.loyaltyProgramCurrencyName';
|
|
304
|
+
if (typeof obj_loyaltyProgramCurrencyName !== 'string') {
|
|
305
|
+
return new TypeError('Expected "string" but received "' + typeof obj_loyaltyProgramCurrencyName + '" (at "' + path_loyaltyProgramCurrencyName + '")');
|
|
306
|
+
}
|
|
307
|
+
})();
|
|
308
|
+
return v_error === undefined ? null : v_error;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function validate$y(obj, path = 'CreditPointsActionOutputRepresentation') {
|
|
312
|
+
const validateActionOutputRepresentation_validateError = validate$A(obj, path);
|
|
313
|
+
if (validateActionOutputRepresentation_validateError !== null) {
|
|
314
|
+
return validateActionOutputRepresentation_validateError;
|
|
315
|
+
}
|
|
316
|
+
const v_error = (() => {
|
|
317
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
318
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
319
|
+
}
|
|
320
|
+
obj.changeInEscrowPointsBalance;
|
|
321
|
+
obj.changeInPointsBalance;
|
|
322
|
+
const obj_escrowPointsCreditDate = obj.escrowPointsCreditDate;
|
|
323
|
+
const path_escrowPointsCreditDate = path + '.escrowPointsCreditDate';
|
|
324
|
+
if (typeof obj_escrowPointsCreditDate !== 'string') {
|
|
325
|
+
return new TypeError('Expected "string" but received "' + typeof obj_escrowPointsCreditDate + '" (at "' + path_escrowPointsCreditDate + '")');
|
|
326
|
+
}
|
|
327
|
+
const obj_loyaltyProgramCurrencyName = obj.loyaltyProgramCurrencyName;
|
|
328
|
+
const path_loyaltyProgramCurrencyName = path + '.loyaltyProgramCurrencyName';
|
|
329
|
+
if (typeof obj_loyaltyProgramCurrencyName !== 'string') {
|
|
330
|
+
return new TypeError('Expected "string" but received "' + typeof obj_loyaltyProgramCurrencyName + '" (at "' + path_loyaltyProgramCurrencyName + '")');
|
|
331
|
+
}
|
|
332
|
+
})();
|
|
333
|
+
return v_error === undefined ? null : v_error;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function validate$x(obj, path = 'IssueVoucherActionOutputRepresentation') {
|
|
337
|
+
const validateActionOutputRepresentation_validateError = validate$A(obj, path);
|
|
338
|
+
if (validateActionOutputRepresentation_validateError !== null) {
|
|
339
|
+
return validateActionOutputRepresentation_validateError;
|
|
340
|
+
}
|
|
341
|
+
const v_error = (() => {
|
|
342
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
343
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
344
|
+
}
|
|
345
|
+
const obj_discountPercent = obj.discountPercent;
|
|
346
|
+
const path_discountPercent = path + '.discountPercent';
|
|
347
|
+
if (typeof obj_discountPercent !== 'number' || (typeof obj_discountPercent === 'number' && Math.floor(obj_discountPercent) !== obj_discountPercent)) {
|
|
348
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_discountPercent + '" (at "' + path_discountPercent + '")');
|
|
349
|
+
}
|
|
350
|
+
const obj_effectiveDate = obj.effectiveDate;
|
|
351
|
+
const path_effectiveDate = path + '.effectiveDate';
|
|
352
|
+
if (typeof obj_effectiveDate !== 'string') {
|
|
353
|
+
return new TypeError('Expected "string" but received "' + typeof obj_effectiveDate + '" (at "' + path_effectiveDate + '")');
|
|
354
|
+
}
|
|
355
|
+
const obj_expiryDate = obj.expiryDate;
|
|
356
|
+
const path_expiryDate = path + '.expiryDate';
|
|
357
|
+
if (typeof obj_expiryDate !== 'string') {
|
|
358
|
+
return new TypeError('Expected "string" but received "' + typeof obj_expiryDate + '" (at "' + path_expiryDate + '")');
|
|
359
|
+
}
|
|
360
|
+
obj.faceValue;
|
|
361
|
+
const obj_productId = obj.productId;
|
|
362
|
+
const path_productId = path + '.productId';
|
|
363
|
+
if (typeof obj_productId !== 'string') {
|
|
364
|
+
return new TypeError('Expected "string" but received "' + typeof obj_productId + '" (at "' + path_productId + '")');
|
|
365
|
+
}
|
|
366
|
+
const obj_voucherCode = obj.voucherCode;
|
|
367
|
+
const path_voucherCode = path + '.voucherCode';
|
|
368
|
+
if (typeof obj_voucherCode !== 'string') {
|
|
369
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherCode + '" (at "' + path_voucherCode + '")');
|
|
370
|
+
}
|
|
371
|
+
const obj_voucherDefinitionName = obj.voucherDefinitionName;
|
|
372
|
+
const path_voucherDefinitionName = path + '.voucherDefinitionName';
|
|
373
|
+
if (typeof obj_voucherDefinitionName !== 'string') {
|
|
374
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherDefinitionName + '" (at "' + path_voucherDefinitionName + '")');
|
|
375
|
+
}
|
|
376
|
+
const obj_voucherId = obj.voucherId;
|
|
377
|
+
const path_voucherId = path + '.voucherId';
|
|
378
|
+
if (typeof obj_voucherId !== 'string') {
|
|
379
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherId + '" (at "' + path_voucherId + '")');
|
|
380
|
+
}
|
|
381
|
+
})();
|
|
382
|
+
return v_error === undefined ? null : v_error;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function validate$w(obj, path = 'UpdateCumulativeUsageActionOutputRepresentation') {
|
|
386
|
+
const validateActionOutputRepresentation_validateError = validate$A(obj, path);
|
|
387
|
+
if (validateActionOutputRepresentation_validateError !== null) {
|
|
388
|
+
return validateActionOutputRepresentation_validateError;
|
|
389
|
+
}
|
|
390
|
+
const v_error = (() => {
|
|
391
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
392
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
393
|
+
}
|
|
394
|
+
const obj_promotion = obj.promotion;
|
|
395
|
+
const path_promotion = path + '.promotion';
|
|
396
|
+
if (typeof obj_promotion !== 'string') {
|
|
397
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotion + '" (at "' + path_promotion + '")');
|
|
398
|
+
}
|
|
399
|
+
const obj_updatedCumulativePromotionUsage = obj.updatedCumulativePromotionUsage;
|
|
400
|
+
const path_updatedCumulativePromotionUsage = path + '.updatedCumulativePromotionUsage';
|
|
401
|
+
if (typeof obj_updatedCumulativePromotionUsage !== 'number' || (typeof obj_updatedCumulativePromotionUsage === 'number' && Math.floor(obj_updatedCumulativePromotionUsage) !== obj_updatedCumulativePromotionUsage)) {
|
|
402
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_updatedCumulativePromotionUsage + '" (at "' + path_updatedCumulativePromotionUsage + '")');
|
|
403
|
+
}
|
|
404
|
+
})();
|
|
405
|
+
return v_error === undefined ? null : v_error;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function validate$v(obj, path = 'LoyaltyProgramProcessRuleStepRepresentation') {
|
|
409
|
+
const v_error = (() => {
|
|
410
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
411
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
412
|
+
}
|
|
413
|
+
if (obj.errorMessage !== undefined) {
|
|
414
|
+
const obj_errorMessage = obj.errorMessage;
|
|
415
|
+
const path_errorMessage = path + '.errorMessage';
|
|
416
|
+
let obj_errorMessage_union0 = null;
|
|
417
|
+
const obj_errorMessage_union0_error = (() => {
|
|
418
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
419
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
420
|
+
}
|
|
421
|
+
})();
|
|
422
|
+
if (obj_errorMessage_union0_error != null) {
|
|
423
|
+
obj_errorMessage_union0 = obj_errorMessage_union0_error.message;
|
|
424
|
+
}
|
|
425
|
+
let obj_errorMessage_union1 = null;
|
|
426
|
+
const obj_errorMessage_union1_error = (() => {
|
|
427
|
+
if (obj_errorMessage !== null) {
|
|
428
|
+
return new TypeError('Expected "null" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
429
|
+
}
|
|
430
|
+
})();
|
|
431
|
+
if (obj_errorMessage_union1_error != null) {
|
|
432
|
+
obj_errorMessage_union1 = obj_errorMessage_union1_error.message;
|
|
433
|
+
}
|
|
434
|
+
if (obj_errorMessage_union0 && obj_errorMessage_union1) {
|
|
435
|
+
let message = 'Object doesn\'t match union (at "' + path_errorMessage + '")';
|
|
436
|
+
message += '\n' + obj_errorMessage_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
437
|
+
message += '\n' + obj_errorMessage_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
438
|
+
return new TypeError(message);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (obj.sequenceNumber !== undefined) {
|
|
442
|
+
const obj_sequenceNumber = obj.sequenceNumber;
|
|
443
|
+
const path_sequenceNumber = path + '.sequenceNumber';
|
|
444
|
+
if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
|
|
445
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const obj_status = obj.status;
|
|
449
|
+
const path_status = path + '.status';
|
|
450
|
+
if (typeof obj_status !== 'string') {
|
|
451
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
452
|
+
}
|
|
453
|
+
const obj_stepName = obj.stepName;
|
|
454
|
+
const path_stepName = path + '.stepName';
|
|
455
|
+
if (typeof obj_stepName !== 'string') {
|
|
456
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
|
|
457
|
+
}
|
|
458
|
+
const obj_stepType = obj.stepType;
|
|
459
|
+
const path_stepType = path + '.stepType';
|
|
460
|
+
if (typeof obj_stepType !== 'string') {
|
|
461
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepType + '" (at "' + path_stepType + '")');
|
|
462
|
+
}
|
|
463
|
+
})();
|
|
464
|
+
return v_error === undefined ? null : v_error;
|
|
465
|
+
}
|
|
466
|
+
function equals$g(existing, incoming) {
|
|
467
|
+
const existing_sequenceNumber = existing.sequenceNumber;
|
|
468
|
+
const incoming_sequenceNumber = incoming.sequenceNumber;
|
|
469
|
+
// if at least one of these optionals is defined
|
|
470
|
+
if (existing_sequenceNumber !== undefined || incoming_sequenceNumber !== undefined) {
|
|
471
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
472
|
+
// not equal
|
|
473
|
+
if (existing_sequenceNumber === undefined || incoming_sequenceNumber === undefined) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
if (!(existing_sequenceNumber === incoming_sequenceNumber)) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const existing_status = existing.status;
|
|
481
|
+
const incoming_status = incoming.status;
|
|
482
|
+
if (!(existing_status === incoming_status)) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
const existing_stepName = existing.stepName;
|
|
486
|
+
const incoming_stepName = incoming.stepName;
|
|
487
|
+
if (!(existing_stepName === incoming_stepName)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
const existing_stepType = existing.stepType;
|
|
491
|
+
const incoming_stepType = incoming.stepType;
|
|
492
|
+
if (!(existing_stepType === incoming_stepType)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
const existing_errorMessage = existing.errorMessage;
|
|
496
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
497
|
+
// if at least one of these optionals is defined
|
|
498
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
499
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
500
|
+
// not equal
|
|
501
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
function deepFreeze$9(input) {
|
|
511
|
+
ObjectFreeze(input);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function validate$u(obj, path = 'ExpressionValueRepresentation') {
|
|
515
|
+
const v_error = (() => {
|
|
516
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
517
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
518
|
+
}
|
|
519
|
+
const obj_dataType = obj.dataType;
|
|
520
|
+
const path_dataType = path + '.dataType';
|
|
521
|
+
if (typeof obj_dataType !== 'string') {
|
|
522
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
523
|
+
}
|
|
524
|
+
const obj_value = obj.value;
|
|
525
|
+
const path_value = path + '.value';
|
|
526
|
+
if (typeof obj_value !== 'object' || ArrayIsArray(obj_value) || obj_value === null) {
|
|
527
|
+
return new TypeError('Expected "object" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
528
|
+
}
|
|
529
|
+
})();
|
|
530
|
+
return v_error === undefined ? null : v_error;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
function validate$t(obj, path = 'ExpressionRepresentation') {
|
|
534
|
+
const v_error = (() => {
|
|
535
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
536
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
537
|
+
}
|
|
538
|
+
const obj_expression = obj.expression;
|
|
539
|
+
const path_expression = path + '.expression';
|
|
540
|
+
if (typeof obj_expression !== 'string') {
|
|
541
|
+
return new TypeError('Expected "string" but received "' + typeof obj_expression + '" (at "' + path_expression + '")');
|
|
542
|
+
}
|
|
543
|
+
const obj_expressionValue = obj.expressionValue;
|
|
544
|
+
const path_expressionValue = path + '.expressionValue';
|
|
545
|
+
const referencepath_expressionValueValidationError = validate$u(obj_expressionValue, path_expressionValue);
|
|
546
|
+
if (referencepath_expressionValueValidationError !== null) {
|
|
547
|
+
let message = 'Object doesn\'t match ExpressionValueRepresentation (at "' + path_expressionValue + '")\n';
|
|
548
|
+
message += referencepath_expressionValueValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
549
|
+
return new TypeError(message);
|
|
550
|
+
}
|
|
551
|
+
const obj_parameterValues = obj.parameterValues;
|
|
552
|
+
const path_parameterValues = path + '.parameterValues';
|
|
553
|
+
if (typeof obj_parameterValues !== 'object' || ArrayIsArray(obj_parameterValues) || obj_parameterValues === null) {
|
|
554
|
+
return new TypeError('Expected "object" but received "' + typeof obj_parameterValues + '" (at "' + path_parameterValues + '")');
|
|
555
|
+
}
|
|
556
|
+
const obj_parameterValues_keys = ObjectKeys(obj_parameterValues);
|
|
557
|
+
for (let i = 0; i < obj_parameterValues_keys.length; i++) {
|
|
558
|
+
const key = obj_parameterValues_keys[i];
|
|
559
|
+
const obj_parameterValues_prop = obj_parameterValues[key];
|
|
560
|
+
const path_parameterValues_prop = path_parameterValues + '["' + key + '"]';
|
|
561
|
+
const referencepath_parameterValues_propValidationError = validate$u(obj_parameterValues_prop, path_parameterValues_prop);
|
|
562
|
+
if (referencepath_parameterValues_propValidationError !== null) {
|
|
563
|
+
let message = 'Object doesn\'t match ExpressionValueRepresentation (at "' + path_parameterValues_prop + '")\n';
|
|
564
|
+
message += referencepath_parameterValues_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
565
|
+
return new TypeError(message);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
const obj_resolvedExpression = obj.resolvedExpression;
|
|
569
|
+
const path_resolvedExpression = path + '.resolvedExpression';
|
|
570
|
+
if (typeof obj_resolvedExpression !== 'string') {
|
|
571
|
+
return new TypeError('Expected "string" but received "' + typeof obj_resolvedExpression + '" (at "' + path_resolvedExpression + '")');
|
|
572
|
+
}
|
|
573
|
+
})();
|
|
574
|
+
return v_error === undefined ? null : v_error;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
function validate$s(obj, path = 'LoyaltyProgramProcessRuleActionParameterRepresentation') {
|
|
578
|
+
const v_error = (() => {
|
|
579
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
580
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
581
|
+
}
|
|
582
|
+
const obj_name = obj.name;
|
|
583
|
+
const path_name = path + '.name';
|
|
584
|
+
if (typeof obj_name !== 'string') {
|
|
585
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
586
|
+
}
|
|
587
|
+
const obj_operator = obj.operator;
|
|
588
|
+
const path_operator = path + '.operator';
|
|
589
|
+
let obj_operator_union0 = null;
|
|
590
|
+
const obj_operator_union0_error = (() => {
|
|
591
|
+
if (typeof obj_operator !== 'string') {
|
|
592
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
593
|
+
}
|
|
594
|
+
})();
|
|
595
|
+
if (obj_operator_union0_error != null) {
|
|
596
|
+
obj_operator_union0 = obj_operator_union0_error.message;
|
|
597
|
+
}
|
|
598
|
+
let obj_operator_union1 = null;
|
|
599
|
+
const obj_operator_union1_error = (() => {
|
|
600
|
+
if (obj_operator !== null) {
|
|
601
|
+
return new TypeError('Expected "null" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
602
|
+
}
|
|
603
|
+
})();
|
|
604
|
+
if (obj_operator_union1_error != null) {
|
|
605
|
+
obj_operator_union1 = obj_operator_union1_error.message;
|
|
606
|
+
}
|
|
607
|
+
if (obj_operator_union0 && obj_operator_union1) {
|
|
608
|
+
let message = 'Object doesn\'t match union (at "' + path_operator + '")';
|
|
609
|
+
message += '\n' + obj_operator_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
610
|
+
message += '\n' + obj_operator_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
611
|
+
return new TypeError(message);
|
|
612
|
+
}
|
|
613
|
+
const obj_sequenceNumber = obj.sequenceNumber;
|
|
614
|
+
const path_sequenceNumber = path + '.sequenceNumber';
|
|
615
|
+
let obj_sequenceNumber_union0 = null;
|
|
616
|
+
const obj_sequenceNumber_union0_error = (() => {
|
|
617
|
+
if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
|
|
618
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
|
|
619
|
+
}
|
|
620
|
+
})();
|
|
621
|
+
if (obj_sequenceNumber_union0_error != null) {
|
|
622
|
+
obj_sequenceNumber_union0 = obj_sequenceNumber_union0_error.message;
|
|
623
|
+
}
|
|
624
|
+
let obj_sequenceNumber_union1 = null;
|
|
625
|
+
const obj_sequenceNumber_union1_error = (() => {
|
|
626
|
+
if (obj_sequenceNumber !== null) {
|
|
627
|
+
return new TypeError('Expected "null" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
|
|
628
|
+
}
|
|
629
|
+
})();
|
|
630
|
+
if (obj_sequenceNumber_union1_error != null) {
|
|
631
|
+
obj_sequenceNumber_union1 = obj_sequenceNumber_union1_error.message;
|
|
632
|
+
}
|
|
633
|
+
if (obj_sequenceNumber_union0 && obj_sequenceNumber_union1) {
|
|
634
|
+
let message = 'Object doesn\'t match union (at "' + path_sequenceNumber + '")';
|
|
635
|
+
message += '\n' + obj_sequenceNumber_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
636
|
+
message += '\n' + obj_sequenceNumber_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
637
|
+
return new TypeError(message);
|
|
638
|
+
}
|
|
639
|
+
const obj_value = obj.value;
|
|
640
|
+
const path_value = path + '.value';
|
|
641
|
+
let obj_value_union0 = null;
|
|
642
|
+
const obj_value_union0_error = (() => {
|
|
643
|
+
const referencepath_valueValidationError = validate$t(obj_value, path_value);
|
|
644
|
+
if (referencepath_valueValidationError !== null) {
|
|
645
|
+
let message = 'Object doesn\'t match ExpressionRepresentation (at "' + path_value + '")\n';
|
|
646
|
+
message += referencepath_valueValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
647
|
+
return new TypeError(message);
|
|
648
|
+
}
|
|
649
|
+
})();
|
|
650
|
+
if (obj_value_union0_error != null) {
|
|
651
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
652
|
+
}
|
|
653
|
+
let obj_value_union1 = null;
|
|
654
|
+
const obj_value_union1_error = (() => {
|
|
655
|
+
if (obj_value !== null) {
|
|
656
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
657
|
+
}
|
|
658
|
+
})();
|
|
659
|
+
if (obj_value_union1_error != null) {
|
|
660
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
661
|
+
}
|
|
662
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
663
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
664
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
665
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
666
|
+
return new TypeError(message);
|
|
667
|
+
}
|
|
668
|
+
})();
|
|
669
|
+
return v_error === undefined ? null : v_error;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function validate$r(obj, path = 'LoyaltyProgramProcessRuleActionRepresentation') {
|
|
673
|
+
const validateLoyaltyProgramProcessRuleStepRepresentation_validateError = validate$v(obj, path);
|
|
674
|
+
if (validateLoyaltyProgramProcessRuleStepRepresentation_validateError !== null) {
|
|
675
|
+
return validateLoyaltyProgramProcessRuleStepRepresentation_validateError;
|
|
676
|
+
}
|
|
677
|
+
const v_error = (() => {
|
|
678
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
679
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
680
|
+
}
|
|
681
|
+
const obj_actionParameters = obj.actionParameters;
|
|
682
|
+
const path_actionParameters = path + '.actionParameters';
|
|
683
|
+
if (!ArrayIsArray(obj_actionParameters)) {
|
|
684
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actionParameters + '" (at "' + path_actionParameters + '")');
|
|
685
|
+
}
|
|
686
|
+
for (let i = 0; i < obj_actionParameters.length; i++) {
|
|
687
|
+
const obj_actionParameters_item = obj_actionParameters[i];
|
|
688
|
+
const path_actionParameters_item = path_actionParameters + '[' + i + ']';
|
|
689
|
+
const referencepath_actionParameters_itemValidationError = validate$s(obj_actionParameters_item, path_actionParameters_item);
|
|
690
|
+
if (referencepath_actionParameters_itemValidationError !== null) {
|
|
691
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleActionParameterRepresentation (at "' + path_actionParameters_item + '")\n';
|
|
692
|
+
message += referencepath_actionParameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
693
|
+
return new TypeError(message);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
const obj_actionType = obj.actionType;
|
|
697
|
+
const path_actionType = path + '.actionType';
|
|
698
|
+
if (typeof obj_actionType !== 'string') {
|
|
699
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
|
|
700
|
+
}
|
|
701
|
+
const obj_decisionTableName = obj.decisionTableName;
|
|
702
|
+
const path_decisionTableName = path + '.decisionTableName';
|
|
703
|
+
let obj_decisionTableName_union0 = null;
|
|
704
|
+
const obj_decisionTableName_union0_error = (() => {
|
|
705
|
+
if (typeof obj_decisionTableName !== 'string') {
|
|
706
|
+
return new TypeError('Expected "string" but received "' + typeof obj_decisionTableName + '" (at "' + path_decisionTableName + '")');
|
|
707
|
+
}
|
|
708
|
+
})();
|
|
709
|
+
if (obj_decisionTableName_union0_error != null) {
|
|
710
|
+
obj_decisionTableName_union0 = obj_decisionTableName_union0_error.message;
|
|
711
|
+
}
|
|
712
|
+
let obj_decisionTableName_union1 = null;
|
|
713
|
+
const obj_decisionTableName_union1_error = (() => {
|
|
714
|
+
if (obj_decisionTableName !== null) {
|
|
715
|
+
return new TypeError('Expected "null" but received "' + typeof obj_decisionTableName + '" (at "' + path_decisionTableName + '")');
|
|
716
|
+
}
|
|
717
|
+
})();
|
|
718
|
+
if (obj_decisionTableName_union1_error != null) {
|
|
719
|
+
obj_decisionTableName_union1 = obj_decisionTableName_union1_error.message;
|
|
720
|
+
}
|
|
721
|
+
if (obj_decisionTableName_union0 && obj_decisionTableName_union1) {
|
|
722
|
+
let message = 'Object doesn\'t match union (at "' + path_decisionTableName + '")';
|
|
723
|
+
message += '\n' + obj_decisionTableName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
724
|
+
message += '\n' + obj_decisionTableName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
725
|
+
return new TypeError(message);
|
|
726
|
+
}
|
|
727
|
+
const obj_flowDefinitionName = obj.flowDefinitionName;
|
|
728
|
+
const path_flowDefinitionName = path + '.flowDefinitionName';
|
|
729
|
+
let obj_flowDefinitionName_union0 = null;
|
|
730
|
+
const obj_flowDefinitionName_union0_error = (() => {
|
|
731
|
+
if (typeof obj_flowDefinitionName !== 'string') {
|
|
732
|
+
return new TypeError('Expected "string" but received "' + typeof obj_flowDefinitionName + '" (at "' + path_flowDefinitionName + '")');
|
|
733
|
+
}
|
|
734
|
+
})();
|
|
735
|
+
if (obj_flowDefinitionName_union0_error != null) {
|
|
736
|
+
obj_flowDefinitionName_union0 = obj_flowDefinitionName_union0_error.message;
|
|
737
|
+
}
|
|
738
|
+
let obj_flowDefinitionName_union1 = null;
|
|
739
|
+
const obj_flowDefinitionName_union1_error = (() => {
|
|
740
|
+
if (obj_flowDefinitionName !== null) {
|
|
741
|
+
return new TypeError('Expected "null" but received "' + typeof obj_flowDefinitionName + '" (at "' + path_flowDefinitionName + '")');
|
|
742
|
+
}
|
|
743
|
+
})();
|
|
744
|
+
if (obj_flowDefinitionName_union1_error != null) {
|
|
745
|
+
obj_flowDefinitionName_union1 = obj_flowDefinitionName_union1_error.message;
|
|
746
|
+
}
|
|
747
|
+
if (obj_flowDefinitionName_union0 && obj_flowDefinitionName_union1) {
|
|
748
|
+
let message = 'Object doesn\'t match union (at "' + path_flowDefinitionName + '")';
|
|
749
|
+
message += '\n' + obj_flowDefinitionName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
750
|
+
message += '\n' + obj_flowDefinitionName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
751
|
+
return new TypeError(message);
|
|
752
|
+
}
|
|
753
|
+
})();
|
|
754
|
+
return v_error === undefined ? null : v_error;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
function validate$q(obj, path = 'LoyaltyProgramProcessRuleConditionGroupRepresentation') {
|
|
758
|
+
const validateLoyaltyProgramProcessRuleStepRepresentation_validateError = validate$v(obj, path);
|
|
759
|
+
if (validateLoyaltyProgramProcessRuleStepRepresentation_validateError !== null) {
|
|
760
|
+
return validateLoyaltyProgramProcessRuleStepRepresentation_validateError;
|
|
761
|
+
}
|
|
762
|
+
const v_error = (() => {
|
|
763
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
764
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
765
|
+
}
|
|
766
|
+
const obj_childSteps = obj.childSteps;
|
|
767
|
+
const path_childSteps = path + '.childSteps';
|
|
768
|
+
if (!ArrayIsArray(obj_childSteps)) {
|
|
769
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childSteps + '" (at "' + path_childSteps + '")');
|
|
770
|
+
}
|
|
771
|
+
for (let i = 0; i < obj_childSteps.length; i++) {
|
|
772
|
+
const obj_childSteps_item = obj_childSteps[i];
|
|
773
|
+
const path_childSteps_item = path_childSteps + '[' + i + ']';
|
|
774
|
+
const referencepath_childSteps_itemValidationError = validate$v(obj_childSteps_item, path_childSteps_item);
|
|
775
|
+
if (referencepath_childSteps_itemValidationError !== null) {
|
|
776
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleStepRepresentation (at "' + path_childSteps_item + '")\n';
|
|
777
|
+
message += referencepath_childSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
778
|
+
return new TypeError(message);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
})();
|
|
782
|
+
return v_error === undefined ? null : v_error;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function validate$p(obj, path = 'LoyaltyProgramProcessRuleConditionFilterCriteriaRepresentation') {
|
|
786
|
+
const v_error = (() => {
|
|
787
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
788
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
789
|
+
}
|
|
790
|
+
const obj_filterCriteriaResult = obj.filterCriteriaResult;
|
|
791
|
+
const path_filterCriteriaResult = path + '.filterCriteriaResult';
|
|
792
|
+
if (typeof obj_filterCriteriaResult !== 'boolean') {
|
|
793
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_filterCriteriaResult + '" (at "' + path_filterCriteriaResult + '")');
|
|
794
|
+
}
|
|
795
|
+
const obj_operator = obj.operator;
|
|
796
|
+
const path_operator = path + '.operator';
|
|
797
|
+
if (typeof obj_operator !== 'string') {
|
|
798
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
799
|
+
}
|
|
800
|
+
const obj_sequence = obj.sequence;
|
|
801
|
+
const path_sequence = path + '.sequence';
|
|
802
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
803
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
804
|
+
}
|
|
805
|
+
const obj_sourceFieldName = obj.sourceFieldName;
|
|
806
|
+
const path_sourceFieldName = path + '.sourceFieldName';
|
|
807
|
+
const referencepath_sourceFieldNameValidationError = validate$t(obj_sourceFieldName, path_sourceFieldName);
|
|
808
|
+
if (referencepath_sourceFieldNameValidationError !== null) {
|
|
809
|
+
let message = 'Object doesn\'t match ExpressionRepresentation (at "' + path_sourceFieldName + '")\n';
|
|
810
|
+
message += referencepath_sourceFieldNameValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
811
|
+
return new TypeError(message);
|
|
812
|
+
}
|
|
813
|
+
const obj_value = obj.value;
|
|
814
|
+
const path_value = path + '.value';
|
|
815
|
+
let obj_value_union0 = null;
|
|
816
|
+
const obj_value_union0_error = (() => {
|
|
817
|
+
const referencepath_valueValidationError = validate$t(obj_value, path_value);
|
|
818
|
+
if (referencepath_valueValidationError !== null) {
|
|
819
|
+
let message = 'Object doesn\'t match ExpressionRepresentation (at "' + path_value + '")\n';
|
|
820
|
+
message += referencepath_valueValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
821
|
+
return new TypeError(message);
|
|
822
|
+
}
|
|
823
|
+
})();
|
|
824
|
+
if (obj_value_union0_error != null) {
|
|
825
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
826
|
+
}
|
|
827
|
+
let obj_value_union1 = null;
|
|
828
|
+
const obj_value_union1_error = (() => {
|
|
829
|
+
if (obj_value !== null) {
|
|
830
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
831
|
+
}
|
|
832
|
+
})();
|
|
833
|
+
if (obj_value_union1_error != null) {
|
|
834
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
835
|
+
}
|
|
836
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
837
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
838
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
839
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
840
|
+
return new TypeError(message);
|
|
841
|
+
}
|
|
842
|
+
const obj_valueType = obj.valueType;
|
|
843
|
+
const path_valueType = path + '.valueType';
|
|
844
|
+
if (typeof obj_valueType !== 'string') {
|
|
845
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueType + '" (at "' + path_valueType + '")');
|
|
846
|
+
}
|
|
847
|
+
})();
|
|
848
|
+
return v_error === undefined ? null : v_error;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
function validate$o(obj, path = 'LoyaltyProgramProcessRuleConditionRepresentation') {
|
|
852
|
+
const validateLoyaltyProgramProcessRuleStepRepresentation_validateError = validate$v(obj, path);
|
|
853
|
+
if (validateLoyaltyProgramProcessRuleStepRepresentation_validateError !== null) {
|
|
854
|
+
return validateLoyaltyProgramProcessRuleStepRepresentation_validateError;
|
|
855
|
+
}
|
|
856
|
+
const v_error = (() => {
|
|
857
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
858
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
859
|
+
}
|
|
860
|
+
const obj_childSteps = obj.childSteps;
|
|
861
|
+
const path_childSteps = path + '.childSteps';
|
|
862
|
+
if (!ArrayIsArray(obj_childSteps)) {
|
|
863
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childSteps + '" (at "' + path_childSteps + '")');
|
|
864
|
+
}
|
|
865
|
+
for (let i = 0; i < obj_childSteps.length; i++) {
|
|
866
|
+
const obj_childSteps_item = obj_childSteps[i];
|
|
867
|
+
const path_childSteps_item = path_childSteps + '[' + i + ']';
|
|
868
|
+
const referencepath_childSteps_itemValidationError = validate$v(obj_childSteps_item, path_childSteps_item);
|
|
869
|
+
if (referencepath_childSteps_itemValidationError !== null) {
|
|
870
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleStepRepresentation (at "' + path_childSteps_item + '")\n';
|
|
871
|
+
message += referencepath_childSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
872
|
+
return new TypeError(message);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
const obj_filterCondition = obj.filterCondition;
|
|
876
|
+
const path_filterCondition = path + '.filterCondition';
|
|
877
|
+
let obj_filterCondition_union0 = null;
|
|
878
|
+
const obj_filterCondition_union0_error = (() => {
|
|
879
|
+
if (typeof obj_filterCondition !== 'string') {
|
|
880
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterCondition + '" (at "' + path_filterCondition + '")');
|
|
881
|
+
}
|
|
882
|
+
})();
|
|
883
|
+
if (obj_filterCondition_union0_error != null) {
|
|
884
|
+
obj_filterCondition_union0 = obj_filterCondition_union0_error.message;
|
|
885
|
+
}
|
|
886
|
+
let obj_filterCondition_union1 = null;
|
|
887
|
+
const obj_filterCondition_union1_error = (() => {
|
|
888
|
+
if (obj_filterCondition !== null) {
|
|
889
|
+
return new TypeError('Expected "null" but received "' + typeof obj_filterCondition + '" (at "' + path_filterCondition + '")');
|
|
890
|
+
}
|
|
891
|
+
})();
|
|
892
|
+
if (obj_filterCondition_union1_error != null) {
|
|
893
|
+
obj_filterCondition_union1 = obj_filterCondition_union1_error.message;
|
|
894
|
+
}
|
|
895
|
+
if (obj_filterCondition_union0 && obj_filterCondition_union1) {
|
|
896
|
+
let message = 'Object doesn\'t match union (at "' + path_filterCondition + '")';
|
|
897
|
+
message += '\n' + obj_filterCondition_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
898
|
+
message += '\n' + obj_filterCondition_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
899
|
+
return new TypeError(message);
|
|
900
|
+
}
|
|
901
|
+
const obj_filterCriteria = obj.filterCriteria;
|
|
902
|
+
const path_filterCriteria = path + '.filterCriteria';
|
|
903
|
+
if (!ArrayIsArray(obj_filterCriteria)) {
|
|
904
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
905
|
+
}
|
|
906
|
+
for (let i = 0; i < obj_filterCriteria.length; i++) {
|
|
907
|
+
const obj_filterCriteria_item = obj_filterCriteria[i];
|
|
908
|
+
const path_filterCriteria_item = path_filterCriteria + '[' + i + ']';
|
|
909
|
+
const referencepath_filterCriteria_itemValidationError = validate$p(obj_filterCriteria_item, path_filterCriteria_item);
|
|
910
|
+
if (referencepath_filterCriteria_itemValidationError !== null) {
|
|
911
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleConditionFilterCriteriaRepresentation (at "' + path_filterCriteria_item + '")\n';
|
|
912
|
+
message += referencepath_filterCriteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
913
|
+
return new TypeError(message);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const obj_isConditionMet = obj.isConditionMet;
|
|
917
|
+
const path_isConditionMet = path + '.isConditionMet';
|
|
918
|
+
if (typeof obj_isConditionMet !== 'boolean') {
|
|
919
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isConditionMet + '" (at "' + path_isConditionMet + '")');
|
|
920
|
+
}
|
|
921
|
+
})();
|
|
922
|
+
return v_error === undefined ? null : v_error;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
const VERSION$f = "66816d4824ffc0bcf2bb5416375ccf90";
|
|
926
|
+
function validate$n(obj, path = 'LoyaltyProgramProcessRuleRepresentation') {
|
|
927
|
+
const v_error = (() => {
|
|
928
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
929
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
930
|
+
}
|
|
931
|
+
const obj_actionResultSummary = obj.actionResultSummary;
|
|
932
|
+
const path_actionResultSummary = path + '.actionResultSummary';
|
|
933
|
+
if (!ArrayIsArray(obj_actionResultSummary)) {
|
|
934
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actionResultSummary + '" (at "' + path_actionResultSummary + '")');
|
|
935
|
+
}
|
|
936
|
+
for (let i = 0; i < obj_actionResultSummary.length; i++) {
|
|
937
|
+
const obj_actionResultSummary_item = obj_actionResultSummary[i];
|
|
938
|
+
const path_actionResultSummary_item = path_actionResultSummary + '[' + i + ']';
|
|
939
|
+
let obj_actionResultSummary_item_union0 = null;
|
|
940
|
+
const obj_actionResultSummary_item_union0_error = (() => {
|
|
941
|
+
const referencepath_actionResultSummary_itemValidationError = validate$A(obj_actionResultSummary_item, path_actionResultSummary_item);
|
|
942
|
+
if (referencepath_actionResultSummary_itemValidationError !== null) {
|
|
943
|
+
let message = 'Object doesn\'t match ActionOutputRepresentation (at "' + path_actionResultSummary_item + '")\n';
|
|
944
|
+
message += referencepath_actionResultSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
945
|
+
return new TypeError(message);
|
|
946
|
+
}
|
|
947
|
+
})();
|
|
948
|
+
if (obj_actionResultSummary_item_union0_error != null) {
|
|
949
|
+
obj_actionResultSummary_item_union0 = obj_actionResultSummary_item_union0_error.message;
|
|
950
|
+
}
|
|
951
|
+
let obj_actionResultSummary_item_union1 = null;
|
|
952
|
+
const obj_actionResultSummary_item_union1_error = (() => {
|
|
953
|
+
const referencepath_actionResultSummary_itemValidationError = validate$z(obj_actionResultSummary_item, path_actionResultSummary_item);
|
|
954
|
+
if (referencepath_actionResultSummary_itemValidationError !== null) {
|
|
955
|
+
let message = 'Object doesn\'t match DebitPointsActionOutputRepresentation (at "' + path_actionResultSummary_item + '")\n';
|
|
956
|
+
message += referencepath_actionResultSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
957
|
+
return new TypeError(message);
|
|
958
|
+
}
|
|
959
|
+
})();
|
|
960
|
+
if (obj_actionResultSummary_item_union1_error != null) {
|
|
961
|
+
obj_actionResultSummary_item_union1 = obj_actionResultSummary_item_union1_error.message;
|
|
962
|
+
}
|
|
963
|
+
let obj_actionResultSummary_item_union2 = null;
|
|
964
|
+
const obj_actionResultSummary_item_union2_error = (() => {
|
|
965
|
+
const referencepath_actionResultSummary_itemValidationError = validate$y(obj_actionResultSummary_item, path_actionResultSummary_item);
|
|
966
|
+
if (referencepath_actionResultSummary_itemValidationError !== null) {
|
|
967
|
+
let message = 'Object doesn\'t match CreditPointsActionOutputRepresentation (at "' + path_actionResultSummary_item + '")\n';
|
|
968
|
+
message += referencepath_actionResultSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
969
|
+
return new TypeError(message);
|
|
970
|
+
}
|
|
971
|
+
})();
|
|
972
|
+
if (obj_actionResultSummary_item_union2_error != null) {
|
|
973
|
+
obj_actionResultSummary_item_union2 = obj_actionResultSummary_item_union2_error.message;
|
|
974
|
+
}
|
|
975
|
+
let obj_actionResultSummary_item_union3 = null;
|
|
976
|
+
const obj_actionResultSummary_item_union3_error = (() => {
|
|
977
|
+
const referencepath_actionResultSummary_itemValidationError = validate$x(obj_actionResultSummary_item, path_actionResultSummary_item);
|
|
978
|
+
if (referencepath_actionResultSummary_itemValidationError !== null) {
|
|
979
|
+
let message = 'Object doesn\'t match IssueVoucherActionOutputRepresentation (at "' + path_actionResultSummary_item + '")\n';
|
|
980
|
+
message += referencepath_actionResultSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
981
|
+
return new TypeError(message);
|
|
982
|
+
}
|
|
983
|
+
})();
|
|
984
|
+
if (obj_actionResultSummary_item_union3_error != null) {
|
|
985
|
+
obj_actionResultSummary_item_union3 = obj_actionResultSummary_item_union3_error.message;
|
|
986
|
+
}
|
|
987
|
+
let obj_actionResultSummary_item_union4 = null;
|
|
988
|
+
const obj_actionResultSummary_item_union4_error = (() => {
|
|
989
|
+
const referencepath_actionResultSummary_itemValidationError = validate$w(obj_actionResultSummary_item, path_actionResultSummary_item);
|
|
990
|
+
if (referencepath_actionResultSummary_itemValidationError !== null) {
|
|
991
|
+
let message = 'Object doesn\'t match UpdateCumulativeUsageActionOutputRepresentation (at "' + path_actionResultSummary_item + '")\n';
|
|
992
|
+
message += referencepath_actionResultSummary_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
993
|
+
return new TypeError(message);
|
|
994
|
+
}
|
|
995
|
+
})();
|
|
996
|
+
if (obj_actionResultSummary_item_union4_error != null) {
|
|
997
|
+
obj_actionResultSummary_item_union4 = obj_actionResultSummary_item_union4_error.message;
|
|
998
|
+
}
|
|
999
|
+
if (obj_actionResultSummary_item_union0 && obj_actionResultSummary_item_union1 && obj_actionResultSummary_item_union2 && obj_actionResultSummary_item_union3 && obj_actionResultSummary_item_union4) {
|
|
1000
|
+
let message = 'Object doesn\'t match union (at "' + path_actionResultSummary_item + '")';
|
|
1001
|
+
message += '\n' + obj_actionResultSummary_item_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1002
|
+
message += '\n' + obj_actionResultSummary_item_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1003
|
+
message += '\n' + obj_actionResultSummary_item_union2.split('\n').map((line) => '\t' + line).join('\n');
|
|
1004
|
+
message += '\n' + obj_actionResultSummary_item_union3.split('\n').map((line) => '\t' + line).join('\n');
|
|
1005
|
+
message += '\n' + obj_actionResultSummary_item_union4.split('\n').map((line) => '\t' + line).join('\n');
|
|
1006
|
+
return new TypeError(message);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
if (obj.errorMessage !== undefined) {
|
|
1010
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1011
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1012
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
1013
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
const obj_executionStatus = obj.executionStatus;
|
|
1017
|
+
const path_executionStatus = path + '.executionStatus';
|
|
1018
|
+
if (typeof obj_executionStatus !== 'string') {
|
|
1019
|
+
return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
|
|
1020
|
+
}
|
|
1021
|
+
const obj_executionSummary = obj.executionSummary;
|
|
1022
|
+
const path_executionSummary = path + '.executionSummary';
|
|
1023
|
+
const referencepath_executionSummaryValidationError = validate$B(obj_executionSummary, path_executionSummary);
|
|
1024
|
+
if (referencepath_executionSummaryValidationError !== null) {
|
|
1025
|
+
let message = 'Object doesn\'t match SummaryRepresentation (at "' + path_executionSummary + '")\n';
|
|
1026
|
+
message += referencepath_executionSummaryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1027
|
+
return new TypeError(message);
|
|
1028
|
+
}
|
|
1029
|
+
if (obj.previousRuleName !== undefined) {
|
|
1030
|
+
const obj_previousRuleName = obj.previousRuleName;
|
|
1031
|
+
const path_previousRuleName = path + '.previousRuleName';
|
|
1032
|
+
if (typeof obj_previousRuleName !== 'string') {
|
|
1033
|
+
return new TypeError('Expected "string" but received "' + typeof obj_previousRuleName + '" (at "' + path_previousRuleName + '")');
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
const obj_processRuleName = obj.processRuleName;
|
|
1037
|
+
const path_processRuleName = path + '.processRuleName';
|
|
1038
|
+
if (typeof obj_processRuleName !== 'string') {
|
|
1039
|
+
return new TypeError('Expected "string" but received "' + typeof obj_processRuleName + '" (at "' + path_processRuleName + '")');
|
|
1040
|
+
}
|
|
1041
|
+
if (obj.promotionName !== undefined) {
|
|
1042
|
+
const obj_promotionName = obj.promotionName;
|
|
1043
|
+
const path_promotionName = path + '.promotionName';
|
|
1044
|
+
if (typeof obj_promotionName !== 'string') {
|
|
1045
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionName + '" (at "' + path_promotionName + '")');
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
const obj_ruleSteps = obj.ruleSteps;
|
|
1049
|
+
const path_ruleSteps = path + '.ruleSteps';
|
|
1050
|
+
if (!ArrayIsArray(obj_ruleSteps)) {
|
|
1051
|
+
return new TypeError('Expected "array" but received "' + typeof obj_ruleSteps + '" (at "' + path_ruleSteps + '")');
|
|
1052
|
+
}
|
|
1053
|
+
for (let i = 0; i < obj_ruleSteps.length; i++) {
|
|
1054
|
+
const obj_ruleSteps_item = obj_ruleSteps[i];
|
|
1055
|
+
const path_ruleSteps_item = path_ruleSteps + '[' + i + ']';
|
|
1056
|
+
let obj_ruleSteps_item_union0 = null;
|
|
1057
|
+
const obj_ruleSteps_item_union0_error = (() => {
|
|
1058
|
+
const referencepath_ruleSteps_itemValidationError = validate$v(obj_ruleSteps_item, path_ruleSteps_item);
|
|
1059
|
+
if (referencepath_ruleSteps_itemValidationError !== null) {
|
|
1060
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleStepRepresentation (at "' + path_ruleSteps_item + '")\n';
|
|
1061
|
+
message += referencepath_ruleSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1062
|
+
return new TypeError(message);
|
|
1063
|
+
}
|
|
1064
|
+
})();
|
|
1065
|
+
if (obj_ruleSteps_item_union0_error != null) {
|
|
1066
|
+
obj_ruleSteps_item_union0 = obj_ruleSteps_item_union0_error.message;
|
|
1067
|
+
}
|
|
1068
|
+
let obj_ruleSteps_item_union1 = null;
|
|
1069
|
+
const obj_ruleSteps_item_union1_error = (() => {
|
|
1070
|
+
const referencepath_ruleSteps_itemValidationError = validate$r(obj_ruleSteps_item, path_ruleSteps_item);
|
|
1071
|
+
if (referencepath_ruleSteps_itemValidationError !== null) {
|
|
1072
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleActionRepresentation (at "' + path_ruleSteps_item + '")\n';
|
|
1073
|
+
message += referencepath_ruleSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1074
|
+
return new TypeError(message);
|
|
1075
|
+
}
|
|
1076
|
+
})();
|
|
1077
|
+
if (obj_ruleSteps_item_union1_error != null) {
|
|
1078
|
+
obj_ruleSteps_item_union1 = obj_ruleSteps_item_union1_error.message;
|
|
1079
|
+
}
|
|
1080
|
+
let obj_ruleSteps_item_union2 = null;
|
|
1081
|
+
const obj_ruleSteps_item_union2_error = (() => {
|
|
1082
|
+
const referencepath_ruleSteps_itemValidationError = validate$q(obj_ruleSteps_item, path_ruleSteps_item);
|
|
1083
|
+
if (referencepath_ruleSteps_itemValidationError !== null) {
|
|
1084
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleConditionGroupRepresentation (at "' + path_ruleSteps_item + '")\n';
|
|
1085
|
+
message += referencepath_ruleSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1086
|
+
return new TypeError(message);
|
|
1087
|
+
}
|
|
1088
|
+
})();
|
|
1089
|
+
if (obj_ruleSteps_item_union2_error != null) {
|
|
1090
|
+
obj_ruleSteps_item_union2 = obj_ruleSteps_item_union2_error.message;
|
|
1091
|
+
}
|
|
1092
|
+
let obj_ruleSteps_item_union3 = null;
|
|
1093
|
+
const obj_ruleSteps_item_union3_error = (() => {
|
|
1094
|
+
const referencepath_ruleSteps_itemValidationError = validate$o(obj_ruleSteps_item, path_ruleSteps_item);
|
|
1095
|
+
if (referencepath_ruleSteps_itemValidationError !== null) {
|
|
1096
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleConditionRepresentation (at "' + path_ruleSteps_item + '")\n';
|
|
1097
|
+
message += referencepath_ruleSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1098
|
+
return new TypeError(message);
|
|
1099
|
+
}
|
|
1100
|
+
})();
|
|
1101
|
+
if (obj_ruleSteps_item_union3_error != null) {
|
|
1102
|
+
obj_ruleSteps_item_union3 = obj_ruleSteps_item_union3_error.message;
|
|
1103
|
+
}
|
|
1104
|
+
if (obj_ruleSteps_item_union0 && obj_ruleSteps_item_union1 && obj_ruleSteps_item_union2 && obj_ruleSteps_item_union3) {
|
|
1105
|
+
let message = 'Object doesn\'t match union (at "' + path_ruleSteps_item + '")';
|
|
1106
|
+
message += '\n' + obj_ruleSteps_item_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1107
|
+
message += '\n' + obj_ruleSteps_item_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1108
|
+
message += '\n' + obj_ruleSteps_item_union2.split('\n').map((line) => '\t' + line).join('\n');
|
|
1109
|
+
message += '\n' + obj_ruleSteps_item_union3.split('\n').map((line) => '\t' + line).join('\n');
|
|
1110
|
+
return new TypeError(message);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
})();
|
|
1114
|
+
return v_error === undefined ? null : v_error;
|
|
1115
|
+
}
|
|
1116
|
+
const select$k = function LoyaltyProgramProcessRuleRepresentationSelect() {
|
|
1117
|
+
const { selections: SummaryRepresentation__selections, opaque: SummaryRepresentation__opaque, } = select$l();
|
|
1118
|
+
return {
|
|
1119
|
+
kind: 'Fragment',
|
|
1120
|
+
version: VERSION$f,
|
|
1121
|
+
private: [],
|
|
1122
|
+
selections: [
|
|
1123
|
+
{
|
|
1124
|
+
kind: 'Object',
|
|
1125
|
+
name: 'actionResultSummary',
|
|
1126
|
+
// Complex union deep
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
name: 'errorMessage',
|
|
1130
|
+
kind: 'Scalar',
|
|
1131
|
+
required: false
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
name: 'executionStatus',
|
|
1135
|
+
kind: 'Scalar'
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
name: 'executionSummary',
|
|
1139
|
+
kind: 'Object',
|
|
1140
|
+
selections: SummaryRepresentation__selections
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
name: 'previousRuleName',
|
|
1144
|
+
kind: 'Scalar',
|
|
1145
|
+
required: false
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
name: 'processRuleName',
|
|
1149
|
+
kind: 'Scalar'
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
name: 'promotionName',
|
|
1153
|
+
kind: 'Scalar',
|
|
1154
|
+
required: false
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
kind: 'Object',
|
|
1158
|
+
name: 'ruleSteps',
|
|
1159
|
+
// Complex union deep
|
|
1160
|
+
}
|
|
1161
|
+
]
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
function equals$f(existing, incoming) {
|
|
1165
|
+
const existing_errorMessage = existing.errorMessage;
|
|
1166
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
1167
|
+
// if at least one of these optionals is defined
|
|
1168
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
1169
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1170
|
+
// not equal
|
|
1171
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
1172
|
+
return false;
|
|
1173
|
+
}
|
|
1174
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
1175
|
+
return false;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
const existing_executionStatus = existing.executionStatus;
|
|
1179
|
+
const incoming_executionStatus = incoming.executionStatus;
|
|
1180
|
+
if (!(existing_executionStatus === incoming_executionStatus)) {
|
|
1181
|
+
return false;
|
|
1182
|
+
}
|
|
1183
|
+
const existing_previousRuleName = existing.previousRuleName;
|
|
1184
|
+
const incoming_previousRuleName = incoming.previousRuleName;
|
|
1185
|
+
// if at least one of these optionals is defined
|
|
1186
|
+
if (existing_previousRuleName !== undefined || incoming_previousRuleName !== undefined) {
|
|
1187
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1188
|
+
// not equal
|
|
1189
|
+
if (existing_previousRuleName === undefined || incoming_previousRuleName === undefined) {
|
|
1190
|
+
return false;
|
|
1191
|
+
}
|
|
1192
|
+
if (!(existing_previousRuleName === incoming_previousRuleName)) {
|
|
1193
|
+
return false;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
const existing_processRuleName = existing.processRuleName;
|
|
1197
|
+
const incoming_processRuleName = incoming.processRuleName;
|
|
1198
|
+
if (!(existing_processRuleName === incoming_processRuleName)) {
|
|
1199
|
+
return false;
|
|
1200
|
+
}
|
|
1201
|
+
const existing_promotionName = existing.promotionName;
|
|
1202
|
+
const incoming_promotionName = incoming.promotionName;
|
|
1203
|
+
// if at least one of these optionals is defined
|
|
1204
|
+
if (existing_promotionName !== undefined || incoming_promotionName !== undefined) {
|
|
1205
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1206
|
+
// not equal
|
|
1207
|
+
if (existing_promotionName === undefined || incoming_promotionName === undefined) {
|
|
1208
|
+
return false;
|
|
1209
|
+
}
|
|
1210
|
+
if (!(existing_promotionName === incoming_promotionName)) {
|
|
1211
|
+
return false;
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
const existing_actionResultSummary = existing.actionResultSummary;
|
|
1215
|
+
const incoming_actionResultSummary = incoming.actionResultSummary;
|
|
1216
|
+
const equals_actionResultSummary_items = equalsArray(existing_actionResultSummary, incoming_actionResultSummary, (existing_actionResultSummary_item, incoming_actionResultSummary_item) => {
|
|
1217
|
+
if (!(existing_actionResultSummary_item === incoming_actionResultSummary_item
|
|
1218
|
+
|| (existing_actionResultSummary_item != null &&
|
|
1219
|
+
incoming_actionResultSummary_item != null &&
|
|
1220
|
+
equals$h(existing_actionResultSummary_item, incoming_actionResultSummary_item)))) {
|
|
1221
|
+
return false;
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
if (equals_actionResultSummary_items === false) {
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
const existing_executionSummary = existing.executionSummary;
|
|
1228
|
+
const incoming_executionSummary = incoming.executionSummary;
|
|
1229
|
+
if (!(equals$i(existing_executionSummary, incoming_executionSummary))) {
|
|
1230
|
+
return false;
|
|
1231
|
+
}
|
|
1232
|
+
const existing_ruleSteps = existing.ruleSteps;
|
|
1233
|
+
const incoming_ruleSteps = incoming.ruleSteps;
|
|
1234
|
+
const equals_ruleSteps_items = equalsArray(existing_ruleSteps, incoming_ruleSteps, (existing_ruleSteps_item, incoming_ruleSteps_item) => {
|
|
1235
|
+
if (!(existing_ruleSteps_item === incoming_ruleSteps_item
|
|
1236
|
+
|| (existing_ruleSteps_item != null &&
|
|
1237
|
+
incoming_ruleSteps_item != null &&
|
|
1238
|
+
equals$g(existing_ruleSteps_item, incoming_ruleSteps_item)))) {
|
|
1239
|
+
return false;
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
if (equals_ruleSteps_items === false) {
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1245
|
+
return true;
|
|
1246
|
+
}
|
|
1247
|
+
function deepFreeze$8(input) {
|
|
1248
|
+
const input_actionResultSummary = input.actionResultSummary;
|
|
1249
|
+
for (let i = 0; i < input_actionResultSummary.length; i++) {
|
|
1250
|
+
const input_actionResultSummary_item = input_actionResultSummary[i];
|
|
1251
|
+
if (input_actionResultSummary_item !== null && typeof input_actionResultSummary_item === 'object') {
|
|
1252
|
+
deepFreeze$a(input_actionResultSummary_item);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
ObjectFreeze(input_actionResultSummary);
|
|
1256
|
+
const input_executionSummary = input.executionSummary;
|
|
1257
|
+
deepFreeze$b(input_executionSummary);
|
|
1258
|
+
const input_ruleSteps = input.ruleSteps;
|
|
1259
|
+
for (let i = 0; i < input_ruleSteps.length; i++) {
|
|
1260
|
+
const input_ruleSteps_item = input_ruleSteps[i];
|
|
1261
|
+
if (input_ruleSteps_item !== null && typeof input_ruleSteps_item === 'object') {
|
|
1262
|
+
deepFreeze$9(input_ruleSteps_item);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
ObjectFreeze(input_ruleSteps);
|
|
1266
|
+
ObjectFreeze(input);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
const VERSION$e = "02fbbb3136329b4111f875519b945a58";
|
|
1270
|
+
function validate$m(obj, path = 'TransactionJournalRepresentation') {
|
|
1271
|
+
const v_error = (() => {
|
|
1272
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1273
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1274
|
+
}
|
|
1275
|
+
const obj_executionSummary = obj.executionSummary;
|
|
1276
|
+
const path_executionSummary = path + '.executionSummary';
|
|
1277
|
+
const referencepath_executionSummaryValidationError = validate$B(obj_executionSummary, path_executionSummary);
|
|
1278
|
+
if (referencepath_executionSummaryValidationError !== null) {
|
|
1279
|
+
let message = 'Object doesn\'t match SummaryRepresentation (at "' + path_executionSummary + '")\n';
|
|
1280
|
+
message += referencepath_executionSummaryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1281
|
+
return new TypeError(message);
|
|
1282
|
+
}
|
|
1283
|
+
const obj_processId = obj.processId;
|
|
1284
|
+
const path_processId = path + '.processId';
|
|
1285
|
+
if (typeof obj_processId !== 'string') {
|
|
1286
|
+
return new TypeError('Expected "string" but received "' + typeof obj_processId + '" (at "' + path_processId + '")');
|
|
1287
|
+
}
|
|
1288
|
+
const obj_processName = obj.processName;
|
|
1289
|
+
const path_processName = path + '.processName';
|
|
1290
|
+
if (typeof obj_processName !== 'string') {
|
|
1291
|
+
return new TypeError('Expected "string" but received "' + typeof obj_processName + '" (at "' + path_processName + '")');
|
|
1292
|
+
}
|
|
1293
|
+
const obj_processRules = obj.processRules;
|
|
1294
|
+
const path_processRules = path + '.processRules';
|
|
1295
|
+
if (!ArrayIsArray(obj_processRules)) {
|
|
1296
|
+
return new TypeError('Expected "array" but received "' + typeof obj_processRules + '" (at "' + path_processRules + '")');
|
|
1297
|
+
}
|
|
1298
|
+
for (let i = 0; i < obj_processRules.length; i++) {
|
|
1299
|
+
const obj_processRules_item = obj_processRules[i];
|
|
1300
|
+
const path_processRules_item = path_processRules + '[' + i + ']';
|
|
1301
|
+
const referencepath_processRules_itemValidationError = validate$n(obj_processRules_item, path_processRules_item);
|
|
1302
|
+
if (referencepath_processRules_itemValidationError !== null) {
|
|
1303
|
+
let message = 'Object doesn\'t match LoyaltyProgramProcessRuleRepresentation (at "' + path_processRules_item + '")\n';
|
|
1304
|
+
message += referencepath_processRules_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1305
|
+
return new TypeError(message);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
})();
|
|
1309
|
+
return v_error === undefined ? null : v_error;
|
|
1310
|
+
}
|
|
1311
|
+
const select$j = function TransactionJournalRepresentationSelect() {
|
|
1312
|
+
const { selections: SummaryRepresentation__selections, opaque: SummaryRepresentation__opaque, } = select$l();
|
|
1313
|
+
const { selections: LoyaltyProgramProcessRuleRepresentation__selections, opaque: LoyaltyProgramProcessRuleRepresentation__opaque, } = select$k();
|
|
1314
|
+
return {
|
|
1315
|
+
kind: 'Fragment',
|
|
1316
|
+
version: VERSION$e,
|
|
1317
|
+
private: [],
|
|
1318
|
+
selections: [
|
|
1319
|
+
{
|
|
1320
|
+
name: 'executionSummary',
|
|
1321
|
+
kind: 'Object',
|
|
1322
|
+
selections: SummaryRepresentation__selections
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
name: 'processId',
|
|
1326
|
+
kind: 'Scalar'
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
name: 'processName',
|
|
1330
|
+
kind: 'Scalar'
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
name: 'processRules',
|
|
1334
|
+
kind: 'Object',
|
|
1335
|
+
plural: true,
|
|
1336
|
+
selections: LoyaltyProgramProcessRuleRepresentation__selections
|
|
1337
|
+
}
|
|
1338
|
+
]
|
|
1339
|
+
};
|
|
1340
|
+
};
|
|
1341
|
+
function equals$e(existing, incoming) {
|
|
1342
|
+
const existing_processId = existing.processId;
|
|
1343
|
+
const incoming_processId = incoming.processId;
|
|
1344
|
+
if (!(existing_processId === incoming_processId)) {
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
const existing_processName = existing.processName;
|
|
1348
|
+
const incoming_processName = incoming.processName;
|
|
1349
|
+
if (!(existing_processName === incoming_processName)) {
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
const existing_executionSummary = existing.executionSummary;
|
|
1353
|
+
const incoming_executionSummary = incoming.executionSummary;
|
|
1354
|
+
if (!(equals$i(existing_executionSummary, incoming_executionSummary))) {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
const existing_processRules = existing.processRules;
|
|
1358
|
+
const incoming_processRules = incoming.processRules;
|
|
1359
|
+
const equals_processRules_items = equalsArray(existing_processRules, incoming_processRules, (existing_processRules_item, incoming_processRules_item) => {
|
|
1360
|
+
if (!(equals$f(existing_processRules_item, incoming_processRules_item))) {
|
|
1361
|
+
return false;
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
if (equals_processRules_items === false) {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
return true;
|
|
1368
|
+
}
|
|
1369
|
+
function deepFreeze$7(input) {
|
|
1370
|
+
const input_executionSummary = input.executionSummary;
|
|
1371
|
+
deepFreeze$b(input_executionSummary);
|
|
1372
|
+
const input_processRules = input.processRules;
|
|
1373
|
+
for (let i = 0; i < input_processRules.length; i++) {
|
|
1374
|
+
const input_processRules_item = input_processRules[i];
|
|
1375
|
+
deepFreeze$8(input_processRules_item);
|
|
1376
|
+
}
|
|
1377
|
+
ObjectFreeze(input_processRules);
|
|
1378
|
+
ObjectFreeze(input);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
const TTL$3 = 10000;
|
|
1382
|
+
const VERSION$d = "5778325029b2b9d33bea8a9da1b16b99";
|
|
1383
|
+
function validate$l(obj, path = 'LoyaltyExplainabilityOutputRepresentation') {
|
|
1384
|
+
const v_error = (() => {
|
|
1385
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1386
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1387
|
+
}
|
|
1388
|
+
const obj_message = obj.message;
|
|
1389
|
+
const path_message = path + '.message';
|
|
1390
|
+
let obj_message_union0 = null;
|
|
1391
|
+
const obj_message_union0_error = (() => {
|
|
1392
|
+
if (typeof obj_message !== 'string') {
|
|
1393
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1394
|
+
}
|
|
1395
|
+
})();
|
|
1396
|
+
if (obj_message_union0_error != null) {
|
|
1397
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
1398
|
+
}
|
|
1399
|
+
let obj_message_union1 = null;
|
|
1400
|
+
const obj_message_union1_error = (() => {
|
|
1401
|
+
if (obj_message !== null) {
|
|
1402
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1403
|
+
}
|
|
1404
|
+
})();
|
|
1405
|
+
if (obj_message_union1_error != null) {
|
|
1406
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
1407
|
+
}
|
|
1408
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
1409
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
1410
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1411
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1412
|
+
return new TypeError(message);
|
|
1413
|
+
}
|
|
1414
|
+
const obj_status = obj.status;
|
|
1415
|
+
const path_status = path + '.status';
|
|
1416
|
+
if (typeof obj_status !== 'boolean') {
|
|
1417
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1418
|
+
}
|
|
1419
|
+
const obj_transactionJournalResult = obj.transactionJournalResult;
|
|
1420
|
+
const path_transactionJournalResult = path + '.transactionJournalResult';
|
|
1421
|
+
let obj_transactionJournalResult_union0 = null;
|
|
1422
|
+
const obj_transactionJournalResult_union0_error = (() => {
|
|
1423
|
+
const referencepath_transactionJournalResultValidationError = validate$m(obj_transactionJournalResult, path_transactionJournalResult);
|
|
1424
|
+
if (referencepath_transactionJournalResultValidationError !== null) {
|
|
1425
|
+
let message = 'Object doesn\'t match TransactionJournalRepresentation (at "' + path_transactionJournalResult + '")\n';
|
|
1426
|
+
message += referencepath_transactionJournalResultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1427
|
+
return new TypeError(message);
|
|
1428
|
+
}
|
|
1429
|
+
})();
|
|
1430
|
+
if (obj_transactionJournalResult_union0_error != null) {
|
|
1431
|
+
obj_transactionJournalResult_union0 = obj_transactionJournalResult_union0_error.message;
|
|
1432
|
+
}
|
|
1433
|
+
let obj_transactionJournalResult_union1 = null;
|
|
1434
|
+
const obj_transactionJournalResult_union1_error = (() => {
|
|
1435
|
+
if (obj_transactionJournalResult !== null) {
|
|
1436
|
+
return new TypeError('Expected "null" but received "' + typeof obj_transactionJournalResult + '" (at "' + path_transactionJournalResult + '")');
|
|
1437
|
+
}
|
|
1438
|
+
})();
|
|
1439
|
+
if (obj_transactionJournalResult_union1_error != null) {
|
|
1440
|
+
obj_transactionJournalResult_union1 = obj_transactionJournalResult_union1_error.message;
|
|
1441
|
+
}
|
|
1442
|
+
if (obj_transactionJournalResult_union0 && obj_transactionJournalResult_union1) {
|
|
1443
|
+
let message = 'Object doesn\'t match union (at "' + path_transactionJournalResult + '")';
|
|
1444
|
+
message += '\n' + obj_transactionJournalResult_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1445
|
+
message += '\n' + obj_transactionJournalResult_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1446
|
+
return new TypeError(message);
|
|
1447
|
+
}
|
|
1448
|
+
})();
|
|
1449
|
+
return v_error === undefined ? null : v_error;
|
|
1450
|
+
}
|
|
1451
|
+
const RepresentationType$3 = 'LoyaltyExplainabilityOutputRepresentation';
|
|
1452
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1453
|
+
return input;
|
|
1454
|
+
}
|
|
1455
|
+
const select$i = function LoyaltyExplainabilityOutputRepresentationSelect() {
|
|
1456
|
+
return {
|
|
1457
|
+
kind: 'Fragment',
|
|
1458
|
+
version: VERSION$d,
|
|
1459
|
+
private: [],
|
|
1460
|
+
opaque: true
|
|
1461
|
+
};
|
|
1462
|
+
};
|
|
1463
|
+
function equals$d(existing, incoming) {
|
|
1464
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1465
|
+
return false;
|
|
1466
|
+
}
|
|
1467
|
+
return true;
|
|
1468
|
+
}
|
|
1469
|
+
function deepFreeze$6(input) {
|
|
1470
|
+
const input_transactionJournalResult = input.transactionJournalResult;
|
|
1471
|
+
if (input_transactionJournalResult !== null && typeof input_transactionJournalResult === 'object') {
|
|
1472
|
+
deepFreeze$7(input_transactionJournalResult);
|
|
1473
|
+
}
|
|
1474
|
+
ObjectFreeze(input);
|
|
1475
|
+
}
|
|
1476
|
+
const ingest$3 = function LoyaltyExplainabilityOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1477
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1478
|
+
const validateError = validate$l(input);
|
|
1479
|
+
if (validateError !== null) {
|
|
1480
|
+
throw validateError;
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
const key = path.fullPath;
|
|
1484
|
+
const existingRecord = store.readEntry(key);
|
|
1485
|
+
const ttlToUse = TTL$3;
|
|
1486
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
1487
|
+
fullPath: key,
|
|
1488
|
+
parent: path.parent,
|
|
1489
|
+
propertyName: path.propertyName,
|
|
1490
|
+
ttl: ttlToUse
|
|
1491
|
+
});
|
|
1492
|
+
deepFreeze$6(input);
|
|
1493
|
+
if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
|
|
1494
|
+
luvio.storePublish(key, incomingRecord);
|
|
1495
|
+
}
|
|
1496
|
+
{
|
|
1497
|
+
const storeMetadataParams = {
|
|
1498
|
+
ttl: ttlToUse,
|
|
1499
|
+
namespace: "loyalty-engine",
|
|
1500
|
+
version: VERSION$d,
|
|
1501
|
+
representationName: RepresentationType$3,
|
|
1502
|
+
};
|
|
1503
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1504
|
+
}
|
|
1505
|
+
return createLink(key);
|
|
1506
|
+
};
|
|
1507
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
1508
|
+
const rootKeySet = new engine.StoreKeyMap();
|
|
1509
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1510
|
+
const rootKey = fullPathFactory();
|
|
1511
|
+
rootKeySet.set(rootKey, {
|
|
1512
|
+
namespace: keyPrefix,
|
|
1513
|
+
representationName: RepresentationType$3,
|
|
1514
|
+
mergeable: false
|
|
1515
|
+
});
|
|
1516
|
+
return rootKeySet;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
function select$h(luvio, params) {
|
|
1520
|
+
return select$i();
|
|
1521
|
+
}
|
|
1522
|
+
function keyBuilder$5(luvio, params) {
|
|
1523
|
+
return keyPrefix + '::LoyaltyExplainabilityOutputRepresentation:(' + 'journalId:' + params.urlParams.journalId + ')';
|
|
1524
|
+
}
|
|
1525
|
+
function getResponseCacheKeys$4(luvio, resourceParams, response) {
|
|
1526
|
+
return getTypeCacheKeys$3(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
1527
|
+
}
|
|
1528
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1529
|
+
const { body } = response;
|
|
1530
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
1531
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1532
|
+
const snapshot = luvio.storeLookup({
|
|
1533
|
+
recordId: key,
|
|
1534
|
+
node: select$h(),
|
|
1535
|
+
variables: {},
|
|
1536
|
+
}, snapshotRefresh);
|
|
1537
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1538
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1539
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
return snapshot;
|
|
1543
|
+
}
|
|
1544
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1545
|
+
const key = keyBuilder$5(luvio, params);
|
|
1546
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1547
|
+
const storeMetadataParams = {
|
|
1548
|
+
ttl: TTL$3,
|
|
1549
|
+
namespace: keyPrefix,
|
|
1550
|
+
version: VERSION$d,
|
|
1551
|
+
representationName: RepresentationType$3
|
|
1552
|
+
};
|
|
1553
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1554
|
+
return errorSnapshot;
|
|
1555
|
+
}
|
|
1556
|
+
function createResourceRequest$4(config) {
|
|
1557
|
+
const headers = {};
|
|
1558
|
+
return {
|
|
1559
|
+
baseUri: '/services/data/v58.0',
|
|
1560
|
+
basePath: '/connect/loyalty/program-process/transaction-journals/' + config.urlParams.journalId + '',
|
|
1561
|
+
method: 'get',
|
|
1562
|
+
body: null,
|
|
1563
|
+
urlParams: config.urlParams,
|
|
1564
|
+
queryParams: {},
|
|
1565
|
+
headers,
|
|
1566
|
+
priority: 'normal',
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
const getJournalExplainabilityInfo_ConfigPropertyNames = {
|
|
1571
|
+
displayName: 'getJournalExplainabilityInfo',
|
|
1572
|
+
parameters: {
|
|
1573
|
+
required: ['journalId'],
|
|
1574
|
+
optional: []
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
function createResourceParams$4(config) {
|
|
1578
|
+
const resourceParams = {
|
|
1579
|
+
urlParams: {
|
|
1580
|
+
journalId: config.journalId
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
return resourceParams;
|
|
1584
|
+
}
|
|
1585
|
+
function keyBuilder$4(luvio, config) {
|
|
1586
|
+
const resourceParams = createResourceParams$4(config);
|
|
1587
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
1588
|
+
}
|
|
1589
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1590
|
+
const config = {};
|
|
1591
|
+
const untrustedConfig_journalId = untrustedConfig.journalId;
|
|
1592
|
+
if (typeof untrustedConfig_journalId === 'string') {
|
|
1593
|
+
config.journalId = untrustedConfig_journalId;
|
|
1594
|
+
}
|
|
1595
|
+
return config;
|
|
1596
|
+
}
|
|
1597
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1598
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1599
|
+
return null;
|
|
1600
|
+
}
|
|
1601
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1602
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1603
|
+
}
|
|
1604
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1605
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1606
|
+
return null;
|
|
1607
|
+
}
|
|
1608
|
+
return config;
|
|
1609
|
+
}
|
|
1610
|
+
function adapterFragment$1(luvio, config) {
|
|
1611
|
+
createResourceParams$4(config);
|
|
1612
|
+
return select$h();
|
|
1613
|
+
}
|
|
1614
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1615
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1616
|
+
config,
|
|
1617
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1618
|
+
});
|
|
1619
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1620
|
+
}
|
|
1621
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1622
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1623
|
+
config,
|
|
1624
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1625
|
+
});
|
|
1626
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1627
|
+
}
|
|
1628
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1629
|
+
const resourceParams = createResourceParams$4(config);
|
|
1630
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1631
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1632
|
+
.then((response) => {
|
|
1633
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
|
|
1634
|
+
}, (response) => {
|
|
1635
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1639
|
+
const { luvio, config } = context;
|
|
1640
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1641
|
+
const dispatchOptions = {
|
|
1642
|
+
resourceRequestContext: {
|
|
1643
|
+
requestCorrelator,
|
|
1644
|
+
luvioRequestMethod: undefined,
|
|
1645
|
+
},
|
|
1646
|
+
eventObservers
|
|
1647
|
+
};
|
|
1648
|
+
if (networkPriority !== 'normal') {
|
|
1649
|
+
dispatchOptions.overrides = {
|
|
1650
|
+
priority: networkPriority
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
|
|
1654
|
+
}
|
|
1655
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1656
|
+
const { luvio, config } = context;
|
|
1657
|
+
const selector = {
|
|
1658
|
+
recordId: keyBuilder$4(luvio, config),
|
|
1659
|
+
node: adapterFragment$1(luvio, config),
|
|
1660
|
+
variables: {},
|
|
1661
|
+
};
|
|
1662
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1663
|
+
config,
|
|
1664
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1665
|
+
});
|
|
1666
|
+
return cacheSnapshot;
|
|
1667
|
+
}
|
|
1668
|
+
const getJournalExplainabilityInfoAdapterFactory = (luvio) => function loyaltyEngine__getJournalExplainabilityInfo(untrustedConfig, requestContext) {
|
|
1669
|
+
const config = validateAdapterConfig$4(untrustedConfig, getJournalExplainabilityInfo_ConfigPropertyNames);
|
|
1670
|
+
// Invalid or incomplete config
|
|
1671
|
+
if (config === null) {
|
|
1672
|
+
return null;
|
|
1673
|
+
}
|
|
1674
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1675
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
function validate$k(obj, path = 'ProcessRuleInputRepresentation') {
|
|
1679
|
+
const v_error = (() => {
|
|
1680
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1681
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1682
|
+
}
|
|
1683
|
+
const obj_actions = obj.actions;
|
|
1684
|
+
const path_actions = path + '.actions';
|
|
1685
|
+
if (!ArrayIsArray(obj_actions)) {
|
|
1686
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actions + '" (at "' + path_actions + '")');
|
|
1687
|
+
}
|
|
1688
|
+
for (let i = 0; i < obj_actions.length; i++) {
|
|
1689
|
+
const obj_actions_item = obj_actions[i];
|
|
1690
|
+
const path_actions_item = path_actions + '[' + i + ']';
|
|
1691
|
+
if (typeof obj_actions_item !== 'object' || ArrayIsArray(obj_actions_item) || obj_actions_item === null) {
|
|
1692
|
+
return new TypeError('Expected "object" but received "' + typeof obj_actions_item + '" (at "' + path_actions_item + '")');
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
const obj_conditions = obj.conditions;
|
|
1696
|
+
const path_conditions = path + '.conditions';
|
|
1697
|
+
if (!ArrayIsArray(obj_conditions)) {
|
|
1698
|
+
return new TypeError('Expected "array" but received "' + typeof obj_conditions + '" (at "' + path_conditions + '")');
|
|
1699
|
+
}
|
|
1700
|
+
for (let i = 0; i < obj_conditions.length; i++) {
|
|
1701
|
+
const obj_conditions_item = obj_conditions[i];
|
|
1702
|
+
const path_conditions_item = path_conditions + '[' + i + ']';
|
|
1703
|
+
if (typeof obj_conditions_item !== 'object' || ArrayIsArray(obj_conditions_item) || obj_conditions_item === null) {
|
|
1704
|
+
return new TypeError('Expected "object" but received "' + typeof obj_conditions_item + '" (at "' + path_conditions_item + '")');
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
const obj_description = obj.description;
|
|
1708
|
+
const path_description = path + '.description';
|
|
1709
|
+
if (typeof obj_description !== 'string') {
|
|
1710
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1711
|
+
}
|
|
1712
|
+
if (obj.endDate !== undefined) {
|
|
1713
|
+
const obj_endDate = obj.endDate;
|
|
1714
|
+
const path_endDate = path + '.endDate';
|
|
1715
|
+
let obj_endDate_union0 = null;
|
|
1716
|
+
const obj_endDate_union0_error = (() => {
|
|
1717
|
+
if (typeof obj_endDate !== 'string') {
|
|
1718
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
1719
|
+
}
|
|
1720
|
+
})();
|
|
1721
|
+
if (obj_endDate_union0_error != null) {
|
|
1722
|
+
obj_endDate_union0 = obj_endDate_union0_error.message;
|
|
1723
|
+
}
|
|
1724
|
+
let obj_endDate_union1 = null;
|
|
1725
|
+
const obj_endDate_union1_error = (() => {
|
|
1726
|
+
if (obj_endDate !== null) {
|
|
1727
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
1728
|
+
}
|
|
1729
|
+
})();
|
|
1730
|
+
if (obj_endDate_union1_error != null) {
|
|
1731
|
+
obj_endDate_union1 = obj_endDate_union1_error.message;
|
|
1732
|
+
}
|
|
1733
|
+
if (obj_endDate_union0 && obj_endDate_union1) {
|
|
1734
|
+
let message = 'Object doesn\'t match union (at "' + path_endDate + '")';
|
|
1735
|
+
message += '\n' + obj_endDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1736
|
+
message += '\n' + obj_endDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1737
|
+
return new TypeError(message);
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
const obj_name = obj.name;
|
|
1741
|
+
const path_name = path + '.name';
|
|
1742
|
+
if (typeof obj_name !== 'string') {
|
|
1743
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1744
|
+
}
|
|
1745
|
+
const obj_previousRuleId = obj.previousRuleId;
|
|
1746
|
+
const path_previousRuleId = path + '.previousRuleId';
|
|
1747
|
+
if (typeof obj_previousRuleId !== 'string') {
|
|
1748
|
+
return new TypeError('Expected "string" but received "' + typeof obj_previousRuleId + '" (at "' + path_previousRuleId + '")');
|
|
1749
|
+
}
|
|
1750
|
+
if (obj.promotionId !== undefined) {
|
|
1751
|
+
const obj_promotionId = obj.promotionId;
|
|
1752
|
+
const path_promotionId = path + '.promotionId';
|
|
1753
|
+
if (typeof obj_promotionId !== 'string') {
|
|
1754
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
const obj_startDate = obj.startDate;
|
|
1758
|
+
const path_startDate = path + '.startDate';
|
|
1759
|
+
if (typeof obj_startDate !== 'string') {
|
|
1760
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
1761
|
+
}
|
|
1762
|
+
const obj_status = obj.status;
|
|
1763
|
+
const path_status = path + '.status';
|
|
1764
|
+
if (typeof obj_status !== 'string') {
|
|
1765
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1766
|
+
}
|
|
1767
|
+
const obj_stepMappings = obj.stepMappings;
|
|
1768
|
+
const path_stepMappings = path + '.stepMappings';
|
|
1769
|
+
if (!ArrayIsArray(obj_stepMappings)) {
|
|
1770
|
+
return new TypeError('Expected "array" but received "' + typeof obj_stepMappings + '" (at "' + path_stepMappings + '")');
|
|
1771
|
+
}
|
|
1772
|
+
for (let i = 0; i < obj_stepMappings.length; i++) {
|
|
1773
|
+
const obj_stepMappings_item = obj_stepMappings[i];
|
|
1774
|
+
const path_stepMappings_item = path_stepMappings + '[' + i + ']';
|
|
1775
|
+
if (typeof obj_stepMappings_item !== 'object' || ArrayIsArray(obj_stepMappings_item) || obj_stepMappings_item === null) {
|
|
1776
|
+
return new TypeError('Expected "object" but received "' + typeof obj_stepMappings_item + '" (at "' + path_stepMappings_item + '")');
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
})();
|
|
1780
|
+
return v_error === undefined ? null : v_error;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
const VERSION$c = "4c335cae0d36875f624a306e46b95127";
|
|
1784
|
+
function validate$j(obj, path = 'ProcessRuleErrorRepresentation') {
|
|
1785
|
+
const v_error = (() => {
|
|
1786
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1787
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1788
|
+
}
|
|
1789
|
+
const obj_criteriaSequence = obj.criteriaSequence;
|
|
1790
|
+
const path_criteriaSequence = path + '.criteriaSequence';
|
|
1791
|
+
let obj_criteriaSequence_union0 = null;
|
|
1792
|
+
const obj_criteriaSequence_union0_error = (() => {
|
|
1793
|
+
if (typeof obj_criteriaSequence !== 'number' || (typeof obj_criteriaSequence === 'number' && Math.floor(obj_criteriaSequence) !== obj_criteriaSequence)) {
|
|
1794
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_criteriaSequence + '" (at "' + path_criteriaSequence + '")');
|
|
1795
|
+
}
|
|
1796
|
+
})();
|
|
1797
|
+
if (obj_criteriaSequence_union0_error != null) {
|
|
1798
|
+
obj_criteriaSequence_union0 = obj_criteriaSequence_union0_error.message;
|
|
1799
|
+
}
|
|
1800
|
+
let obj_criteriaSequence_union1 = null;
|
|
1801
|
+
const obj_criteriaSequence_union1_error = (() => {
|
|
1802
|
+
if (obj_criteriaSequence !== null) {
|
|
1803
|
+
return new TypeError('Expected "null" but received "' + typeof obj_criteriaSequence + '" (at "' + path_criteriaSequence + '")');
|
|
1804
|
+
}
|
|
1805
|
+
})();
|
|
1806
|
+
if (obj_criteriaSequence_union1_error != null) {
|
|
1807
|
+
obj_criteriaSequence_union1 = obj_criteriaSequence_union1_error.message;
|
|
1808
|
+
}
|
|
1809
|
+
if (obj_criteriaSequence_union0 && obj_criteriaSequence_union1) {
|
|
1810
|
+
let message = 'Object doesn\'t match union (at "' + path_criteriaSequence + '")';
|
|
1811
|
+
message += '\n' + obj_criteriaSequence_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1812
|
+
message += '\n' + obj_criteriaSequence_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1813
|
+
return new TypeError(message);
|
|
1814
|
+
}
|
|
1815
|
+
const obj_error = obj.error;
|
|
1816
|
+
const path_error = path + '.error';
|
|
1817
|
+
if (typeof obj_error !== 'string') {
|
|
1818
|
+
return new TypeError('Expected "string" but received "' + typeof obj_error + '" (at "' + path_error + '")');
|
|
1819
|
+
}
|
|
1820
|
+
const obj_fieldName = obj.fieldName;
|
|
1821
|
+
const path_fieldName = path + '.fieldName';
|
|
1822
|
+
let obj_fieldName_union0 = null;
|
|
1823
|
+
const obj_fieldName_union0_error = (() => {
|
|
1824
|
+
if (typeof obj_fieldName !== 'string') {
|
|
1825
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
1826
|
+
}
|
|
1827
|
+
})();
|
|
1828
|
+
if (obj_fieldName_union0_error != null) {
|
|
1829
|
+
obj_fieldName_union0 = obj_fieldName_union0_error.message;
|
|
1830
|
+
}
|
|
1831
|
+
let obj_fieldName_union1 = null;
|
|
1832
|
+
const obj_fieldName_union1_error = (() => {
|
|
1833
|
+
if (obj_fieldName !== null) {
|
|
1834
|
+
return new TypeError('Expected "null" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
1835
|
+
}
|
|
1836
|
+
})();
|
|
1837
|
+
if (obj_fieldName_union1_error != null) {
|
|
1838
|
+
obj_fieldName_union1 = obj_fieldName_union1_error.message;
|
|
1839
|
+
}
|
|
1840
|
+
if (obj_fieldName_union0 && obj_fieldName_union1) {
|
|
1841
|
+
let message = 'Object doesn\'t match union (at "' + path_fieldName + '")';
|
|
1842
|
+
message += '\n' + obj_fieldName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1843
|
+
message += '\n' + obj_fieldName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1844
|
+
return new TypeError(message);
|
|
1845
|
+
}
|
|
1846
|
+
const obj_resource = obj.resource;
|
|
1847
|
+
const path_resource = path + '.resource';
|
|
1848
|
+
if (typeof obj_resource !== 'string') {
|
|
1849
|
+
return new TypeError('Expected "string" but received "' + typeof obj_resource + '" (at "' + path_resource + '")');
|
|
1850
|
+
}
|
|
1851
|
+
const obj_stepName = obj.stepName;
|
|
1852
|
+
const path_stepName = path + '.stepName';
|
|
1853
|
+
let obj_stepName_union0 = null;
|
|
1854
|
+
const obj_stepName_union0_error = (() => {
|
|
1855
|
+
if (typeof obj_stepName !== 'string') {
|
|
1856
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
|
|
1857
|
+
}
|
|
1858
|
+
})();
|
|
1859
|
+
if (obj_stepName_union0_error != null) {
|
|
1860
|
+
obj_stepName_union0 = obj_stepName_union0_error.message;
|
|
1861
|
+
}
|
|
1862
|
+
let obj_stepName_union1 = null;
|
|
1863
|
+
const obj_stepName_union1_error = (() => {
|
|
1864
|
+
if (obj_stepName !== null) {
|
|
1865
|
+
return new TypeError('Expected "null" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
|
|
1866
|
+
}
|
|
1867
|
+
})();
|
|
1868
|
+
if (obj_stepName_union1_error != null) {
|
|
1869
|
+
obj_stepName_union1 = obj_stepName_union1_error.message;
|
|
1870
|
+
}
|
|
1871
|
+
if (obj_stepName_union0 && obj_stepName_union1) {
|
|
1872
|
+
let message = 'Object doesn\'t match union (at "' + path_stepName + '")';
|
|
1873
|
+
message += '\n' + obj_stepName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1874
|
+
message += '\n' + obj_stepName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1875
|
+
return new TypeError(message);
|
|
1876
|
+
}
|
|
1877
|
+
})();
|
|
1878
|
+
return v_error === undefined ? null : v_error;
|
|
1879
|
+
}
|
|
1880
|
+
const select$g = function ProcessRuleErrorRepresentationSelect() {
|
|
1881
|
+
return {
|
|
1882
|
+
kind: 'Fragment',
|
|
1883
|
+
version: VERSION$c,
|
|
1884
|
+
private: [],
|
|
1885
|
+
selections: [
|
|
1886
|
+
{
|
|
1887
|
+
name: 'criteriaSequence',
|
|
1888
|
+
kind: 'Scalar'
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
name: 'error',
|
|
1892
|
+
kind: 'Scalar'
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
name: 'fieldName',
|
|
1896
|
+
kind: 'Scalar'
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
name: 'resource',
|
|
1900
|
+
kind: 'Scalar'
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
name: 'stepName',
|
|
1904
|
+
kind: 'Scalar'
|
|
1905
|
+
}
|
|
1906
|
+
]
|
|
1907
|
+
};
|
|
1908
|
+
};
|
|
1909
|
+
function equals$c(existing, incoming) {
|
|
1910
|
+
const existing_error = existing.error;
|
|
1911
|
+
const incoming_error = incoming.error;
|
|
1912
|
+
if (!(existing_error === incoming_error)) {
|
|
1913
|
+
return false;
|
|
1914
|
+
}
|
|
1915
|
+
const existing_resource = existing.resource;
|
|
1916
|
+
const incoming_resource = incoming.resource;
|
|
1917
|
+
if (!(existing_resource === incoming_resource)) {
|
|
1918
|
+
return false;
|
|
1919
|
+
}
|
|
1920
|
+
const existing_criteriaSequence = existing.criteriaSequence;
|
|
1921
|
+
const incoming_criteriaSequence = incoming.criteriaSequence;
|
|
1922
|
+
if (!(existing_criteriaSequence === incoming_criteriaSequence)) {
|
|
1923
|
+
return false;
|
|
1924
|
+
}
|
|
1925
|
+
const existing_fieldName = existing.fieldName;
|
|
1926
|
+
const incoming_fieldName = incoming.fieldName;
|
|
1927
|
+
if (!(existing_fieldName === incoming_fieldName)) {
|
|
1928
|
+
return false;
|
|
1929
|
+
}
|
|
1930
|
+
const existing_stepName = existing.stepName;
|
|
1931
|
+
const incoming_stepName = incoming.stepName;
|
|
1932
|
+
if (!(existing_stepName === incoming_stepName)) {
|
|
1933
|
+
return false;
|
|
1934
|
+
}
|
|
1935
|
+
return true;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
const TTL$2 = 10000;
|
|
1939
|
+
const VERSION$b = "def3b2fb07871a4b3e8a02fe7d66f0c1";
|
|
1940
|
+
function validate$i(obj, path = 'ProcessRuleStatusRepresentation') {
|
|
1941
|
+
const v_error = (() => {
|
|
1942
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1943
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1944
|
+
}
|
|
1945
|
+
const obj_errors = obj.errors;
|
|
1946
|
+
const path_errors = path + '.errors';
|
|
1947
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
1948
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
1949
|
+
}
|
|
1950
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
1951
|
+
const obj_errors_item = obj_errors[i];
|
|
1952
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
1953
|
+
const referencepath_errors_itemValidationError = validate$j(obj_errors_item, path_errors_item);
|
|
1954
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
1955
|
+
let message = 'Object doesn\'t match ProcessRuleErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
1956
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1957
|
+
return new TypeError(message);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
const obj_message = obj.message;
|
|
1961
|
+
const path_message = path + '.message';
|
|
1962
|
+
let obj_message_union0 = null;
|
|
1963
|
+
const obj_message_union0_error = (() => {
|
|
1964
|
+
if (typeof obj_message !== 'string') {
|
|
1965
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1966
|
+
}
|
|
1967
|
+
})();
|
|
1968
|
+
if (obj_message_union0_error != null) {
|
|
1969
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
1970
|
+
}
|
|
1971
|
+
let obj_message_union1 = null;
|
|
1972
|
+
const obj_message_union1_error = (() => {
|
|
1973
|
+
if (obj_message !== null) {
|
|
1974
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1975
|
+
}
|
|
1976
|
+
})();
|
|
1977
|
+
if (obj_message_union1_error != null) {
|
|
1978
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
1979
|
+
}
|
|
1980
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
1981
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
1982
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1983
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1984
|
+
return new TypeError(message);
|
|
1985
|
+
}
|
|
1986
|
+
const obj_ruleId = obj.ruleId;
|
|
1987
|
+
const path_ruleId = path + '.ruleId';
|
|
1988
|
+
let obj_ruleId_union0 = null;
|
|
1989
|
+
const obj_ruleId_union0_error = (() => {
|
|
1990
|
+
if (typeof obj_ruleId !== 'string') {
|
|
1991
|
+
return new TypeError('Expected "string" but received "' + typeof obj_ruleId + '" (at "' + path_ruleId + '")');
|
|
1992
|
+
}
|
|
1993
|
+
})();
|
|
1994
|
+
if (obj_ruleId_union0_error != null) {
|
|
1995
|
+
obj_ruleId_union0 = obj_ruleId_union0_error.message;
|
|
1996
|
+
}
|
|
1997
|
+
let obj_ruleId_union1 = null;
|
|
1998
|
+
const obj_ruleId_union1_error = (() => {
|
|
1999
|
+
if (obj_ruleId !== null) {
|
|
2000
|
+
return new TypeError('Expected "null" but received "' + typeof obj_ruleId + '" (at "' + path_ruleId + '")');
|
|
2001
|
+
}
|
|
2002
|
+
})();
|
|
2003
|
+
if (obj_ruleId_union1_error != null) {
|
|
2004
|
+
obj_ruleId_union1 = obj_ruleId_union1_error.message;
|
|
2005
|
+
}
|
|
2006
|
+
if (obj_ruleId_union0 && obj_ruleId_union1) {
|
|
2007
|
+
let message = 'Object doesn\'t match union (at "' + path_ruleId + '")';
|
|
2008
|
+
message += '\n' + obj_ruleId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2009
|
+
message += '\n' + obj_ruleId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2010
|
+
return new TypeError(message);
|
|
2011
|
+
}
|
|
2012
|
+
const obj_status = obj.status;
|
|
2013
|
+
const path_status = path + '.status';
|
|
2014
|
+
let obj_status_union0 = null;
|
|
2015
|
+
const obj_status_union0_error = (() => {
|
|
2016
|
+
if (typeof obj_status !== 'string') {
|
|
2017
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2018
|
+
}
|
|
2019
|
+
})();
|
|
2020
|
+
if (obj_status_union0_error != null) {
|
|
2021
|
+
obj_status_union0 = obj_status_union0_error.message;
|
|
2022
|
+
}
|
|
2023
|
+
let obj_status_union1 = null;
|
|
2024
|
+
const obj_status_union1_error = (() => {
|
|
2025
|
+
if (obj_status !== null) {
|
|
2026
|
+
return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2027
|
+
}
|
|
2028
|
+
})();
|
|
2029
|
+
if (obj_status_union1_error != null) {
|
|
2030
|
+
obj_status_union1 = obj_status_union1_error.message;
|
|
2031
|
+
}
|
|
2032
|
+
if (obj_status_union0 && obj_status_union1) {
|
|
2033
|
+
let message = 'Object doesn\'t match union (at "' + path_status + '")';
|
|
2034
|
+
message += '\n' + obj_status_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2035
|
+
message += '\n' + obj_status_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2036
|
+
return new TypeError(message);
|
|
2037
|
+
}
|
|
2038
|
+
})();
|
|
2039
|
+
return v_error === undefined ? null : v_error;
|
|
2040
|
+
}
|
|
2041
|
+
const RepresentationType$2 = 'ProcessRuleStatusRepresentation';
|
|
2042
|
+
function keyBuilder$3(luvio, config) {
|
|
2043
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + (config.id === null ? '' : config.id);
|
|
2044
|
+
}
|
|
2045
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
2046
|
+
const keyParams = {
|
|
2047
|
+
id: object.ruleId
|
|
2048
|
+
};
|
|
2049
|
+
return keyBuilder$3(luvio, keyParams);
|
|
2050
|
+
}
|
|
2051
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2052
|
+
return input;
|
|
2053
|
+
}
|
|
2054
|
+
const select$f = function ProcessRuleStatusRepresentationSelect() {
|
|
2055
|
+
const { selections: ProcessRuleErrorRepresentation__selections, opaque: ProcessRuleErrorRepresentation__opaque, } = select$g();
|
|
2056
|
+
return {
|
|
2057
|
+
kind: 'Fragment',
|
|
2058
|
+
version: VERSION$b,
|
|
2059
|
+
private: [],
|
|
2060
|
+
selections: [
|
|
2061
|
+
{
|
|
2062
|
+
name: 'errors',
|
|
2063
|
+
kind: 'Object',
|
|
2064
|
+
plural: true,
|
|
2065
|
+
selections: ProcessRuleErrorRepresentation__selections
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
name: 'message',
|
|
2069
|
+
kind: 'Scalar'
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
name: 'ruleId',
|
|
2073
|
+
kind: 'Scalar'
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
name: 'status',
|
|
2077
|
+
kind: 'Scalar'
|
|
2078
|
+
}
|
|
2079
|
+
]
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
function equals$b(existing, incoming) {
|
|
2083
|
+
const existing_errors = existing.errors;
|
|
2084
|
+
const incoming_errors = incoming.errors;
|
|
2085
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
2086
|
+
if (!(equals$c(existing_errors_item, incoming_errors_item))) {
|
|
2087
|
+
return false;
|
|
2088
|
+
}
|
|
2089
|
+
});
|
|
2090
|
+
if (equals_errors_items === false) {
|
|
2091
|
+
return false;
|
|
2092
|
+
}
|
|
2093
|
+
const existing_message = existing.message;
|
|
2094
|
+
const incoming_message = incoming.message;
|
|
2095
|
+
if (!(existing_message === incoming_message)) {
|
|
2096
|
+
return false;
|
|
2097
|
+
}
|
|
2098
|
+
const existing_ruleId = existing.ruleId;
|
|
2099
|
+
const incoming_ruleId = incoming.ruleId;
|
|
2100
|
+
if (!(existing_ruleId === incoming_ruleId)) {
|
|
2101
|
+
return false;
|
|
2102
|
+
}
|
|
2103
|
+
const existing_status = existing.status;
|
|
2104
|
+
const incoming_status = incoming.status;
|
|
2105
|
+
if (!(existing_status === incoming_status)) {
|
|
2106
|
+
return false;
|
|
2107
|
+
}
|
|
2108
|
+
return true;
|
|
2109
|
+
}
|
|
2110
|
+
const ingest$2 = function ProcessRuleStatusRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2111
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2112
|
+
const validateError = validate$i(input);
|
|
2113
|
+
if (validateError !== null) {
|
|
2114
|
+
throw validateError;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
2118
|
+
const existingRecord = store.readEntry(key);
|
|
2119
|
+
const ttlToUse = TTL$2;
|
|
2120
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
2121
|
+
fullPath: key,
|
|
2122
|
+
parent: path.parent,
|
|
2123
|
+
propertyName: path.propertyName,
|
|
2124
|
+
ttl: ttlToUse
|
|
2125
|
+
});
|
|
2126
|
+
if (existingRecord === undefined || equals$b(existingRecord, incomingRecord) === false) {
|
|
2127
|
+
luvio.storePublish(key, incomingRecord);
|
|
2128
|
+
}
|
|
2129
|
+
{
|
|
2130
|
+
const storeMetadataParams = {
|
|
2131
|
+
ttl: ttlToUse,
|
|
2132
|
+
namespace: "loyalty-engine",
|
|
2133
|
+
version: VERSION$b,
|
|
2134
|
+
representationName: RepresentationType$2,
|
|
2135
|
+
};
|
|
2136
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2137
|
+
}
|
|
2138
|
+
return createLink(key);
|
|
2139
|
+
};
|
|
2140
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
2141
|
+
const rootKeySet = new engine.StoreKeyMap();
|
|
2142
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2143
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
2144
|
+
rootKeySet.set(rootKey, {
|
|
2145
|
+
namespace: keyPrefix,
|
|
2146
|
+
representationName: RepresentationType$2,
|
|
2147
|
+
mergeable: false
|
|
2148
|
+
});
|
|
2149
|
+
return rootKeySet;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
function select$e(luvio, params) {
|
|
2153
|
+
return select$f();
|
|
2154
|
+
}
|
|
2155
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
2156
|
+
return getTypeCacheKeys$2(luvio, response);
|
|
2157
|
+
}
|
|
2158
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
2159
|
+
const { body } = response;
|
|
2160
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
2161
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2162
|
+
const snapshot = luvio.storeLookup({
|
|
2163
|
+
recordId: key,
|
|
2164
|
+
node: select$e(),
|
|
2165
|
+
variables: {},
|
|
2166
|
+
});
|
|
2167
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2168
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2169
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
return snapshot;
|
|
2173
|
+
}
|
|
2174
|
+
function createResourceRequest$3(config) {
|
|
2175
|
+
const headers = {};
|
|
2176
|
+
return {
|
|
2177
|
+
baseUri: '/services/data/v58.0',
|
|
2178
|
+
basePath: '/connect/loyalty/programs/' + config.urlParams.programName + '/processes/' + config.urlParams.processName + '',
|
|
2179
|
+
method: 'put',
|
|
2180
|
+
body: config.body,
|
|
2181
|
+
urlParams: config.urlParams,
|
|
2182
|
+
queryParams: {},
|
|
2183
|
+
headers,
|
|
2184
|
+
priority: 'normal',
|
|
2185
|
+
};
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
const createProgramProcessRule_ConfigPropertyNames = {
|
|
2189
|
+
displayName: 'createProgramProcessRule',
|
|
2190
|
+
parameters: {
|
|
2191
|
+
required: ['processName', 'programName', 'programProcessRule'],
|
|
2192
|
+
optional: []
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
function createResourceParams$3(config) {
|
|
2196
|
+
const resourceParams = {
|
|
2197
|
+
urlParams: {
|
|
2198
|
+
processName: config.processName, programName: config.programName
|
|
2199
|
+
},
|
|
2200
|
+
body: {
|
|
2201
|
+
programProcessRule: config.programProcessRule
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
return resourceParams;
|
|
2205
|
+
}
|
|
2206
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2207
|
+
const config = {};
|
|
2208
|
+
const untrustedConfig_processName = untrustedConfig.processName;
|
|
2209
|
+
if (typeof untrustedConfig_processName === 'string') {
|
|
2210
|
+
config.processName = untrustedConfig_processName;
|
|
2211
|
+
}
|
|
2212
|
+
const untrustedConfig_programName = untrustedConfig.programName;
|
|
2213
|
+
if (typeof untrustedConfig_programName === 'string') {
|
|
2214
|
+
config.programName = untrustedConfig_programName;
|
|
2215
|
+
}
|
|
2216
|
+
const untrustedConfig_programProcessRule = untrustedConfig.programProcessRule;
|
|
2217
|
+
const referenceProcessRuleInputRepresentationValidationError = validate$k(untrustedConfig_programProcessRule);
|
|
2218
|
+
if (referenceProcessRuleInputRepresentationValidationError === null) {
|
|
2219
|
+
config.programProcessRule = untrustedConfig_programProcessRule;
|
|
2220
|
+
}
|
|
2221
|
+
return config;
|
|
2222
|
+
}
|
|
2223
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2224
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2225
|
+
return null;
|
|
2226
|
+
}
|
|
2227
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2228
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2229
|
+
}
|
|
2230
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2231
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2232
|
+
return null;
|
|
2233
|
+
}
|
|
2234
|
+
return config;
|
|
2235
|
+
}
|
|
2236
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2237
|
+
const resourceParams = createResourceParams$3(config);
|
|
2238
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2239
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2240
|
+
.then((response) => {
|
|
2241
|
+
return luvio.handleSuccessResponse(() => {
|
|
2242
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
2243
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2244
|
+
}, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
2245
|
+
}, (response) => {
|
|
2246
|
+
deepFreeze$d(response);
|
|
2247
|
+
throw response;
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2250
|
+
const createProgramProcessRuleAdapterFactory = (luvio) => {
|
|
2251
|
+
return function createProgramProcessRule(untrustedConfig) {
|
|
2252
|
+
const config = validateAdapterConfig$3(untrustedConfig, createProgramProcessRule_ConfigPropertyNames);
|
|
2253
|
+
// Invalid or incomplete config
|
|
2254
|
+
if (config === null) {
|
|
2255
|
+
throw new Error('Invalid config for "createProgramProcessRule"');
|
|
2256
|
+
}
|
|
2257
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2258
|
+
};
|
|
2259
|
+
};
|
|
2260
|
+
|
|
2261
|
+
function validate$h(obj, path = 'ProcessRuleActionParameterRepresentation') {
|
|
2262
|
+
const v_error = (() => {
|
|
2263
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2264
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2265
|
+
}
|
|
2266
|
+
const obj_name = obj.name;
|
|
2267
|
+
const path_name = path + '.name';
|
|
2268
|
+
if (typeof obj_name !== 'string') {
|
|
2269
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2270
|
+
}
|
|
2271
|
+
if (obj.operator !== undefined) {
|
|
2272
|
+
const obj_operator = obj.operator;
|
|
2273
|
+
const path_operator = path + '.operator';
|
|
2274
|
+
let obj_operator_union0 = null;
|
|
2275
|
+
const obj_operator_union0_error = (() => {
|
|
2276
|
+
if (typeof obj_operator !== 'string') {
|
|
2277
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
2278
|
+
}
|
|
2279
|
+
})();
|
|
2280
|
+
if (obj_operator_union0_error != null) {
|
|
2281
|
+
obj_operator_union0 = obj_operator_union0_error.message;
|
|
2282
|
+
}
|
|
2283
|
+
let obj_operator_union1 = null;
|
|
2284
|
+
const obj_operator_union1_error = (() => {
|
|
2285
|
+
if (obj_operator !== null) {
|
|
2286
|
+
return new TypeError('Expected "null" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
2287
|
+
}
|
|
2288
|
+
})();
|
|
2289
|
+
if (obj_operator_union1_error != null) {
|
|
2290
|
+
obj_operator_union1 = obj_operator_union1_error.message;
|
|
2291
|
+
}
|
|
2292
|
+
if (obj_operator_union0 && obj_operator_union1) {
|
|
2293
|
+
let message = 'Object doesn\'t match union (at "' + path_operator + '")';
|
|
2294
|
+
message += '\n' + obj_operator_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2295
|
+
message += '\n' + obj_operator_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2296
|
+
return new TypeError(message);
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
if (obj.sequenceNumber !== undefined) {
|
|
2300
|
+
const obj_sequenceNumber = obj.sequenceNumber;
|
|
2301
|
+
const path_sequenceNumber = path + '.sequenceNumber';
|
|
2302
|
+
let obj_sequenceNumber_union0 = null;
|
|
2303
|
+
const obj_sequenceNumber_union0_error = (() => {
|
|
2304
|
+
if (typeof obj_sequenceNumber !== 'number' || (typeof obj_sequenceNumber === 'number' && Math.floor(obj_sequenceNumber) !== obj_sequenceNumber)) {
|
|
2305
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
|
|
2306
|
+
}
|
|
2307
|
+
})();
|
|
2308
|
+
if (obj_sequenceNumber_union0_error != null) {
|
|
2309
|
+
obj_sequenceNumber_union0 = obj_sequenceNumber_union0_error.message;
|
|
2310
|
+
}
|
|
2311
|
+
let obj_sequenceNumber_union1 = null;
|
|
2312
|
+
const obj_sequenceNumber_union1_error = (() => {
|
|
2313
|
+
if (obj_sequenceNumber !== null) {
|
|
2314
|
+
return new TypeError('Expected "null" but received "' + typeof obj_sequenceNumber + '" (at "' + path_sequenceNumber + '")');
|
|
2315
|
+
}
|
|
2316
|
+
})();
|
|
2317
|
+
if (obj_sequenceNumber_union1_error != null) {
|
|
2318
|
+
obj_sequenceNumber_union1 = obj_sequenceNumber_union1_error.message;
|
|
2319
|
+
}
|
|
2320
|
+
if (obj_sequenceNumber_union0 && obj_sequenceNumber_union1) {
|
|
2321
|
+
let message = 'Object doesn\'t match union (at "' + path_sequenceNumber + '")';
|
|
2322
|
+
message += '\n' + obj_sequenceNumber_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2323
|
+
message += '\n' + obj_sequenceNumber_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2324
|
+
return new TypeError(message);
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
const obj_value = obj.value;
|
|
2328
|
+
const path_value = path + '.value';
|
|
2329
|
+
let obj_value_union0 = null;
|
|
2330
|
+
const obj_value_union0_error = (() => {
|
|
2331
|
+
if (typeof obj_value !== 'string') {
|
|
2332
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
2333
|
+
}
|
|
2334
|
+
})();
|
|
2335
|
+
if (obj_value_union0_error != null) {
|
|
2336
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
2337
|
+
}
|
|
2338
|
+
let obj_value_union1 = null;
|
|
2339
|
+
const obj_value_union1_error = (() => {
|
|
2340
|
+
if (obj_value !== null) {
|
|
2341
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
2342
|
+
}
|
|
2343
|
+
})();
|
|
2344
|
+
if (obj_value_union1_error != null) {
|
|
2345
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
2346
|
+
}
|
|
2347
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
2348
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
2349
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2350
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2351
|
+
return new TypeError(message);
|
|
2352
|
+
}
|
|
2353
|
+
})();
|
|
2354
|
+
return v_error === undefined ? null : v_error;
|
|
2355
|
+
}
|
|
2356
|
+
function deepFreeze$5(input) {
|
|
2357
|
+
ObjectFreeze(input);
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
function validate$g(obj, path = 'ProcessRuleActionRepresentation') {
|
|
2361
|
+
const v_error = (() => {
|
|
2362
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2363
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2364
|
+
}
|
|
2365
|
+
const obj_actionParameters = obj.actionParameters;
|
|
2366
|
+
const path_actionParameters = path + '.actionParameters';
|
|
2367
|
+
if (!ArrayIsArray(obj_actionParameters)) {
|
|
2368
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actionParameters + '" (at "' + path_actionParameters + '")');
|
|
2369
|
+
}
|
|
2370
|
+
for (let i = 0; i < obj_actionParameters.length; i++) {
|
|
2371
|
+
const obj_actionParameters_item = obj_actionParameters[i];
|
|
2372
|
+
const path_actionParameters_item = path_actionParameters + '[' + i + ']';
|
|
2373
|
+
const referencepath_actionParameters_itemValidationError = validate$h(obj_actionParameters_item, path_actionParameters_item);
|
|
2374
|
+
if (referencepath_actionParameters_itemValidationError !== null) {
|
|
2375
|
+
let message = 'Object doesn\'t match ProcessRuleActionParameterRepresentation (at "' + path_actionParameters_item + '")\n';
|
|
2376
|
+
message += referencepath_actionParameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2377
|
+
return new TypeError(message);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
const obj_actionType = obj.actionType;
|
|
2381
|
+
const path_actionType = path + '.actionType';
|
|
2382
|
+
if (typeof obj_actionType !== 'string') {
|
|
2383
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
|
|
2384
|
+
}
|
|
2385
|
+
const obj_decisionTable = obj.decisionTable;
|
|
2386
|
+
const path_decisionTable = path + '.decisionTable';
|
|
2387
|
+
let obj_decisionTable_union0 = null;
|
|
2388
|
+
const obj_decisionTable_union0_error = (() => {
|
|
2389
|
+
if (typeof obj_decisionTable !== 'string') {
|
|
2390
|
+
return new TypeError('Expected "string" but received "' + typeof obj_decisionTable + '" (at "' + path_decisionTable + '")');
|
|
2391
|
+
}
|
|
2392
|
+
})();
|
|
2393
|
+
if (obj_decisionTable_union0_error != null) {
|
|
2394
|
+
obj_decisionTable_union0 = obj_decisionTable_union0_error.message;
|
|
2395
|
+
}
|
|
2396
|
+
let obj_decisionTable_union1 = null;
|
|
2397
|
+
const obj_decisionTable_union1_error = (() => {
|
|
2398
|
+
if (obj_decisionTable !== null) {
|
|
2399
|
+
return new TypeError('Expected "null" but received "' + typeof obj_decisionTable + '" (at "' + path_decisionTable + '")');
|
|
2400
|
+
}
|
|
2401
|
+
})();
|
|
2402
|
+
if (obj_decisionTable_union1_error != null) {
|
|
2403
|
+
obj_decisionTable_union1 = obj_decisionTable_union1_error.message;
|
|
2404
|
+
}
|
|
2405
|
+
if (obj_decisionTable_union0 && obj_decisionTable_union1) {
|
|
2406
|
+
let message = 'Object doesn\'t match union (at "' + path_decisionTable + '")';
|
|
2407
|
+
message += '\n' + obj_decisionTable_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2408
|
+
message += '\n' + obj_decisionTable_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2409
|
+
return new TypeError(message);
|
|
2410
|
+
}
|
|
2411
|
+
const obj_decisionTableDatasetLink = obj.decisionTableDatasetLink;
|
|
2412
|
+
const path_decisionTableDatasetLink = path + '.decisionTableDatasetLink';
|
|
2413
|
+
let obj_decisionTableDatasetLink_union0 = null;
|
|
2414
|
+
const obj_decisionTableDatasetLink_union0_error = (() => {
|
|
2415
|
+
if (typeof obj_decisionTableDatasetLink !== 'string') {
|
|
2416
|
+
return new TypeError('Expected "string" but received "' + typeof obj_decisionTableDatasetLink + '" (at "' + path_decisionTableDatasetLink + '")');
|
|
2417
|
+
}
|
|
2418
|
+
})();
|
|
2419
|
+
if (obj_decisionTableDatasetLink_union0_error != null) {
|
|
2420
|
+
obj_decisionTableDatasetLink_union0 = obj_decisionTableDatasetLink_union0_error.message;
|
|
2421
|
+
}
|
|
2422
|
+
let obj_decisionTableDatasetLink_union1 = null;
|
|
2423
|
+
const obj_decisionTableDatasetLink_union1_error = (() => {
|
|
2424
|
+
if (obj_decisionTableDatasetLink !== null) {
|
|
2425
|
+
return new TypeError('Expected "null" but received "' + typeof obj_decisionTableDatasetLink + '" (at "' + path_decisionTableDatasetLink + '")');
|
|
2426
|
+
}
|
|
2427
|
+
})();
|
|
2428
|
+
if (obj_decisionTableDatasetLink_union1_error != null) {
|
|
2429
|
+
obj_decisionTableDatasetLink_union1 = obj_decisionTableDatasetLink_union1_error.message;
|
|
2430
|
+
}
|
|
2431
|
+
if (obj_decisionTableDatasetLink_union0 && obj_decisionTableDatasetLink_union1) {
|
|
2432
|
+
let message = 'Object doesn\'t match union (at "' + path_decisionTableDatasetLink + '")';
|
|
2433
|
+
message += '\n' + obj_decisionTableDatasetLink_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2434
|
+
message += '\n' + obj_decisionTableDatasetLink_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2435
|
+
return new TypeError(message);
|
|
2436
|
+
}
|
|
2437
|
+
const obj_flowDefinition = obj.flowDefinition;
|
|
2438
|
+
const path_flowDefinition = path + '.flowDefinition';
|
|
2439
|
+
let obj_flowDefinition_union0 = null;
|
|
2440
|
+
const obj_flowDefinition_union0_error = (() => {
|
|
2441
|
+
if (typeof obj_flowDefinition !== 'string') {
|
|
2442
|
+
return new TypeError('Expected "string" but received "' + typeof obj_flowDefinition + '" (at "' + path_flowDefinition + '")');
|
|
2443
|
+
}
|
|
2444
|
+
})();
|
|
2445
|
+
if (obj_flowDefinition_union0_error != null) {
|
|
2446
|
+
obj_flowDefinition_union0 = obj_flowDefinition_union0_error.message;
|
|
2447
|
+
}
|
|
2448
|
+
let obj_flowDefinition_union1 = null;
|
|
2449
|
+
const obj_flowDefinition_union1_error = (() => {
|
|
2450
|
+
if (obj_flowDefinition !== null) {
|
|
2451
|
+
return new TypeError('Expected "null" but received "' + typeof obj_flowDefinition + '" (at "' + path_flowDefinition + '")');
|
|
2452
|
+
}
|
|
2453
|
+
})();
|
|
2454
|
+
if (obj_flowDefinition_union1_error != null) {
|
|
2455
|
+
obj_flowDefinition_union1 = obj_flowDefinition_union1_error.message;
|
|
2456
|
+
}
|
|
2457
|
+
if (obj_flowDefinition_union0 && obj_flowDefinition_union1) {
|
|
2458
|
+
let message = 'Object doesn\'t match union (at "' + path_flowDefinition + '")';
|
|
2459
|
+
message += '\n' + obj_flowDefinition_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2460
|
+
message += '\n' + obj_flowDefinition_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2461
|
+
return new TypeError(message);
|
|
2462
|
+
}
|
|
2463
|
+
const obj_name = obj.name;
|
|
2464
|
+
const path_name = path + '.name';
|
|
2465
|
+
if (typeof obj_name !== 'string') {
|
|
2466
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2467
|
+
}
|
|
2468
|
+
})();
|
|
2469
|
+
return v_error === undefined ? null : v_error;
|
|
2470
|
+
}
|
|
2471
|
+
function deepFreeze$4(input) {
|
|
2472
|
+
const input_actionParameters = input.actionParameters;
|
|
2473
|
+
for (let i = 0; i < input_actionParameters.length; i++) {
|
|
2474
|
+
const input_actionParameters_item = input_actionParameters[i];
|
|
2475
|
+
deepFreeze$5(input_actionParameters_item);
|
|
2476
|
+
}
|
|
2477
|
+
ObjectFreeze(input_actionParameters);
|
|
2478
|
+
ObjectFreeze(input);
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
function validate$f(obj, path = 'ProcessRuleConditionFilterCriteriaRepresentation') {
|
|
2482
|
+
const v_error = (() => {
|
|
2483
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2484
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2485
|
+
}
|
|
2486
|
+
const obj_operator = obj.operator;
|
|
2487
|
+
const path_operator = path + '.operator';
|
|
2488
|
+
if (typeof obj_operator !== 'string') {
|
|
2489
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
2490
|
+
}
|
|
2491
|
+
const obj_sequence = obj.sequence;
|
|
2492
|
+
const path_sequence = path + '.sequence';
|
|
2493
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
2494
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
2495
|
+
}
|
|
2496
|
+
const obj_sourceFieldName = obj.sourceFieldName;
|
|
2497
|
+
const path_sourceFieldName = path + '.sourceFieldName';
|
|
2498
|
+
if (typeof obj_sourceFieldName !== 'string') {
|
|
2499
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceFieldName + '" (at "' + path_sourceFieldName + '")');
|
|
2500
|
+
}
|
|
2501
|
+
const obj_value = obj.value;
|
|
2502
|
+
const path_value = path + '.value';
|
|
2503
|
+
let obj_value_union0 = null;
|
|
2504
|
+
const obj_value_union0_error = (() => {
|
|
2505
|
+
if (typeof obj_value !== 'string') {
|
|
2506
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
2507
|
+
}
|
|
2508
|
+
})();
|
|
2509
|
+
if (obj_value_union0_error != null) {
|
|
2510
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
2511
|
+
}
|
|
2512
|
+
let obj_value_union1 = null;
|
|
2513
|
+
const obj_value_union1_error = (() => {
|
|
2514
|
+
if (obj_value !== null) {
|
|
2515
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
2516
|
+
}
|
|
2517
|
+
})();
|
|
2518
|
+
if (obj_value_union1_error != null) {
|
|
2519
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
2520
|
+
}
|
|
2521
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
2522
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
2523
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2524
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2525
|
+
return new TypeError(message);
|
|
2526
|
+
}
|
|
2527
|
+
const obj_valueType = obj.valueType;
|
|
2528
|
+
const path_valueType = path + '.valueType';
|
|
2529
|
+
if (typeof obj_valueType !== 'string') {
|
|
2530
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueType + '" (at "' + path_valueType + '")');
|
|
2531
|
+
}
|
|
2532
|
+
})();
|
|
2533
|
+
return v_error === undefined ? null : v_error;
|
|
2534
|
+
}
|
|
2535
|
+
function deepFreeze$3(input) {
|
|
2536
|
+
ObjectFreeze(input);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
function validate$e(obj, path = 'ProcessRuleConditionRepresentation') {
|
|
2540
|
+
const v_error = (() => {
|
|
2541
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2542
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2543
|
+
}
|
|
2544
|
+
const obj_conditionType = obj.conditionType;
|
|
2545
|
+
const path_conditionType = path + '.conditionType';
|
|
2546
|
+
if (typeof obj_conditionType !== 'string') {
|
|
2547
|
+
return new TypeError('Expected "string" but received "' + typeof obj_conditionType + '" (at "' + path_conditionType + '")');
|
|
2548
|
+
}
|
|
2549
|
+
const obj_criteria = obj.criteria;
|
|
2550
|
+
const path_criteria = path + '.criteria';
|
|
2551
|
+
if (!ArrayIsArray(obj_criteria)) {
|
|
2552
|
+
return new TypeError('Expected "array" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
2553
|
+
}
|
|
2554
|
+
for (let i = 0; i < obj_criteria.length; i++) {
|
|
2555
|
+
const obj_criteria_item = obj_criteria[i];
|
|
2556
|
+
const path_criteria_item = path_criteria + '[' + i + ']';
|
|
2557
|
+
const referencepath_criteria_itemValidationError = validate$f(obj_criteria_item, path_criteria_item);
|
|
2558
|
+
if (referencepath_criteria_itemValidationError !== null) {
|
|
2559
|
+
let message = 'Object doesn\'t match ProcessRuleConditionFilterCriteriaRepresentation (at "' + path_criteria_item + '")\n';
|
|
2560
|
+
message += referencepath_criteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2561
|
+
return new TypeError(message);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
const obj_filterCondition = obj.filterCondition;
|
|
2565
|
+
const path_filterCondition = path + '.filterCondition';
|
|
2566
|
+
let obj_filterCondition_union0 = null;
|
|
2567
|
+
const obj_filterCondition_union0_error = (() => {
|
|
2568
|
+
if (typeof obj_filterCondition !== 'string') {
|
|
2569
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterCondition + '" (at "' + path_filterCondition + '")');
|
|
2570
|
+
}
|
|
2571
|
+
})();
|
|
2572
|
+
if (obj_filterCondition_union0_error != null) {
|
|
2573
|
+
obj_filterCondition_union0 = obj_filterCondition_union0_error.message;
|
|
2574
|
+
}
|
|
2575
|
+
let obj_filterCondition_union1 = null;
|
|
2576
|
+
const obj_filterCondition_union1_error = (() => {
|
|
2577
|
+
if (obj_filterCondition !== null) {
|
|
2578
|
+
return new TypeError('Expected "null" but received "' + typeof obj_filterCondition + '" (at "' + path_filterCondition + '")');
|
|
2579
|
+
}
|
|
2580
|
+
})();
|
|
2581
|
+
if (obj_filterCondition_union1_error != null) {
|
|
2582
|
+
obj_filterCondition_union1 = obj_filterCondition_union1_error.message;
|
|
2583
|
+
}
|
|
2584
|
+
if (obj_filterCondition_union0 && obj_filterCondition_union1) {
|
|
2585
|
+
let message = 'Object doesn\'t match union (at "' + path_filterCondition + '")';
|
|
2586
|
+
message += '\n' + obj_filterCondition_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2587
|
+
message += '\n' + obj_filterCondition_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2588
|
+
return new TypeError(message);
|
|
2589
|
+
}
|
|
2590
|
+
const obj_filterExpression = obj.filterExpression;
|
|
2591
|
+
const path_filterExpression = path + '.filterExpression';
|
|
2592
|
+
let obj_filterExpression_union0 = null;
|
|
2593
|
+
const obj_filterExpression_union0_error = (() => {
|
|
2594
|
+
if (typeof obj_filterExpression !== 'string') {
|
|
2595
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterExpression + '" (at "' + path_filterExpression + '")');
|
|
2596
|
+
}
|
|
2597
|
+
})();
|
|
2598
|
+
if (obj_filterExpression_union0_error != null) {
|
|
2599
|
+
obj_filterExpression_union0 = obj_filterExpression_union0_error.message;
|
|
2600
|
+
}
|
|
2601
|
+
let obj_filterExpression_union1 = null;
|
|
2602
|
+
const obj_filterExpression_union1_error = (() => {
|
|
2603
|
+
if (obj_filterExpression !== null) {
|
|
2604
|
+
return new TypeError('Expected "null" but received "' + typeof obj_filterExpression + '" (at "' + path_filterExpression + '")');
|
|
2605
|
+
}
|
|
2606
|
+
})();
|
|
2607
|
+
if (obj_filterExpression_union1_error != null) {
|
|
2608
|
+
obj_filterExpression_union1 = obj_filterExpression_union1_error.message;
|
|
2609
|
+
}
|
|
2610
|
+
if (obj_filterExpression_union0 && obj_filterExpression_union1) {
|
|
2611
|
+
let message = 'Object doesn\'t match union (at "' + path_filterExpression + '")';
|
|
2612
|
+
message += '\n' + obj_filterExpression_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2613
|
+
message += '\n' + obj_filterExpression_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2614
|
+
return new TypeError(message);
|
|
2615
|
+
}
|
|
2616
|
+
const obj_name = obj.name;
|
|
2617
|
+
const path_name = path + '.name';
|
|
2618
|
+
if (typeof obj_name !== 'string') {
|
|
2619
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2620
|
+
}
|
|
2621
|
+
})();
|
|
2622
|
+
return v_error === undefined ? null : v_error;
|
|
2623
|
+
}
|
|
2624
|
+
function deepFreeze$2(input) {
|
|
2625
|
+
const input_criteria = input.criteria;
|
|
2626
|
+
for (let i = 0; i < input_criteria.length; i++) {
|
|
2627
|
+
const input_criteria_item = input_criteria[i];
|
|
2628
|
+
deepFreeze$3(input_criteria_item);
|
|
2629
|
+
}
|
|
2630
|
+
ObjectFreeze(input_criteria);
|
|
2631
|
+
ObjectFreeze(input);
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
function validate$d(obj, path = 'ProcessRuleStepMappingRepresentation') {
|
|
2635
|
+
const v_error = (() => {
|
|
2636
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2637
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2638
|
+
}
|
|
2639
|
+
const obj_associatedStep = obj.associatedStep;
|
|
2640
|
+
const path_associatedStep = path + '.associatedStep';
|
|
2641
|
+
if (typeof obj_associatedStep !== 'string') {
|
|
2642
|
+
return new TypeError('Expected "string" but received "' + typeof obj_associatedStep + '" (at "' + path_associatedStep + '")');
|
|
2643
|
+
}
|
|
2644
|
+
const obj_parentStep = obj.parentStep;
|
|
2645
|
+
const path_parentStep = path + '.parentStep';
|
|
2646
|
+
let obj_parentStep_union0 = null;
|
|
2647
|
+
const obj_parentStep_union0_error = (() => {
|
|
2648
|
+
if (typeof obj_parentStep !== 'string') {
|
|
2649
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parentStep + '" (at "' + path_parentStep + '")');
|
|
2650
|
+
}
|
|
2651
|
+
})();
|
|
2652
|
+
if (obj_parentStep_union0_error != null) {
|
|
2653
|
+
obj_parentStep_union0 = obj_parentStep_union0_error.message;
|
|
2654
|
+
}
|
|
2655
|
+
let obj_parentStep_union1 = null;
|
|
2656
|
+
const obj_parentStep_union1_error = (() => {
|
|
2657
|
+
if (obj_parentStep !== null) {
|
|
2658
|
+
return new TypeError('Expected "null" but received "' + typeof obj_parentStep + '" (at "' + path_parentStep + '")');
|
|
2659
|
+
}
|
|
2660
|
+
})();
|
|
2661
|
+
if (obj_parentStep_union1_error != null) {
|
|
2662
|
+
obj_parentStep_union1 = obj_parentStep_union1_error.message;
|
|
2663
|
+
}
|
|
2664
|
+
if (obj_parentStep_union0 && obj_parentStep_union1) {
|
|
2665
|
+
let message = 'Object doesn\'t match union (at "' + path_parentStep + '")';
|
|
2666
|
+
message += '\n' + obj_parentStep_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2667
|
+
message += '\n' + obj_parentStep_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2668
|
+
return new TypeError(message);
|
|
2669
|
+
}
|
|
2670
|
+
const obj_sequence = obj.sequence;
|
|
2671
|
+
const path_sequence = path + '.sequence';
|
|
2672
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
2673
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
2674
|
+
}
|
|
2675
|
+
})();
|
|
2676
|
+
return v_error === undefined ? null : v_error;
|
|
2677
|
+
}
|
|
2678
|
+
function deepFreeze$1(input) {
|
|
2679
|
+
ObjectFreeze(input);
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
const TTL$1 = 10000;
|
|
2683
|
+
const VERSION$a = "37ac5c7e7b5763ded042c498e5de144a";
|
|
2684
|
+
function validate$c(obj, path = 'ProcessRuleDetailRepresentation') {
|
|
2685
|
+
const v_error = (() => {
|
|
2686
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2687
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2688
|
+
}
|
|
2689
|
+
const obj_actions = obj.actions;
|
|
2690
|
+
const path_actions = path + '.actions';
|
|
2691
|
+
if (!ArrayIsArray(obj_actions)) {
|
|
2692
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actions + '" (at "' + path_actions + '")');
|
|
2693
|
+
}
|
|
2694
|
+
for (let i = 0; i < obj_actions.length; i++) {
|
|
2695
|
+
const obj_actions_item = obj_actions[i];
|
|
2696
|
+
const path_actions_item = path_actions + '[' + i + ']';
|
|
2697
|
+
const referencepath_actions_itemValidationError = validate$g(obj_actions_item, path_actions_item);
|
|
2698
|
+
if (referencepath_actions_itemValidationError !== null) {
|
|
2699
|
+
let message = 'Object doesn\'t match ProcessRuleActionRepresentation (at "' + path_actions_item + '")\n';
|
|
2700
|
+
message += referencepath_actions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2701
|
+
return new TypeError(message);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
const obj_conditions = obj.conditions;
|
|
2705
|
+
const path_conditions = path + '.conditions';
|
|
2706
|
+
if (!ArrayIsArray(obj_conditions)) {
|
|
2707
|
+
return new TypeError('Expected "array" but received "' + typeof obj_conditions + '" (at "' + path_conditions + '")');
|
|
2708
|
+
}
|
|
2709
|
+
for (let i = 0; i < obj_conditions.length; i++) {
|
|
2710
|
+
const obj_conditions_item = obj_conditions[i];
|
|
2711
|
+
const path_conditions_item = path_conditions + '[' + i + ']';
|
|
2712
|
+
const referencepath_conditions_itemValidationError = validate$e(obj_conditions_item, path_conditions_item);
|
|
2713
|
+
if (referencepath_conditions_itemValidationError !== null) {
|
|
2714
|
+
let message = 'Object doesn\'t match ProcessRuleConditionRepresentation (at "' + path_conditions_item + '")\n';
|
|
2715
|
+
message += referencepath_conditions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2716
|
+
return new TypeError(message);
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2719
|
+
const obj_description = obj.description;
|
|
2720
|
+
const path_description = path + '.description';
|
|
2721
|
+
let obj_description_union0 = null;
|
|
2722
|
+
const obj_description_union0_error = (() => {
|
|
2723
|
+
if (typeof obj_description !== 'string') {
|
|
2724
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2725
|
+
}
|
|
2726
|
+
})();
|
|
2727
|
+
if (obj_description_union0_error != null) {
|
|
2728
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
2729
|
+
}
|
|
2730
|
+
let obj_description_union1 = null;
|
|
2731
|
+
const obj_description_union1_error = (() => {
|
|
2732
|
+
if (obj_description !== null) {
|
|
2733
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2734
|
+
}
|
|
2735
|
+
})();
|
|
2736
|
+
if (obj_description_union1_error != null) {
|
|
2737
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
2738
|
+
}
|
|
2739
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
2740
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
2741
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2742
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2743
|
+
return new TypeError(message);
|
|
2744
|
+
}
|
|
2745
|
+
const obj_endDate = obj.endDate;
|
|
2746
|
+
const path_endDate = path + '.endDate';
|
|
2747
|
+
let obj_endDate_union0 = null;
|
|
2748
|
+
const obj_endDate_union0_error = (() => {
|
|
2749
|
+
if (typeof obj_endDate !== 'string') {
|
|
2750
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
2751
|
+
}
|
|
2752
|
+
})();
|
|
2753
|
+
if (obj_endDate_union0_error != null) {
|
|
2754
|
+
obj_endDate_union0 = obj_endDate_union0_error.message;
|
|
2755
|
+
}
|
|
2756
|
+
let obj_endDate_union1 = null;
|
|
2757
|
+
const obj_endDate_union1_error = (() => {
|
|
2758
|
+
if (obj_endDate !== null) {
|
|
2759
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
|
|
2760
|
+
}
|
|
2761
|
+
})();
|
|
2762
|
+
if (obj_endDate_union1_error != null) {
|
|
2763
|
+
obj_endDate_union1 = obj_endDate_union1_error.message;
|
|
2764
|
+
}
|
|
2765
|
+
if (obj_endDate_union0 && obj_endDate_union1) {
|
|
2766
|
+
let message = 'Object doesn\'t match union (at "' + path_endDate + '")';
|
|
2767
|
+
message += '\n' + obj_endDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2768
|
+
message += '\n' + obj_endDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2769
|
+
return new TypeError(message);
|
|
2770
|
+
}
|
|
2771
|
+
const obj_name = obj.name;
|
|
2772
|
+
const path_name = path + '.name';
|
|
2773
|
+
if (typeof obj_name !== 'string') {
|
|
2774
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2775
|
+
}
|
|
2776
|
+
const obj_nextRuleId = obj.nextRuleId;
|
|
2777
|
+
const path_nextRuleId = path + '.nextRuleId';
|
|
2778
|
+
let obj_nextRuleId_union0 = null;
|
|
2779
|
+
const obj_nextRuleId_union0_error = (() => {
|
|
2780
|
+
if (typeof obj_nextRuleId !== 'string') {
|
|
2781
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextRuleId + '" (at "' + path_nextRuleId + '")');
|
|
2782
|
+
}
|
|
2783
|
+
})();
|
|
2784
|
+
if (obj_nextRuleId_union0_error != null) {
|
|
2785
|
+
obj_nextRuleId_union0 = obj_nextRuleId_union0_error.message;
|
|
2786
|
+
}
|
|
2787
|
+
let obj_nextRuleId_union1 = null;
|
|
2788
|
+
const obj_nextRuleId_union1_error = (() => {
|
|
2789
|
+
if (obj_nextRuleId !== null) {
|
|
2790
|
+
return new TypeError('Expected "null" but received "' + typeof obj_nextRuleId + '" (at "' + path_nextRuleId + '")');
|
|
2791
|
+
}
|
|
2792
|
+
})();
|
|
2793
|
+
if (obj_nextRuleId_union1_error != null) {
|
|
2794
|
+
obj_nextRuleId_union1 = obj_nextRuleId_union1_error.message;
|
|
2795
|
+
}
|
|
2796
|
+
if (obj_nextRuleId_union0 && obj_nextRuleId_union1) {
|
|
2797
|
+
let message = 'Object doesn\'t match union (at "' + path_nextRuleId + '")';
|
|
2798
|
+
message += '\n' + obj_nextRuleId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2799
|
+
message += '\n' + obj_nextRuleId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2800
|
+
return new TypeError(message);
|
|
2801
|
+
}
|
|
2802
|
+
const obj_nextRuleName = obj.nextRuleName;
|
|
2803
|
+
const path_nextRuleName = path + '.nextRuleName';
|
|
2804
|
+
let obj_nextRuleName_union0 = null;
|
|
2805
|
+
const obj_nextRuleName_union0_error = (() => {
|
|
2806
|
+
if (typeof obj_nextRuleName !== 'string') {
|
|
2807
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextRuleName + '" (at "' + path_nextRuleName + '")');
|
|
2808
|
+
}
|
|
2809
|
+
})();
|
|
2810
|
+
if (obj_nextRuleName_union0_error != null) {
|
|
2811
|
+
obj_nextRuleName_union0 = obj_nextRuleName_union0_error.message;
|
|
2812
|
+
}
|
|
2813
|
+
let obj_nextRuleName_union1 = null;
|
|
2814
|
+
const obj_nextRuleName_union1_error = (() => {
|
|
2815
|
+
if (obj_nextRuleName !== null) {
|
|
2816
|
+
return new TypeError('Expected "null" but received "' + typeof obj_nextRuleName + '" (at "' + path_nextRuleName + '")');
|
|
2817
|
+
}
|
|
2818
|
+
})();
|
|
2819
|
+
if (obj_nextRuleName_union1_error != null) {
|
|
2820
|
+
obj_nextRuleName_union1 = obj_nextRuleName_union1_error.message;
|
|
2821
|
+
}
|
|
2822
|
+
if (obj_nextRuleName_union0 && obj_nextRuleName_union1) {
|
|
2823
|
+
let message = 'Object doesn\'t match union (at "' + path_nextRuleName + '")';
|
|
2824
|
+
message += '\n' + obj_nextRuleName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2825
|
+
message += '\n' + obj_nextRuleName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2826
|
+
return new TypeError(message);
|
|
2827
|
+
}
|
|
2828
|
+
const obj_previousRuleId = obj.previousRuleId;
|
|
2829
|
+
const path_previousRuleId = path + '.previousRuleId';
|
|
2830
|
+
let obj_previousRuleId_union0 = null;
|
|
2831
|
+
const obj_previousRuleId_union0_error = (() => {
|
|
2832
|
+
if (typeof obj_previousRuleId !== 'string') {
|
|
2833
|
+
return new TypeError('Expected "string" but received "' + typeof obj_previousRuleId + '" (at "' + path_previousRuleId + '")');
|
|
2834
|
+
}
|
|
2835
|
+
})();
|
|
2836
|
+
if (obj_previousRuleId_union0_error != null) {
|
|
2837
|
+
obj_previousRuleId_union0 = obj_previousRuleId_union0_error.message;
|
|
2838
|
+
}
|
|
2839
|
+
let obj_previousRuleId_union1 = null;
|
|
2840
|
+
const obj_previousRuleId_union1_error = (() => {
|
|
2841
|
+
if (obj_previousRuleId !== null) {
|
|
2842
|
+
return new TypeError('Expected "null" but received "' + typeof obj_previousRuleId + '" (at "' + path_previousRuleId + '")');
|
|
2843
|
+
}
|
|
2844
|
+
})();
|
|
2845
|
+
if (obj_previousRuleId_union1_error != null) {
|
|
2846
|
+
obj_previousRuleId_union1 = obj_previousRuleId_union1_error.message;
|
|
2847
|
+
}
|
|
2848
|
+
if (obj_previousRuleId_union0 && obj_previousRuleId_union1) {
|
|
2849
|
+
let message = 'Object doesn\'t match union (at "' + path_previousRuleId + '")';
|
|
2850
|
+
message += '\n' + obj_previousRuleId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2851
|
+
message += '\n' + obj_previousRuleId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2852
|
+
return new TypeError(message);
|
|
2853
|
+
}
|
|
2854
|
+
const obj_previousRuleName = obj.previousRuleName;
|
|
2855
|
+
const path_previousRuleName = path + '.previousRuleName';
|
|
2856
|
+
let obj_previousRuleName_union0 = null;
|
|
2857
|
+
const obj_previousRuleName_union0_error = (() => {
|
|
2858
|
+
if (typeof obj_previousRuleName !== 'string') {
|
|
2859
|
+
return new TypeError('Expected "string" but received "' + typeof obj_previousRuleName + '" (at "' + path_previousRuleName + '")');
|
|
2860
|
+
}
|
|
2861
|
+
})();
|
|
2862
|
+
if (obj_previousRuleName_union0_error != null) {
|
|
2863
|
+
obj_previousRuleName_union0 = obj_previousRuleName_union0_error.message;
|
|
2864
|
+
}
|
|
2865
|
+
let obj_previousRuleName_union1 = null;
|
|
2866
|
+
const obj_previousRuleName_union1_error = (() => {
|
|
2867
|
+
if (obj_previousRuleName !== null) {
|
|
2868
|
+
return new TypeError('Expected "null" but received "' + typeof obj_previousRuleName + '" (at "' + path_previousRuleName + '")');
|
|
2869
|
+
}
|
|
2870
|
+
})();
|
|
2871
|
+
if (obj_previousRuleName_union1_error != null) {
|
|
2872
|
+
obj_previousRuleName_union1 = obj_previousRuleName_union1_error.message;
|
|
2873
|
+
}
|
|
2874
|
+
if (obj_previousRuleName_union0 && obj_previousRuleName_union1) {
|
|
2875
|
+
let message = 'Object doesn\'t match union (at "' + path_previousRuleName + '")';
|
|
2876
|
+
message += '\n' + obj_previousRuleName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2877
|
+
message += '\n' + obj_previousRuleName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2878
|
+
return new TypeError(message);
|
|
2879
|
+
}
|
|
2880
|
+
const obj_processId = obj.processId;
|
|
2881
|
+
const path_processId = path + '.processId';
|
|
2882
|
+
let obj_processId_union0 = null;
|
|
2883
|
+
const obj_processId_union0_error = (() => {
|
|
2884
|
+
if (typeof obj_processId !== 'string') {
|
|
2885
|
+
return new TypeError('Expected "string" but received "' + typeof obj_processId + '" (at "' + path_processId + '")');
|
|
2886
|
+
}
|
|
2887
|
+
})();
|
|
2888
|
+
if (obj_processId_union0_error != null) {
|
|
2889
|
+
obj_processId_union0 = obj_processId_union0_error.message;
|
|
2890
|
+
}
|
|
2891
|
+
let obj_processId_union1 = null;
|
|
2892
|
+
const obj_processId_union1_error = (() => {
|
|
2893
|
+
if (obj_processId !== null) {
|
|
2894
|
+
return new TypeError('Expected "null" but received "' + typeof obj_processId + '" (at "' + path_processId + '")');
|
|
2895
|
+
}
|
|
2896
|
+
})();
|
|
2897
|
+
if (obj_processId_union1_error != null) {
|
|
2898
|
+
obj_processId_union1 = obj_processId_union1_error.message;
|
|
2899
|
+
}
|
|
2900
|
+
if (obj_processId_union0 && obj_processId_union1) {
|
|
2901
|
+
let message = 'Object doesn\'t match union (at "' + path_processId + '")';
|
|
2902
|
+
message += '\n' + obj_processId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2903
|
+
message += '\n' + obj_processId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2904
|
+
return new TypeError(message);
|
|
2905
|
+
}
|
|
2906
|
+
const obj_processName = obj.processName;
|
|
2907
|
+
const path_processName = path + '.processName';
|
|
2908
|
+
let obj_processName_union0 = null;
|
|
2909
|
+
const obj_processName_union0_error = (() => {
|
|
2910
|
+
if (typeof obj_processName !== 'string') {
|
|
2911
|
+
return new TypeError('Expected "string" but received "' + typeof obj_processName + '" (at "' + path_processName + '")');
|
|
2912
|
+
}
|
|
2913
|
+
})();
|
|
2914
|
+
if (obj_processName_union0_error != null) {
|
|
2915
|
+
obj_processName_union0 = obj_processName_union0_error.message;
|
|
2916
|
+
}
|
|
2917
|
+
let obj_processName_union1 = null;
|
|
2918
|
+
const obj_processName_union1_error = (() => {
|
|
2919
|
+
if (obj_processName !== null) {
|
|
2920
|
+
return new TypeError('Expected "null" but received "' + typeof obj_processName + '" (at "' + path_processName + '")');
|
|
2921
|
+
}
|
|
2922
|
+
})();
|
|
2923
|
+
if (obj_processName_union1_error != null) {
|
|
2924
|
+
obj_processName_union1 = obj_processName_union1_error.message;
|
|
2925
|
+
}
|
|
2926
|
+
if (obj_processName_union0 && obj_processName_union1) {
|
|
2927
|
+
let message = 'Object doesn\'t match union (at "' + path_processName + '")';
|
|
2928
|
+
message += '\n' + obj_processName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2929
|
+
message += '\n' + obj_processName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2930
|
+
return new TypeError(message);
|
|
2931
|
+
}
|
|
2932
|
+
const obj_promotionId = obj.promotionId;
|
|
2933
|
+
const path_promotionId = path + '.promotionId';
|
|
2934
|
+
let obj_promotionId_union0 = null;
|
|
2935
|
+
const obj_promotionId_union0_error = (() => {
|
|
2936
|
+
if (typeof obj_promotionId !== 'string') {
|
|
2937
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
2938
|
+
}
|
|
2939
|
+
})();
|
|
2940
|
+
if (obj_promotionId_union0_error != null) {
|
|
2941
|
+
obj_promotionId_union0 = obj_promotionId_union0_error.message;
|
|
2942
|
+
}
|
|
2943
|
+
let obj_promotionId_union1 = null;
|
|
2944
|
+
const obj_promotionId_union1_error = (() => {
|
|
2945
|
+
if (obj_promotionId !== null) {
|
|
2946
|
+
return new TypeError('Expected "null" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
2947
|
+
}
|
|
2948
|
+
})();
|
|
2949
|
+
if (obj_promotionId_union1_error != null) {
|
|
2950
|
+
obj_promotionId_union1 = obj_promotionId_union1_error.message;
|
|
2951
|
+
}
|
|
2952
|
+
if (obj_promotionId_union0 && obj_promotionId_union1) {
|
|
2953
|
+
let message = 'Object doesn\'t match union (at "' + path_promotionId + '")';
|
|
2954
|
+
message += '\n' + obj_promotionId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2955
|
+
message += '\n' + obj_promotionId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2956
|
+
return new TypeError(message);
|
|
2957
|
+
}
|
|
2958
|
+
const obj_promotionName = obj.promotionName;
|
|
2959
|
+
const path_promotionName = path + '.promotionName';
|
|
2960
|
+
let obj_promotionName_union0 = null;
|
|
2961
|
+
const obj_promotionName_union0_error = (() => {
|
|
2962
|
+
if (typeof obj_promotionName !== 'string') {
|
|
2963
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionName + '" (at "' + path_promotionName + '")');
|
|
2964
|
+
}
|
|
2965
|
+
})();
|
|
2966
|
+
if (obj_promotionName_union0_error != null) {
|
|
2967
|
+
obj_promotionName_union0 = obj_promotionName_union0_error.message;
|
|
2968
|
+
}
|
|
2969
|
+
let obj_promotionName_union1 = null;
|
|
2970
|
+
const obj_promotionName_union1_error = (() => {
|
|
2971
|
+
if (obj_promotionName !== null) {
|
|
2972
|
+
return new TypeError('Expected "null" but received "' + typeof obj_promotionName + '" (at "' + path_promotionName + '")');
|
|
2973
|
+
}
|
|
2974
|
+
})();
|
|
2975
|
+
if (obj_promotionName_union1_error != null) {
|
|
2976
|
+
obj_promotionName_union1 = obj_promotionName_union1_error.message;
|
|
2977
|
+
}
|
|
2978
|
+
if (obj_promotionName_union0 && obj_promotionName_union1) {
|
|
2979
|
+
let message = 'Object doesn\'t match union (at "' + path_promotionName + '")';
|
|
2980
|
+
message += '\n' + obj_promotionName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2981
|
+
message += '\n' + obj_promotionName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2982
|
+
return new TypeError(message);
|
|
2983
|
+
}
|
|
2984
|
+
const obj_startDate = obj.startDate;
|
|
2985
|
+
const path_startDate = path + '.startDate';
|
|
2986
|
+
if (typeof obj_startDate !== 'string') {
|
|
2987
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
2988
|
+
}
|
|
2989
|
+
const obj_status = obj.status;
|
|
2990
|
+
const path_status = path + '.status';
|
|
2991
|
+
if (typeof obj_status !== 'string') {
|
|
2992
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2993
|
+
}
|
|
2994
|
+
const obj_stepMappings = obj.stepMappings;
|
|
2995
|
+
const path_stepMappings = path + '.stepMappings';
|
|
2996
|
+
if (!ArrayIsArray(obj_stepMappings)) {
|
|
2997
|
+
return new TypeError('Expected "array" but received "' + typeof obj_stepMappings + '" (at "' + path_stepMappings + '")');
|
|
2998
|
+
}
|
|
2999
|
+
for (let i = 0; i < obj_stepMappings.length; i++) {
|
|
3000
|
+
const obj_stepMappings_item = obj_stepMappings[i];
|
|
3001
|
+
const path_stepMappings_item = path_stepMappings + '[' + i + ']';
|
|
3002
|
+
const referencepath_stepMappings_itemValidationError = validate$d(obj_stepMappings_item, path_stepMappings_item);
|
|
3003
|
+
if (referencepath_stepMappings_itemValidationError !== null) {
|
|
3004
|
+
let message = 'Object doesn\'t match ProcessRuleStepMappingRepresentation (at "' + path_stepMappings_item + '")\n';
|
|
3005
|
+
message += referencepath_stepMappings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3006
|
+
return new TypeError(message);
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
})();
|
|
3010
|
+
return v_error === undefined ? null : v_error;
|
|
3011
|
+
}
|
|
3012
|
+
const RepresentationType$1 = 'ProcessRuleDetailRepresentation';
|
|
3013
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
3014
|
+
return input;
|
|
3015
|
+
}
|
|
3016
|
+
const select$d = function ProcessRuleDetailRepresentationSelect() {
|
|
3017
|
+
return {
|
|
3018
|
+
kind: 'Fragment',
|
|
3019
|
+
version: VERSION$a,
|
|
3020
|
+
private: [],
|
|
3021
|
+
opaque: true
|
|
3022
|
+
};
|
|
3023
|
+
};
|
|
3024
|
+
function equals$a(existing, incoming) {
|
|
3025
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
3026
|
+
return false;
|
|
3027
|
+
}
|
|
3028
|
+
return true;
|
|
3029
|
+
}
|
|
3030
|
+
function deepFreeze(input) {
|
|
3031
|
+
const input_actions = input.actions;
|
|
3032
|
+
for (let i = 0; i < input_actions.length; i++) {
|
|
3033
|
+
const input_actions_item = input_actions[i];
|
|
3034
|
+
deepFreeze$4(input_actions_item);
|
|
3035
|
+
}
|
|
3036
|
+
ObjectFreeze(input_actions);
|
|
3037
|
+
const input_conditions = input.conditions;
|
|
3038
|
+
for (let i = 0; i < input_conditions.length; i++) {
|
|
3039
|
+
const input_conditions_item = input_conditions[i];
|
|
3040
|
+
deepFreeze$2(input_conditions_item);
|
|
3041
|
+
}
|
|
3042
|
+
ObjectFreeze(input_conditions);
|
|
3043
|
+
const input_stepMappings = input.stepMappings;
|
|
3044
|
+
for (let i = 0; i < input_stepMappings.length; i++) {
|
|
3045
|
+
const input_stepMappings_item = input_stepMappings[i];
|
|
3046
|
+
deepFreeze$1(input_stepMappings_item);
|
|
3047
|
+
}
|
|
3048
|
+
ObjectFreeze(input_stepMappings);
|
|
3049
|
+
ObjectFreeze(input);
|
|
3050
|
+
}
|
|
3051
|
+
const ingest$1 = function ProcessRuleDetailRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3052
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3053
|
+
const validateError = validate$c(input);
|
|
3054
|
+
if (validateError !== null) {
|
|
3055
|
+
throw validateError;
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
const key = path.fullPath;
|
|
3059
|
+
const existingRecord = store.readEntry(key);
|
|
3060
|
+
const ttlToUse = TTL$1;
|
|
3061
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
3062
|
+
fullPath: key,
|
|
3063
|
+
parent: path.parent,
|
|
3064
|
+
propertyName: path.propertyName,
|
|
3065
|
+
ttl: ttlToUse
|
|
3066
|
+
});
|
|
3067
|
+
deepFreeze(input);
|
|
3068
|
+
if (existingRecord === undefined || equals$a(existingRecord, incomingRecord) === false) {
|
|
3069
|
+
luvio.storePublish(key, incomingRecord);
|
|
3070
|
+
}
|
|
3071
|
+
{
|
|
3072
|
+
const storeMetadataParams = {
|
|
3073
|
+
ttl: ttlToUse,
|
|
3074
|
+
namespace: "loyalty-engine",
|
|
3075
|
+
version: VERSION$a,
|
|
3076
|
+
representationName: RepresentationType$1,
|
|
3077
|
+
};
|
|
3078
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3079
|
+
}
|
|
3080
|
+
return createLink(key);
|
|
3081
|
+
};
|
|
3082
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
3083
|
+
const rootKeySet = new engine.StoreKeyMap();
|
|
3084
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3085
|
+
const rootKey = fullPathFactory();
|
|
3086
|
+
rootKeySet.set(rootKey, {
|
|
3087
|
+
namespace: keyPrefix,
|
|
3088
|
+
representationName: RepresentationType$1,
|
|
3089
|
+
mergeable: false
|
|
3090
|
+
});
|
|
3091
|
+
return rootKeySet;
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
function select$c(luvio, params) {
|
|
3095
|
+
return select$d();
|
|
3096
|
+
}
|
|
3097
|
+
function keyBuilder$2(luvio, params) {
|
|
3098
|
+
return keyPrefix + '::ProcessRuleDetailRepresentation:(' + 'processName:' + params.urlParams.processName + ',' + 'programName:' + params.urlParams.programName + ',' + 'ruleName:' + params.urlParams.ruleName + ')';
|
|
3099
|
+
}
|
|
3100
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
3101
|
+
return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
|
|
3102
|
+
}
|
|
3103
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
3104
|
+
const { body } = response;
|
|
3105
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
3106
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
3107
|
+
const snapshot = luvio.storeLookup({
|
|
3108
|
+
recordId: key,
|
|
3109
|
+
node: select$c(),
|
|
3110
|
+
variables: {},
|
|
3111
|
+
}, snapshotRefresh);
|
|
3112
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3113
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3114
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
return snapshot;
|
|
3118
|
+
}
|
|
3119
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
3120
|
+
const key = keyBuilder$2(luvio, params);
|
|
3121
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3122
|
+
const storeMetadataParams = {
|
|
3123
|
+
ttl: TTL$1,
|
|
3124
|
+
namespace: keyPrefix,
|
|
3125
|
+
version: VERSION$a,
|
|
3126
|
+
representationName: RepresentationType$1
|
|
3127
|
+
};
|
|
3128
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3129
|
+
return errorSnapshot;
|
|
3130
|
+
}
|
|
3131
|
+
function createResourceRequest$2(config) {
|
|
3132
|
+
const headers = {};
|
|
3133
|
+
return {
|
|
3134
|
+
baseUri: '/services/data/v58.0',
|
|
3135
|
+
basePath: '/connect/loyalty/programs/' + config.urlParams.programName + '/processes/' + config.urlParams.processName + '/rule/' + config.urlParams.ruleName + '',
|
|
3136
|
+
method: 'get',
|
|
3137
|
+
body: null,
|
|
3138
|
+
urlParams: config.urlParams,
|
|
3139
|
+
queryParams: {},
|
|
3140
|
+
headers,
|
|
3141
|
+
priority: 'normal',
|
|
3142
|
+
};
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
const getProgramProcessRule_ConfigPropertyNames = {
|
|
3146
|
+
displayName: 'getProgramProcessRule',
|
|
3147
|
+
parameters: {
|
|
3148
|
+
required: ['processName', 'programName', 'ruleName'],
|
|
3149
|
+
optional: []
|
|
3150
|
+
}
|
|
3151
|
+
};
|
|
3152
|
+
function createResourceParams$2(config) {
|
|
3153
|
+
const resourceParams = {
|
|
3154
|
+
urlParams: {
|
|
3155
|
+
processName: config.processName, programName: config.programName, ruleName: config.ruleName
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
return resourceParams;
|
|
3159
|
+
}
|
|
3160
|
+
function keyBuilder$1(luvio, config) {
|
|
3161
|
+
const resourceParams = createResourceParams$2(config);
|
|
3162
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
3163
|
+
}
|
|
3164
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
3165
|
+
const config = {};
|
|
3166
|
+
const untrustedConfig_processName = untrustedConfig.processName;
|
|
3167
|
+
if (typeof untrustedConfig_processName === 'string') {
|
|
3168
|
+
config.processName = untrustedConfig_processName;
|
|
3169
|
+
}
|
|
3170
|
+
const untrustedConfig_programName = untrustedConfig.programName;
|
|
3171
|
+
if (typeof untrustedConfig_programName === 'string') {
|
|
3172
|
+
config.programName = untrustedConfig_programName;
|
|
3173
|
+
}
|
|
3174
|
+
const untrustedConfig_ruleName = untrustedConfig.ruleName;
|
|
3175
|
+
if (typeof untrustedConfig_ruleName === 'string') {
|
|
3176
|
+
config.ruleName = untrustedConfig_ruleName;
|
|
3177
|
+
}
|
|
3178
|
+
return config;
|
|
3179
|
+
}
|
|
3180
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
3181
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3182
|
+
return null;
|
|
3183
|
+
}
|
|
3184
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3185
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3186
|
+
}
|
|
3187
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
3188
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3189
|
+
return null;
|
|
3190
|
+
}
|
|
3191
|
+
return config;
|
|
3192
|
+
}
|
|
3193
|
+
function adapterFragment(luvio, config) {
|
|
3194
|
+
createResourceParams$2(config);
|
|
3195
|
+
return select$c();
|
|
3196
|
+
}
|
|
3197
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3198
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
3199
|
+
config,
|
|
3200
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3201
|
+
});
|
|
3202
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3203
|
+
}
|
|
3204
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3205
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3206
|
+
config,
|
|
3207
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3208
|
+
});
|
|
3209
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3210
|
+
}
|
|
3211
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
3212
|
+
const resourceParams = createResourceParams$2(config);
|
|
3213
|
+
const request = createResourceRequest$2(resourceParams);
|
|
3214
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3215
|
+
.then((response) => {
|
|
3216
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
3217
|
+
}, (response) => {
|
|
3218
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3219
|
+
});
|
|
3220
|
+
}
|
|
3221
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3222
|
+
const { luvio, config } = context;
|
|
3223
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
3224
|
+
const dispatchOptions = {
|
|
3225
|
+
resourceRequestContext: {
|
|
3226
|
+
requestCorrelator,
|
|
3227
|
+
luvioRequestMethod: undefined,
|
|
3228
|
+
},
|
|
3229
|
+
eventObservers
|
|
3230
|
+
};
|
|
3231
|
+
if (networkPriority !== 'normal') {
|
|
3232
|
+
dispatchOptions.overrides = {
|
|
3233
|
+
priority: networkPriority
|
|
3234
|
+
};
|
|
3235
|
+
}
|
|
3236
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
3237
|
+
}
|
|
3238
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3239
|
+
const { luvio, config } = context;
|
|
3240
|
+
const selector = {
|
|
3241
|
+
recordId: keyBuilder$1(luvio, config),
|
|
3242
|
+
node: adapterFragment(luvio, config),
|
|
3243
|
+
variables: {},
|
|
3244
|
+
};
|
|
3245
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3246
|
+
config,
|
|
3247
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3248
|
+
});
|
|
3249
|
+
return cacheSnapshot;
|
|
3250
|
+
}
|
|
3251
|
+
const getProgramProcessRuleAdapterFactory = (luvio) => function loyaltyEngine__getProgramProcessRule(untrustedConfig, requestContext) {
|
|
3252
|
+
const config = validateAdapterConfig$2(untrustedConfig, getProgramProcessRule_ConfigPropertyNames);
|
|
3253
|
+
// Invalid or incomplete config
|
|
3254
|
+
if (config === null) {
|
|
3255
|
+
return null;
|
|
3256
|
+
}
|
|
3257
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3258
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3259
|
+
};
|
|
3260
|
+
|
|
3261
|
+
function select$b(luvio, params) {
|
|
3262
|
+
return select$f();
|
|
3263
|
+
}
|
|
3264
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
3265
|
+
return getTypeCacheKeys$2(luvio, response);
|
|
3266
|
+
}
|
|
3267
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
3268
|
+
const { body } = response;
|
|
3269
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
3270
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3271
|
+
const snapshot = luvio.storeLookup({
|
|
3272
|
+
recordId: key,
|
|
3273
|
+
node: select$b(),
|
|
3274
|
+
variables: {},
|
|
3275
|
+
});
|
|
3276
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3277
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3278
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
return snapshot;
|
|
3282
|
+
}
|
|
3283
|
+
function createResourceRequest$1(config) {
|
|
3284
|
+
const headers = {};
|
|
3285
|
+
return {
|
|
3286
|
+
baseUri: '/services/data/v58.0',
|
|
3287
|
+
basePath: '/connect/loyalty/programs/' + config.urlParams.programName + '/processes/' + config.urlParams.processName + '/rule/' + config.urlParams.ruleName + '',
|
|
3288
|
+
method: 'patch',
|
|
3289
|
+
body: config.body,
|
|
3290
|
+
urlParams: config.urlParams,
|
|
3291
|
+
queryParams: {},
|
|
3292
|
+
headers,
|
|
3293
|
+
priority: 'normal',
|
|
3294
|
+
};
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
const updateProgramProcessRule_ConfigPropertyNames = {
|
|
3298
|
+
displayName: 'updateProgramProcessRule',
|
|
3299
|
+
parameters: {
|
|
3300
|
+
required: ['processName', 'programName', 'ruleName', 'programProcessRule'],
|
|
3301
|
+
optional: []
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
function createResourceParams$1(config) {
|
|
3305
|
+
const resourceParams = {
|
|
3306
|
+
urlParams: {
|
|
3307
|
+
processName: config.processName, programName: config.programName, ruleName: config.ruleName
|
|
3308
|
+
},
|
|
3309
|
+
body: {
|
|
3310
|
+
programProcessRule: config.programProcessRule
|
|
3311
|
+
}
|
|
3312
|
+
};
|
|
3313
|
+
return resourceParams;
|
|
3314
|
+
}
|
|
3315
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3316
|
+
const config = {};
|
|
3317
|
+
const untrustedConfig_processName = untrustedConfig.processName;
|
|
3318
|
+
if (typeof untrustedConfig_processName === 'string') {
|
|
3319
|
+
config.processName = untrustedConfig_processName;
|
|
3320
|
+
}
|
|
3321
|
+
const untrustedConfig_programName = untrustedConfig.programName;
|
|
3322
|
+
if (typeof untrustedConfig_programName === 'string') {
|
|
3323
|
+
config.programName = untrustedConfig_programName;
|
|
3324
|
+
}
|
|
3325
|
+
const untrustedConfig_ruleName = untrustedConfig.ruleName;
|
|
3326
|
+
if (typeof untrustedConfig_ruleName === 'string') {
|
|
3327
|
+
config.ruleName = untrustedConfig_ruleName;
|
|
3328
|
+
}
|
|
3329
|
+
const untrustedConfig_programProcessRule = untrustedConfig.programProcessRule;
|
|
3330
|
+
const referenceProcessRuleInputRepresentationValidationError = validate$k(untrustedConfig_programProcessRule);
|
|
3331
|
+
if (referenceProcessRuleInputRepresentationValidationError === null) {
|
|
3332
|
+
config.programProcessRule = untrustedConfig_programProcessRule;
|
|
3333
|
+
}
|
|
3334
|
+
return config;
|
|
3335
|
+
}
|
|
3336
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3337
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3338
|
+
return null;
|
|
3339
|
+
}
|
|
3340
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3341
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3342
|
+
}
|
|
3343
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3344
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3345
|
+
return null;
|
|
3346
|
+
}
|
|
3347
|
+
return config;
|
|
3348
|
+
}
|
|
3349
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3350
|
+
const resourceParams = createResourceParams$1(config);
|
|
3351
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3352
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3353
|
+
.then((response) => {
|
|
3354
|
+
return luvio.handleSuccessResponse(() => {
|
|
3355
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
3356
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3357
|
+
}, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
3358
|
+
}, (response) => {
|
|
3359
|
+
deepFreeze$d(response);
|
|
3360
|
+
throw response;
|
|
3361
|
+
});
|
|
3362
|
+
}
|
|
3363
|
+
const updateProgramProcessRuleAdapterFactory = (luvio) => {
|
|
3364
|
+
return function updateProgramProcessRule(untrustedConfig) {
|
|
3365
|
+
const config = validateAdapterConfig$1(untrustedConfig, updateProgramProcessRule_ConfigPropertyNames);
|
|
3366
|
+
// Invalid or incomplete config
|
|
3367
|
+
if (config === null) {
|
|
3368
|
+
throw new Error('Invalid config for "updateProgramProcessRule"');
|
|
3369
|
+
}
|
|
3370
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
3371
|
+
};
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3374
|
+
function validate$b(obj, path = 'LoyaltyEngineRunSettingsRepresentation') {
|
|
3375
|
+
const v_error = (() => {
|
|
3376
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3377
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3378
|
+
}
|
|
3379
|
+
const obj_isSimulation = obj.isSimulation;
|
|
3380
|
+
const path_isSimulation = path + '.isSimulation';
|
|
3381
|
+
if (typeof obj_isSimulation !== 'boolean') {
|
|
3382
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSimulation + '" (at "' + path_isSimulation + '")');
|
|
3383
|
+
}
|
|
3384
|
+
})();
|
|
3385
|
+
return v_error === undefined ? null : v_error;
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
function validate$a(obj, path = 'LoyaltyEngineInputRepresentation') {
|
|
3389
|
+
const v_error = (() => {
|
|
3390
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3391
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3392
|
+
}
|
|
3393
|
+
const obj_runSetting = obj.runSetting;
|
|
3394
|
+
const path_runSetting = path + '.runSetting';
|
|
3395
|
+
const referencepath_runSettingValidationError = validate$b(obj_runSetting, path_runSetting);
|
|
3396
|
+
if (referencepath_runSettingValidationError !== null) {
|
|
3397
|
+
let message = 'Object doesn\'t match LoyaltyEngineRunSettingsRepresentation (at "' + path_runSetting + '")\n';
|
|
3398
|
+
message += referencepath_runSettingValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3399
|
+
return new TypeError(message);
|
|
3400
|
+
}
|
|
3401
|
+
const obj_transactionJournals = obj.transactionJournals;
|
|
3402
|
+
const path_transactionJournals = path + '.transactionJournals';
|
|
3403
|
+
if (!ArrayIsArray(obj_transactionJournals)) {
|
|
3404
|
+
return new TypeError('Expected "array" but received "' + typeof obj_transactionJournals + '" (at "' + path_transactionJournals + '")');
|
|
3405
|
+
}
|
|
3406
|
+
for (let i = 0; i < obj_transactionJournals.length; i++) {
|
|
3407
|
+
const obj_transactionJournals_item = obj_transactionJournals[i];
|
|
3408
|
+
const path_transactionJournals_item = path_transactionJournals + '[' + i + ']';
|
|
3409
|
+
if (typeof obj_transactionJournals_item !== 'object' || ArrayIsArray(obj_transactionJournals_item) || obj_transactionJournals_item === null) {
|
|
3410
|
+
return new TypeError('Expected "object" but received "' + typeof obj_transactionJournals_item + '" (at "' + path_transactionJournals_item + '")');
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
})();
|
|
3414
|
+
return v_error === undefined ? null : v_error;
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
const VERSION$9 = "0241daf5ae464ec811e3c3f4ab433a0f";
|
|
3418
|
+
function validate$9(obj, path = 'MemberCurrencyRepresentation') {
|
|
3419
|
+
const v_error = (() => {
|
|
3420
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3421
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3422
|
+
}
|
|
3423
|
+
const obj_currencyName = obj.currencyName;
|
|
3424
|
+
const path_currencyName = path + '.currencyName';
|
|
3425
|
+
if (typeof obj_currencyName !== 'string') {
|
|
3426
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currencyName + '" (at "' + path_currencyName + '")');
|
|
3427
|
+
}
|
|
3428
|
+
const obj_currencyType = obj.currencyType;
|
|
3429
|
+
const path_currencyType = path + '.currencyType';
|
|
3430
|
+
if (typeof obj_currencyType !== 'string') {
|
|
3431
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currencyType + '" (at "' + path_currencyType + '")');
|
|
3432
|
+
}
|
|
3433
|
+
obj.escrowPointsBalance;
|
|
3434
|
+
obj.pointsBalance;
|
|
3435
|
+
})();
|
|
3436
|
+
return v_error === undefined ? null : v_error;
|
|
3437
|
+
}
|
|
3438
|
+
const select$a = function MemberCurrencyRepresentationSelect() {
|
|
3439
|
+
return {
|
|
3440
|
+
kind: 'Fragment',
|
|
3441
|
+
version: VERSION$9,
|
|
3442
|
+
private: [],
|
|
3443
|
+
selections: [
|
|
3444
|
+
{
|
|
3445
|
+
name: 'currencyName',
|
|
3446
|
+
kind: 'Scalar'
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
name: 'currencyType',
|
|
3450
|
+
kind: 'Scalar'
|
|
3451
|
+
},
|
|
3452
|
+
{
|
|
3453
|
+
name: 'escrowPointsBalance',
|
|
3454
|
+
kind: 'Scalar'
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
name: 'pointsBalance',
|
|
3458
|
+
kind: 'Scalar'
|
|
3459
|
+
}
|
|
3460
|
+
]
|
|
3461
|
+
};
|
|
3462
|
+
};
|
|
3463
|
+
function equals$9(existing, incoming) {
|
|
3464
|
+
const existing_currencyName = existing.currencyName;
|
|
3465
|
+
const incoming_currencyName = incoming.currencyName;
|
|
3466
|
+
if (!(existing_currencyName === incoming_currencyName)) {
|
|
3467
|
+
return false;
|
|
3468
|
+
}
|
|
3469
|
+
const existing_currencyType = existing.currencyType;
|
|
3470
|
+
const incoming_currencyType = incoming.currencyType;
|
|
3471
|
+
if (!(existing_currencyType === incoming_currencyType)) {
|
|
3472
|
+
return false;
|
|
3473
|
+
}
|
|
3474
|
+
const existing_escrowPointsBalance = existing.escrowPointsBalance;
|
|
3475
|
+
const incoming_escrowPointsBalance = incoming.escrowPointsBalance;
|
|
3476
|
+
if (!(existing_escrowPointsBalance === incoming_escrowPointsBalance)) {
|
|
3477
|
+
return false;
|
|
3478
|
+
}
|
|
3479
|
+
const existing_pointsBalance = existing.pointsBalance;
|
|
3480
|
+
const incoming_pointsBalance = incoming.pointsBalance;
|
|
3481
|
+
if (!(existing_pointsBalance === incoming_pointsBalance)) {
|
|
3482
|
+
return false;
|
|
3483
|
+
}
|
|
3484
|
+
return true;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
const VERSION$8 = "98e59bb056ad73e31c0a6aeb94595f40";
|
|
3488
|
+
function validate$8(obj, path = 'MemberPointsBalanceRepresentation') {
|
|
3489
|
+
const v_error = (() => {
|
|
3490
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3491
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3492
|
+
}
|
|
3493
|
+
const obj_memberCurrencies = obj.memberCurrencies;
|
|
3494
|
+
const path_memberCurrencies = path + '.memberCurrencies';
|
|
3495
|
+
if (!ArrayIsArray(obj_memberCurrencies)) {
|
|
3496
|
+
return new TypeError('Expected "array" but received "' + typeof obj_memberCurrencies + '" (at "' + path_memberCurrencies + '")');
|
|
3497
|
+
}
|
|
3498
|
+
for (let i = 0; i < obj_memberCurrencies.length; i++) {
|
|
3499
|
+
const obj_memberCurrencies_item = obj_memberCurrencies[i];
|
|
3500
|
+
const path_memberCurrencies_item = path_memberCurrencies + '[' + i + ']';
|
|
3501
|
+
const referencepath_memberCurrencies_itemValidationError = validate$9(obj_memberCurrencies_item, path_memberCurrencies_item);
|
|
3502
|
+
if (referencepath_memberCurrencies_itemValidationError !== null) {
|
|
3503
|
+
let message = 'Object doesn\'t match MemberCurrencyRepresentation (at "' + path_memberCurrencies_item + '")\n';
|
|
3504
|
+
message += referencepath_memberCurrencies_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3505
|
+
return new TypeError(message);
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
const obj_memberShipNumber = obj.memberShipNumber;
|
|
3509
|
+
const path_memberShipNumber = path + '.memberShipNumber';
|
|
3510
|
+
if (typeof obj_memberShipNumber !== 'string') {
|
|
3511
|
+
return new TypeError('Expected "string" but received "' + typeof obj_memberShipNumber + '" (at "' + path_memberShipNumber + '")');
|
|
3512
|
+
}
|
|
3513
|
+
})();
|
|
3514
|
+
return v_error === undefined ? null : v_error;
|
|
3515
|
+
}
|
|
3516
|
+
const select$9 = function MemberPointsBalanceRepresentationSelect() {
|
|
3517
|
+
const { selections: MemberCurrencyRepresentation__selections, opaque: MemberCurrencyRepresentation__opaque, } = select$a();
|
|
3518
|
+
return {
|
|
3519
|
+
kind: 'Fragment',
|
|
3520
|
+
version: VERSION$8,
|
|
3521
|
+
private: [],
|
|
3522
|
+
selections: [
|
|
3523
|
+
{
|
|
3524
|
+
name: 'memberCurrencies',
|
|
3525
|
+
kind: 'Object',
|
|
3526
|
+
plural: true,
|
|
3527
|
+
selections: MemberCurrencyRepresentation__selections
|
|
3528
|
+
},
|
|
3529
|
+
{
|
|
3530
|
+
name: 'memberShipNumber',
|
|
3531
|
+
kind: 'Scalar'
|
|
3532
|
+
}
|
|
3533
|
+
]
|
|
3534
|
+
};
|
|
3535
|
+
};
|
|
3536
|
+
function equals$8(existing, incoming) {
|
|
3537
|
+
const existing_memberShipNumber = existing.memberShipNumber;
|
|
3538
|
+
const incoming_memberShipNumber = incoming.memberShipNumber;
|
|
3539
|
+
if (!(existing_memberShipNumber === incoming_memberShipNumber)) {
|
|
3540
|
+
return false;
|
|
3541
|
+
}
|
|
3542
|
+
const existing_memberCurrencies = existing.memberCurrencies;
|
|
3543
|
+
const incoming_memberCurrencies = incoming.memberCurrencies;
|
|
3544
|
+
const equals_memberCurrencies_items = equalsArray(existing_memberCurrencies, incoming_memberCurrencies, (existing_memberCurrencies_item, incoming_memberCurrencies_item) => {
|
|
3545
|
+
if (!(equals$9(existing_memberCurrencies_item, incoming_memberCurrencies_item))) {
|
|
3546
|
+
return false;
|
|
3547
|
+
}
|
|
3548
|
+
});
|
|
3549
|
+
if (equals_memberCurrencies_items === false) {
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3552
|
+
return true;
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
const VERSION$7 = "79600d919e7f40229fadfcddd2766286";
|
|
3556
|
+
function validate$7(obj, path = 'MemberCurrencyChangeRepresentation') {
|
|
3557
|
+
const v_error = (() => {
|
|
3558
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3559
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3560
|
+
}
|
|
3561
|
+
obj.changeInEscrowPointsBalance;
|
|
3562
|
+
obj.changeInPointsBalance;
|
|
3563
|
+
const obj_currencyName = obj.currencyName;
|
|
3564
|
+
const path_currencyName = path + '.currencyName';
|
|
3565
|
+
if (typeof obj_currencyName !== 'string') {
|
|
3566
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currencyName + '" (at "' + path_currencyName + '")');
|
|
3567
|
+
}
|
|
3568
|
+
const obj_currencyType = obj.currencyType;
|
|
3569
|
+
const path_currencyType = path + '.currencyType';
|
|
3570
|
+
if (typeof obj_currencyType !== 'string') {
|
|
3571
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currencyType + '" (at "' + path_currencyType + '")');
|
|
3572
|
+
}
|
|
3573
|
+
const obj_promotionId = obj.promotionId;
|
|
3574
|
+
const path_promotionId = path + '.promotionId';
|
|
3575
|
+
if (typeof obj_promotionId !== 'string') {
|
|
3576
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
3577
|
+
}
|
|
3578
|
+
})();
|
|
3579
|
+
return v_error === undefined ? null : v_error;
|
|
3580
|
+
}
|
|
3581
|
+
const select$8 = function MemberCurrencyChangeRepresentationSelect() {
|
|
3582
|
+
return {
|
|
3583
|
+
kind: 'Fragment',
|
|
3584
|
+
version: VERSION$7,
|
|
3585
|
+
private: [],
|
|
3586
|
+
selections: [
|
|
3587
|
+
{
|
|
3588
|
+
name: 'changeInEscrowPointsBalance',
|
|
3589
|
+
kind: 'Scalar'
|
|
3590
|
+
},
|
|
3591
|
+
{
|
|
3592
|
+
name: 'changeInPointsBalance',
|
|
3593
|
+
kind: 'Scalar'
|
|
3594
|
+
},
|
|
3595
|
+
{
|
|
3596
|
+
name: 'currencyName',
|
|
3597
|
+
kind: 'Scalar'
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
name: 'currencyType',
|
|
3601
|
+
kind: 'Scalar'
|
|
3602
|
+
},
|
|
3603
|
+
{
|
|
3604
|
+
name: 'promotionId',
|
|
3605
|
+
kind: 'Scalar'
|
|
3606
|
+
}
|
|
3607
|
+
]
|
|
3608
|
+
};
|
|
3609
|
+
};
|
|
3610
|
+
function equals$7(existing, incoming) {
|
|
3611
|
+
const existing_currencyName = existing.currencyName;
|
|
3612
|
+
const incoming_currencyName = incoming.currencyName;
|
|
3613
|
+
if (!(existing_currencyName === incoming_currencyName)) {
|
|
3614
|
+
return false;
|
|
3615
|
+
}
|
|
3616
|
+
const existing_currencyType = existing.currencyType;
|
|
3617
|
+
const incoming_currencyType = incoming.currencyType;
|
|
3618
|
+
if (!(existing_currencyType === incoming_currencyType)) {
|
|
3619
|
+
return false;
|
|
3620
|
+
}
|
|
3621
|
+
const existing_promotionId = existing.promotionId;
|
|
3622
|
+
const incoming_promotionId = incoming.promotionId;
|
|
3623
|
+
if (!(existing_promotionId === incoming_promotionId)) {
|
|
3624
|
+
return false;
|
|
3625
|
+
}
|
|
3626
|
+
const existing_changeInEscrowPointsBalance = existing.changeInEscrowPointsBalance;
|
|
3627
|
+
const incoming_changeInEscrowPointsBalance = incoming.changeInEscrowPointsBalance;
|
|
3628
|
+
if (!(existing_changeInEscrowPointsBalance === incoming_changeInEscrowPointsBalance)) {
|
|
3629
|
+
return false;
|
|
3630
|
+
}
|
|
3631
|
+
const existing_changeInPointsBalance = existing.changeInPointsBalance;
|
|
3632
|
+
const incoming_changeInPointsBalance = incoming.changeInPointsBalance;
|
|
3633
|
+
if (!(existing_changeInPointsBalance === incoming_changeInPointsBalance)) {
|
|
3634
|
+
return false;
|
|
3635
|
+
}
|
|
3636
|
+
return true;
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
const VERSION$6 = "3f58d1cb55c1ecf896f214deecabcbcb";
|
|
3640
|
+
function validate$6(obj, path = 'MemberPointsBalanceChangeRepresentation') {
|
|
3641
|
+
const v_error = (() => {
|
|
3642
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3643
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3644
|
+
}
|
|
3645
|
+
const obj_changeInMemberCurrencies = obj.changeInMemberCurrencies;
|
|
3646
|
+
const path_changeInMemberCurrencies = path + '.changeInMemberCurrencies';
|
|
3647
|
+
if (!ArrayIsArray(obj_changeInMemberCurrencies)) {
|
|
3648
|
+
return new TypeError('Expected "array" but received "' + typeof obj_changeInMemberCurrencies + '" (at "' + path_changeInMemberCurrencies + '")');
|
|
3649
|
+
}
|
|
3650
|
+
for (let i = 0; i < obj_changeInMemberCurrencies.length; i++) {
|
|
3651
|
+
const obj_changeInMemberCurrencies_item = obj_changeInMemberCurrencies[i];
|
|
3652
|
+
const path_changeInMemberCurrencies_item = path_changeInMemberCurrencies + '[' + i + ']';
|
|
3653
|
+
const referencepath_changeInMemberCurrencies_itemValidationError = validate$7(obj_changeInMemberCurrencies_item, path_changeInMemberCurrencies_item);
|
|
3654
|
+
if (referencepath_changeInMemberCurrencies_itemValidationError !== null) {
|
|
3655
|
+
let message = 'Object doesn\'t match MemberCurrencyChangeRepresentation (at "' + path_changeInMemberCurrencies_item + '")\n';
|
|
3656
|
+
message += referencepath_changeInMemberCurrencies_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3657
|
+
return new TypeError(message);
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
const obj_memberShipNumber = obj.memberShipNumber;
|
|
3661
|
+
const path_memberShipNumber = path + '.memberShipNumber';
|
|
3662
|
+
if (typeof obj_memberShipNumber !== 'string') {
|
|
3663
|
+
return new TypeError('Expected "string" but received "' + typeof obj_memberShipNumber + '" (at "' + path_memberShipNumber + '")');
|
|
3664
|
+
}
|
|
3665
|
+
})();
|
|
3666
|
+
return v_error === undefined ? null : v_error;
|
|
3667
|
+
}
|
|
3668
|
+
const select$7 = function MemberPointsBalanceChangeRepresentationSelect() {
|
|
3669
|
+
const { selections: MemberCurrencyChangeRepresentation__selections, opaque: MemberCurrencyChangeRepresentation__opaque, } = select$8();
|
|
3670
|
+
return {
|
|
3671
|
+
kind: 'Fragment',
|
|
3672
|
+
version: VERSION$6,
|
|
3673
|
+
private: [],
|
|
3674
|
+
selections: [
|
|
3675
|
+
{
|
|
3676
|
+
name: 'changeInMemberCurrencies',
|
|
3677
|
+
kind: 'Object',
|
|
3678
|
+
plural: true,
|
|
3679
|
+
selections: MemberCurrencyChangeRepresentation__selections
|
|
3680
|
+
},
|
|
3681
|
+
{
|
|
3682
|
+
name: 'memberShipNumber',
|
|
3683
|
+
kind: 'Scalar'
|
|
3684
|
+
}
|
|
3685
|
+
]
|
|
3686
|
+
};
|
|
3687
|
+
};
|
|
3688
|
+
function equals$6(existing, incoming) {
|
|
3689
|
+
const existing_memberShipNumber = existing.memberShipNumber;
|
|
3690
|
+
const incoming_memberShipNumber = incoming.memberShipNumber;
|
|
3691
|
+
if (!(existing_memberShipNumber === incoming_memberShipNumber)) {
|
|
3692
|
+
return false;
|
|
3693
|
+
}
|
|
3694
|
+
const existing_changeInMemberCurrencies = existing.changeInMemberCurrencies;
|
|
3695
|
+
const incoming_changeInMemberCurrencies = incoming.changeInMemberCurrencies;
|
|
3696
|
+
const equals_changeInMemberCurrencies_items = equalsArray(existing_changeInMemberCurrencies, incoming_changeInMemberCurrencies, (existing_changeInMemberCurrencies_item, incoming_changeInMemberCurrencies_item) => {
|
|
3697
|
+
if (!(equals$7(existing_changeInMemberCurrencies_item, incoming_changeInMemberCurrencies_item))) {
|
|
3698
|
+
return false;
|
|
3699
|
+
}
|
|
3700
|
+
});
|
|
3701
|
+
if (equals_changeInMemberCurrencies_items === false) {
|
|
3702
|
+
return false;
|
|
3703
|
+
}
|
|
3704
|
+
return true;
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
const VERSION$5 = "f4eff4ba9612d9a81dca3e7840210efa";
|
|
3708
|
+
function validate$5(obj, path = 'VoucherOutputRepresentation') {
|
|
3709
|
+
const v_error = (() => {
|
|
3710
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3711
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3712
|
+
}
|
|
3713
|
+
const obj_discountPercent = obj.discountPercent;
|
|
3714
|
+
const path_discountPercent = path + '.discountPercent';
|
|
3715
|
+
if (typeof obj_discountPercent !== 'number' || (typeof obj_discountPercent === 'number' && Math.floor(obj_discountPercent) !== obj_discountPercent)) {
|
|
3716
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_discountPercent + '" (at "' + path_discountPercent + '")');
|
|
3717
|
+
}
|
|
3718
|
+
const obj_effectiveDate = obj.effectiveDate;
|
|
3719
|
+
const path_effectiveDate = path + '.effectiveDate';
|
|
3720
|
+
if (typeof obj_effectiveDate !== 'string') {
|
|
3721
|
+
return new TypeError('Expected "string" but received "' + typeof obj_effectiveDate + '" (at "' + path_effectiveDate + '")');
|
|
3722
|
+
}
|
|
3723
|
+
const obj_expirationDate = obj.expirationDate;
|
|
3724
|
+
const path_expirationDate = path + '.expirationDate';
|
|
3725
|
+
if (typeof obj_expirationDate !== 'string') {
|
|
3726
|
+
return new TypeError('Expected "string" but received "' + typeof obj_expirationDate + '" (at "' + path_expirationDate + '")');
|
|
3727
|
+
}
|
|
3728
|
+
obj.faceValue;
|
|
3729
|
+
const obj_productId = obj.productId;
|
|
3730
|
+
const path_productId = path + '.productId';
|
|
3731
|
+
if (typeof obj_productId !== 'string') {
|
|
3732
|
+
return new TypeError('Expected "string" but received "' + typeof obj_productId + '" (at "' + path_productId + '")');
|
|
3733
|
+
}
|
|
3734
|
+
const obj_promotionId = obj.promotionId;
|
|
3735
|
+
const path_promotionId = path + '.promotionId';
|
|
3736
|
+
if (typeof obj_promotionId !== 'string') {
|
|
3737
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promotionId + '" (at "' + path_promotionId + '")');
|
|
3738
|
+
}
|
|
3739
|
+
const obj_voucherCode = obj.voucherCode;
|
|
3740
|
+
const path_voucherCode = path + '.voucherCode';
|
|
3741
|
+
if (typeof obj_voucherCode !== 'string') {
|
|
3742
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherCode + '" (at "' + path_voucherCode + '")');
|
|
3743
|
+
}
|
|
3744
|
+
const obj_voucherDefinitionName = obj.voucherDefinitionName;
|
|
3745
|
+
const path_voucherDefinitionName = path + '.voucherDefinitionName';
|
|
3746
|
+
if (typeof obj_voucherDefinitionName !== 'string') {
|
|
3747
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherDefinitionName + '" (at "' + path_voucherDefinitionName + '")');
|
|
3748
|
+
}
|
|
3749
|
+
const obj_voucherId = obj.voucherId;
|
|
3750
|
+
const path_voucherId = path + '.voucherId';
|
|
3751
|
+
if (typeof obj_voucherId !== 'string') {
|
|
3752
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voucherId + '" (at "' + path_voucherId + '")');
|
|
3753
|
+
}
|
|
3754
|
+
})();
|
|
3755
|
+
return v_error === undefined ? null : v_error;
|
|
3756
|
+
}
|
|
3757
|
+
const select$6 = function VoucherOutputRepresentationSelect() {
|
|
3758
|
+
return {
|
|
3759
|
+
kind: 'Fragment',
|
|
3760
|
+
version: VERSION$5,
|
|
3761
|
+
private: [],
|
|
3762
|
+
selections: [
|
|
3763
|
+
{
|
|
3764
|
+
name: 'discountPercent',
|
|
3765
|
+
kind: 'Scalar'
|
|
3766
|
+
},
|
|
3767
|
+
{
|
|
3768
|
+
name: 'effectiveDate',
|
|
3769
|
+
kind: 'Scalar'
|
|
3770
|
+
},
|
|
3771
|
+
{
|
|
3772
|
+
name: 'expirationDate',
|
|
3773
|
+
kind: 'Scalar'
|
|
3774
|
+
},
|
|
3775
|
+
{
|
|
3776
|
+
name: 'faceValue',
|
|
3777
|
+
kind: 'Scalar'
|
|
3778
|
+
},
|
|
3779
|
+
{
|
|
3780
|
+
name: 'productId',
|
|
3781
|
+
kind: 'Scalar'
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
name: 'promotionId',
|
|
3785
|
+
kind: 'Scalar'
|
|
3786
|
+
},
|
|
3787
|
+
{
|
|
3788
|
+
name: 'voucherCode',
|
|
3789
|
+
kind: 'Scalar'
|
|
3790
|
+
},
|
|
3791
|
+
{
|
|
3792
|
+
name: 'voucherDefinitionName',
|
|
3793
|
+
kind: 'Scalar'
|
|
3794
|
+
},
|
|
3795
|
+
{
|
|
3796
|
+
name: 'voucherId',
|
|
3797
|
+
kind: 'Scalar'
|
|
3798
|
+
}
|
|
3799
|
+
]
|
|
3800
|
+
};
|
|
3801
|
+
};
|
|
3802
|
+
function equals$5(existing, incoming) {
|
|
3803
|
+
const existing_discountPercent = existing.discountPercent;
|
|
3804
|
+
const incoming_discountPercent = incoming.discountPercent;
|
|
3805
|
+
if (!(existing_discountPercent === incoming_discountPercent)) {
|
|
3806
|
+
return false;
|
|
3807
|
+
}
|
|
3808
|
+
const existing_effectiveDate = existing.effectiveDate;
|
|
3809
|
+
const incoming_effectiveDate = incoming.effectiveDate;
|
|
3810
|
+
if (!(existing_effectiveDate === incoming_effectiveDate)) {
|
|
3811
|
+
return false;
|
|
3812
|
+
}
|
|
3813
|
+
const existing_expirationDate = existing.expirationDate;
|
|
3814
|
+
const incoming_expirationDate = incoming.expirationDate;
|
|
3815
|
+
if (!(existing_expirationDate === incoming_expirationDate)) {
|
|
3816
|
+
return false;
|
|
3817
|
+
}
|
|
3818
|
+
const existing_productId = existing.productId;
|
|
3819
|
+
const incoming_productId = incoming.productId;
|
|
3820
|
+
if (!(existing_productId === incoming_productId)) {
|
|
3821
|
+
return false;
|
|
3822
|
+
}
|
|
3823
|
+
const existing_promotionId = existing.promotionId;
|
|
3824
|
+
const incoming_promotionId = incoming.promotionId;
|
|
3825
|
+
if (!(existing_promotionId === incoming_promotionId)) {
|
|
3826
|
+
return false;
|
|
3827
|
+
}
|
|
3828
|
+
const existing_voucherCode = existing.voucherCode;
|
|
3829
|
+
const incoming_voucherCode = incoming.voucherCode;
|
|
3830
|
+
if (!(existing_voucherCode === incoming_voucherCode)) {
|
|
3831
|
+
return false;
|
|
3832
|
+
}
|
|
3833
|
+
const existing_voucherDefinitionName = existing.voucherDefinitionName;
|
|
3834
|
+
const incoming_voucherDefinitionName = incoming.voucherDefinitionName;
|
|
3835
|
+
if (!(existing_voucherDefinitionName === incoming_voucherDefinitionName)) {
|
|
3836
|
+
return false;
|
|
3837
|
+
}
|
|
3838
|
+
const existing_voucherId = existing.voucherId;
|
|
3839
|
+
const incoming_voucherId = incoming.voucherId;
|
|
3840
|
+
if (!(existing_voucherId === incoming_voucherId)) {
|
|
3841
|
+
return false;
|
|
3842
|
+
}
|
|
3843
|
+
const existing_faceValue = existing.faceValue;
|
|
3844
|
+
const incoming_faceValue = incoming.faceValue;
|
|
3845
|
+
if (!(existing_faceValue === incoming_faceValue)) {
|
|
3846
|
+
return false;
|
|
3847
|
+
}
|
|
3848
|
+
return true;
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
const VERSION$4 = "96b446ff15cc879a193e1b71a0ef3ffd";
|
|
3852
|
+
function validate$4(obj, path = 'VoucherResultRepresentation') {
|
|
3853
|
+
const v_error = (() => {
|
|
3854
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3855
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3856
|
+
}
|
|
3857
|
+
const obj_vouchersIssued = obj.vouchersIssued;
|
|
3858
|
+
const path_vouchersIssued = path + '.vouchersIssued';
|
|
3859
|
+
if (!ArrayIsArray(obj_vouchersIssued)) {
|
|
3860
|
+
return new TypeError('Expected "array" but received "' + typeof obj_vouchersIssued + '" (at "' + path_vouchersIssued + '")');
|
|
3861
|
+
}
|
|
3862
|
+
for (let i = 0; i < obj_vouchersIssued.length; i++) {
|
|
3863
|
+
const obj_vouchersIssued_item = obj_vouchersIssued[i];
|
|
3864
|
+
const path_vouchersIssued_item = path_vouchersIssued + '[' + i + ']';
|
|
3865
|
+
const referencepath_vouchersIssued_itemValidationError = validate$5(obj_vouchersIssued_item, path_vouchersIssued_item);
|
|
3866
|
+
if (referencepath_vouchersIssued_itemValidationError !== null) {
|
|
3867
|
+
let message = 'Object doesn\'t match VoucherOutputRepresentation (at "' + path_vouchersIssued_item + '")\n';
|
|
3868
|
+
message += referencepath_vouchersIssued_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3869
|
+
return new TypeError(message);
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
})();
|
|
3873
|
+
return v_error === undefined ? null : v_error;
|
|
3874
|
+
}
|
|
3875
|
+
const select$5 = function VoucherResultRepresentationSelect() {
|
|
3876
|
+
const { selections: VoucherOutputRepresentation__selections, opaque: VoucherOutputRepresentation__opaque, } = select$6();
|
|
3877
|
+
return {
|
|
3878
|
+
kind: 'Fragment',
|
|
3879
|
+
version: VERSION$4,
|
|
3880
|
+
private: [],
|
|
3881
|
+
selections: [
|
|
3882
|
+
{
|
|
3883
|
+
name: 'vouchersIssued',
|
|
3884
|
+
kind: 'Object',
|
|
3885
|
+
plural: true,
|
|
3886
|
+
selections: VoucherOutputRepresentation__selections
|
|
3887
|
+
}
|
|
3888
|
+
]
|
|
3889
|
+
};
|
|
3890
|
+
};
|
|
3891
|
+
function equals$4(existing, incoming) {
|
|
3892
|
+
const existing_vouchersIssued = existing.vouchersIssued;
|
|
3893
|
+
const incoming_vouchersIssued = incoming.vouchersIssued;
|
|
3894
|
+
const equals_vouchersIssued_items = equalsArray(existing_vouchersIssued, incoming_vouchersIssued, (existing_vouchersIssued_item, incoming_vouchersIssued_item) => {
|
|
3895
|
+
if (!(equals$5(existing_vouchersIssued_item, incoming_vouchersIssued_item))) {
|
|
3896
|
+
return false;
|
|
3897
|
+
}
|
|
3898
|
+
});
|
|
3899
|
+
if (equals_vouchersIssued_items === false) {
|
|
3900
|
+
return false;
|
|
3901
|
+
}
|
|
3902
|
+
return true;
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
const VERSION$3 = "1910eedcb21900b491ce6be270d7d949";
|
|
3906
|
+
function validate$3(obj, path = 'TransactionJournalResultRepresentation') {
|
|
3907
|
+
const v_error = (() => {
|
|
3908
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3909
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3910
|
+
}
|
|
3911
|
+
const obj_changeInMemberPoints = obj.changeInMemberPoints;
|
|
3912
|
+
const path_changeInMemberPoints = path + '.changeInMemberPoints';
|
|
3913
|
+
if (!ArrayIsArray(obj_changeInMemberPoints)) {
|
|
3914
|
+
return new TypeError('Expected "array" but received "' + typeof obj_changeInMemberPoints + '" (at "' + path_changeInMemberPoints + '")');
|
|
3915
|
+
}
|
|
3916
|
+
for (let i = 0; i < obj_changeInMemberPoints.length; i++) {
|
|
3917
|
+
const obj_changeInMemberPoints_item = obj_changeInMemberPoints[i];
|
|
3918
|
+
const path_changeInMemberPoints_item = path_changeInMemberPoints + '[' + i + ']';
|
|
3919
|
+
const referencepath_changeInMemberPoints_itemValidationError = validate$6(obj_changeInMemberPoints_item, path_changeInMemberPoints_item);
|
|
3920
|
+
if (referencepath_changeInMemberPoints_itemValidationError !== null) {
|
|
3921
|
+
let message = 'Object doesn\'t match MemberPointsBalanceChangeRepresentation (at "' + path_changeInMemberPoints_item + '")\n';
|
|
3922
|
+
message += referencepath_changeInMemberPoints_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3923
|
+
return new TypeError(message);
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
const obj_id = obj.id;
|
|
3927
|
+
const path_id = path + '.id';
|
|
3928
|
+
if (typeof obj_id !== 'string') {
|
|
3929
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
3930
|
+
}
|
|
3931
|
+
const obj_voucherResult = obj.voucherResult;
|
|
3932
|
+
const path_voucherResult = path + '.voucherResult';
|
|
3933
|
+
const referencepath_voucherResultValidationError = validate$4(obj_voucherResult, path_voucherResult);
|
|
3934
|
+
if (referencepath_voucherResultValidationError !== null) {
|
|
3935
|
+
let message = 'Object doesn\'t match VoucherResultRepresentation (at "' + path_voucherResult + '")\n';
|
|
3936
|
+
message += referencepath_voucherResultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3937
|
+
return new TypeError(message);
|
|
3938
|
+
}
|
|
3939
|
+
})();
|
|
3940
|
+
return v_error === undefined ? null : v_error;
|
|
3941
|
+
}
|
|
3942
|
+
const select$4 = function TransactionJournalResultRepresentationSelect() {
|
|
3943
|
+
const { selections: MemberPointsBalanceChangeRepresentation__selections, opaque: MemberPointsBalanceChangeRepresentation__opaque, } = select$7();
|
|
3944
|
+
const { selections: VoucherResultRepresentation__selections, opaque: VoucherResultRepresentation__opaque, } = select$5();
|
|
3945
|
+
return {
|
|
3946
|
+
kind: 'Fragment',
|
|
3947
|
+
version: VERSION$3,
|
|
3948
|
+
private: [],
|
|
3949
|
+
selections: [
|
|
3950
|
+
{
|
|
3951
|
+
name: 'changeInMemberPoints',
|
|
3952
|
+
kind: 'Object',
|
|
3953
|
+
plural: true,
|
|
3954
|
+
selections: MemberPointsBalanceChangeRepresentation__selections
|
|
3955
|
+
},
|
|
3956
|
+
{
|
|
3957
|
+
name: 'id',
|
|
3958
|
+
kind: 'Scalar'
|
|
3959
|
+
},
|
|
3960
|
+
{
|
|
3961
|
+
name: 'voucherResult',
|
|
3962
|
+
kind: 'Object',
|
|
3963
|
+
selections: VoucherResultRepresentation__selections
|
|
3964
|
+
}
|
|
3965
|
+
]
|
|
3966
|
+
};
|
|
3967
|
+
};
|
|
3968
|
+
function equals$3(existing, incoming) {
|
|
3969
|
+
const existing_id = existing.id;
|
|
3970
|
+
const incoming_id = incoming.id;
|
|
3971
|
+
if (!(existing_id === incoming_id)) {
|
|
3972
|
+
return false;
|
|
3973
|
+
}
|
|
3974
|
+
const existing_changeInMemberPoints = existing.changeInMemberPoints;
|
|
3975
|
+
const incoming_changeInMemberPoints = incoming.changeInMemberPoints;
|
|
3976
|
+
const equals_changeInMemberPoints_items = equalsArray(existing_changeInMemberPoints, incoming_changeInMemberPoints, (existing_changeInMemberPoints_item, incoming_changeInMemberPoints_item) => {
|
|
3977
|
+
if (!(equals$6(existing_changeInMemberPoints_item, incoming_changeInMemberPoints_item))) {
|
|
3978
|
+
return false;
|
|
3979
|
+
}
|
|
3980
|
+
});
|
|
3981
|
+
if (equals_changeInMemberPoints_items === false) {
|
|
3982
|
+
return false;
|
|
3983
|
+
}
|
|
3984
|
+
const existing_voucherResult = existing.voucherResult;
|
|
3985
|
+
const incoming_voucherResult = incoming.voucherResult;
|
|
3986
|
+
if (!(equals$4(existing_voucherResult, incoming_voucherResult))) {
|
|
3987
|
+
return false;
|
|
3988
|
+
}
|
|
3989
|
+
return true;
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
const VERSION$2 = "4368a48af4cef1c5302783e5c0bc5f4f";
|
|
3993
|
+
function validate$2(obj, path = 'ProcessResultRepresentation') {
|
|
3994
|
+
const v_error = (() => {
|
|
3995
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3996
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3997
|
+
}
|
|
3998
|
+
const obj_memberPointsBalance = obj.memberPointsBalance;
|
|
3999
|
+
const path_memberPointsBalance = path + '.memberPointsBalance';
|
|
4000
|
+
if (!ArrayIsArray(obj_memberPointsBalance)) {
|
|
4001
|
+
return new TypeError('Expected "array" but received "' + typeof obj_memberPointsBalance + '" (at "' + path_memberPointsBalance + '")');
|
|
4002
|
+
}
|
|
4003
|
+
for (let i = 0; i < obj_memberPointsBalance.length; i++) {
|
|
4004
|
+
const obj_memberPointsBalance_item = obj_memberPointsBalance[i];
|
|
4005
|
+
const path_memberPointsBalance_item = path_memberPointsBalance + '[' + i + ']';
|
|
4006
|
+
const referencepath_memberPointsBalance_itemValidationError = validate$8(obj_memberPointsBalance_item, path_memberPointsBalance_item);
|
|
4007
|
+
if (referencepath_memberPointsBalance_itemValidationError !== null) {
|
|
4008
|
+
let message = 'Object doesn\'t match MemberPointsBalanceRepresentation (at "' + path_memberPointsBalance_item + '")\n';
|
|
4009
|
+
message += referencepath_memberPointsBalance_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4010
|
+
return new TypeError(message);
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
const obj_transactionJournalResult = obj.transactionJournalResult;
|
|
4014
|
+
const path_transactionJournalResult = path + '.transactionJournalResult';
|
|
4015
|
+
if (!ArrayIsArray(obj_transactionJournalResult)) {
|
|
4016
|
+
return new TypeError('Expected "array" but received "' + typeof obj_transactionJournalResult + '" (at "' + path_transactionJournalResult + '")');
|
|
4017
|
+
}
|
|
4018
|
+
for (let i = 0; i < obj_transactionJournalResult.length; i++) {
|
|
4019
|
+
const obj_transactionJournalResult_item = obj_transactionJournalResult[i];
|
|
4020
|
+
const path_transactionJournalResult_item = path_transactionJournalResult + '[' + i + ']';
|
|
4021
|
+
const referencepath_transactionJournalResult_itemValidationError = validate$3(obj_transactionJournalResult_item, path_transactionJournalResult_item);
|
|
4022
|
+
if (referencepath_transactionJournalResult_itemValidationError !== null) {
|
|
4023
|
+
let message = 'Object doesn\'t match TransactionJournalResultRepresentation (at "' + path_transactionJournalResult_item + '")\n';
|
|
4024
|
+
message += referencepath_transactionJournalResult_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4025
|
+
return new TypeError(message);
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
})();
|
|
4029
|
+
return v_error === undefined ? null : v_error;
|
|
4030
|
+
}
|
|
4031
|
+
const select$3 = function ProcessResultRepresentationSelect() {
|
|
4032
|
+
const { selections: MemberPointsBalanceRepresentation__selections, opaque: MemberPointsBalanceRepresentation__opaque, } = select$9();
|
|
4033
|
+
const { selections: TransactionJournalResultRepresentation__selections, opaque: TransactionJournalResultRepresentation__opaque, } = select$4();
|
|
4034
|
+
return {
|
|
4035
|
+
kind: 'Fragment',
|
|
4036
|
+
version: VERSION$2,
|
|
4037
|
+
private: [],
|
|
4038
|
+
selections: [
|
|
4039
|
+
{
|
|
4040
|
+
name: 'memberPointsBalance',
|
|
4041
|
+
kind: 'Object',
|
|
4042
|
+
plural: true,
|
|
4043
|
+
selections: MemberPointsBalanceRepresentation__selections
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
name: 'transactionJournalResult',
|
|
4047
|
+
kind: 'Object',
|
|
4048
|
+
plural: true,
|
|
4049
|
+
selections: TransactionJournalResultRepresentation__selections
|
|
4050
|
+
}
|
|
4051
|
+
]
|
|
4052
|
+
};
|
|
4053
|
+
};
|
|
4054
|
+
function equals$2(existing, incoming) {
|
|
4055
|
+
const existing_memberPointsBalance = existing.memberPointsBalance;
|
|
4056
|
+
const incoming_memberPointsBalance = incoming.memberPointsBalance;
|
|
4057
|
+
const equals_memberPointsBalance_items = equalsArray(existing_memberPointsBalance, incoming_memberPointsBalance, (existing_memberPointsBalance_item, incoming_memberPointsBalance_item) => {
|
|
4058
|
+
if (!(equals$8(existing_memberPointsBalance_item, incoming_memberPointsBalance_item))) {
|
|
4059
|
+
return false;
|
|
4060
|
+
}
|
|
4061
|
+
});
|
|
4062
|
+
if (equals_memberPointsBalance_items === false) {
|
|
4063
|
+
return false;
|
|
4064
|
+
}
|
|
4065
|
+
const existing_transactionJournalResult = existing.transactionJournalResult;
|
|
4066
|
+
const incoming_transactionJournalResult = incoming.transactionJournalResult;
|
|
4067
|
+
const equals_transactionJournalResult_items = equalsArray(existing_transactionJournalResult, incoming_transactionJournalResult, (existing_transactionJournalResult_item, incoming_transactionJournalResult_item) => {
|
|
4068
|
+
if (!(equals$3(existing_transactionJournalResult_item, incoming_transactionJournalResult_item))) {
|
|
4069
|
+
return false;
|
|
4070
|
+
}
|
|
4071
|
+
});
|
|
4072
|
+
if (equals_transactionJournalResult_items === false) {
|
|
4073
|
+
return false;
|
|
4074
|
+
}
|
|
4075
|
+
return true;
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
const VERSION$1 = "dfc9913faf0cedc61107fca69658f5c1";
|
|
4079
|
+
function validate$1(obj, path = 'TransactionJournalOutputRepresentation') {
|
|
4080
|
+
const v_error = (() => {
|
|
4081
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4082
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4083
|
+
}
|
|
4084
|
+
const obj_transactionJournals = obj.transactionJournals;
|
|
4085
|
+
const path_transactionJournals = path + '.transactionJournals';
|
|
4086
|
+
if (!ArrayIsArray(obj_transactionJournals)) {
|
|
4087
|
+
return new TypeError('Expected "array" but received "' + typeof obj_transactionJournals + '" (at "' + path_transactionJournals + '")');
|
|
4088
|
+
}
|
|
4089
|
+
for (let i = 0; i < obj_transactionJournals.length; i++) {
|
|
4090
|
+
const obj_transactionJournals_item = obj_transactionJournals[i];
|
|
4091
|
+
const path_transactionJournals_item = path_transactionJournals + '[' + i + ']';
|
|
4092
|
+
const referencepath_transactionJournals_itemValidationError = validate$m(obj_transactionJournals_item, path_transactionJournals_item);
|
|
4093
|
+
if (referencepath_transactionJournals_itemValidationError !== null) {
|
|
4094
|
+
let message = 'Object doesn\'t match TransactionJournalRepresentation (at "' + path_transactionJournals_item + '")\n';
|
|
4095
|
+
message += referencepath_transactionJournals_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4096
|
+
return new TypeError(message);
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
})();
|
|
4100
|
+
return v_error === undefined ? null : v_error;
|
|
4101
|
+
}
|
|
4102
|
+
const select$2 = function TransactionJournalOutputRepresentationSelect() {
|
|
4103
|
+
const { selections: TransactionJournalRepresentation__selections, opaque: TransactionJournalRepresentation__opaque, } = select$j();
|
|
4104
|
+
return {
|
|
4105
|
+
kind: 'Fragment',
|
|
4106
|
+
version: VERSION$1,
|
|
4107
|
+
private: [],
|
|
4108
|
+
selections: [
|
|
4109
|
+
{
|
|
4110
|
+
name: 'transactionJournals',
|
|
4111
|
+
kind: 'Object',
|
|
4112
|
+
plural: true,
|
|
4113
|
+
selections: TransactionJournalRepresentation__selections
|
|
4114
|
+
}
|
|
4115
|
+
]
|
|
4116
|
+
};
|
|
4117
|
+
};
|
|
4118
|
+
function equals$1(existing, incoming) {
|
|
4119
|
+
const existing_transactionJournals = existing.transactionJournals;
|
|
4120
|
+
const incoming_transactionJournals = incoming.transactionJournals;
|
|
4121
|
+
const equals_transactionJournals_items = equalsArray(existing_transactionJournals, incoming_transactionJournals, (existing_transactionJournals_item, incoming_transactionJournals_item) => {
|
|
4122
|
+
if (!(equals$e(existing_transactionJournals_item, incoming_transactionJournals_item))) {
|
|
4123
|
+
return false;
|
|
4124
|
+
}
|
|
4125
|
+
});
|
|
4126
|
+
if (equals_transactionJournals_items === false) {
|
|
4127
|
+
return false;
|
|
4128
|
+
}
|
|
4129
|
+
return true;
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
const TTL = 10000;
|
|
4133
|
+
const VERSION = "775434be71565df68900ed550be84104";
|
|
4134
|
+
function validate(obj, path = 'LoyaltyEngineRealtimeOutputRepresentation') {
|
|
4135
|
+
const v_error = (() => {
|
|
4136
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4137
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4138
|
+
}
|
|
4139
|
+
const obj_message = obj.message;
|
|
4140
|
+
const path_message = path + '.message';
|
|
4141
|
+
let obj_message_union0 = null;
|
|
4142
|
+
const obj_message_union0_error = (() => {
|
|
4143
|
+
if (typeof obj_message !== 'string') {
|
|
4144
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
4145
|
+
}
|
|
4146
|
+
})();
|
|
4147
|
+
if (obj_message_union0_error != null) {
|
|
4148
|
+
obj_message_union0 = obj_message_union0_error.message;
|
|
4149
|
+
}
|
|
4150
|
+
let obj_message_union1 = null;
|
|
4151
|
+
const obj_message_union1_error = (() => {
|
|
4152
|
+
if (obj_message !== null) {
|
|
4153
|
+
return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
4154
|
+
}
|
|
4155
|
+
})();
|
|
4156
|
+
if (obj_message_union1_error != null) {
|
|
4157
|
+
obj_message_union1 = obj_message_union1_error.message;
|
|
4158
|
+
}
|
|
4159
|
+
if (obj_message_union0 && obj_message_union1) {
|
|
4160
|
+
let message = 'Object doesn\'t match union (at "' + path_message + '")';
|
|
4161
|
+
message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4162
|
+
message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4163
|
+
return new TypeError(message);
|
|
4164
|
+
}
|
|
4165
|
+
const obj_processResult = obj.processResult;
|
|
4166
|
+
const path_processResult = path + '.processResult';
|
|
4167
|
+
let obj_processResult_union0 = null;
|
|
4168
|
+
const obj_processResult_union0_error = (() => {
|
|
4169
|
+
const referencepath_processResultValidationError = validate$2(obj_processResult, path_processResult);
|
|
4170
|
+
if (referencepath_processResultValidationError !== null) {
|
|
4171
|
+
let message = 'Object doesn\'t match ProcessResultRepresentation (at "' + path_processResult + '")\n';
|
|
4172
|
+
message += referencepath_processResultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4173
|
+
return new TypeError(message);
|
|
4174
|
+
}
|
|
4175
|
+
})();
|
|
4176
|
+
if (obj_processResult_union0_error != null) {
|
|
4177
|
+
obj_processResult_union0 = obj_processResult_union0_error.message;
|
|
4178
|
+
}
|
|
4179
|
+
let obj_processResult_union1 = null;
|
|
4180
|
+
const obj_processResult_union1_error = (() => {
|
|
4181
|
+
if (obj_processResult !== null) {
|
|
4182
|
+
return new TypeError('Expected "null" but received "' + typeof obj_processResult + '" (at "' + path_processResult + '")');
|
|
4183
|
+
}
|
|
4184
|
+
})();
|
|
4185
|
+
if (obj_processResult_union1_error != null) {
|
|
4186
|
+
obj_processResult_union1 = obj_processResult_union1_error.message;
|
|
4187
|
+
}
|
|
4188
|
+
if (obj_processResult_union0 && obj_processResult_union1) {
|
|
4189
|
+
let message = 'Object doesn\'t match union (at "' + path_processResult + '")';
|
|
4190
|
+
message += '\n' + obj_processResult_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4191
|
+
message += '\n' + obj_processResult_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4192
|
+
return new TypeError(message);
|
|
4193
|
+
}
|
|
4194
|
+
const obj_programName = obj.programName;
|
|
4195
|
+
const path_programName = path + '.programName';
|
|
4196
|
+
if (typeof obj_programName !== 'string') {
|
|
4197
|
+
return new TypeError('Expected "string" but received "' + typeof obj_programName + '" (at "' + path_programName + '")');
|
|
4198
|
+
}
|
|
4199
|
+
const obj_simulationResults = obj.simulationResults;
|
|
4200
|
+
const path_simulationResults = path + '.simulationResults';
|
|
4201
|
+
let obj_simulationResults_union0 = null;
|
|
4202
|
+
const obj_simulationResults_union0_error = (() => {
|
|
4203
|
+
const referencepath_simulationResultsValidationError = validate$1(obj_simulationResults, path_simulationResults);
|
|
4204
|
+
if (referencepath_simulationResultsValidationError !== null) {
|
|
4205
|
+
let message = 'Object doesn\'t match TransactionJournalOutputRepresentation (at "' + path_simulationResults + '")\n';
|
|
4206
|
+
message += referencepath_simulationResultsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4207
|
+
return new TypeError(message);
|
|
4208
|
+
}
|
|
4209
|
+
})();
|
|
4210
|
+
if (obj_simulationResults_union0_error != null) {
|
|
4211
|
+
obj_simulationResults_union0 = obj_simulationResults_union0_error.message;
|
|
4212
|
+
}
|
|
4213
|
+
let obj_simulationResults_union1 = null;
|
|
4214
|
+
const obj_simulationResults_union1_error = (() => {
|
|
4215
|
+
if (obj_simulationResults !== null) {
|
|
4216
|
+
return new TypeError('Expected "null" but received "' + typeof obj_simulationResults + '" (at "' + path_simulationResults + '")');
|
|
4217
|
+
}
|
|
4218
|
+
})();
|
|
4219
|
+
if (obj_simulationResults_union1_error != null) {
|
|
4220
|
+
obj_simulationResults_union1 = obj_simulationResults_union1_error.message;
|
|
4221
|
+
}
|
|
4222
|
+
if (obj_simulationResults_union0 && obj_simulationResults_union1) {
|
|
4223
|
+
let message = 'Object doesn\'t match union (at "' + path_simulationResults + '")';
|
|
4224
|
+
message += '\n' + obj_simulationResults_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4225
|
+
message += '\n' + obj_simulationResults_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4226
|
+
return new TypeError(message);
|
|
4227
|
+
}
|
|
4228
|
+
const obj_status = obj.status;
|
|
4229
|
+
const path_status = path + '.status';
|
|
4230
|
+
if (typeof obj_status !== 'boolean') {
|
|
4231
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
4232
|
+
}
|
|
4233
|
+
})();
|
|
4234
|
+
return v_error === undefined ? null : v_error;
|
|
4235
|
+
}
|
|
4236
|
+
const RepresentationType = 'LoyaltyEngineRealtimeOutputRepresentation';
|
|
4237
|
+
function keyBuilder(luvio, config) {
|
|
4238
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
4239
|
+
}
|
|
4240
|
+
function keyBuilderFromType(luvio, object) {
|
|
4241
|
+
const keyParams = {
|
|
4242
|
+
id: object.programName
|
|
4243
|
+
};
|
|
4244
|
+
return keyBuilder(luvio, keyParams);
|
|
4245
|
+
}
|
|
4246
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
4247
|
+
return input;
|
|
4248
|
+
}
|
|
4249
|
+
const select$1 = function LoyaltyEngineRealtimeOutputRepresentationSelect() {
|
|
4250
|
+
const { selections: ProcessResultRepresentation__selections, opaque: ProcessResultRepresentation__opaque, } = select$3();
|
|
4251
|
+
const { selections: TransactionJournalOutputRepresentation__selections, opaque: TransactionJournalOutputRepresentation__opaque, } = select$2();
|
|
4252
|
+
return {
|
|
4253
|
+
kind: 'Fragment',
|
|
4254
|
+
version: VERSION,
|
|
4255
|
+
private: [],
|
|
4256
|
+
selections: [
|
|
4257
|
+
{
|
|
4258
|
+
name: 'message',
|
|
4259
|
+
kind: 'Scalar'
|
|
4260
|
+
},
|
|
4261
|
+
{
|
|
4262
|
+
name: 'processResult',
|
|
4263
|
+
kind: 'Object',
|
|
4264
|
+
nullable: true,
|
|
4265
|
+
selections: ProcessResultRepresentation__selections
|
|
4266
|
+
},
|
|
4267
|
+
{
|
|
4268
|
+
name: 'programName',
|
|
4269
|
+
kind: 'Scalar'
|
|
4270
|
+
},
|
|
4271
|
+
{
|
|
4272
|
+
name: 'simulationResults',
|
|
4273
|
+
kind: 'Object',
|
|
4274
|
+
nullable: true,
|
|
4275
|
+
selections: TransactionJournalOutputRepresentation__selections
|
|
4276
|
+
},
|
|
4277
|
+
{
|
|
4278
|
+
name: 'status',
|
|
4279
|
+
kind: 'Scalar'
|
|
4280
|
+
}
|
|
4281
|
+
]
|
|
4282
|
+
};
|
|
4283
|
+
};
|
|
4284
|
+
function equals(existing, incoming) {
|
|
4285
|
+
const existing_status = existing.status;
|
|
4286
|
+
const incoming_status = incoming.status;
|
|
4287
|
+
if (!(existing_status === incoming_status)) {
|
|
4288
|
+
return false;
|
|
4289
|
+
}
|
|
4290
|
+
const existing_programName = existing.programName;
|
|
4291
|
+
const incoming_programName = incoming.programName;
|
|
4292
|
+
if (!(existing_programName === incoming_programName)) {
|
|
4293
|
+
return false;
|
|
4294
|
+
}
|
|
4295
|
+
const existing_message = existing.message;
|
|
4296
|
+
const incoming_message = incoming.message;
|
|
4297
|
+
if (!(existing_message === incoming_message)) {
|
|
4298
|
+
return false;
|
|
4299
|
+
}
|
|
4300
|
+
const existing_processResult = existing.processResult;
|
|
4301
|
+
const incoming_processResult = incoming.processResult;
|
|
4302
|
+
if (!(existing_processResult === incoming_processResult
|
|
4303
|
+
|| (existing_processResult != null &&
|
|
4304
|
+
incoming_processResult != null &&
|
|
4305
|
+
equals$2(existing_processResult, incoming_processResult)))) {
|
|
4306
|
+
return false;
|
|
4307
|
+
}
|
|
4308
|
+
const existing_simulationResults = existing.simulationResults;
|
|
4309
|
+
const incoming_simulationResults = incoming.simulationResults;
|
|
4310
|
+
if (!(existing_simulationResults === incoming_simulationResults
|
|
4311
|
+
|| (existing_simulationResults != null &&
|
|
4312
|
+
incoming_simulationResults != null &&
|
|
4313
|
+
equals$1(existing_simulationResults, incoming_simulationResults)))) {
|
|
4314
|
+
return false;
|
|
4315
|
+
}
|
|
4316
|
+
return true;
|
|
4317
|
+
}
|
|
4318
|
+
const ingest = function LoyaltyEngineRealtimeOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4319
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4320
|
+
const validateError = validate(input);
|
|
4321
|
+
if (validateError !== null) {
|
|
4322
|
+
throw validateError;
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
const key = keyBuilderFromType(luvio, input);
|
|
4326
|
+
const existingRecord = store.readEntry(key);
|
|
4327
|
+
const ttlToUse = TTL;
|
|
4328
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
4329
|
+
fullPath: key,
|
|
4330
|
+
parent: path.parent,
|
|
4331
|
+
propertyName: path.propertyName,
|
|
4332
|
+
ttl: ttlToUse
|
|
4333
|
+
});
|
|
4334
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
4335
|
+
luvio.storePublish(key, incomingRecord);
|
|
4336
|
+
}
|
|
4337
|
+
{
|
|
4338
|
+
const storeMetadataParams = {
|
|
4339
|
+
ttl: ttlToUse,
|
|
4340
|
+
namespace: "loyalty-engine",
|
|
4341
|
+
version: VERSION,
|
|
4342
|
+
representationName: RepresentationType,
|
|
4343
|
+
};
|
|
4344
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
4345
|
+
}
|
|
4346
|
+
return createLink(key);
|
|
4347
|
+
};
|
|
4348
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
4349
|
+
const rootKeySet = new engine.StoreKeyMap();
|
|
4350
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4351
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
4352
|
+
rootKeySet.set(rootKey, {
|
|
4353
|
+
namespace: keyPrefix,
|
|
4354
|
+
representationName: RepresentationType,
|
|
4355
|
+
mergeable: false
|
|
4356
|
+
});
|
|
4357
|
+
return rootKeySet;
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
function select(luvio, params) {
|
|
4361
|
+
return select$1();
|
|
4362
|
+
}
|
|
4363
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
4364
|
+
return getTypeCacheKeys(luvio, response);
|
|
4365
|
+
}
|
|
4366
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
4367
|
+
const { body } = response;
|
|
4368
|
+
const key = keyBuilderFromType(luvio, body);
|
|
4369
|
+
luvio.storeIngest(key, ingest, body);
|
|
4370
|
+
const snapshot = luvio.storeLookup({
|
|
4371
|
+
recordId: key,
|
|
4372
|
+
node: select(),
|
|
4373
|
+
variables: {},
|
|
4374
|
+
});
|
|
4375
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4376
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4377
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4378
|
+
}
|
|
4379
|
+
}
|
|
4380
|
+
return snapshot;
|
|
4381
|
+
}
|
|
4382
|
+
function createResourceRequest(config) {
|
|
4383
|
+
const headers = {};
|
|
4384
|
+
return {
|
|
4385
|
+
baseUri: '/services/data/v58.0',
|
|
4386
|
+
basePath: '/connect/realtime/loyalty/programs/' + config.urlParams.programName + '',
|
|
4387
|
+
method: 'post',
|
|
4388
|
+
body: config.body,
|
|
4389
|
+
urlParams: config.urlParams,
|
|
4390
|
+
queryParams: {},
|
|
4391
|
+
headers,
|
|
4392
|
+
priority: 'normal',
|
|
4393
|
+
};
|
|
4394
|
+
}
|
|
4395
|
+
|
|
4396
|
+
const executeRealtimeLoyaltyEngine_ConfigPropertyNames = {
|
|
4397
|
+
displayName: 'executeRealtimeLoyaltyEngine',
|
|
4398
|
+
parameters: {
|
|
4399
|
+
required: ['programName', 'loyaltyProcessInput'],
|
|
4400
|
+
optional: []
|
|
4401
|
+
}
|
|
4402
|
+
};
|
|
4403
|
+
function createResourceParams(config) {
|
|
4404
|
+
const resourceParams = {
|
|
4405
|
+
urlParams: {
|
|
4406
|
+
programName: config.programName
|
|
4407
|
+
},
|
|
4408
|
+
body: {
|
|
4409
|
+
loyaltyProcessInput: config.loyaltyProcessInput
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
return resourceParams;
|
|
4413
|
+
}
|
|
4414
|
+
function typeCheckConfig(untrustedConfig) {
|
|
4415
|
+
const config = {};
|
|
4416
|
+
const untrustedConfig_programName = untrustedConfig.programName;
|
|
4417
|
+
if (typeof untrustedConfig_programName === 'string') {
|
|
4418
|
+
config.programName = untrustedConfig_programName;
|
|
4419
|
+
}
|
|
4420
|
+
const untrustedConfig_loyaltyProcessInput = untrustedConfig.loyaltyProcessInput;
|
|
4421
|
+
const referenceLoyaltyEngineInputRepresentationValidationError = validate$a(untrustedConfig_loyaltyProcessInput);
|
|
4422
|
+
if (referenceLoyaltyEngineInputRepresentationValidationError === null) {
|
|
4423
|
+
config.loyaltyProcessInput = untrustedConfig_loyaltyProcessInput;
|
|
4424
|
+
}
|
|
4425
|
+
return config;
|
|
4426
|
+
}
|
|
4427
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
4428
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4429
|
+
return null;
|
|
4430
|
+
}
|
|
4431
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4432
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4433
|
+
}
|
|
4434
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
4435
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4436
|
+
return null;
|
|
4437
|
+
}
|
|
4438
|
+
return config;
|
|
4439
|
+
}
|
|
4440
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
4441
|
+
const resourceParams = createResourceParams(config);
|
|
4442
|
+
const request = createResourceRequest(resourceParams);
|
|
4443
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4444
|
+
.then((response) => {
|
|
4445
|
+
return luvio.handleSuccessResponse(() => {
|
|
4446
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
4447
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4448
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
4449
|
+
}, (response) => {
|
|
4450
|
+
deepFreeze$d(response);
|
|
4451
|
+
throw response;
|
|
4452
|
+
});
|
|
4453
|
+
}
|
|
4454
|
+
const executeRealtimeLoyaltyEngineAdapterFactory = (luvio) => {
|
|
4455
|
+
return function executeRealtimeLoyaltyEngine(untrustedConfig) {
|
|
4456
|
+
const config = validateAdapterConfig(untrustedConfig, executeRealtimeLoyaltyEngine_ConfigPropertyNames);
|
|
4457
|
+
// Invalid or incomplete config
|
|
4458
|
+
if (config === null) {
|
|
4459
|
+
throw new Error('Invalid config for "executeRealtimeLoyaltyEngine"');
|
|
4460
|
+
}
|
|
4461
|
+
return buildNetworkSnapshot(luvio, config);
|
|
4462
|
+
};
|
|
4463
|
+
};
|
|
4464
|
+
|
|
4465
|
+
exports.createProgramProcessRuleAdapterFactory = createProgramProcessRuleAdapterFactory;
|
|
4466
|
+
exports.executeRealtimeLoyaltyEngineAdapterFactory = executeRealtimeLoyaltyEngineAdapterFactory;
|
|
4467
|
+
exports.getJournalExplainabilityInfoAdapterFactory = getJournalExplainabilityInfoAdapterFactory;
|
|
4468
|
+
exports.getProgramProcessRuleAdapterFactory = getProgramProcessRuleAdapterFactory;
|
|
4469
|
+
exports.updateProgramProcessRuleAdapterFactory = updateProgramProcessRuleAdapterFactory;
|
|
4470
|
+
|
|
4471
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4472
|
+
|
|
4473
|
+
}));
|