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