@salesforce/lds-adapters-commerce-extensions 1.124.2 → 1.124.3
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-extensions.js +1994 -1994
- package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
- package/dist/{types → es/es2018/types}/src/generated/adapters/createMapping.d.ts +17 -17
- package/dist/{types → es/es2018/types}/src/generated/adapters/deleteMapping.d.ts +13 -13
- package/dist/{types → es/es2018/types}/src/generated/adapters/getExtensions.d.ts +25 -25
- package/dist/{types → es/es2018/types}/src/generated/adapters/getMapping.d.ts +27 -27
- package/dist/{types → es/es2018/types}/src/generated/adapters/getMappings.d.ts +27 -27
- package/dist/{types → es/es2018/types}/src/generated/adapters/getProviders.d.ts +27 -27
- package/dist/{types → es/es2018/types}/src/generated/adapters/updateMapping.d.ts +18 -18
- package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +7 -7
- package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +13 -13
- package/dist/{types → es/es2018/types}/src/generated/resources/deleteCommerceExtensionMappingsByMappingId.d.ts +12 -12
- package/dist/{types → es/es2018/types}/src/generated/resources/getCommerceExtensionExtensions.d.ts +12 -12
- package/dist/{types → es/es2018/types}/src/generated/resources/getCommerceExtensionMappings.d.ts +16 -16
- package/dist/{types → es/es2018/types}/src/generated/resources/getCommerceExtensionMappingsByMappingId.d.ts +16 -16
- package/dist/{types → es/es2018/types}/src/generated/resources/getCommerceExtensionProviders.d.ts +16 -16
- package/dist/{types → es/es2018/types}/src/generated/resources/postCommerceExtensionMappings.d.ts +15 -15
- package/dist/{types → es/es2018/types}/src/generated/resources/putCommerceExtensionMappingsByMappingId.d.ts +18 -18
- package/dist/{types → es/es2018/types}/src/generated/types/ApexClassOutputRepresentation.d.ts +38 -38
- package/dist/{types → es/es2018/types}/src/generated/types/EffectiveMappingRepresentation.d.ts +29 -29
- package/dist/{types → es/es2018/types}/src/generated/types/ExtensionOutputCollectionRepresentation.d.ts +43 -43
- package/dist/{types → es/es2018/types}/src/generated/types/ExtensionOutputRepresentation.d.ts +57 -57
- package/dist/{types → es/es2018/types}/src/generated/types/MappingInputRepresentation.d.ts +48 -48
- package/dist/{types → es/es2018/types}/src/generated/types/MappingOutputCollectionRepresentation.d.ts +43 -43
- package/dist/{types → es/es2018/types}/src/generated/types/MappingOutputRepresentation.d.ts +49 -49
- package/dist/{types → es/es2018/types}/src/generated/types/ProviderOutputCollectionRepresentation.d.ts +43 -43
- package/dist/{types → es/es2018/types}/src/generated/types/ProviderOutputRepresentation.d.ts +53 -53
- package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
- package/dist/{types → es/es2018/types}/src/main.d.ts +2 -2
- package/dist/{types → es/es2018/types}/src/sfdc.d.ts +3 -3
- package/package.json +1 -1
- package/sfdc/index.d.ts +1 -1
- package/sfdc/index.js +2093 -2093
- package/dist/umd/es2018/commerce-extensions.js +0 -2066
- package/dist/umd/es5/commerce-extensions.js +0 -2074
|
@@ -1,2074 +0,0 @@
|
|
|
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.commerceExtensions = {}, 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 = 'extensions';
|
|
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(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(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(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 TTL$5 = 60000;
|
|
98
|
-
var VERSION$7 = "504c635d0167987915edb8f94a23ca6d";
|
|
99
|
-
function validate$7(obj, path) {
|
|
100
|
-
if (path === void 0) { path = 'ExtensionOutputRepresentation'; }
|
|
101
|
-
var v_error = (function () {
|
|
102
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
103
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
104
|
-
}
|
|
105
|
-
var obj_domain = obj.domain;
|
|
106
|
-
var path_domain = path + '.domain';
|
|
107
|
-
if (typeof obj_domain !== 'string') {
|
|
108
|
-
return new TypeError('Expected "string" but received "' + typeof obj_domain + '" (at "' + path_domain + '")');
|
|
109
|
-
}
|
|
110
|
-
var obj_epn = obj.epn;
|
|
111
|
-
var path_epn = path + '.epn';
|
|
112
|
-
if (typeof obj_epn !== 'string') {
|
|
113
|
-
return new TypeError('Expected "string" but received "' + typeof obj_epn + '" (at "' + path_epn + '")');
|
|
114
|
-
}
|
|
115
|
-
var obj_name = obj.name;
|
|
116
|
-
var path_name = path + '.name';
|
|
117
|
-
if (typeof obj_name !== 'string') {
|
|
118
|
-
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
119
|
-
}
|
|
120
|
-
var obj_product = obj.product;
|
|
121
|
-
var path_product = path + '.product';
|
|
122
|
-
if (typeof obj_product !== 'string') {
|
|
123
|
-
return new TypeError('Expected "string" but received "' + typeof obj_product + '" (at "' + path_product + '")');
|
|
124
|
-
}
|
|
125
|
-
var obj_status = obj.status;
|
|
126
|
-
var path_status = path + '.status';
|
|
127
|
-
if (typeof obj_status !== 'string') {
|
|
128
|
-
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
129
|
-
}
|
|
130
|
-
var obj_type = obj.type;
|
|
131
|
-
var path_type = path + '.type';
|
|
132
|
-
if (typeof obj_type !== 'string') {
|
|
133
|
-
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
134
|
-
}
|
|
135
|
-
var obj_version = obj.version;
|
|
136
|
-
var path_version = path + '.version';
|
|
137
|
-
if (typeof obj_version !== 'number' || (typeof obj_version === 'number' && Math.floor(obj_version) !== obj_version)) {
|
|
138
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_version + '" (at "' + path_version + '")');
|
|
139
|
-
}
|
|
140
|
-
})();
|
|
141
|
-
return v_error === undefined ? null : v_error;
|
|
142
|
-
}
|
|
143
|
-
var RepresentationType$5 = 'ExtensionOutputRepresentation';
|
|
144
|
-
function keyBuilder$b(luvio, config) {
|
|
145
|
-
return keyPrefix + '::' + RepresentationType$5 + ':' + config.epn;
|
|
146
|
-
}
|
|
147
|
-
function keyBuilderFromType$2(luvio, object) {
|
|
148
|
-
var keyParams = {
|
|
149
|
-
epn: object.epn
|
|
150
|
-
};
|
|
151
|
-
return keyBuilder$b(luvio, keyParams);
|
|
152
|
-
}
|
|
153
|
-
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
154
|
-
return input;
|
|
155
|
-
}
|
|
156
|
-
var select$d = function ExtensionOutputRepresentationSelect() {
|
|
157
|
-
return {
|
|
158
|
-
kind: 'Fragment',
|
|
159
|
-
version: VERSION$7,
|
|
160
|
-
private: [],
|
|
161
|
-
selections: [
|
|
162
|
-
{
|
|
163
|
-
name: 'domain',
|
|
164
|
-
kind: 'Scalar'
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: 'epn',
|
|
168
|
-
kind: 'Scalar'
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: 'name',
|
|
172
|
-
kind: 'Scalar'
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: 'product',
|
|
176
|
-
kind: 'Scalar'
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: 'status',
|
|
180
|
-
kind: 'Scalar'
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: 'type',
|
|
184
|
-
kind: 'Scalar'
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: 'version',
|
|
188
|
-
kind: 'Scalar'
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
function equals$7(existing, incoming) {
|
|
194
|
-
var existing_version = existing.version;
|
|
195
|
-
var incoming_version = incoming.version;
|
|
196
|
-
if (!(existing_version === incoming_version)) {
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
var existing_domain = existing.domain;
|
|
200
|
-
var incoming_domain = incoming.domain;
|
|
201
|
-
if (!(existing_domain === incoming_domain)) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
var existing_epn = existing.epn;
|
|
205
|
-
var incoming_epn = incoming.epn;
|
|
206
|
-
if (!(existing_epn === incoming_epn)) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
var existing_name = existing.name;
|
|
210
|
-
var incoming_name = incoming.name;
|
|
211
|
-
if (!(existing_name === incoming_name)) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
var existing_product = existing.product;
|
|
215
|
-
var incoming_product = incoming.product;
|
|
216
|
-
if (!(existing_product === incoming_product)) {
|
|
217
|
-
return false;
|
|
218
|
-
}
|
|
219
|
-
var existing_status = existing.status;
|
|
220
|
-
var incoming_status = incoming.status;
|
|
221
|
-
if (!(existing_status === incoming_status)) {
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
var existing_type = existing.type;
|
|
225
|
-
var incoming_type = incoming.type;
|
|
226
|
-
if (!(existing_type === incoming_type)) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
var ingest$5 = function ExtensionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
232
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
233
|
-
var validateError = validate$7(input);
|
|
234
|
-
if (validateError !== null) {
|
|
235
|
-
throw validateError;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
var key = keyBuilderFromType$2(luvio, input);
|
|
239
|
-
var existingRecord = store.readEntry(key);
|
|
240
|
-
var ttlToUse = TTL$5;
|
|
241
|
-
var incomingRecord = normalize$5(input, store.readEntry(key), {
|
|
242
|
-
fullPath: key,
|
|
243
|
-
parent: path.parent,
|
|
244
|
-
propertyName: path.propertyName,
|
|
245
|
-
ttl: ttlToUse
|
|
246
|
-
});
|
|
247
|
-
if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
|
|
248
|
-
luvio.storePublish(key, incomingRecord);
|
|
249
|
-
}
|
|
250
|
-
{
|
|
251
|
-
var storeMetadataParams = {
|
|
252
|
-
ttl: ttlToUse,
|
|
253
|
-
namespace: "extensions",
|
|
254
|
-
version: VERSION$7,
|
|
255
|
-
representationName: RepresentationType$5,
|
|
256
|
-
};
|
|
257
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
258
|
-
}
|
|
259
|
-
return createLink(key);
|
|
260
|
-
};
|
|
261
|
-
function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
|
|
262
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
263
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
264
|
-
var rootKey = keyBuilderFromType$2(luvio, input);
|
|
265
|
-
rootKeySet.set(rootKey, {
|
|
266
|
-
namespace: keyPrefix,
|
|
267
|
-
representationName: RepresentationType$5,
|
|
268
|
-
mergeable: false
|
|
269
|
-
});
|
|
270
|
-
return rootKeySet;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
var TTL$4 = 60000;
|
|
274
|
-
var VERSION$6 = "d4f70ccafbea6d39e182d71c60d4ba89";
|
|
275
|
-
function validate$6(obj, path) {
|
|
276
|
-
if (path === void 0) { path = 'ExtensionOutputCollectionRepresentation'; }
|
|
277
|
-
var v_error = (function () {
|
|
278
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
279
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
280
|
-
}
|
|
281
|
-
var obj_count = obj.count;
|
|
282
|
-
var path_count = path + '.count';
|
|
283
|
-
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
284
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
285
|
-
}
|
|
286
|
-
var obj_items = obj.items;
|
|
287
|
-
var path_items = path + '.items';
|
|
288
|
-
if (!ArrayIsArray(obj_items)) {
|
|
289
|
-
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
290
|
-
}
|
|
291
|
-
for (var i = 0; i < obj_items.length; i++) {
|
|
292
|
-
var obj_items_item = obj_items[i];
|
|
293
|
-
var path_items_item = path_items + '[' + i + ']';
|
|
294
|
-
if (typeof obj_items_item !== 'object') {
|
|
295
|
-
return new TypeError('Expected "object" but received "' + typeof obj_items_item + '" (at "' + path_items_item + '")');
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
})();
|
|
299
|
-
return v_error === undefined ? null : v_error;
|
|
300
|
-
}
|
|
301
|
-
var RepresentationType$4 = 'ExtensionOutputCollectionRepresentation';
|
|
302
|
-
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
303
|
-
var input_items = input.items;
|
|
304
|
-
var input_items_id = path.fullPath + '__items';
|
|
305
|
-
for (var i = 0; i < input_items.length; i++) {
|
|
306
|
-
var input_items_item = input_items[i];
|
|
307
|
-
var input_items_item_id = input_items_id + '__' + i;
|
|
308
|
-
input_items[i] = ingest$5(input_items_item, {
|
|
309
|
-
fullPath: input_items_item_id,
|
|
310
|
-
propertyName: i,
|
|
311
|
-
parent: {
|
|
312
|
-
data: input,
|
|
313
|
-
key: path.fullPath,
|
|
314
|
-
existing: existing,
|
|
315
|
-
},
|
|
316
|
-
ttl: path.ttl
|
|
317
|
-
}, luvio, store);
|
|
318
|
-
}
|
|
319
|
-
return input;
|
|
320
|
-
}
|
|
321
|
-
var select$c = function ExtensionOutputCollectionRepresentationSelect() {
|
|
322
|
-
return {
|
|
323
|
-
kind: 'Fragment',
|
|
324
|
-
version: VERSION$6,
|
|
325
|
-
private: [],
|
|
326
|
-
selections: [
|
|
327
|
-
{
|
|
328
|
-
name: 'count',
|
|
329
|
-
kind: 'Scalar'
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
name: 'items',
|
|
333
|
-
kind: 'Link',
|
|
334
|
-
plural: true,
|
|
335
|
-
fragment: select$d()
|
|
336
|
-
}
|
|
337
|
-
]
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
function equals$6(existing, incoming) {
|
|
341
|
-
var existing_count = existing.count;
|
|
342
|
-
var incoming_count = incoming.count;
|
|
343
|
-
if (!(existing_count === incoming_count)) {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
var existing_items = existing.items;
|
|
347
|
-
var incoming_items = incoming.items;
|
|
348
|
-
var equals_items_items = equalsArray(existing_items, incoming_items, function (existing_items_item, incoming_items_item) {
|
|
349
|
-
if (!(existing_items_item.__ref === incoming_items_item.__ref)) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
if (equals_items_items === false) {
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
|
-
return true;
|
|
357
|
-
}
|
|
358
|
-
var ingest$4 = function ExtensionOutputCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
359
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
-
var validateError = validate$6(input);
|
|
361
|
-
if (validateError !== null) {
|
|
362
|
-
throw validateError;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
var key = path.fullPath;
|
|
366
|
-
var existingRecord = store.readEntry(key);
|
|
367
|
-
var ttlToUse = TTL$4;
|
|
368
|
-
var incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
369
|
-
fullPath: key,
|
|
370
|
-
parent: path.parent,
|
|
371
|
-
propertyName: path.propertyName,
|
|
372
|
-
ttl: ttlToUse
|
|
373
|
-
}, luvio, store);
|
|
374
|
-
if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
|
|
375
|
-
luvio.storePublish(key, incomingRecord);
|
|
376
|
-
}
|
|
377
|
-
{
|
|
378
|
-
var storeMetadataParams = {
|
|
379
|
-
ttl: ttlToUse,
|
|
380
|
-
namespace: "extensions",
|
|
381
|
-
version: VERSION$6,
|
|
382
|
-
representationName: RepresentationType$4,
|
|
383
|
-
};
|
|
384
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
385
|
-
}
|
|
386
|
-
return createLink(key);
|
|
387
|
-
};
|
|
388
|
-
function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
|
|
389
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
390
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
391
|
-
var rootKey = fullPathFactory();
|
|
392
|
-
rootKeySet.set(rootKey, {
|
|
393
|
-
namespace: keyPrefix,
|
|
394
|
-
representationName: RepresentationType$4,
|
|
395
|
-
mergeable: false
|
|
396
|
-
});
|
|
397
|
-
var input_items_length = input.items.length;
|
|
398
|
-
for (var i = 0; i < input_items_length; i++) {
|
|
399
|
-
rootKeySet.merge(getTypeCacheKeys$5(luvio, input.items[i]));
|
|
400
|
-
}
|
|
401
|
-
return rootKeySet;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function select$b(luvio, params) {
|
|
405
|
-
return select$c();
|
|
406
|
-
}
|
|
407
|
-
function keyBuilder$a(luvio, params) {
|
|
408
|
-
return keyPrefix + '::ExtensionOutputCollectionRepresentation:(' + ')';
|
|
409
|
-
}
|
|
410
|
-
function getResponseCacheKeys$6(luvio, resourceParams, response) {
|
|
411
|
-
return getTypeCacheKeys$4(luvio, response, function () { return keyBuilder$a(); });
|
|
412
|
-
}
|
|
413
|
-
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
414
|
-
var body = response.body;
|
|
415
|
-
var key = keyBuilder$a();
|
|
416
|
-
luvio.storeIngest(key, ingest$4, body);
|
|
417
|
-
var snapshot = luvio.storeLookup({
|
|
418
|
-
recordId: key,
|
|
419
|
-
node: select$b(),
|
|
420
|
-
variables: {},
|
|
421
|
-
}, snapshotRefresh);
|
|
422
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
423
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
424
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
return snapshot;
|
|
428
|
-
}
|
|
429
|
-
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
430
|
-
var key = keyBuilder$a();
|
|
431
|
-
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
432
|
-
var storeMetadataParams = {
|
|
433
|
-
ttl: TTL$4,
|
|
434
|
-
namespace: keyPrefix,
|
|
435
|
-
version: VERSION$6,
|
|
436
|
-
representationName: RepresentationType$4
|
|
437
|
-
};
|
|
438
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
439
|
-
return errorSnapshot;
|
|
440
|
-
}
|
|
441
|
-
function createResourceRequest$6(config) {
|
|
442
|
-
var headers = {};
|
|
443
|
-
return {
|
|
444
|
-
baseUri: '/services/data/v58.0',
|
|
445
|
-
basePath: '/commerce/extension/extensions',
|
|
446
|
-
method: 'get',
|
|
447
|
-
body: null,
|
|
448
|
-
urlParams: {},
|
|
449
|
-
queryParams: {},
|
|
450
|
-
headers: headers,
|
|
451
|
-
priority: 'normal',
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
var getExtensions_ConfigPropertyNames = {
|
|
456
|
-
displayName: 'getExtensions',
|
|
457
|
-
parameters: {
|
|
458
|
-
required: [],
|
|
459
|
-
optional: []
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
function createResourceParams$6(config) {
|
|
463
|
-
var resourceParams = {};
|
|
464
|
-
return resourceParams;
|
|
465
|
-
}
|
|
466
|
-
function keyBuilder$9(luvio, config) {
|
|
467
|
-
return keyBuilder$a();
|
|
468
|
-
}
|
|
469
|
-
function typeCheckConfig$6(untrustedConfig) {
|
|
470
|
-
var config = {};
|
|
471
|
-
return config;
|
|
472
|
-
}
|
|
473
|
-
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
474
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
478
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
479
|
-
}
|
|
480
|
-
var config = typeCheckConfig$6();
|
|
481
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
482
|
-
return null;
|
|
483
|
-
}
|
|
484
|
-
return config;
|
|
485
|
-
}
|
|
486
|
-
function adapterFragment$3(luvio, config) {
|
|
487
|
-
return select$b();
|
|
488
|
-
}
|
|
489
|
-
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
490
|
-
var snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
491
|
-
config: config,
|
|
492
|
-
resolve: function () { return buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions); }
|
|
493
|
-
});
|
|
494
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
495
|
-
}
|
|
496
|
-
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
497
|
-
var snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
498
|
-
config: config,
|
|
499
|
-
resolve: function () { return buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions); }
|
|
500
|
-
});
|
|
501
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
502
|
-
}
|
|
503
|
-
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
504
|
-
var resourceParams = createResourceParams$6();
|
|
505
|
-
var request = createResourceRequest$6();
|
|
506
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
507
|
-
.then(function (response) {
|
|
508
|
-
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$3(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$6(luvio, resourceParams, response.body); });
|
|
509
|
-
}, function (response) {
|
|
510
|
-
return luvio.handleErrorResponse(function () { return onFetchResponseError$3(luvio, config, resourceParams, response); });
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
514
|
-
var luvio = context.luvio, config = context.config;
|
|
515
|
-
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
516
|
-
var dispatchOptions = {
|
|
517
|
-
resourceRequestContext: {
|
|
518
|
-
requestCorrelator: requestCorrelator,
|
|
519
|
-
luvioRequestMethod: undefined,
|
|
520
|
-
},
|
|
521
|
-
eventObservers: eventObservers
|
|
522
|
-
};
|
|
523
|
-
if (networkPriority !== 'normal') {
|
|
524
|
-
dispatchOptions.overrides = {
|
|
525
|
-
priority: networkPriority
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
return buildNetworkSnapshot$6(luvio, config, dispatchOptions);
|
|
529
|
-
}
|
|
530
|
-
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
531
|
-
var luvio = context.luvio, config = context.config;
|
|
532
|
-
var selector = {
|
|
533
|
-
recordId: keyBuilder$9(),
|
|
534
|
-
node: adapterFragment$3(),
|
|
535
|
-
variables: {},
|
|
536
|
-
};
|
|
537
|
-
var cacheSnapshot = storeLookup(selector, {
|
|
538
|
-
config: config,
|
|
539
|
-
resolve: function () { return buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions); }
|
|
540
|
-
});
|
|
541
|
-
return cacheSnapshot;
|
|
542
|
-
}
|
|
543
|
-
var getExtensionsAdapterFactory = function (luvio) { return function extensions__getExtensions(untrustedConfig, requestContext) {
|
|
544
|
-
var config = validateAdapterConfig$6(untrustedConfig, getExtensions_ConfigPropertyNames);
|
|
545
|
-
// Invalid or incomplete config
|
|
546
|
-
if (config === null) {
|
|
547
|
-
return null;
|
|
548
|
-
}
|
|
549
|
-
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
550
|
-
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
551
|
-
}; };
|
|
552
|
-
|
|
553
|
-
var TTL$3 = 60000;
|
|
554
|
-
var VERSION$5 = "cef52859122e69e7f8552d6d2fbf67f8";
|
|
555
|
-
function validate$5(obj, path) {
|
|
556
|
-
if (path === void 0) { path = 'MappingOutputRepresentation'; }
|
|
557
|
-
var v_error = (function () {
|
|
558
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
559
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
560
|
-
}
|
|
561
|
-
var obj_epn = obj.epn;
|
|
562
|
-
var path_epn = path + '.epn';
|
|
563
|
-
if (typeof obj_epn !== 'string') {
|
|
564
|
-
return new TypeError('Expected "string" but received "' + typeof obj_epn + '" (at "' + path_epn + '")');
|
|
565
|
-
}
|
|
566
|
-
var obj_id = obj.id;
|
|
567
|
-
var path_id = path + '.id';
|
|
568
|
-
if (typeof obj_id !== 'string') {
|
|
569
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
570
|
-
}
|
|
571
|
-
var obj_providerName = obj.providerName;
|
|
572
|
-
var path_providerName = path + '.providerName';
|
|
573
|
-
if (typeof obj_providerName !== 'string') {
|
|
574
|
-
return new TypeError('Expected "string" but received "' + typeof obj_providerName + '" (at "' + path_providerName + '")');
|
|
575
|
-
}
|
|
576
|
-
var obj_webstoreId = obj.webstoreId;
|
|
577
|
-
var path_webstoreId = path + '.webstoreId';
|
|
578
|
-
if (typeof obj_webstoreId !== 'string') {
|
|
579
|
-
return new TypeError('Expected "string" but received "' + typeof obj_webstoreId + '" (at "' + path_webstoreId + '")');
|
|
580
|
-
}
|
|
581
|
-
})();
|
|
582
|
-
return v_error === undefined ? null : v_error;
|
|
583
|
-
}
|
|
584
|
-
var RepresentationType$3 = 'MappingOutputRepresentation';
|
|
585
|
-
function keyBuilder$8(luvio, config) {
|
|
586
|
-
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
587
|
-
}
|
|
588
|
-
function keyBuilderFromType$1(luvio, object) {
|
|
589
|
-
var keyParams = {
|
|
590
|
-
id: object.id
|
|
591
|
-
};
|
|
592
|
-
return keyBuilder$8(luvio, keyParams);
|
|
593
|
-
}
|
|
594
|
-
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
595
|
-
return input;
|
|
596
|
-
}
|
|
597
|
-
var select$a = function MappingOutputRepresentationSelect() {
|
|
598
|
-
return {
|
|
599
|
-
kind: 'Fragment',
|
|
600
|
-
version: VERSION$5,
|
|
601
|
-
private: [],
|
|
602
|
-
selections: [
|
|
603
|
-
{
|
|
604
|
-
name: 'epn',
|
|
605
|
-
kind: 'Scalar'
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
name: 'id',
|
|
609
|
-
kind: 'Scalar'
|
|
610
|
-
},
|
|
611
|
-
{
|
|
612
|
-
name: 'providerName',
|
|
613
|
-
kind: 'Scalar'
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
name: 'webstoreId',
|
|
617
|
-
kind: 'Scalar'
|
|
618
|
-
}
|
|
619
|
-
]
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
function equals$5(existing, incoming) {
|
|
623
|
-
var existing_epn = existing.epn;
|
|
624
|
-
var incoming_epn = incoming.epn;
|
|
625
|
-
if (!(existing_epn === incoming_epn)) {
|
|
626
|
-
return false;
|
|
627
|
-
}
|
|
628
|
-
var existing_id = existing.id;
|
|
629
|
-
var incoming_id = incoming.id;
|
|
630
|
-
if (!(existing_id === incoming_id)) {
|
|
631
|
-
return false;
|
|
632
|
-
}
|
|
633
|
-
var existing_providerName = existing.providerName;
|
|
634
|
-
var incoming_providerName = incoming.providerName;
|
|
635
|
-
if (!(existing_providerName === incoming_providerName)) {
|
|
636
|
-
return false;
|
|
637
|
-
}
|
|
638
|
-
var existing_webstoreId = existing.webstoreId;
|
|
639
|
-
var incoming_webstoreId = incoming.webstoreId;
|
|
640
|
-
if (!(existing_webstoreId === incoming_webstoreId)) {
|
|
641
|
-
return false;
|
|
642
|
-
}
|
|
643
|
-
return true;
|
|
644
|
-
}
|
|
645
|
-
var ingest$3 = function MappingOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
646
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
647
|
-
var validateError = validate$5(input);
|
|
648
|
-
if (validateError !== null) {
|
|
649
|
-
throw validateError;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
var key = keyBuilderFromType$1(luvio, input);
|
|
653
|
-
var existingRecord = store.readEntry(key);
|
|
654
|
-
var ttlToUse = TTL$3;
|
|
655
|
-
var incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
656
|
-
fullPath: key,
|
|
657
|
-
parent: path.parent,
|
|
658
|
-
propertyName: path.propertyName,
|
|
659
|
-
ttl: ttlToUse
|
|
660
|
-
});
|
|
661
|
-
if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
|
|
662
|
-
luvio.storePublish(key, incomingRecord);
|
|
663
|
-
}
|
|
664
|
-
{
|
|
665
|
-
var storeMetadataParams = {
|
|
666
|
-
ttl: ttlToUse,
|
|
667
|
-
namespace: "extensions",
|
|
668
|
-
version: VERSION$5,
|
|
669
|
-
representationName: RepresentationType$3,
|
|
670
|
-
};
|
|
671
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
672
|
-
}
|
|
673
|
-
return createLink(key);
|
|
674
|
-
};
|
|
675
|
-
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
676
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
677
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
678
|
-
var rootKey = keyBuilderFromType$1(luvio, input);
|
|
679
|
-
rootKeySet.set(rootKey, {
|
|
680
|
-
namespace: keyPrefix,
|
|
681
|
-
representationName: RepresentationType$3,
|
|
682
|
-
mergeable: false
|
|
683
|
-
});
|
|
684
|
-
return rootKeySet;
|
|
685
|
-
}
|
|
686
|
-
var notifyUpdateAvailableFactory = function (luvio) {
|
|
687
|
-
return function notifyMappingUpdateAvailable(configs) {
|
|
688
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
689
|
-
var requiredKeyParams_1 = ['id'];
|
|
690
|
-
configs.forEach(function (config) {
|
|
691
|
-
if (false === requiredKeyParams_1.every(function (req) { return req in config; })) {
|
|
692
|
-
throw new Error("one of the configs did not contain all required parameters: ".concat(JSONStringify(ObjectKeys(config))));
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
var keys = configs.map(function (c) { return keyBuilder$8(luvio, c); });
|
|
697
|
-
return luvio.notifyStoreUpdateAvailable(keys);
|
|
698
|
-
};
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
var TTL$2 = 60000;
|
|
702
|
-
var VERSION$4 = "7aeadbbc38a3c6a4adff51c98906ed3e";
|
|
703
|
-
function validate$4(obj, path) {
|
|
704
|
-
if (path === void 0) { path = 'MappingOutputCollectionRepresentation'; }
|
|
705
|
-
var v_error = (function () {
|
|
706
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
707
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
708
|
-
}
|
|
709
|
-
var obj_count = obj.count;
|
|
710
|
-
var path_count = path + '.count';
|
|
711
|
-
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
712
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
713
|
-
}
|
|
714
|
-
var obj_items = obj.items;
|
|
715
|
-
var path_items = path + '.items';
|
|
716
|
-
if (!ArrayIsArray(obj_items)) {
|
|
717
|
-
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
718
|
-
}
|
|
719
|
-
for (var i = 0; i < obj_items.length; i++) {
|
|
720
|
-
var obj_items_item = obj_items[i];
|
|
721
|
-
var path_items_item = path_items + '[' + i + ']';
|
|
722
|
-
if (typeof obj_items_item !== 'object') {
|
|
723
|
-
return new TypeError('Expected "object" but received "' + typeof obj_items_item + '" (at "' + path_items_item + '")');
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
})();
|
|
727
|
-
return v_error === undefined ? null : v_error;
|
|
728
|
-
}
|
|
729
|
-
var RepresentationType$2 = 'MappingOutputCollectionRepresentation';
|
|
730
|
-
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
731
|
-
var input_items = input.items;
|
|
732
|
-
var input_items_id = path.fullPath + '__items';
|
|
733
|
-
for (var i = 0; i < input_items.length; i++) {
|
|
734
|
-
var input_items_item = input_items[i];
|
|
735
|
-
var input_items_item_id = input_items_id + '__' + i;
|
|
736
|
-
input_items[i] = ingest$3(input_items_item, {
|
|
737
|
-
fullPath: input_items_item_id,
|
|
738
|
-
propertyName: i,
|
|
739
|
-
parent: {
|
|
740
|
-
data: input,
|
|
741
|
-
key: path.fullPath,
|
|
742
|
-
existing: existing,
|
|
743
|
-
},
|
|
744
|
-
ttl: path.ttl
|
|
745
|
-
}, luvio, store);
|
|
746
|
-
}
|
|
747
|
-
return input;
|
|
748
|
-
}
|
|
749
|
-
var select$9 = function MappingOutputCollectionRepresentationSelect() {
|
|
750
|
-
return {
|
|
751
|
-
kind: 'Fragment',
|
|
752
|
-
version: VERSION$4,
|
|
753
|
-
private: [],
|
|
754
|
-
selections: [
|
|
755
|
-
{
|
|
756
|
-
name: 'count',
|
|
757
|
-
kind: 'Scalar'
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
name: 'items',
|
|
761
|
-
kind: 'Link',
|
|
762
|
-
plural: true,
|
|
763
|
-
fragment: select$a()
|
|
764
|
-
}
|
|
765
|
-
]
|
|
766
|
-
};
|
|
767
|
-
};
|
|
768
|
-
function equals$4(existing, incoming) {
|
|
769
|
-
var existing_count = existing.count;
|
|
770
|
-
var incoming_count = incoming.count;
|
|
771
|
-
if (!(existing_count === incoming_count)) {
|
|
772
|
-
return false;
|
|
773
|
-
}
|
|
774
|
-
var existing_items = existing.items;
|
|
775
|
-
var incoming_items = incoming.items;
|
|
776
|
-
var equals_items_items = equalsArray(existing_items, incoming_items, function (existing_items_item, incoming_items_item) {
|
|
777
|
-
if (!(existing_items_item.__ref === incoming_items_item.__ref)) {
|
|
778
|
-
return false;
|
|
779
|
-
}
|
|
780
|
-
});
|
|
781
|
-
if (equals_items_items === false) {
|
|
782
|
-
return false;
|
|
783
|
-
}
|
|
784
|
-
return true;
|
|
785
|
-
}
|
|
786
|
-
var ingest$2 = function MappingOutputCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
787
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
788
|
-
var validateError = validate$4(input);
|
|
789
|
-
if (validateError !== null) {
|
|
790
|
-
throw validateError;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
var key = path.fullPath;
|
|
794
|
-
var existingRecord = store.readEntry(key);
|
|
795
|
-
var ttlToUse = TTL$2;
|
|
796
|
-
var incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
797
|
-
fullPath: key,
|
|
798
|
-
parent: path.parent,
|
|
799
|
-
propertyName: path.propertyName,
|
|
800
|
-
ttl: ttlToUse
|
|
801
|
-
}, luvio, store);
|
|
802
|
-
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
803
|
-
luvio.storePublish(key, incomingRecord);
|
|
804
|
-
}
|
|
805
|
-
{
|
|
806
|
-
var storeMetadataParams = {
|
|
807
|
-
ttl: ttlToUse,
|
|
808
|
-
namespace: "extensions",
|
|
809
|
-
version: VERSION$4,
|
|
810
|
-
representationName: RepresentationType$2,
|
|
811
|
-
};
|
|
812
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
813
|
-
}
|
|
814
|
-
return createLink(key);
|
|
815
|
-
};
|
|
816
|
-
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
817
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
818
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
819
|
-
var rootKey = fullPathFactory();
|
|
820
|
-
rootKeySet.set(rootKey, {
|
|
821
|
-
namespace: keyPrefix,
|
|
822
|
-
representationName: RepresentationType$2,
|
|
823
|
-
mergeable: false
|
|
824
|
-
});
|
|
825
|
-
var input_items_length = input.items.length;
|
|
826
|
-
for (var i = 0; i < input_items_length; i++) {
|
|
827
|
-
rootKeySet.merge(getTypeCacheKeys$3(luvio, input.items[i]));
|
|
828
|
-
}
|
|
829
|
-
return rootKeySet;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
function select$8(luvio, params) {
|
|
833
|
-
return select$9();
|
|
834
|
-
}
|
|
835
|
-
function keyBuilder$7(luvio, params) {
|
|
836
|
-
return keyPrefix + '::MappingOutputCollectionRepresentation:(' + 'epn:' + params.queryParams.epn + ',' + 'webstoreId:' + params.queryParams.webstoreId + ')';
|
|
837
|
-
}
|
|
838
|
-
function getResponseCacheKeys$5(luvio, resourceParams, response) {
|
|
839
|
-
return getTypeCacheKeys$2(luvio, response, function () { return keyBuilder$7(luvio, resourceParams); });
|
|
840
|
-
}
|
|
841
|
-
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
842
|
-
var body = response.body;
|
|
843
|
-
var key = keyBuilder$7(luvio, resourceParams);
|
|
844
|
-
luvio.storeIngest(key, ingest$2, body);
|
|
845
|
-
var snapshot = luvio.storeLookup({
|
|
846
|
-
recordId: key,
|
|
847
|
-
node: select$8(),
|
|
848
|
-
variables: {},
|
|
849
|
-
}, snapshotRefresh);
|
|
850
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
851
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
852
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
return snapshot;
|
|
856
|
-
}
|
|
857
|
-
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
858
|
-
var key = keyBuilder$7(luvio, params);
|
|
859
|
-
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
860
|
-
var storeMetadataParams = {
|
|
861
|
-
ttl: TTL$2,
|
|
862
|
-
namespace: keyPrefix,
|
|
863
|
-
version: VERSION$4,
|
|
864
|
-
representationName: RepresentationType$2
|
|
865
|
-
};
|
|
866
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
867
|
-
return errorSnapshot;
|
|
868
|
-
}
|
|
869
|
-
function createResourceRequest$5(config) {
|
|
870
|
-
var headers = {};
|
|
871
|
-
return {
|
|
872
|
-
baseUri: '/services/data/v58.0',
|
|
873
|
-
basePath: '/commerce/extension/mappings',
|
|
874
|
-
method: 'get',
|
|
875
|
-
body: null,
|
|
876
|
-
urlParams: {},
|
|
877
|
-
queryParams: config.queryParams,
|
|
878
|
-
headers: headers,
|
|
879
|
-
priority: 'normal',
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
var getMappings_ConfigPropertyNames = {
|
|
884
|
-
displayName: 'getMappings',
|
|
885
|
-
parameters: {
|
|
886
|
-
required: [],
|
|
887
|
-
optional: ['epn', 'webstoreId']
|
|
888
|
-
}
|
|
889
|
-
};
|
|
890
|
-
function createResourceParams$5(config) {
|
|
891
|
-
var resourceParams = {
|
|
892
|
-
queryParams: {
|
|
893
|
-
epn: config.epn, webstoreId: config.webstoreId
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
return resourceParams;
|
|
897
|
-
}
|
|
898
|
-
function keyBuilder$6(luvio, config) {
|
|
899
|
-
var resourceParams = createResourceParams$5(config);
|
|
900
|
-
return keyBuilder$7(luvio, resourceParams);
|
|
901
|
-
}
|
|
902
|
-
function typeCheckConfig$5(untrustedConfig) {
|
|
903
|
-
var config = {};
|
|
904
|
-
var untrustedConfig_epn = untrustedConfig.epn;
|
|
905
|
-
if (typeof untrustedConfig_epn === 'string') {
|
|
906
|
-
config.epn = untrustedConfig_epn;
|
|
907
|
-
}
|
|
908
|
-
var untrustedConfig_webstoreId = untrustedConfig.webstoreId;
|
|
909
|
-
if (typeof untrustedConfig_webstoreId === 'string') {
|
|
910
|
-
config.webstoreId = untrustedConfig_webstoreId;
|
|
911
|
-
}
|
|
912
|
-
return config;
|
|
913
|
-
}
|
|
914
|
-
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
915
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
916
|
-
return null;
|
|
917
|
-
}
|
|
918
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
919
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
920
|
-
}
|
|
921
|
-
var config = typeCheckConfig$5(untrustedConfig);
|
|
922
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
923
|
-
return null;
|
|
924
|
-
}
|
|
925
|
-
return config;
|
|
926
|
-
}
|
|
927
|
-
function adapterFragment$2(luvio, config) {
|
|
928
|
-
createResourceParams$5(config);
|
|
929
|
-
return select$8();
|
|
930
|
-
}
|
|
931
|
-
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
932
|
-
var snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
933
|
-
config: config,
|
|
934
|
-
resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
|
|
935
|
-
});
|
|
936
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
937
|
-
}
|
|
938
|
-
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
939
|
-
var snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
940
|
-
config: config,
|
|
941
|
-
resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
|
|
942
|
-
});
|
|
943
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
944
|
-
}
|
|
945
|
-
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
946
|
-
var resourceParams = createResourceParams$5(config);
|
|
947
|
-
var request = createResourceRequest$5(resourceParams);
|
|
948
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
949
|
-
.then(function (response) {
|
|
950
|
-
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$2(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$5(luvio, resourceParams, response.body); });
|
|
951
|
-
}, function (response) {
|
|
952
|
-
return luvio.handleErrorResponse(function () { return onFetchResponseError$2(luvio, config, resourceParams, response); });
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
956
|
-
var luvio = context.luvio, config = context.config;
|
|
957
|
-
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
958
|
-
var dispatchOptions = {
|
|
959
|
-
resourceRequestContext: {
|
|
960
|
-
requestCorrelator: requestCorrelator,
|
|
961
|
-
luvioRequestMethod: undefined,
|
|
962
|
-
},
|
|
963
|
-
eventObservers: eventObservers
|
|
964
|
-
};
|
|
965
|
-
if (networkPriority !== 'normal') {
|
|
966
|
-
dispatchOptions.overrides = {
|
|
967
|
-
priority: networkPriority
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
|
|
971
|
-
}
|
|
972
|
-
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
973
|
-
var luvio = context.luvio, config = context.config;
|
|
974
|
-
var selector = {
|
|
975
|
-
recordId: keyBuilder$6(luvio, config),
|
|
976
|
-
node: adapterFragment$2(luvio, config),
|
|
977
|
-
variables: {},
|
|
978
|
-
};
|
|
979
|
-
var cacheSnapshot = storeLookup(selector, {
|
|
980
|
-
config: config,
|
|
981
|
-
resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
|
|
982
|
-
});
|
|
983
|
-
return cacheSnapshot;
|
|
984
|
-
}
|
|
985
|
-
var getMappingsAdapterFactory = function (luvio) { return function extensions__getMappings(untrustedConfig, requestContext) {
|
|
986
|
-
var config = validateAdapterConfig$5(untrustedConfig, getMappings_ConfigPropertyNames);
|
|
987
|
-
// Invalid or incomplete config
|
|
988
|
-
if (config === null) {
|
|
989
|
-
return null;
|
|
990
|
-
}
|
|
991
|
-
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
992
|
-
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
993
|
-
}; };
|
|
994
|
-
|
|
995
|
-
function select$7(luvio, params) {
|
|
996
|
-
return select$a();
|
|
997
|
-
}
|
|
998
|
-
function getResponseCacheKeys$4(luvio, resourceParams, response) {
|
|
999
|
-
return getTypeCacheKeys$3(luvio, response);
|
|
1000
|
-
}
|
|
1001
|
-
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
1002
|
-
var body = response.body;
|
|
1003
|
-
var key = keyBuilderFromType$1(luvio, body);
|
|
1004
|
-
luvio.storeIngest(key, ingest$3, body);
|
|
1005
|
-
var snapshot = luvio.storeLookup({
|
|
1006
|
-
recordId: key,
|
|
1007
|
-
node: select$7(),
|
|
1008
|
-
variables: {},
|
|
1009
|
-
});
|
|
1010
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1011
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1012
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
return snapshot;
|
|
1016
|
-
}
|
|
1017
|
-
function createResourceRequest$4(config) {
|
|
1018
|
-
var headers = {};
|
|
1019
|
-
return {
|
|
1020
|
-
baseUri: '/services/data/v58.0',
|
|
1021
|
-
basePath: '/commerce/extension/mappings',
|
|
1022
|
-
method: 'post',
|
|
1023
|
-
body: config.body,
|
|
1024
|
-
urlParams: {},
|
|
1025
|
-
queryParams: {},
|
|
1026
|
-
headers: headers,
|
|
1027
|
-
priority: 'normal',
|
|
1028
|
-
};
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
var createMapping_ConfigPropertyNames = {
|
|
1032
|
-
displayName: 'createMapping',
|
|
1033
|
-
parameters: {
|
|
1034
|
-
required: ['epn', 'providerName', 'webstoreId'],
|
|
1035
|
-
optional: ['id']
|
|
1036
|
-
}
|
|
1037
|
-
};
|
|
1038
|
-
function createResourceParams$4(config) {
|
|
1039
|
-
var resourceParams = {
|
|
1040
|
-
body: {
|
|
1041
|
-
epn: config.epn, providerName: config.providerName, webstoreId: config.webstoreId
|
|
1042
|
-
}
|
|
1043
|
-
};
|
|
1044
|
-
if (config['id'] !== undefined) {
|
|
1045
|
-
resourceParams.body['id'] = config['id'];
|
|
1046
|
-
}
|
|
1047
|
-
return resourceParams;
|
|
1048
|
-
}
|
|
1049
|
-
function typeCheckConfig$4(untrustedConfig) {
|
|
1050
|
-
var config = {};
|
|
1051
|
-
var untrustedConfig_epn = untrustedConfig.epn;
|
|
1052
|
-
if (typeof untrustedConfig_epn === 'string') {
|
|
1053
|
-
config.epn = untrustedConfig_epn;
|
|
1054
|
-
}
|
|
1055
|
-
var untrustedConfig_id = untrustedConfig.id;
|
|
1056
|
-
if (typeof untrustedConfig_id === 'string') {
|
|
1057
|
-
config.id = untrustedConfig_id;
|
|
1058
|
-
}
|
|
1059
|
-
var untrustedConfig_providerName = untrustedConfig.providerName;
|
|
1060
|
-
if (typeof untrustedConfig_providerName === 'string') {
|
|
1061
|
-
config.providerName = untrustedConfig_providerName;
|
|
1062
|
-
}
|
|
1063
|
-
var untrustedConfig_webstoreId = untrustedConfig.webstoreId;
|
|
1064
|
-
if (typeof untrustedConfig_webstoreId === 'string') {
|
|
1065
|
-
config.webstoreId = untrustedConfig_webstoreId;
|
|
1066
|
-
}
|
|
1067
|
-
return config;
|
|
1068
|
-
}
|
|
1069
|
-
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1070
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1071
|
-
return null;
|
|
1072
|
-
}
|
|
1073
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1074
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1075
|
-
}
|
|
1076
|
-
var config = typeCheckConfig$4(untrustedConfig);
|
|
1077
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1078
|
-
return null;
|
|
1079
|
-
}
|
|
1080
|
-
return config;
|
|
1081
|
-
}
|
|
1082
|
-
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1083
|
-
var resourceParams = createResourceParams$4(config);
|
|
1084
|
-
var request = createResourceRequest$4(resourceParams);
|
|
1085
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1086
|
-
.then(function (response) {
|
|
1087
|
-
return luvio.handleSuccessResponse(function () {
|
|
1088
|
-
var snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
1089
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1090
|
-
}, function () { return getResponseCacheKeys$4(luvio, resourceParams, response.body); });
|
|
1091
|
-
}, function (response) {
|
|
1092
|
-
deepFreeze(response);
|
|
1093
|
-
throw response;
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
var createMappingAdapterFactory = function (luvio) {
|
|
1097
|
-
return function createMapping(untrustedConfig) {
|
|
1098
|
-
var config = validateAdapterConfig$4(untrustedConfig, createMapping_ConfigPropertyNames);
|
|
1099
|
-
// Invalid or incomplete config
|
|
1100
|
-
if (config === null) {
|
|
1101
|
-
throw new Error('Invalid config for "createMapping"');
|
|
1102
|
-
}
|
|
1103
|
-
return buildNetworkSnapshot$4(luvio, config);
|
|
1104
|
-
};
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
|
-
function keyBuilder$5(luvio, params) {
|
|
1108
|
-
return keyBuilder$8(luvio, {
|
|
1109
|
-
id: params.urlParams.mappingId
|
|
1110
|
-
});
|
|
1111
|
-
}
|
|
1112
|
-
function getResponseCacheKeys$3(luvio, resourceParams) {
|
|
1113
|
-
var key = keyBuilder$5(luvio, resourceParams);
|
|
1114
|
-
var cacheKeyMap = new engine.StoreKeyMap();
|
|
1115
|
-
cacheKeyMap.set(key, {
|
|
1116
|
-
namespace: keyPrefix,
|
|
1117
|
-
representationName: RepresentationType$3,
|
|
1118
|
-
mergeable: false
|
|
1119
|
-
});
|
|
1120
|
-
return cacheKeyMap;
|
|
1121
|
-
}
|
|
1122
|
-
function evictSuccess(luvio, resourceParams) {
|
|
1123
|
-
var key = keyBuilder$5(luvio, resourceParams);
|
|
1124
|
-
luvio.storeEvict(key);
|
|
1125
|
-
}
|
|
1126
|
-
function createResourceRequest$3(config) {
|
|
1127
|
-
var headers = {};
|
|
1128
|
-
return {
|
|
1129
|
-
baseUri: '/services/data/v58.0',
|
|
1130
|
-
basePath: '/commerce/extension/mappings/' + config.urlParams.mappingId + '',
|
|
1131
|
-
method: 'delete',
|
|
1132
|
-
body: null,
|
|
1133
|
-
urlParams: config.urlParams,
|
|
1134
|
-
queryParams: {},
|
|
1135
|
-
headers: headers,
|
|
1136
|
-
priority: 'normal',
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
var adapterName = 'deleteMapping';
|
|
1141
|
-
var deleteMapping_ConfigPropertyNames = {
|
|
1142
|
-
displayName: 'deleteMapping',
|
|
1143
|
-
parameters: {
|
|
1144
|
-
required: ['mappingId'],
|
|
1145
|
-
optional: []
|
|
1146
|
-
}
|
|
1147
|
-
};
|
|
1148
|
-
function createResourceParams$3(config) {
|
|
1149
|
-
var resourceParams = {
|
|
1150
|
-
urlParams: {
|
|
1151
|
-
mappingId: config.mappingId
|
|
1152
|
-
}
|
|
1153
|
-
};
|
|
1154
|
-
return resourceParams;
|
|
1155
|
-
}
|
|
1156
|
-
function typeCheckConfig$3(untrustedConfig) {
|
|
1157
|
-
var config = {};
|
|
1158
|
-
var untrustedConfig_mappingId = untrustedConfig.mappingId;
|
|
1159
|
-
if (typeof untrustedConfig_mappingId === 'string') {
|
|
1160
|
-
config.mappingId = untrustedConfig_mappingId;
|
|
1161
|
-
}
|
|
1162
|
-
return config;
|
|
1163
|
-
}
|
|
1164
|
-
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1165
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1166
|
-
return null;
|
|
1167
|
-
}
|
|
1168
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1169
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1170
|
-
}
|
|
1171
|
-
var config = typeCheckConfig$3(untrustedConfig);
|
|
1172
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1173
|
-
return null;
|
|
1174
|
-
}
|
|
1175
|
-
return config;
|
|
1176
|
-
}
|
|
1177
|
-
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1178
|
-
var resourceParams = createResourceParams$3(config);
|
|
1179
|
-
var request = createResourceRequest$3(resourceParams);
|
|
1180
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1181
|
-
.then(function () {
|
|
1182
|
-
return luvio.handleSuccessResponse(function () {
|
|
1183
|
-
evictSuccess(luvio, resourceParams);
|
|
1184
|
-
return luvio.storeBroadcast();
|
|
1185
|
-
}, function () { return getResponseCacheKeys$3(luvio, resourceParams); });
|
|
1186
|
-
}, function (response) {
|
|
1187
|
-
deepFreeze(response);
|
|
1188
|
-
throw response;
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1191
|
-
var deleteMappingAdapterFactory = function (luvio) {
|
|
1192
|
-
return function extensionsdeleteMapping(untrustedConfig) {
|
|
1193
|
-
var config = validateAdapterConfig$3(untrustedConfig, deleteMapping_ConfigPropertyNames);
|
|
1194
|
-
// Invalid or incomplete config
|
|
1195
|
-
if (config === null) {
|
|
1196
|
-
throw new Error("Invalid config for \"".concat(adapterName, "\""));
|
|
1197
|
-
}
|
|
1198
|
-
return buildNetworkSnapshot$3(luvio, config);
|
|
1199
|
-
};
|
|
1200
|
-
};
|
|
1201
|
-
|
|
1202
|
-
function select$6(luvio, params) {
|
|
1203
|
-
return select$a();
|
|
1204
|
-
}
|
|
1205
|
-
function keyBuilder$4(luvio, params) {
|
|
1206
|
-
return keyBuilder$8(luvio, {
|
|
1207
|
-
id: params.urlParams.mappingId
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
1211
|
-
return getTypeCacheKeys$3(luvio, response);
|
|
1212
|
-
}
|
|
1213
|
-
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1214
|
-
var body = response.body;
|
|
1215
|
-
var key = keyBuilder$4(luvio, resourceParams);
|
|
1216
|
-
luvio.storeIngest(key, ingest$3, body);
|
|
1217
|
-
var snapshot = luvio.storeLookup({
|
|
1218
|
-
recordId: key,
|
|
1219
|
-
node: select$6(),
|
|
1220
|
-
variables: {},
|
|
1221
|
-
}, snapshotRefresh);
|
|
1222
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1223
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1224
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
return snapshot;
|
|
1228
|
-
}
|
|
1229
|
-
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1230
|
-
var key = keyBuilder$4(luvio, params);
|
|
1231
|
-
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1232
|
-
var storeMetadataParams = {
|
|
1233
|
-
ttl: TTL$3,
|
|
1234
|
-
namespace: keyPrefix,
|
|
1235
|
-
version: VERSION$5,
|
|
1236
|
-
representationName: RepresentationType$3
|
|
1237
|
-
};
|
|
1238
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1239
|
-
return errorSnapshot;
|
|
1240
|
-
}
|
|
1241
|
-
function createResourceRequest$2(config) {
|
|
1242
|
-
var headers = {};
|
|
1243
|
-
return {
|
|
1244
|
-
baseUri: '/services/data/v58.0',
|
|
1245
|
-
basePath: '/commerce/extension/mappings/' + config.urlParams.mappingId + '',
|
|
1246
|
-
method: 'get',
|
|
1247
|
-
body: null,
|
|
1248
|
-
urlParams: config.urlParams,
|
|
1249
|
-
queryParams: {},
|
|
1250
|
-
headers: headers,
|
|
1251
|
-
priority: 'normal',
|
|
1252
|
-
};
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
var getMapping_ConfigPropertyNames = {
|
|
1256
|
-
displayName: 'getMapping',
|
|
1257
|
-
parameters: {
|
|
1258
|
-
required: ['mappingId'],
|
|
1259
|
-
optional: []
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
function createResourceParams$2(config) {
|
|
1263
|
-
var resourceParams = {
|
|
1264
|
-
urlParams: {
|
|
1265
|
-
mappingId: config.mappingId
|
|
1266
|
-
}
|
|
1267
|
-
};
|
|
1268
|
-
return resourceParams;
|
|
1269
|
-
}
|
|
1270
|
-
function keyBuilder$3(luvio, config) {
|
|
1271
|
-
var resourceParams = createResourceParams$2(config);
|
|
1272
|
-
return keyBuilder$4(luvio, resourceParams);
|
|
1273
|
-
}
|
|
1274
|
-
function typeCheckConfig$2(untrustedConfig) {
|
|
1275
|
-
var config = {};
|
|
1276
|
-
var untrustedConfig_mappingId = untrustedConfig.mappingId;
|
|
1277
|
-
if (typeof untrustedConfig_mappingId === 'string') {
|
|
1278
|
-
config.mappingId = untrustedConfig_mappingId;
|
|
1279
|
-
}
|
|
1280
|
-
return config;
|
|
1281
|
-
}
|
|
1282
|
-
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1283
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1284
|
-
return null;
|
|
1285
|
-
}
|
|
1286
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1287
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1288
|
-
}
|
|
1289
|
-
var config = typeCheckConfig$2(untrustedConfig);
|
|
1290
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1291
|
-
return null;
|
|
1292
|
-
}
|
|
1293
|
-
return config;
|
|
1294
|
-
}
|
|
1295
|
-
function adapterFragment$1(luvio, config) {
|
|
1296
|
-
createResourceParams$2(config);
|
|
1297
|
-
return select$6();
|
|
1298
|
-
}
|
|
1299
|
-
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1300
|
-
var snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1301
|
-
config: config,
|
|
1302
|
-
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
1303
|
-
});
|
|
1304
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1305
|
-
}
|
|
1306
|
-
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1307
|
-
var snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1308
|
-
config: config,
|
|
1309
|
-
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
1310
|
-
});
|
|
1311
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1312
|
-
}
|
|
1313
|
-
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1314
|
-
var resourceParams = createResourceParams$2(config);
|
|
1315
|
-
var request = createResourceRequest$2(resourceParams);
|
|
1316
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1317
|
-
.then(function (response) {
|
|
1318
|
-
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$1(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$2(luvio, resourceParams, response.body); });
|
|
1319
|
-
}, function (response) {
|
|
1320
|
-
return luvio.handleErrorResponse(function () { return onFetchResponseError$1(luvio, config, resourceParams, response); });
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1324
|
-
var luvio = context.luvio, config = context.config;
|
|
1325
|
-
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
1326
|
-
var dispatchOptions = {
|
|
1327
|
-
resourceRequestContext: {
|
|
1328
|
-
requestCorrelator: requestCorrelator,
|
|
1329
|
-
luvioRequestMethod: undefined,
|
|
1330
|
-
},
|
|
1331
|
-
eventObservers: eventObservers
|
|
1332
|
-
};
|
|
1333
|
-
if (networkPriority !== 'normal') {
|
|
1334
|
-
dispatchOptions.overrides = {
|
|
1335
|
-
priority: networkPriority
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
1339
|
-
}
|
|
1340
|
-
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1341
|
-
var luvio = context.luvio, config = context.config;
|
|
1342
|
-
var selector = {
|
|
1343
|
-
recordId: keyBuilder$3(luvio, config),
|
|
1344
|
-
node: adapterFragment$1(luvio, config),
|
|
1345
|
-
variables: {},
|
|
1346
|
-
};
|
|
1347
|
-
var cacheSnapshot = storeLookup(selector, {
|
|
1348
|
-
config: config,
|
|
1349
|
-
resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
|
|
1350
|
-
});
|
|
1351
|
-
return cacheSnapshot;
|
|
1352
|
-
}
|
|
1353
|
-
var getMappingAdapterFactory = function (luvio) { return function extensions__getMapping(untrustedConfig, requestContext) {
|
|
1354
|
-
var config = validateAdapterConfig$2(untrustedConfig, getMapping_ConfigPropertyNames);
|
|
1355
|
-
// Invalid or incomplete config
|
|
1356
|
-
if (config === null) {
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
1360
|
-
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1361
|
-
}; };
|
|
1362
|
-
|
|
1363
|
-
function select$5(luvio, params) {
|
|
1364
|
-
return select$a();
|
|
1365
|
-
}
|
|
1366
|
-
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
1367
|
-
return getTypeCacheKeys$3(luvio, response);
|
|
1368
|
-
}
|
|
1369
|
-
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
1370
|
-
var body = response.body;
|
|
1371
|
-
var key = keyBuilderFromType$1(luvio, body);
|
|
1372
|
-
luvio.storeIngest(key, ingest$3, body);
|
|
1373
|
-
var snapshot = luvio.storeLookup({
|
|
1374
|
-
recordId: key,
|
|
1375
|
-
node: select$5(),
|
|
1376
|
-
variables: {},
|
|
1377
|
-
});
|
|
1378
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1379
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1380
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
return snapshot;
|
|
1384
|
-
}
|
|
1385
|
-
function createResourceRequest$1(config) {
|
|
1386
|
-
var headers = {};
|
|
1387
|
-
return {
|
|
1388
|
-
baseUri: '/services/data/v58.0',
|
|
1389
|
-
basePath: '/commerce/extension/mappings/' + config.urlParams.mappingId + '',
|
|
1390
|
-
method: 'put',
|
|
1391
|
-
body: config.body,
|
|
1392
|
-
urlParams: config.urlParams,
|
|
1393
|
-
queryParams: {},
|
|
1394
|
-
headers: headers,
|
|
1395
|
-
priority: 'normal',
|
|
1396
|
-
};
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
var updateMapping_ConfigPropertyNames = {
|
|
1400
|
-
displayName: 'updateMapping',
|
|
1401
|
-
parameters: {
|
|
1402
|
-
required: ['mappingId', 'epn', 'providerName', 'webstoreId'],
|
|
1403
|
-
optional: ['id']
|
|
1404
|
-
}
|
|
1405
|
-
};
|
|
1406
|
-
function createResourceParams$1(config) {
|
|
1407
|
-
var resourceParams = {
|
|
1408
|
-
urlParams: {
|
|
1409
|
-
mappingId: config.mappingId
|
|
1410
|
-
},
|
|
1411
|
-
body: {
|
|
1412
|
-
epn: config.epn, providerName: config.providerName, webstoreId: config.webstoreId
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
if (config['id'] !== undefined) {
|
|
1416
|
-
resourceParams.body['id'] = config['id'];
|
|
1417
|
-
}
|
|
1418
|
-
return resourceParams;
|
|
1419
|
-
}
|
|
1420
|
-
function typeCheckConfig$1(untrustedConfig) {
|
|
1421
|
-
var config = {};
|
|
1422
|
-
var untrustedConfig_mappingId = untrustedConfig.mappingId;
|
|
1423
|
-
if (typeof untrustedConfig_mappingId === 'string') {
|
|
1424
|
-
config.mappingId = untrustedConfig_mappingId;
|
|
1425
|
-
}
|
|
1426
|
-
var untrustedConfig_epn = untrustedConfig.epn;
|
|
1427
|
-
if (typeof untrustedConfig_epn === 'string') {
|
|
1428
|
-
config.epn = untrustedConfig_epn;
|
|
1429
|
-
}
|
|
1430
|
-
var untrustedConfig_id = untrustedConfig.id;
|
|
1431
|
-
if (typeof untrustedConfig_id === 'string') {
|
|
1432
|
-
config.id = untrustedConfig_id;
|
|
1433
|
-
}
|
|
1434
|
-
var untrustedConfig_providerName = untrustedConfig.providerName;
|
|
1435
|
-
if (typeof untrustedConfig_providerName === 'string') {
|
|
1436
|
-
config.providerName = untrustedConfig_providerName;
|
|
1437
|
-
}
|
|
1438
|
-
var untrustedConfig_webstoreId = untrustedConfig.webstoreId;
|
|
1439
|
-
if (typeof untrustedConfig_webstoreId === 'string') {
|
|
1440
|
-
config.webstoreId = untrustedConfig_webstoreId;
|
|
1441
|
-
}
|
|
1442
|
-
return config;
|
|
1443
|
-
}
|
|
1444
|
-
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1445
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1446
|
-
return null;
|
|
1447
|
-
}
|
|
1448
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1449
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1450
|
-
}
|
|
1451
|
-
var config = typeCheckConfig$1(untrustedConfig);
|
|
1452
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1453
|
-
return null;
|
|
1454
|
-
}
|
|
1455
|
-
return config;
|
|
1456
|
-
}
|
|
1457
|
-
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1458
|
-
var resourceParams = createResourceParams$1(config);
|
|
1459
|
-
var request = createResourceRequest$1(resourceParams);
|
|
1460
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1461
|
-
.then(function (response) {
|
|
1462
|
-
return luvio.handleSuccessResponse(function () {
|
|
1463
|
-
var snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
1464
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
1465
|
-
}, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
|
|
1466
|
-
}, function (response) {
|
|
1467
|
-
deepFreeze(response);
|
|
1468
|
-
throw response;
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
var updateMappingAdapterFactory = function (luvio) {
|
|
1472
|
-
return function updateMapping(untrustedConfig) {
|
|
1473
|
-
var config = validateAdapterConfig$1(untrustedConfig, updateMapping_ConfigPropertyNames);
|
|
1474
|
-
// Invalid or incomplete config
|
|
1475
|
-
if (config === null) {
|
|
1476
|
-
throw new Error('Invalid config for "updateMapping"');
|
|
1477
|
-
}
|
|
1478
|
-
return buildNetworkSnapshot$1(luvio, config);
|
|
1479
|
-
};
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
var VERSION$3 = "bed780ad418f5f02446c1b0f9d165e5d";
|
|
1483
|
-
function validate$3(obj, path) {
|
|
1484
|
-
if (path === void 0) { path = 'ApexClassOutputRepresentation'; }
|
|
1485
|
-
var v_error = (function () {
|
|
1486
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1487
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1488
|
-
}
|
|
1489
|
-
var obj_classId = obj.classId;
|
|
1490
|
-
var path_classId = path + '.classId';
|
|
1491
|
-
if (typeof obj_classId !== 'string') {
|
|
1492
|
-
return new TypeError('Expected "string" but received "' + typeof obj_classId + '" (at "' + path_classId + '")');
|
|
1493
|
-
}
|
|
1494
|
-
var obj_className = obj.className;
|
|
1495
|
-
var path_className = path + '.className';
|
|
1496
|
-
if (typeof obj_className !== 'string') {
|
|
1497
|
-
return new TypeError('Expected "string" but received "' + typeof obj_className + '" (at "' + path_className + '")');
|
|
1498
|
-
}
|
|
1499
|
-
var obj_namespace = obj.namespace;
|
|
1500
|
-
var path_namespace = path + '.namespace';
|
|
1501
|
-
if (typeof obj_namespace !== 'string') {
|
|
1502
|
-
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
1503
|
-
}
|
|
1504
|
-
var obj_version = obj.version;
|
|
1505
|
-
var path_version = path + '.version';
|
|
1506
|
-
if (typeof obj_version !== 'string') {
|
|
1507
|
-
return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
|
|
1508
|
-
}
|
|
1509
|
-
})();
|
|
1510
|
-
return v_error === undefined ? null : v_error;
|
|
1511
|
-
}
|
|
1512
|
-
var select$4 = function ApexClassOutputRepresentationSelect() {
|
|
1513
|
-
return {
|
|
1514
|
-
kind: 'Fragment',
|
|
1515
|
-
version: VERSION$3,
|
|
1516
|
-
private: [],
|
|
1517
|
-
selections: [
|
|
1518
|
-
{
|
|
1519
|
-
name: 'classId',
|
|
1520
|
-
kind: 'Scalar'
|
|
1521
|
-
},
|
|
1522
|
-
{
|
|
1523
|
-
name: 'className',
|
|
1524
|
-
kind: 'Scalar'
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
name: 'namespace',
|
|
1528
|
-
kind: 'Scalar'
|
|
1529
|
-
},
|
|
1530
|
-
{
|
|
1531
|
-
name: 'version',
|
|
1532
|
-
kind: 'Scalar'
|
|
1533
|
-
}
|
|
1534
|
-
]
|
|
1535
|
-
};
|
|
1536
|
-
};
|
|
1537
|
-
function equals$3(existing, incoming) {
|
|
1538
|
-
var existing_classId = existing.classId;
|
|
1539
|
-
var incoming_classId = incoming.classId;
|
|
1540
|
-
if (!(existing_classId === incoming_classId)) {
|
|
1541
|
-
return false;
|
|
1542
|
-
}
|
|
1543
|
-
var existing_className = existing.className;
|
|
1544
|
-
var incoming_className = incoming.className;
|
|
1545
|
-
if (!(existing_className === incoming_className)) {
|
|
1546
|
-
return false;
|
|
1547
|
-
}
|
|
1548
|
-
var existing_namespace = existing.namespace;
|
|
1549
|
-
var incoming_namespace = incoming.namespace;
|
|
1550
|
-
if (!(existing_namespace === incoming_namespace)) {
|
|
1551
|
-
return false;
|
|
1552
|
-
}
|
|
1553
|
-
var existing_version = existing.version;
|
|
1554
|
-
var incoming_version = incoming.version;
|
|
1555
|
-
if (!(existing_version === incoming_version)) {
|
|
1556
|
-
return false;
|
|
1557
|
-
}
|
|
1558
|
-
return true;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
var VERSION$2 = "5d74820ea8d6cfbe4e56d4a37b7cdb77";
|
|
1562
|
-
function validate$2(obj, path) {
|
|
1563
|
-
if (path === void 0) { path = 'EffectiveMappingRepresentation'; }
|
|
1564
|
-
var v_error = (function () {
|
|
1565
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1566
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1567
|
-
}
|
|
1568
|
-
var obj_webstoreId = obj.webstoreId;
|
|
1569
|
-
var path_webstoreId = path + '.webstoreId';
|
|
1570
|
-
if (typeof obj_webstoreId !== 'string') {
|
|
1571
|
-
return new TypeError('Expected "string" but received "' + typeof obj_webstoreId + '" (at "' + path_webstoreId + '")');
|
|
1572
|
-
}
|
|
1573
|
-
})();
|
|
1574
|
-
return v_error === undefined ? null : v_error;
|
|
1575
|
-
}
|
|
1576
|
-
var select$3 = function EffectiveMappingRepresentationSelect() {
|
|
1577
|
-
return {
|
|
1578
|
-
kind: 'Fragment',
|
|
1579
|
-
version: VERSION$2,
|
|
1580
|
-
private: [],
|
|
1581
|
-
selections: [
|
|
1582
|
-
{
|
|
1583
|
-
name: 'webstoreId',
|
|
1584
|
-
kind: 'Scalar'
|
|
1585
|
-
}
|
|
1586
|
-
]
|
|
1587
|
-
};
|
|
1588
|
-
};
|
|
1589
|
-
function equals$2(existing, incoming) {
|
|
1590
|
-
var existing_webstoreId = existing.webstoreId;
|
|
1591
|
-
var incoming_webstoreId = incoming.webstoreId;
|
|
1592
|
-
if (!(existing_webstoreId === incoming_webstoreId)) {
|
|
1593
|
-
return false;
|
|
1594
|
-
}
|
|
1595
|
-
return true;
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
var TTL$1 = 60000;
|
|
1599
|
-
var VERSION$1 = "9e92dd6efb0ca494bcd06a4ad326b6a0";
|
|
1600
|
-
function validate$1(obj, path) {
|
|
1601
|
-
if (path === void 0) { path = 'ProviderOutputRepresentation'; }
|
|
1602
|
-
var v_error = (function () {
|
|
1603
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1604
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1605
|
-
}
|
|
1606
|
-
var obj_apexClass = obj.apexClass;
|
|
1607
|
-
var path_apexClass = path + '.apexClass';
|
|
1608
|
-
var referencepath_apexClassValidationError = validate$3(obj_apexClass, path_apexClass);
|
|
1609
|
-
if (referencepath_apexClassValidationError !== null) {
|
|
1610
|
-
var message = 'Object doesn\'t match ApexClassOutputRepresentation (at "' + path_apexClass + '")\n';
|
|
1611
|
-
message += referencepath_apexClassValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1612
|
-
return new TypeError(message);
|
|
1613
|
-
}
|
|
1614
|
-
var obj_effectiveMappings = obj.effectiveMappings;
|
|
1615
|
-
var path_effectiveMappings = path + '.effectiveMappings';
|
|
1616
|
-
if (!ArrayIsArray(obj_effectiveMappings)) {
|
|
1617
|
-
return new TypeError('Expected "array" but received "' + typeof obj_effectiveMappings + '" (at "' + path_effectiveMappings + '")');
|
|
1618
|
-
}
|
|
1619
|
-
for (var i = 0; i < obj_effectiveMappings.length; i++) {
|
|
1620
|
-
var obj_effectiveMappings_item = obj_effectiveMappings[i];
|
|
1621
|
-
var path_effectiveMappings_item = path_effectiveMappings + '[' + i + ']';
|
|
1622
|
-
var referencepath_effectiveMappings_itemValidationError = validate$2(obj_effectiveMappings_item, path_effectiveMappings_item);
|
|
1623
|
-
if (referencepath_effectiveMappings_itemValidationError !== null) {
|
|
1624
|
-
var message = 'Object doesn\'t match EffectiveMappingRepresentation (at "' + path_effectiveMappings_item + '")\n';
|
|
1625
|
-
message += referencepath_effectiveMappings_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
1626
|
-
return new TypeError(message);
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
var obj_epn = obj.epn;
|
|
1630
|
-
var path_epn = path + '.epn';
|
|
1631
|
-
if (typeof obj_epn !== 'string') {
|
|
1632
|
-
return new TypeError('Expected "string" but received "' + typeof obj_epn + '" (at "' + path_epn + '")');
|
|
1633
|
-
}
|
|
1634
|
-
var obj_name = obj.name;
|
|
1635
|
-
var path_name = path + '.name';
|
|
1636
|
-
if (typeof obj_name !== 'string') {
|
|
1637
|
-
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1638
|
-
}
|
|
1639
|
-
var obj_type = obj.type;
|
|
1640
|
-
var path_type = path + '.type';
|
|
1641
|
-
if (typeof obj_type !== 'string') {
|
|
1642
|
-
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1643
|
-
}
|
|
1644
|
-
})();
|
|
1645
|
-
return v_error === undefined ? null : v_error;
|
|
1646
|
-
}
|
|
1647
|
-
var RepresentationType$1 = 'ProviderOutputRepresentation';
|
|
1648
|
-
function keyBuilder$2(luvio, config) {
|
|
1649
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.name;
|
|
1650
|
-
}
|
|
1651
|
-
function keyBuilderFromType(luvio, object) {
|
|
1652
|
-
var keyParams = {
|
|
1653
|
-
name: object.name
|
|
1654
|
-
};
|
|
1655
|
-
return keyBuilder$2(luvio, keyParams);
|
|
1656
|
-
}
|
|
1657
|
-
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1658
|
-
return input;
|
|
1659
|
-
}
|
|
1660
|
-
var select$2 = function ProviderOutputRepresentationSelect() {
|
|
1661
|
-
var _a = select$4(), ApexClassOutputRepresentation__selections = _a.selections;
|
|
1662
|
-
var _b = select$3(), EffectiveMappingRepresentation__selections = _b.selections;
|
|
1663
|
-
return {
|
|
1664
|
-
kind: 'Fragment',
|
|
1665
|
-
version: VERSION$1,
|
|
1666
|
-
private: [],
|
|
1667
|
-
selections: [
|
|
1668
|
-
{
|
|
1669
|
-
name: 'apexClass',
|
|
1670
|
-
kind: 'Object',
|
|
1671
|
-
selections: ApexClassOutputRepresentation__selections
|
|
1672
|
-
},
|
|
1673
|
-
{
|
|
1674
|
-
name: 'effectiveMappings',
|
|
1675
|
-
kind: 'Object',
|
|
1676
|
-
plural: true,
|
|
1677
|
-
selections: EffectiveMappingRepresentation__selections
|
|
1678
|
-
},
|
|
1679
|
-
{
|
|
1680
|
-
name: 'epn',
|
|
1681
|
-
kind: 'Scalar'
|
|
1682
|
-
},
|
|
1683
|
-
{
|
|
1684
|
-
name: 'name',
|
|
1685
|
-
kind: 'Scalar'
|
|
1686
|
-
},
|
|
1687
|
-
{
|
|
1688
|
-
name: 'type',
|
|
1689
|
-
kind: 'Scalar'
|
|
1690
|
-
}
|
|
1691
|
-
]
|
|
1692
|
-
};
|
|
1693
|
-
};
|
|
1694
|
-
function equals$1(existing, incoming) {
|
|
1695
|
-
var existing_epn = existing.epn;
|
|
1696
|
-
var incoming_epn = incoming.epn;
|
|
1697
|
-
if (!(existing_epn === incoming_epn)) {
|
|
1698
|
-
return false;
|
|
1699
|
-
}
|
|
1700
|
-
var existing_name = existing.name;
|
|
1701
|
-
var incoming_name = incoming.name;
|
|
1702
|
-
if (!(existing_name === incoming_name)) {
|
|
1703
|
-
return false;
|
|
1704
|
-
}
|
|
1705
|
-
var existing_type = existing.type;
|
|
1706
|
-
var incoming_type = incoming.type;
|
|
1707
|
-
if (!(existing_type === incoming_type)) {
|
|
1708
|
-
return false;
|
|
1709
|
-
}
|
|
1710
|
-
var existing_apexClass = existing.apexClass;
|
|
1711
|
-
var incoming_apexClass = incoming.apexClass;
|
|
1712
|
-
if (!(equals$3(existing_apexClass, incoming_apexClass))) {
|
|
1713
|
-
return false;
|
|
1714
|
-
}
|
|
1715
|
-
var existing_effectiveMappings = existing.effectiveMappings;
|
|
1716
|
-
var incoming_effectiveMappings = incoming.effectiveMappings;
|
|
1717
|
-
var equals_effectiveMappings_items = equalsArray(existing_effectiveMappings, incoming_effectiveMappings, function (existing_effectiveMappings_item, incoming_effectiveMappings_item) {
|
|
1718
|
-
if (!(equals$2(existing_effectiveMappings_item, incoming_effectiveMappings_item))) {
|
|
1719
|
-
return false;
|
|
1720
|
-
}
|
|
1721
|
-
});
|
|
1722
|
-
if (equals_effectiveMappings_items === false) {
|
|
1723
|
-
return false;
|
|
1724
|
-
}
|
|
1725
|
-
return true;
|
|
1726
|
-
}
|
|
1727
|
-
var ingest$1 = function ProviderOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1728
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1729
|
-
var validateError = validate$1(input);
|
|
1730
|
-
if (validateError !== null) {
|
|
1731
|
-
throw validateError;
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
var key = keyBuilderFromType(luvio, input);
|
|
1735
|
-
var existingRecord = store.readEntry(key);
|
|
1736
|
-
var ttlToUse = TTL$1;
|
|
1737
|
-
var incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
1738
|
-
fullPath: key,
|
|
1739
|
-
parent: path.parent,
|
|
1740
|
-
propertyName: path.propertyName,
|
|
1741
|
-
ttl: ttlToUse
|
|
1742
|
-
});
|
|
1743
|
-
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
1744
|
-
luvio.storePublish(key, incomingRecord);
|
|
1745
|
-
}
|
|
1746
|
-
{
|
|
1747
|
-
var storeMetadataParams = {
|
|
1748
|
-
ttl: ttlToUse,
|
|
1749
|
-
namespace: "extensions",
|
|
1750
|
-
version: VERSION$1,
|
|
1751
|
-
representationName: RepresentationType$1,
|
|
1752
|
-
};
|
|
1753
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1754
|
-
}
|
|
1755
|
-
return createLink(key);
|
|
1756
|
-
};
|
|
1757
|
-
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
1758
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
1759
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1760
|
-
var rootKey = keyBuilderFromType(luvio, input);
|
|
1761
|
-
rootKeySet.set(rootKey, {
|
|
1762
|
-
namespace: keyPrefix,
|
|
1763
|
-
representationName: RepresentationType$1,
|
|
1764
|
-
mergeable: false
|
|
1765
|
-
});
|
|
1766
|
-
return rootKeySet;
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
var TTL = 60000;
|
|
1770
|
-
var VERSION = "d9978417e0efd08a87aa592d226979e1";
|
|
1771
|
-
function validate(obj, path) {
|
|
1772
|
-
if (path === void 0) { path = 'ProviderOutputCollectionRepresentation'; }
|
|
1773
|
-
var v_error = (function () {
|
|
1774
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1775
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1776
|
-
}
|
|
1777
|
-
var obj_count = obj.count;
|
|
1778
|
-
var path_count = path + '.count';
|
|
1779
|
-
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
1780
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
1781
|
-
}
|
|
1782
|
-
var obj_items = obj.items;
|
|
1783
|
-
var path_items = path + '.items';
|
|
1784
|
-
if (!ArrayIsArray(obj_items)) {
|
|
1785
|
-
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
1786
|
-
}
|
|
1787
|
-
for (var i = 0; i < obj_items.length; i++) {
|
|
1788
|
-
var obj_items_item = obj_items[i];
|
|
1789
|
-
var path_items_item = path_items + '[' + i + ']';
|
|
1790
|
-
if (typeof obj_items_item !== 'object') {
|
|
1791
|
-
return new TypeError('Expected "object" but received "' + typeof obj_items_item + '" (at "' + path_items_item + '")');
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
})();
|
|
1795
|
-
return v_error === undefined ? null : v_error;
|
|
1796
|
-
}
|
|
1797
|
-
var RepresentationType = 'ProviderOutputCollectionRepresentation';
|
|
1798
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1799
|
-
var input_items = input.items;
|
|
1800
|
-
var input_items_id = path.fullPath + '__items';
|
|
1801
|
-
for (var i = 0; i < input_items.length; i++) {
|
|
1802
|
-
var input_items_item = input_items[i];
|
|
1803
|
-
var input_items_item_id = input_items_id + '__' + i;
|
|
1804
|
-
input_items[i] = ingest$1(input_items_item, {
|
|
1805
|
-
fullPath: input_items_item_id,
|
|
1806
|
-
propertyName: i,
|
|
1807
|
-
parent: {
|
|
1808
|
-
data: input,
|
|
1809
|
-
key: path.fullPath,
|
|
1810
|
-
existing: existing,
|
|
1811
|
-
},
|
|
1812
|
-
ttl: path.ttl
|
|
1813
|
-
}, luvio, store);
|
|
1814
|
-
}
|
|
1815
|
-
return input;
|
|
1816
|
-
}
|
|
1817
|
-
var select$1 = function ProviderOutputCollectionRepresentationSelect() {
|
|
1818
|
-
return {
|
|
1819
|
-
kind: 'Fragment',
|
|
1820
|
-
version: VERSION,
|
|
1821
|
-
private: [],
|
|
1822
|
-
selections: [
|
|
1823
|
-
{
|
|
1824
|
-
name: 'count',
|
|
1825
|
-
kind: 'Scalar'
|
|
1826
|
-
},
|
|
1827
|
-
{
|
|
1828
|
-
name: 'items',
|
|
1829
|
-
kind: 'Link',
|
|
1830
|
-
plural: true,
|
|
1831
|
-
fragment: select$2()
|
|
1832
|
-
}
|
|
1833
|
-
]
|
|
1834
|
-
};
|
|
1835
|
-
};
|
|
1836
|
-
function equals(existing, incoming) {
|
|
1837
|
-
var existing_count = existing.count;
|
|
1838
|
-
var incoming_count = incoming.count;
|
|
1839
|
-
if (!(existing_count === incoming_count)) {
|
|
1840
|
-
return false;
|
|
1841
|
-
}
|
|
1842
|
-
var existing_items = existing.items;
|
|
1843
|
-
var incoming_items = incoming.items;
|
|
1844
|
-
var equals_items_items = equalsArray(existing_items, incoming_items, function (existing_items_item, incoming_items_item) {
|
|
1845
|
-
if (!(existing_items_item.__ref === incoming_items_item.__ref)) {
|
|
1846
|
-
return false;
|
|
1847
|
-
}
|
|
1848
|
-
});
|
|
1849
|
-
if (equals_items_items === false) {
|
|
1850
|
-
return false;
|
|
1851
|
-
}
|
|
1852
|
-
return true;
|
|
1853
|
-
}
|
|
1854
|
-
var ingest = function ProviderOutputCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1855
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1856
|
-
var validateError = validate(input);
|
|
1857
|
-
if (validateError !== null) {
|
|
1858
|
-
throw validateError;
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
var key = path.fullPath;
|
|
1862
|
-
var existingRecord = store.readEntry(key);
|
|
1863
|
-
var ttlToUse = TTL;
|
|
1864
|
-
var incomingRecord = normalize(input, store.readEntry(key), {
|
|
1865
|
-
fullPath: key,
|
|
1866
|
-
parent: path.parent,
|
|
1867
|
-
propertyName: path.propertyName,
|
|
1868
|
-
ttl: ttlToUse
|
|
1869
|
-
}, luvio, store);
|
|
1870
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1871
|
-
luvio.storePublish(key, incomingRecord);
|
|
1872
|
-
}
|
|
1873
|
-
{
|
|
1874
|
-
var storeMetadataParams = {
|
|
1875
|
-
ttl: ttlToUse,
|
|
1876
|
-
namespace: "extensions",
|
|
1877
|
-
version: VERSION,
|
|
1878
|
-
representationName: RepresentationType,
|
|
1879
|
-
};
|
|
1880
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1881
|
-
}
|
|
1882
|
-
return createLink(key);
|
|
1883
|
-
};
|
|
1884
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1885
|
-
var rootKeySet = new engine.StoreKeyMap();
|
|
1886
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1887
|
-
var rootKey = fullPathFactory();
|
|
1888
|
-
rootKeySet.set(rootKey, {
|
|
1889
|
-
namespace: keyPrefix,
|
|
1890
|
-
representationName: RepresentationType,
|
|
1891
|
-
mergeable: false
|
|
1892
|
-
});
|
|
1893
|
-
var input_items_length = input.items.length;
|
|
1894
|
-
for (var i = 0; i < input_items_length; i++) {
|
|
1895
|
-
rootKeySet.merge(getTypeCacheKeys$1(luvio, input.items[i]));
|
|
1896
|
-
}
|
|
1897
|
-
return rootKeySet;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
function select(luvio, params) {
|
|
1901
|
-
return select$1();
|
|
1902
|
-
}
|
|
1903
|
-
function keyBuilder$1(luvio, params) {
|
|
1904
|
-
return keyPrefix + '::ProviderOutputCollectionRepresentation:(' + 'effectiveMappingsWebstoreId:' + params.queryParams.effectiveMappingsWebstoreId + ',' + 'epn:' + params.queryParams.epn + ')';
|
|
1905
|
-
}
|
|
1906
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1907
|
-
return getTypeCacheKeys(luvio, response, function () { return keyBuilder$1(luvio, resourceParams); });
|
|
1908
|
-
}
|
|
1909
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1910
|
-
var body = response.body;
|
|
1911
|
-
var key = keyBuilder$1(luvio, resourceParams);
|
|
1912
|
-
luvio.storeIngest(key, ingest, body);
|
|
1913
|
-
var snapshot = luvio.storeLookup({
|
|
1914
|
-
recordId: key,
|
|
1915
|
-
node: select(),
|
|
1916
|
-
variables: {},
|
|
1917
|
-
}, snapshotRefresh);
|
|
1918
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1919
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1920
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
return snapshot;
|
|
1924
|
-
}
|
|
1925
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1926
|
-
var key = keyBuilder$1(luvio, params);
|
|
1927
|
-
var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1928
|
-
var storeMetadataParams = {
|
|
1929
|
-
ttl: TTL,
|
|
1930
|
-
namespace: keyPrefix,
|
|
1931
|
-
version: VERSION,
|
|
1932
|
-
representationName: RepresentationType
|
|
1933
|
-
};
|
|
1934
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1935
|
-
return errorSnapshot;
|
|
1936
|
-
}
|
|
1937
|
-
function createResourceRequest(config) {
|
|
1938
|
-
var headers = {};
|
|
1939
|
-
return {
|
|
1940
|
-
baseUri: '/services/data/v58.0',
|
|
1941
|
-
basePath: '/commerce/extension/providers',
|
|
1942
|
-
method: 'get',
|
|
1943
|
-
body: null,
|
|
1944
|
-
urlParams: {},
|
|
1945
|
-
queryParams: config.queryParams,
|
|
1946
|
-
headers: headers,
|
|
1947
|
-
priority: 'normal',
|
|
1948
|
-
};
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
var getProviders_ConfigPropertyNames = {
|
|
1952
|
-
displayName: 'getProviders',
|
|
1953
|
-
parameters: {
|
|
1954
|
-
required: [],
|
|
1955
|
-
optional: ['effectiveMappingsWebstoreId', 'epn']
|
|
1956
|
-
}
|
|
1957
|
-
};
|
|
1958
|
-
function createResourceParams(config) {
|
|
1959
|
-
var resourceParams = {
|
|
1960
|
-
queryParams: {
|
|
1961
|
-
effectiveMappingsWebstoreId: config.effectiveMappingsWebstoreId, epn: config.epn
|
|
1962
|
-
}
|
|
1963
|
-
};
|
|
1964
|
-
return resourceParams;
|
|
1965
|
-
}
|
|
1966
|
-
function keyBuilder(luvio, config) {
|
|
1967
|
-
var resourceParams = createResourceParams(config);
|
|
1968
|
-
return keyBuilder$1(luvio, resourceParams);
|
|
1969
|
-
}
|
|
1970
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1971
|
-
var config = {};
|
|
1972
|
-
var untrustedConfig_effectiveMappingsWebstoreId = untrustedConfig.effectiveMappingsWebstoreId;
|
|
1973
|
-
if (typeof untrustedConfig_effectiveMappingsWebstoreId === 'string') {
|
|
1974
|
-
config.effectiveMappingsWebstoreId = untrustedConfig_effectiveMappingsWebstoreId;
|
|
1975
|
-
}
|
|
1976
|
-
var untrustedConfig_epn = untrustedConfig.epn;
|
|
1977
|
-
if (typeof untrustedConfig_epn === 'string') {
|
|
1978
|
-
config.epn = untrustedConfig_epn;
|
|
1979
|
-
}
|
|
1980
|
-
return config;
|
|
1981
|
-
}
|
|
1982
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1983
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1984
|
-
return null;
|
|
1985
|
-
}
|
|
1986
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1987
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1988
|
-
}
|
|
1989
|
-
var config = typeCheckConfig(untrustedConfig);
|
|
1990
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1991
|
-
return null;
|
|
1992
|
-
}
|
|
1993
|
-
return config;
|
|
1994
|
-
}
|
|
1995
|
-
function adapterFragment(luvio, config) {
|
|
1996
|
-
createResourceParams(config);
|
|
1997
|
-
return select();
|
|
1998
|
-
}
|
|
1999
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2000
|
-
var snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
2001
|
-
config: config,
|
|
2002
|
-
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
2003
|
-
});
|
|
2004
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
2005
|
-
}
|
|
2006
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2007
|
-
var snapshot = ingestError(luvio, resourceParams, response, {
|
|
2008
|
-
config: config,
|
|
2009
|
-
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
2010
|
-
});
|
|
2011
|
-
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
2012
|
-
}
|
|
2013
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
2014
|
-
var resourceParams = createResourceParams(config);
|
|
2015
|
-
var request = createResourceRequest(resourceParams);
|
|
2016
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
2017
|
-
.then(function (response) {
|
|
2018
|
-
return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
|
|
2019
|
-
}, function (response) {
|
|
2020
|
-
return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
|
|
2021
|
-
});
|
|
2022
|
-
}
|
|
2023
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2024
|
-
var luvio = context.luvio, config = context.config;
|
|
2025
|
-
var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
|
|
2026
|
-
var dispatchOptions = {
|
|
2027
|
-
resourceRequestContext: {
|
|
2028
|
-
requestCorrelator: requestCorrelator,
|
|
2029
|
-
luvioRequestMethod: undefined,
|
|
2030
|
-
},
|
|
2031
|
-
eventObservers: eventObservers
|
|
2032
|
-
};
|
|
2033
|
-
if (networkPriority !== 'normal') {
|
|
2034
|
-
dispatchOptions.overrides = {
|
|
2035
|
-
priority: networkPriority
|
|
2036
|
-
};
|
|
2037
|
-
}
|
|
2038
|
-
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
2039
|
-
}
|
|
2040
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2041
|
-
var luvio = context.luvio, config = context.config;
|
|
2042
|
-
var selector = {
|
|
2043
|
-
recordId: keyBuilder(luvio, config),
|
|
2044
|
-
node: adapterFragment(luvio, config),
|
|
2045
|
-
variables: {},
|
|
2046
|
-
};
|
|
2047
|
-
var cacheSnapshot = storeLookup(selector, {
|
|
2048
|
-
config: config,
|
|
2049
|
-
resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
|
|
2050
|
-
});
|
|
2051
|
-
return cacheSnapshot;
|
|
2052
|
-
}
|
|
2053
|
-
var getProvidersAdapterFactory = function (luvio) { return function extensions__getProviders(untrustedConfig, requestContext) {
|
|
2054
|
-
var config = validateAdapterConfig(untrustedConfig, getProviders_ConfigPropertyNames);
|
|
2055
|
-
// Invalid or incomplete config
|
|
2056
|
-
if (config === null) {
|
|
2057
|
-
return null;
|
|
2058
|
-
}
|
|
2059
|
-
return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
|
|
2060
|
-
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2061
|
-
}; };
|
|
2062
|
-
|
|
2063
|
-
exports.createMappingAdapterFactory = createMappingAdapterFactory;
|
|
2064
|
-
exports.deleteMappingAdapterFactory = deleteMappingAdapterFactory;
|
|
2065
|
-
exports.getExtensionsAdapterFactory = getExtensionsAdapterFactory;
|
|
2066
|
-
exports.getMappingAdapterFactory = getMappingAdapterFactory;
|
|
2067
|
-
exports.getMappingsAdapterFactory = getMappingsAdapterFactory;
|
|
2068
|
-
exports.getProvidersAdapterFactory = getProvidersAdapterFactory;
|
|
2069
|
-
exports.notifyMappingUpdateAvailableFactory = notifyUpdateAvailableFactory;
|
|
2070
|
-
exports.updateMappingAdapterFactory = updateMappingAdapterFactory;
|
|
2071
|
-
|
|
2072
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2073
|
-
|
|
2074
|
-
}));
|