@salesforce/lds-adapters-commerce-configuration 1.251.0 → 1.253.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/commerce-configuration.js +268 -63
- package/dist/es/es2018/types/src/generated/adapters/putCommerceConfigurationAttribute.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/resources/putCommerceConfigurationByAttributeIdAndContextIdAndContextType.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/types/CommerceConfigurationAttributeInputRepresentation.d.ts +16 -4
- package/dist/es/es2018/types/src/generated/types/CommerceConfigurationAttributeOutputRepresentation.d.ts +28 -4
- package/package.json +1 -1
- package/sfdc/index.js +271 -64
- package/src/raml/api.raml +57 -10
- package/src/raml/luvio.raml +6 -0
|
@@ -72,6 +72,19 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
72
72
|
const keyPrefix = 'commerce-configuration';
|
|
73
73
|
|
|
74
74
|
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
function equalsArray(a, b, equalsItem) {
|
|
76
|
+
const aLength = a.length;
|
|
77
|
+
const bLength = b.length;
|
|
78
|
+
if (aLength !== bLength) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
for (let i = 0; i < aLength; i++) {
|
|
82
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
75
88
|
function createLink(ref) {
|
|
76
89
|
return {
|
|
77
90
|
__ref: serializeStructuredKey(ref),
|
|
@@ -79,73 +92,165 @@ function createLink(ref) {
|
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
const TTL = 1000;
|
|
82
|
-
const VERSION = "
|
|
95
|
+
const VERSION = "3f1cb4f5f9992e44d62eef68eeaa8ee0";
|
|
83
96
|
function validate(obj, path = 'CommerceConfigurationAttributeOutputRepresentation') {
|
|
84
97
|
const v_error = (() => {
|
|
85
98
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
86
99
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
87
100
|
}
|
|
101
|
+
if (obj.booleanValue !== undefined) {
|
|
102
|
+
const obj_booleanValue = obj.booleanValue;
|
|
103
|
+
const path_booleanValue = path + '.booleanValue';
|
|
104
|
+
let obj_booleanValue_union0 = null;
|
|
105
|
+
const obj_booleanValue_union0_error = (() => {
|
|
106
|
+
if (typeof obj_booleanValue !== 'boolean') {
|
|
107
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_booleanValue + '" (at "' + path_booleanValue + '")');
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
if (obj_booleanValue_union0_error != null) {
|
|
111
|
+
obj_booleanValue_union0 = obj_booleanValue_union0_error.message;
|
|
112
|
+
}
|
|
113
|
+
let obj_booleanValue_union1 = null;
|
|
114
|
+
const obj_booleanValue_union1_error = (() => {
|
|
115
|
+
if (obj_booleanValue !== null) {
|
|
116
|
+
return new TypeError('Expected "null" but received "' + typeof obj_booleanValue + '" (at "' + path_booleanValue + '")');
|
|
117
|
+
}
|
|
118
|
+
})();
|
|
119
|
+
if (obj_booleanValue_union1_error != null) {
|
|
120
|
+
obj_booleanValue_union1 = obj_booleanValue_union1_error.message;
|
|
121
|
+
}
|
|
122
|
+
if (obj_booleanValue_union0 && obj_booleanValue_union1) {
|
|
123
|
+
let message = 'Object doesn\'t match union (at "' + path_booleanValue + '")';
|
|
124
|
+
message += '\n' + obj_booleanValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
125
|
+
message += '\n' + obj_booleanValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
126
|
+
return new TypeError(message);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const obj_contextId = obj.contextId;
|
|
130
|
+
const path_contextId = path + '.contextId';
|
|
131
|
+
if (typeof obj_contextId !== 'string') {
|
|
132
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextId + '" (at "' + path_contextId + '")');
|
|
133
|
+
}
|
|
134
|
+
const obj_contextType = obj.contextType;
|
|
135
|
+
const path_contextType = path + '.contextType';
|
|
136
|
+
if (typeof obj_contextType !== 'string') {
|
|
137
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextType + '" (at "' + path_contextType + '")');
|
|
138
|
+
}
|
|
88
139
|
const obj_id = obj.id;
|
|
89
140
|
const path_id = path + '.id';
|
|
90
141
|
if (typeof obj_id !== 'string') {
|
|
91
142
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
92
143
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
144
|
+
if (obj.integerValue !== undefined) {
|
|
145
|
+
const obj_integerValue = obj.integerValue;
|
|
146
|
+
const path_integerValue = path + '.integerValue';
|
|
147
|
+
let obj_integerValue_union0 = null;
|
|
148
|
+
const obj_integerValue_union0_error = (() => {
|
|
149
|
+
if (typeof obj_integerValue !== 'number' || (typeof obj_integerValue === 'number' && Math.floor(obj_integerValue) !== obj_integerValue)) {
|
|
150
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_integerValue + '" (at "' + path_integerValue + '")');
|
|
151
|
+
}
|
|
152
|
+
})();
|
|
153
|
+
if (obj_integerValue_union0_error != null) {
|
|
154
|
+
obj_integerValue_union0 = obj_integerValue_union0_error.message;
|
|
99
155
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
-
|
|
156
|
+
let obj_integerValue_union1 = null;
|
|
157
|
+
const obj_integerValue_union1_error = (() => {
|
|
158
|
+
if (obj_integerValue !== null) {
|
|
159
|
+
return new TypeError('Expected "null" but received "' + typeof obj_integerValue + '" (at "' + path_integerValue + '")');
|
|
160
|
+
}
|
|
161
|
+
})();
|
|
162
|
+
if (obj_integerValue_union1_error != null) {
|
|
163
|
+
obj_integerValue_union1 = obj_integerValue_union1_error.message;
|
|
164
|
+
}
|
|
165
|
+
if (obj_integerValue_union0 && obj_integerValue_union1) {
|
|
166
|
+
let message = 'Object doesn\'t match union (at "' + path_integerValue + '")';
|
|
167
|
+
message += '\n' + obj_integerValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
168
|
+
message += '\n' + obj_integerValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
169
|
+
return new TypeError(message);
|
|
108
170
|
}
|
|
109
|
-
})();
|
|
110
|
-
if (obj_value_union1_error != null) {
|
|
111
|
-
obj_value_union1 = obj_value_union1_error.message;
|
|
112
171
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
172
|
+
if (obj.numberValue !== undefined) {
|
|
173
|
+
const obj_numberValue = obj.numberValue;
|
|
174
|
+
const path_numberValue = path + '.numberValue';
|
|
175
|
+
let obj_numberValue_union0 = null;
|
|
176
|
+
const obj_numberValue_union0_error = (() => {
|
|
177
|
+
if (typeof obj_numberValue !== 'number') {
|
|
178
|
+
return new TypeError('Expected "number" but received "' + typeof obj_numberValue + '" (at "' + path_numberValue + '")');
|
|
179
|
+
}
|
|
180
|
+
})();
|
|
181
|
+
if (obj_numberValue_union0_error != null) {
|
|
182
|
+
obj_numberValue_union0 = obj_numberValue_union0_error.message;
|
|
183
|
+
}
|
|
184
|
+
let obj_numberValue_union1 = null;
|
|
185
|
+
const obj_numberValue_union1_error = (() => {
|
|
186
|
+
if (obj_numberValue !== null) {
|
|
187
|
+
return new TypeError('Expected "null" but received "' + typeof obj_numberValue + '" (at "' + path_numberValue + '")');
|
|
188
|
+
}
|
|
189
|
+
})();
|
|
190
|
+
if (obj_numberValue_union1_error != null) {
|
|
191
|
+
obj_numberValue_union1 = obj_numberValue_union1_error.message;
|
|
192
|
+
}
|
|
193
|
+
if (obj_numberValue_union0 && obj_numberValue_union1) {
|
|
194
|
+
let message = 'Object doesn\'t match union (at "' + path_numberValue + '")';
|
|
195
|
+
message += '\n' + obj_numberValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
196
|
+
message += '\n' + obj_numberValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
197
|
+
return new TypeError(message);
|
|
117
198
|
}
|
|
118
|
-
})();
|
|
119
|
-
if (obj_value_union2_error != null) {
|
|
120
|
-
obj_value_union2 = obj_value_union2_error.message;
|
|
121
199
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
200
|
+
if (obj.stringValue !== undefined) {
|
|
201
|
+
const obj_stringValue = obj.stringValue;
|
|
202
|
+
const path_stringValue = path + '.stringValue';
|
|
203
|
+
let obj_stringValue_union0 = null;
|
|
204
|
+
const obj_stringValue_union0_error = (() => {
|
|
205
|
+
if (typeof obj_stringValue !== 'string') {
|
|
206
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stringValue + '" (at "' + path_stringValue + '")');
|
|
207
|
+
}
|
|
208
|
+
})();
|
|
209
|
+
if (obj_stringValue_union0_error != null) {
|
|
210
|
+
obj_stringValue_union0 = obj_stringValue_union0_error.message;
|
|
211
|
+
}
|
|
212
|
+
let obj_stringValue_union1 = null;
|
|
213
|
+
const obj_stringValue_union1_error = (() => {
|
|
214
|
+
if (obj_stringValue !== null) {
|
|
215
|
+
return new TypeError('Expected "null" but received "' + typeof obj_stringValue + '" (at "' + path_stringValue + '")');
|
|
216
|
+
}
|
|
217
|
+
})();
|
|
218
|
+
if (obj_stringValue_union1_error != null) {
|
|
219
|
+
obj_stringValue_union1 = obj_stringValue_union1_error.message;
|
|
220
|
+
}
|
|
221
|
+
if (obj_stringValue_union0 && obj_stringValue_union1) {
|
|
222
|
+
let message = 'Object doesn\'t match union (at "' + path_stringValue + '")';
|
|
223
|
+
message += '\n' + obj_stringValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
224
|
+
message += '\n' + obj_stringValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
225
|
+
return new TypeError(message);
|
|
126
226
|
}
|
|
127
|
-
})();
|
|
128
|
-
if (obj_value_union3_error != null) {
|
|
129
|
-
obj_value_union3 = obj_value_union3_error.message;
|
|
130
227
|
}
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
228
|
+
if (obj.stringValues !== undefined) {
|
|
229
|
+
const obj_stringValues = obj.stringValues;
|
|
230
|
+
const path_stringValues = path + '.stringValues';
|
|
231
|
+
if (!ArrayIsArray(obj_stringValues)) {
|
|
232
|
+
return new TypeError('Expected "array" but received "' + typeof obj_stringValues + '" (at "' + path_stringValues + '")');
|
|
233
|
+
}
|
|
234
|
+
for (let i = 0; i < obj_stringValues.length; i++) {
|
|
235
|
+
const obj_stringValues_item = obj_stringValues[i];
|
|
236
|
+
const path_stringValues_item = path_stringValues + '[' + i + ']';
|
|
237
|
+
if (typeof obj_stringValues_item !== 'string') {
|
|
238
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stringValues_item + '" (at "' + path_stringValues_item + '")');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
138
241
|
}
|
|
139
242
|
})();
|
|
140
243
|
return v_error === undefined ? null : v_error;
|
|
141
244
|
}
|
|
142
245
|
const RepresentationType = 'CommerceConfigurationAttributeOutputRepresentation';
|
|
143
246
|
function keyBuilder$3(luvio, config) {
|
|
144
|
-
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
247
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id + ':' + config.contextId + ':' + config.contextType;
|
|
145
248
|
}
|
|
146
249
|
function keyBuilderFromType(luvio, object) {
|
|
147
250
|
const keyParams = {
|
|
148
|
-
id: object.id
|
|
251
|
+
id: object.id,
|
|
252
|
+
contextId: object.contextId,
|
|
253
|
+
contextType: object.contextType
|
|
149
254
|
};
|
|
150
255
|
return keyBuilder$3(luvio, keyParams);
|
|
151
256
|
}
|
|
@@ -159,26 +264,131 @@ const select$2 = function CommerceConfigurationAttributeOutputRepresentationSele
|
|
|
159
264
|
private: [],
|
|
160
265
|
selections: [
|
|
161
266
|
{
|
|
162
|
-
name: '
|
|
267
|
+
name: 'booleanValue',
|
|
268
|
+
kind: 'Scalar',
|
|
269
|
+
required: false
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'contextId',
|
|
163
273
|
kind: 'Scalar'
|
|
164
274
|
},
|
|
165
275
|
{
|
|
166
|
-
name: '
|
|
276
|
+
name: 'contextType',
|
|
167
277
|
kind: 'Scalar'
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'id',
|
|
281
|
+
kind: 'Scalar'
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: 'integerValue',
|
|
285
|
+
kind: 'Scalar',
|
|
286
|
+
required: false
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'numberValue',
|
|
290
|
+
kind: 'Scalar',
|
|
291
|
+
required: false
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'stringValue',
|
|
295
|
+
kind: 'Scalar',
|
|
296
|
+
required: false
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: 'stringValues',
|
|
300
|
+
kind: 'Scalar',
|
|
301
|
+
plural: true,
|
|
302
|
+
required: false
|
|
168
303
|
}
|
|
169
304
|
]
|
|
170
305
|
};
|
|
171
306
|
};
|
|
172
307
|
function equals(existing, incoming) {
|
|
308
|
+
const existing_contextId = existing.contextId;
|
|
309
|
+
const incoming_contextId = incoming.contextId;
|
|
310
|
+
if (!(existing_contextId === incoming_contextId)) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
const existing_contextType = existing.contextType;
|
|
314
|
+
const incoming_contextType = incoming.contextType;
|
|
315
|
+
if (!(existing_contextType === incoming_contextType)) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
173
318
|
const existing_id = existing.id;
|
|
174
319
|
const incoming_id = incoming.id;
|
|
175
320
|
if (!(existing_id === incoming_id)) {
|
|
176
321
|
return false;
|
|
177
322
|
}
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
if
|
|
181
|
-
|
|
323
|
+
const existing_booleanValue = existing.booleanValue;
|
|
324
|
+
const incoming_booleanValue = incoming.booleanValue;
|
|
325
|
+
// if at least one of these optionals is defined
|
|
326
|
+
if (existing_booleanValue !== undefined || incoming_booleanValue !== undefined) {
|
|
327
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
328
|
+
// not equal
|
|
329
|
+
if (existing_booleanValue === undefined || incoming_booleanValue === undefined) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (!(existing_booleanValue === incoming_booleanValue)) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const existing_integerValue = existing.integerValue;
|
|
337
|
+
const incoming_integerValue = incoming.integerValue;
|
|
338
|
+
// if at least one of these optionals is defined
|
|
339
|
+
if (existing_integerValue !== undefined || incoming_integerValue !== undefined) {
|
|
340
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
341
|
+
// not equal
|
|
342
|
+
if (existing_integerValue === undefined || incoming_integerValue === undefined) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
if (!(existing_integerValue === incoming_integerValue)) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const existing_numberValue = existing.numberValue;
|
|
350
|
+
const incoming_numberValue = incoming.numberValue;
|
|
351
|
+
// if at least one of these optionals is defined
|
|
352
|
+
if (existing_numberValue !== undefined || incoming_numberValue !== undefined) {
|
|
353
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
354
|
+
// not equal
|
|
355
|
+
if (existing_numberValue === undefined || incoming_numberValue === undefined) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
if (!(existing_numberValue === incoming_numberValue)) {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const existing_stringValue = existing.stringValue;
|
|
363
|
+
const incoming_stringValue = incoming.stringValue;
|
|
364
|
+
// if at least one of these optionals is defined
|
|
365
|
+
if (existing_stringValue !== undefined || incoming_stringValue !== undefined) {
|
|
366
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
367
|
+
// not equal
|
|
368
|
+
if (existing_stringValue === undefined || incoming_stringValue === undefined) {
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
if (!(existing_stringValue === incoming_stringValue)) {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const existing_stringValues = existing.stringValues;
|
|
376
|
+
const incoming_stringValues = incoming.stringValues;
|
|
377
|
+
// if at least one of these optionals is defined
|
|
378
|
+
if (existing_stringValues !== undefined || incoming_stringValues !== undefined) {
|
|
379
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
380
|
+
// not equal
|
|
381
|
+
if (existing_stringValues === undefined || incoming_stringValues === undefined) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
const equals_stringValues_items = equalsArray(existing_stringValues, incoming_stringValues, (existing_stringValues_item, incoming_stringValues_item) => {
|
|
385
|
+
if (!(existing_stringValues_item === incoming_stringValues_item)) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
if (equals_stringValues_items === false) {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
182
392
|
}
|
|
183
393
|
return true;
|
|
184
394
|
}
|
|
@@ -206,7 +416,9 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
206
416
|
|
|
207
417
|
function keyBuilder$2(luvio, params) {
|
|
208
418
|
return keyBuilder$3(luvio, {
|
|
209
|
-
id: params.urlParams.attributeId
|
|
419
|
+
id: params.urlParams.attributeId,
|
|
420
|
+
contextId: params.urlParams.contextId,
|
|
421
|
+
contextType: params.urlParams.contextType
|
|
210
422
|
});
|
|
211
423
|
}
|
|
212
424
|
function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
|
|
@@ -295,7 +507,9 @@ function select$1(luvio, params) {
|
|
|
295
507
|
}
|
|
296
508
|
function keyBuilder$1(luvio, params) {
|
|
297
509
|
return keyBuilder$3(luvio, {
|
|
298
|
-
id: params.urlParams.attributeId
|
|
510
|
+
id: params.urlParams.attributeId,
|
|
511
|
+
contextId: params.urlParams.contextId,
|
|
512
|
+
contextType: params.urlParams.contextType
|
|
299
513
|
});
|
|
300
514
|
}
|
|
301
515
|
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
@@ -475,26 +689,17 @@ const putCommerceConfigurationAttribute_ConfigPropertyMetadata = [
|
|
|
475
689
|
generateParamConfigMetadata('attributeId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
476
690
|
generateParamConfigMetadata('contextId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
477
691
|
generateParamConfigMetadata('contextType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
478
|
-
generateParamConfigMetadata('
|
|
692
|
+
generateParamConfigMetadata('booleanValue', false, 2 /* Body */, 1 /* Boolean */),
|
|
693
|
+
generateParamConfigMetadata('integerValue', false, 2 /* Body */, 3 /* Integer */),
|
|
694
|
+
generateParamConfigMetadata('numberValue', false, 2 /* Body */, 2 /* Number */),
|
|
695
|
+
generateParamConfigMetadata('stringValue', false, 2 /* Body */, 0 /* String */),
|
|
696
|
+
generateParamConfigMetadata('stringValues', false, 2 /* Body */, 0 /* String */, true),
|
|
479
697
|
];
|
|
480
698
|
const putCommerceConfigurationAttribute_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
481
699
|
const createResourceParams = /*#__PURE__*/ createResourceParams$3(putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
482
700
|
function typeCheckConfig(untrustedConfig) {
|
|
483
701
|
const config = {};
|
|
484
702
|
typeCheckConfig$3(untrustedConfig, config, putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
485
|
-
const untrustedConfig_value = untrustedConfig.value;
|
|
486
|
-
if (typeof untrustedConfig_value === 'boolean') {
|
|
487
|
-
config.value = untrustedConfig_value;
|
|
488
|
-
}
|
|
489
|
-
if (typeof untrustedConfig_value === 'number' && Math.floor(untrustedConfig_value) === untrustedConfig_value) {
|
|
490
|
-
config.value = untrustedConfig_value;
|
|
491
|
-
}
|
|
492
|
-
if (typeof untrustedConfig_value === 'number') {
|
|
493
|
-
config.value = untrustedConfig_value;
|
|
494
|
-
}
|
|
495
|
-
if (typeof untrustedConfig_value === 'string') {
|
|
496
|
-
config.value = untrustedConfig_value;
|
|
497
|
-
}
|
|
498
703
|
return config;
|
|
499
704
|
}
|
|
500
705
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -9,7 +9,11 @@ export interface PutCommerceConfigurationAttributeConfig {
|
|
|
9
9
|
attributeId: string;
|
|
10
10
|
contextId: string;
|
|
11
11
|
contextType: string;
|
|
12
|
-
|
|
12
|
+
booleanValue?: boolean;
|
|
13
|
+
integerValue?: number;
|
|
14
|
+
numberValue?: number;
|
|
15
|
+
stringValue?: string;
|
|
16
|
+
stringValues?: Array<string>;
|
|
13
17
|
}
|
|
14
18
|
export declare const createResourceParams: (config: PutCommerceConfigurationAttributeConfig) => resources_putCommerceConfigurationByAttributeIdAndContextIdAndContextType_ResourceRequestConfig;
|
|
15
19
|
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<PutCommerceConfigurationAttributeConfig>): adapter$45$utils_Untrusted<PutCommerceConfigurationAttributeConfig>;
|
|
@@ -7,7 +7,11 @@ export interface ResourceRequestConfig {
|
|
|
7
7
|
contextType: string;
|
|
8
8
|
};
|
|
9
9
|
body: {
|
|
10
|
-
|
|
10
|
+
booleanValue?: boolean;
|
|
11
|
+
integerValue?: number;
|
|
12
|
+
numberValue?: number;
|
|
13
|
+
stringValue?: string;
|
|
14
|
+
stringValues?: Array<string>;
|
|
11
15
|
};
|
|
12
16
|
}
|
|
13
17
|
export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
-
export declare const VERSION = "
|
|
2
|
+
export declare const VERSION = "54491e1b64d09f72b06432b3674b34c1";
|
|
3
3
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
4
4
|
export declare const RepresentationType: string;
|
|
5
5
|
export declare function normalize(input: CommerceConfigurationAttributeInputRepresentation, existing: CommerceConfigurationAttributeInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): CommerceConfigurationAttributeInputRepresentationNormalized;
|
|
@@ -14,8 +14,16 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
14
14
|
* (none)
|
|
15
15
|
*/
|
|
16
16
|
export interface CommerceConfigurationAttributeInputRepresentationNormalized {
|
|
17
|
-
/** The
|
|
18
|
-
|
|
17
|
+
/** The boolean value of the commerce configuration attribute. */
|
|
18
|
+
booleanValue?: boolean;
|
|
19
|
+
/** The integer value of the commerce configuration attribute. */
|
|
20
|
+
integerValue?: number;
|
|
21
|
+
/** The number value of the commerce configuration attribute. */
|
|
22
|
+
numberValue?: number;
|
|
23
|
+
/** The string value of the commerce configuration attribute. */
|
|
24
|
+
stringValue?: string;
|
|
25
|
+
/** The list of string values of the commerce configuration attribute. */
|
|
26
|
+
stringValues?: Array<string>;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Input representation of a commerce configuration attribute.
|
|
@@ -24,5 +32,9 @@ export interface CommerceConfigurationAttributeInputRepresentationNormalized {
|
|
|
24
32
|
* (none)
|
|
25
33
|
*/
|
|
26
34
|
export interface CommerceConfigurationAttributeInputRepresentation {
|
|
27
|
-
|
|
35
|
+
booleanValue?: boolean;
|
|
36
|
+
integerValue?: number;
|
|
37
|
+
numberValue?: number;
|
|
38
|
+
stringValue?: string;
|
|
39
|
+
stringValues?: Array<string>;
|
|
28
40
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
|
|
2
2
|
export declare const TTL = 1000;
|
|
3
|
-
export declare const VERSION = "
|
|
3
|
+
export declare const VERSION = "3f1cb4f5f9992e44d62eef68eeaa8ee0";
|
|
4
4
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
5
|
export declare const RepresentationType: string;
|
|
6
6
|
export interface KeyParams extends $64$luvio_engine_KeyMetadata {
|
|
7
7
|
id: string;
|
|
8
|
+
contextId: string;
|
|
9
|
+
contextType: string;
|
|
8
10
|
}
|
|
9
11
|
export type CommerceConfigurationAttributeOutputRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
|
|
10
12
|
export type PartialCommerceConfigurationAttributeOutputRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
|
|
@@ -22,20 +24,42 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
22
24
|
*
|
|
23
25
|
* Keys:
|
|
24
26
|
* id (string): id
|
|
27
|
+
* contextId (string): contextId
|
|
28
|
+
* contextType (string): contextType
|
|
25
29
|
*/
|
|
26
30
|
export interface CommerceConfigurationAttributeOutputRepresentationNormalized {
|
|
31
|
+
/** The boolean value of the commerce configuration attribute. */
|
|
32
|
+
booleanValue?: boolean | null;
|
|
33
|
+
/** The id of the context in scope of the context type. */
|
|
34
|
+
contextId: string;
|
|
35
|
+
/** The type of context the configuration attribute applies for. */
|
|
36
|
+
contextType: string;
|
|
27
37
|
/** The id of the commerce configuration attribute. */
|
|
28
38
|
id: string;
|
|
29
|
-
/** The
|
|
30
|
-
|
|
39
|
+
/** The integer value of the commerce configuration attribute. */
|
|
40
|
+
integerValue?: number | null;
|
|
41
|
+
/** The number value of the commerce configuration attribute. */
|
|
42
|
+
numberValue?: number | null;
|
|
43
|
+
/** The string value of the commerce configuration attribute. */
|
|
44
|
+
stringValue?: string | null;
|
|
45
|
+
/** The list of string values of the commerce configuration attribute. */
|
|
46
|
+
stringValues?: Array<string>;
|
|
31
47
|
}
|
|
32
48
|
/**
|
|
33
49
|
* Output representation of a configuration attribute.
|
|
34
50
|
*
|
|
35
51
|
* Keys:
|
|
36
52
|
* id (string): id
|
|
53
|
+
* contextId (string): contextId
|
|
54
|
+
* contextType (string): contextType
|
|
37
55
|
*/
|
|
38
56
|
export interface CommerceConfigurationAttributeOutputRepresentation {
|
|
57
|
+
booleanValue?: boolean | null;
|
|
58
|
+
contextId: string;
|
|
59
|
+
contextType: string;
|
|
39
60
|
id: string;
|
|
40
|
-
|
|
61
|
+
integerValue?: number | null;
|
|
62
|
+
numberValue?: number | null;
|
|
63
|
+
stringValue?: string | null;
|
|
64
|
+
stringValues?: Array<string>;
|
|
41
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-commerce-configuration",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.253.0",
|
|
4
4
|
"description": "Allows reading and changing the values of commerce configuration attributes. These configurations can impact one or multiple areas of Salesforce Commerce.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "dist/es/es2018/commerce-configuration.js",
|
package/sfdc/index.js
CHANGED
|
@@ -82,6 +82,19 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
82
82
|
const keyPrefix = 'commerce-configuration';
|
|
83
83
|
|
|
84
84
|
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
85
98
|
function createLink(ref) {
|
|
86
99
|
return {
|
|
87
100
|
__ref: serializeStructuredKey(ref),
|
|
@@ -89,73 +102,165 @@ function createLink(ref) {
|
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
const TTL = 1000;
|
|
92
|
-
const VERSION = "
|
|
105
|
+
const VERSION = "3f1cb4f5f9992e44d62eef68eeaa8ee0";
|
|
93
106
|
function validate(obj, path = 'CommerceConfigurationAttributeOutputRepresentation') {
|
|
94
107
|
const v_error = (() => {
|
|
95
108
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
96
109
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
97
110
|
}
|
|
111
|
+
if (obj.booleanValue !== undefined) {
|
|
112
|
+
const obj_booleanValue = obj.booleanValue;
|
|
113
|
+
const path_booleanValue = path + '.booleanValue';
|
|
114
|
+
let obj_booleanValue_union0 = null;
|
|
115
|
+
const obj_booleanValue_union0_error = (() => {
|
|
116
|
+
if (typeof obj_booleanValue !== 'boolean') {
|
|
117
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_booleanValue + '" (at "' + path_booleanValue + '")');
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
if (obj_booleanValue_union0_error != null) {
|
|
121
|
+
obj_booleanValue_union0 = obj_booleanValue_union0_error.message;
|
|
122
|
+
}
|
|
123
|
+
let obj_booleanValue_union1 = null;
|
|
124
|
+
const obj_booleanValue_union1_error = (() => {
|
|
125
|
+
if (obj_booleanValue !== null) {
|
|
126
|
+
return new TypeError('Expected "null" but received "' + typeof obj_booleanValue + '" (at "' + path_booleanValue + '")');
|
|
127
|
+
}
|
|
128
|
+
})();
|
|
129
|
+
if (obj_booleanValue_union1_error != null) {
|
|
130
|
+
obj_booleanValue_union1 = obj_booleanValue_union1_error.message;
|
|
131
|
+
}
|
|
132
|
+
if (obj_booleanValue_union0 && obj_booleanValue_union1) {
|
|
133
|
+
let message = 'Object doesn\'t match union (at "' + path_booleanValue + '")';
|
|
134
|
+
message += '\n' + obj_booleanValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
135
|
+
message += '\n' + obj_booleanValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
136
|
+
return new TypeError(message);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const obj_contextId = obj.contextId;
|
|
140
|
+
const path_contextId = path + '.contextId';
|
|
141
|
+
if (typeof obj_contextId !== 'string') {
|
|
142
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextId + '" (at "' + path_contextId + '")');
|
|
143
|
+
}
|
|
144
|
+
const obj_contextType = obj.contextType;
|
|
145
|
+
const path_contextType = path + '.contextType';
|
|
146
|
+
if (typeof obj_contextType !== 'string') {
|
|
147
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contextType + '" (at "' + path_contextType + '")');
|
|
148
|
+
}
|
|
98
149
|
const obj_id = obj.id;
|
|
99
150
|
const path_id = path + '.id';
|
|
100
151
|
if (typeof obj_id !== 'string') {
|
|
101
152
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
102
153
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
154
|
+
if (obj.integerValue !== undefined) {
|
|
155
|
+
const obj_integerValue = obj.integerValue;
|
|
156
|
+
const path_integerValue = path + '.integerValue';
|
|
157
|
+
let obj_integerValue_union0 = null;
|
|
158
|
+
const obj_integerValue_union0_error = (() => {
|
|
159
|
+
if (typeof obj_integerValue !== 'number' || (typeof obj_integerValue === 'number' && Math.floor(obj_integerValue) !== obj_integerValue)) {
|
|
160
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_integerValue + '" (at "' + path_integerValue + '")');
|
|
161
|
+
}
|
|
162
|
+
})();
|
|
163
|
+
if (obj_integerValue_union0_error != null) {
|
|
164
|
+
obj_integerValue_union0 = obj_integerValue_union0_error.message;
|
|
109
165
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
|
|
166
|
+
let obj_integerValue_union1 = null;
|
|
167
|
+
const obj_integerValue_union1_error = (() => {
|
|
168
|
+
if (obj_integerValue !== null) {
|
|
169
|
+
return new TypeError('Expected "null" but received "' + typeof obj_integerValue + '" (at "' + path_integerValue + '")');
|
|
170
|
+
}
|
|
171
|
+
})();
|
|
172
|
+
if (obj_integerValue_union1_error != null) {
|
|
173
|
+
obj_integerValue_union1 = obj_integerValue_union1_error.message;
|
|
174
|
+
}
|
|
175
|
+
if (obj_integerValue_union0 && obj_integerValue_union1) {
|
|
176
|
+
let message = 'Object doesn\'t match union (at "' + path_integerValue + '")';
|
|
177
|
+
message += '\n' + obj_integerValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
178
|
+
message += '\n' + obj_integerValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
179
|
+
return new TypeError(message);
|
|
118
180
|
}
|
|
119
|
-
})();
|
|
120
|
-
if (obj_value_union1_error != null) {
|
|
121
|
-
obj_value_union1 = obj_value_union1_error.message;
|
|
122
181
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
182
|
+
if (obj.numberValue !== undefined) {
|
|
183
|
+
const obj_numberValue = obj.numberValue;
|
|
184
|
+
const path_numberValue = path + '.numberValue';
|
|
185
|
+
let obj_numberValue_union0 = null;
|
|
186
|
+
const obj_numberValue_union0_error = (() => {
|
|
187
|
+
if (typeof obj_numberValue !== 'number') {
|
|
188
|
+
return new TypeError('Expected "number" but received "' + typeof obj_numberValue + '" (at "' + path_numberValue + '")');
|
|
189
|
+
}
|
|
190
|
+
})();
|
|
191
|
+
if (obj_numberValue_union0_error != null) {
|
|
192
|
+
obj_numberValue_union0 = obj_numberValue_union0_error.message;
|
|
193
|
+
}
|
|
194
|
+
let obj_numberValue_union1 = null;
|
|
195
|
+
const obj_numberValue_union1_error = (() => {
|
|
196
|
+
if (obj_numberValue !== null) {
|
|
197
|
+
return new TypeError('Expected "null" but received "' + typeof obj_numberValue + '" (at "' + path_numberValue + '")');
|
|
198
|
+
}
|
|
199
|
+
})();
|
|
200
|
+
if (obj_numberValue_union1_error != null) {
|
|
201
|
+
obj_numberValue_union1 = obj_numberValue_union1_error.message;
|
|
202
|
+
}
|
|
203
|
+
if (obj_numberValue_union0 && obj_numberValue_union1) {
|
|
204
|
+
let message = 'Object doesn\'t match union (at "' + path_numberValue + '")';
|
|
205
|
+
message += '\n' + obj_numberValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
206
|
+
message += '\n' + obj_numberValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
207
|
+
return new TypeError(message);
|
|
127
208
|
}
|
|
128
|
-
})();
|
|
129
|
-
if (obj_value_union2_error != null) {
|
|
130
|
-
obj_value_union2 = obj_value_union2_error.message;
|
|
131
209
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
210
|
+
if (obj.stringValue !== undefined) {
|
|
211
|
+
const obj_stringValue = obj.stringValue;
|
|
212
|
+
const path_stringValue = path + '.stringValue';
|
|
213
|
+
let obj_stringValue_union0 = null;
|
|
214
|
+
const obj_stringValue_union0_error = (() => {
|
|
215
|
+
if (typeof obj_stringValue !== 'string') {
|
|
216
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stringValue + '" (at "' + path_stringValue + '")');
|
|
217
|
+
}
|
|
218
|
+
})();
|
|
219
|
+
if (obj_stringValue_union0_error != null) {
|
|
220
|
+
obj_stringValue_union0 = obj_stringValue_union0_error.message;
|
|
221
|
+
}
|
|
222
|
+
let obj_stringValue_union1 = null;
|
|
223
|
+
const obj_stringValue_union1_error = (() => {
|
|
224
|
+
if (obj_stringValue !== null) {
|
|
225
|
+
return new TypeError('Expected "null" but received "' + typeof obj_stringValue + '" (at "' + path_stringValue + '")');
|
|
226
|
+
}
|
|
227
|
+
})();
|
|
228
|
+
if (obj_stringValue_union1_error != null) {
|
|
229
|
+
obj_stringValue_union1 = obj_stringValue_union1_error.message;
|
|
230
|
+
}
|
|
231
|
+
if (obj_stringValue_union0 && obj_stringValue_union1) {
|
|
232
|
+
let message = 'Object doesn\'t match union (at "' + path_stringValue + '")';
|
|
233
|
+
message += '\n' + obj_stringValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
234
|
+
message += '\n' + obj_stringValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
235
|
+
return new TypeError(message);
|
|
136
236
|
}
|
|
137
|
-
})();
|
|
138
|
-
if (obj_value_union3_error != null) {
|
|
139
|
-
obj_value_union3 = obj_value_union3_error.message;
|
|
140
237
|
}
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
238
|
+
if (obj.stringValues !== undefined) {
|
|
239
|
+
const obj_stringValues = obj.stringValues;
|
|
240
|
+
const path_stringValues = path + '.stringValues';
|
|
241
|
+
if (!ArrayIsArray(obj_stringValues)) {
|
|
242
|
+
return new TypeError('Expected "array" but received "' + typeof obj_stringValues + '" (at "' + path_stringValues + '")');
|
|
243
|
+
}
|
|
244
|
+
for (let i = 0; i < obj_stringValues.length; i++) {
|
|
245
|
+
const obj_stringValues_item = obj_stringValues[i];
|
|
246
|
+
const path_stringValues_item = path_stringValues + '[' + i + ']';
|
|
247
|
+
if (typeof obj_stringValues_item !== 'string') {
|
|
248
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stringValues_item + '" (at "' + path_stringValues_item + '")');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
148
251
|
}
|
|
149
252
|
})();
|
|
150
253
|
return v_error === undefined ? null : v_error;
|
|
151
254
|
}
|
|
152
255
|
const RepresentationType = 'CommerceConfigurationAttributeOutputRepresentation';
|
|
153
256
|
function keyBuilder$3(luvio, config) {
|
|
154
|
-
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
257
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id + ':' + config.contextId + ':' + config.contextType;
|
|
155
258
|
}
|
|
156
259
|
function keyBuilderFromType(luvio, object) {
|
|
157
260
|
const keyParams = {
|
|
158
|
-
id: object.id
|
|
261
|
+
id: object.id,
|
|
262
|
+
contextId: object.contextId,
|
|
263
|
+
contextType: object.contextType
|
|
159
264
|
};
|
|
160
265
|
return keyBuilder$3(luvio, keyParams);
|
|
161
266
|
}
|
|
@@ -169,26 +274,131 @@ const select$2 = function CommerceConfigurationAttributeOutputRepresentationSele
|
|
|
169
274
|
private: [],
|
|
170
275
|
selections: [
|
|
171
276
|
{
|
|
172
|
-
name: '
|
|
277
|
+
name: 'booleanValue',
|
|
278
|
+
kind: 'Scalar',
|
|
279
|
+
required: false
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'contextId',
|
|
173
283
|
kind: 'Scalar'
|
|
174
284
|
},
|
|
175
285
|
{
|
|
176
|
-
name: '
|
|
286
|
+
name: 'contextType',
|
|
177
287
|
kind: 'Scalar'
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'id',
|
|
291
|
+
kind: 'Scalar'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'integerValue',
|
|
295
|
+
kind: 'Scalar',
|
|
296
|
+
required: false
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: 'numberValue',
|
|
300
|
+
kind: 'Scalar',
|
|
301
|
+
required: false
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: 'stringValue',
|
|
305
|
+
kind: 'Scalar',
|
|
306
|
+
required: false
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'stringValues',
|
|
310
|
+
kind: 'Scalar',
|
|
311
|
+
plural: true,
|
|
312
|
+
required: false
|
|
178
313
|
}
|
|
179
314
|
]
|
|
180
315
|
};
|
|
181
316
|
};
|
|
182
317
|
function equals(existing, incoming) {
|
|
318
|
+
const existing_contextId = existing.contextId;
|
|
319
|
+
const incoming_contextId = incoming.contextId;
|
|
320
|
+
if (!(existing_contextId === incoming_contextId)) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
const existing_contextType = existing.contextType;
|
|
324
|
+
const incoming_contextType = incoming.contextType;
|
|
325
|
+
if (!(existing_contextType === incoming_contextType)) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
183
328
|
const existing_id = existing.id;
|
|
184
329
|
const incoming_id = incoming.id;
|
|
185
330
|
if (!(existing_id === incoming_id)) {
|
|
186
331
|
return false;
|
|
187
332
|
}
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
if
|
|
191
|
-
|
|
333
|
+
const existing_booleanValue = existing.booleanValue;
|
|
334
|
+
const incoming_booleanValue = incoming.booleanValue;
|
|
335
|
+
// if at least one of these optionals is defined
|
|
336
|
+
if (existing_booleanValue !== undefined || incoming_booleanValue !== undefined) {
|
|
337
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
338
|
+
// not equal
|
|
339
|
+
if (existing_booleanValue === undefined || incoming_booleanValue === undefined) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
if (!(existing_booleanValue === incoming_booleanValue)) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const existing_integerValue = existing.integerValue;
|
|
347
|
+
const incoming_integerValue = incoming.integerValue;
|
|
348
|
+
// if at least one of these optionals is defined
|
|
349
|
+
if (existing_integerValue !== undefined || incoming_integerValue !== undefined) {
|
|
350
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
351
|
+
// not equal
|
|
352
|
+
if (existing_integerValue === undefined || incoming_integerValue === undefined) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
if (!(existing_integerValue === incoming_integerValue)) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
const existing_numberValue = existing.numberValue;
|
|
360
|
+
const incoming_numberValue = incoming.numberValue;
|
|
361
|
+
// if at least one of these optionals is defined
|
|
362
|
+
if (existing_numberValue !== undefined || incoming_numberValue !== undefined) {
|
|
363
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
364
|
+
// not equal
|
|
365
|
+
if (existing_numberValue === undefined || incoming_numberValue === undefined) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
if (!(existing_numberValue === incoming_numberValue)) {
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const existing_stringValue = existing.stringValue;
|
|
373
|
+
const incoming_stringValue = incoming.stringValue;
|
|
374
|
+
// if at least one of these optionals is defined
|
|
375
|
+
if (existing_stringValue !== undefined || incoming_stringValue !== undefined) {
|
|
376
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
377
|
+
// not equal
|
|
378
|
+
if (existing_stringValue === undefined || incoming_stringValue === undefined) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
if (!(existing_stringValue === incoming_stringValue)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const existing_stringValues = existing.stringValues;
|
|
386
|
+
const incoming_stringValues = incoming.stringValues;
|
|
387
|
+
// if at least one of these optionals is defined
|
|
388
|
+
if (existing_stringValues !== undefined || incoming_stringValues !== undefined) {
|
|
389
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
390
|
+
// not equal
|
|
391
|
+
if (existing_stringValues === undefined || incoming_stringValues === undefined) {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
const equals_stringValues_items = equalsArray(existing_stringValues, incoming_stringValues, (existing_stringValues_item, incoming_stringValues_item) => {
|
|
395
|
+
if (!(existing_stringValues_item === incoming_stringValues_item)) {
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
if (equals_stringValues_items === false) {
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
192
402
|
}
|
|
193
403
|
return true;
|
|
194
404
|
}
|
|
@@ -216,7 +426,9 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
216
426
|
|
|
217
427
|
function keyBuilder$2(luvio, params) {
|
|
218
428
|
return keyBuilder$3(luvio, {
|
|
219
|
-
id: params.urlParams.attributeId
|
|
429
|
+
id: params.urlParams.attributeId,
|
|
430
|
+
contextId: params.urlParams.contextId,
|
|
431
|
+
contextType: params.urlParams.contextType
|
|
220
432
|
});
|
|
221
433
|
}
|
|
222
434
|
function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
|
|
@@ -305,7 +517,9 @@ function select$1(luvio, params) {
|
|
|
305
517
|
}
|
|
306
518
|
function keyBuilder$1(luvio, params) {
|
|
307
519
|
return keyBuilder$3(luvio, {
|
|
308
|
-
id: params.urlParams.attributeId
|
|
520
|
+
id: params.urlParams.attributeId,
|
|
521
|
+
contextId: params.urlParams.contextId,
|
|
522
|
+
contextType: params.urlParams.contextType
|
|
309
523
|
});
|
|
310
524
|
}
|
|
311
525
|
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
@@ -359,6 +573,8 @@ function createResourceRequestFromRepresentation(representation) {
|
|
|
359
573
|
queryParams: {},
|
|
360
574
|
};
|
|
361
575
|
config.urlParams.attributeId = representation.id;
|
|
576
|
+
config.urlParams.contextId = representation.contextId;
|
|
577
|
+
config.urlParams.contextType = representation.contextType;
|
|
362
578
|
return createResourceRequest$1(config);
|
|
363
579
|
}
|
|
364
580
|
|
|
@@ -527,26 +743,17 @@ const putCommerceConfigurationAttribute_ConfigPropertyMetadata = [
|
|
|
527
743
|
generateParamConfigMetadata('attributeId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
528
744
|
generateParamConfigMetadata('contextId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
529
745
|
generateParamConfigMetadata('contextType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
530
|
-
generateParamConfigMetadata('
|
|
746
|
+
generateParamConfigMetadata('booleanValue', false, 2 /* Body */, 1 /* Boolean */),
|
|
747
|
+
generateParamConfigMetadata('integerValue', false, 2 /* Body */, 3 /* Integer */),
|
|
748
|
+
generateParamConfigMetadata('numberValue', false, 2 /* Body */, 2 /* Number */),
|
|
749
|
+
generateParamConfigMetadata('stringValue', false, 2 /* Body */, 0 /* String */),
|
|
750
|
+
generateParamConfigMetadata('stringValues', false, 2 /* Body */, 0 /* String */, true),
|
|
531
751
|
];
|
|
532
752
|
const putCommerceConfigurationAttribute_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
533
753
|
const createResourceParams = /*#__PURE__*/ createResourceParams$3(putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
534
754
|
function typeCheckConfig(untrustedConfig) {
|
|
535
755
|
const config = {};
|
|
536
756
|
typeCheckConfig$3(untrustedConfig, config, putCommerceConfigurationAttribute_ConfigPropertyMetadata);
|
|
537
|
-
const untrustedConfig_value = untrustedConfig.value;
|
|
538
|
-
if (typeof untrustedConfig_value === 'boolean') {
|
|
539
|
-
config.value = untrustedConfig_value;
|
|
540
|
-
}
|
|
541
|
-
if (typeof untrustedConfig_value === 'number' && Math.floor(untrustedConfig_value) === untrustedConfig_value) {
|
|
542
|
-
config.value = untrustedConfig_value;
|
|
543
|
-
}
|
|
544
|
-
if (typeof untrustedConfig_value === 'number') {
|
|
545
|
-
config.value = untrustedConfig_value;
|
|
546
|
-
}
|
|
547
|
-
if (typeof untrustedConfig_value === 'string') {
|
|
548
|
-
config.value = untrustedConfig_value;
|
|
549
|
-
}
|
|
550
757
|
return config;
|
|
551
758
|
}
|
|
552
759
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -625,4 +832,4 @@ withDefaultLuvio((luvio) => {
|
|
|
625
832
|
});
|
|
626
833
|
|
|
627
834
|
export { deleteCommerceConfigurationAttribute, getCommerceConfigurationAttribute, getCommerceConfigurationAttributeNotifyChange, getCommerceConfigurationAttribute_imperative, putCommerceConfigurationAttribute };
|
|
628
|
-
// version: 1.
|
|
835
|
+
// version: 1.253.0-15fc9805a
|
package/src/raml/api.raml
CHANGED
|
@@ -29,23 +29,70 @@ types:
|
|
|
29
29
|
description: Input representation of a commerce configuration attribute.
|
|
30
30
|
type: object
|
|
31
31
|
properties:
|
|
32
|
-
|
|
33
|
-
description: The
|
|
34
|
-
# hand
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
booleanValue:
|
|
33
|
+
description: The boolean value of the commerce configuration attribute.
|
|
34
|
+
required: false # hand-rolled
|
|
35
|
+
type: boolean
|
|
36
|
+
integerValue:
|
|
37
|
+
description: The integer value of the commerce configuration attribute.
|
|
38
|
+
required: false # hand-rolled
|
|
39
|
+
type: integer
|
|
40
|
+
numberValue:
|
|
41
|
+
description: The number value of the commerce configuration attribute.
|
|
42
|
+
# format: double # hand-rolled
|
|
43
|
+
required: false # hand-rolled
|
|
44
|
+
type: number
|
|
45
|
+
stringValue:
|
|
46
|
+
description: The string value of the commerce configuration attribute.
|
|
47
|
+
required: false # hand-rolled
|
|
48
|
+
type: string
|
|
49
|
+
stringValues:
|
|
50
|
+
description: The list of string values of the commerce configuration attribute.
|
|
51
|
+
required: false # hand-rolled
|
|
52
|
+
type: array
|
|
53
|
+
items:
|
|
54
|
+
type: string
|
|
37
55
|
CommerceConfigurationAttributeOutputRepresentation:
|
|
38
56
|
description: Output representation of a configuration attribute.
|
|
39
57
|
type: object
|
|
40
58
|
properties:
|
|
59
|
+
booleanValue:
|
|
60
|
+
description: The boolean value of the commerce configuration attribute.
|
|
61
|
+
required: false # hand-rolled
|
|
62
|
+
type: boolean | nil
|
|
63
|
+
contextId:
|
|
64
|
+
description: The id of the context in scope of the context type.
|
|
65
|
+
type: string
|
|
66
|
+
contextType:
|
|
67
|
+
description: The type of context the configuration attribute applies for.
|
|
68
|
+
type: string
|
|
69
|
+
enum:
|
|
70
|
+
- CommerceChannel
|
|
71
|
+
- ExperienceNetwork
|
|
72
|
+
- Organization
|
|
73
|
+
- WebStore
|
|
41
74
|
id:
|
|
42
75
|
description: The id of the commerce configuration attribute.
|
|
43
76
|
type: string
|
|
44
|
-
|
|
45
|
-
description: The
|
|
46
|
-
# hand
|
|
47
|
-
|
|
48
|
-
|
|
77
|
+
integerValue:
|
|
78
|
+
description: The integer value of the commerce configuration attribute.
|
|
79
|
+
required: false # hand-rolled
|
|
80
|
+
type: integer | nil
|
|
81
|
+
numberValue:
|
|
82
|
+
description: The number value of the commerce configuration attribute.
|
|
83
|
+
# format: double # hand-rolled removed, causes errors with union type
|
|
84
|
+
required: false # hand-rolled
|
|
85
|
+
type: number | nil
|
|
86
|
+
stringValue:
|
|
87
|
+
description: The string value of the commerce configuration attribute.
|
|
88
|
+
required: false # hand-rolled
|
|
89
|
+
type: string | nil
|
|
90
|
+
stringValues:
|
|
91
|
+
description: The list of string values of the commerce configuration attribute.
|
|
92
|
+
required: false # hand-rolled
|
|
93
|
+
type: array
|
|
94
|
+
items:
|
|
95
|
+
type: string
|
|
49
96
|
/commerce/configuration/{attributeId}/{contextType}/{contextId}:
|
|
50
97
|
delete:
|
|
51
98
|
displayName: deleteCommerceConfigurationAttribute
|
package/src/raml/luvio.raml
CHANGED
|
@@ -13,6 +13,8 @@ types:
|
|
|
13
13
|
(luvio.ttl): 1000
|
|
14
14
|
(luvio.key):
|
|
15
15
|
id: id
|
|
16
|
+
contextId: contextId
|
|
17
|
+
contextType: contextType
|
|
16
18
|
|
|
17
19
|
/commerce/configuration/{attributeId}/{contextType}/{contextId}:
|
|
18
20
|
delete:
|
|
@@ -20,11 +22,15 @@ types:
|
|
|
20
22
|
name: deleteCommerceConfigurationAttribute
|
|
21
23
|
(luvio.key):
|
|
22
24
|
id: urlParams.attributeId
|
|
25
|
+
contextId: urlParams.contextId
|
|
26
|
+
contextType: urlParams.contextType
|
|
23
27
|
get:
|
|
24
28
|
(luvio.adapter):
|
|
25
29
|
name: getCommerceConfigurationAttribute
|
|
26
30
|
(luvio.key):
|
|
27
31
|
id: urlParams.attributeId
|
|
32
|
+
contextId: urlParams.contextId
|
|
33
|
+
contextType: urlParams.contextType
|
|
28
34
|
put:
|
|
29
35
|
(luvio.adapter):
|
|
30
36
|
name: putCommerceConfigurationAttribute
|