@salesforce/lds-adapters-industries-contextrules 1.293.0 → 1.295.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/industries-contextrules.js +452 -195
- package/dist/es/es2018/types/src/generated/adapters/getUsageTypeDetail.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectContextRulesUsageTypesByUsageType.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/UsageSubtypeOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/UsageTypeOutputRepresentation.d.ts +45 -0
- package/package.json +3 -3
- package/sfdc/index.js +492 -179
- package/src/raml/api.raml +43 -0
- package/src/raml/luvio.raml +11 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$6, StoreKeyMap, createResourceParams as createResourceParams$6 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -79,9 +79,9 @@ function createLink(ref) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const TTL$
|
|
83
|
-
const VERSION$
|
|
84
|
-
function validate$
|
|
82
|
+
const TTL$3 = 1000;
|
|
83
|
+
const VERSION$3 = "4b7bef672f4996c31c5a042959681437";
|
|
84
|
+
function validate$5(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentation') {
|
|
85
85
|
const v_error = (() => {
|
|
86
86
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
87
87
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -128,58 +128,58 @@ function validate$3(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentation'
|
|
|
128
128
|
})();
|
|
129
129
|
return v_error === undefined ? null : v_error;
|
|
130
130
|
}
|
|
131
|
-
const RepresentationType$
|
|
132
|
-
function keyBuilder$
|
|
133
|
-
return keyPrefix + '::' + RepresentationType$
|
|
131
|
+
const RepresentationType$3 = 'RuleLibraryTagMappingsReadOutputRepresentation';
|
|
132
|
+
function keyBuilder$9(luvio, config) {
|
|
133
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
134
134
|
}
|
|
135
|
-
function keyBuilderFromType$
|
|
135
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
136
136
|
const keyParams = {
|
|
137
137
|
id: object.mappingName
|
|
138
138
|
};
|
|
139
|
-
return keyBuilder$
|
|
139
|
+
return keyBuilder$9(luvio, keyParams);
|
|
140
140
|
}
|
|
141
|
-
function normalize$
|
|
141
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
142
142
|
return input;
|
|
143
143
|
}
|
|
144
|
-
const select$
|
|
144
|
+
const select$8 = function RuleLibraryTagMappingsReadOutputRepresentationSelect() {
|
|
145
145
|
return {
|
|
146
146
|
kind: 'Fragment',
|
|
147
|
-
version: VERSION$
|
|
147
|
+
version: VERSION$3,
|
|
148
148
|
private: [],
|
|
149
149
|
opaque: true
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
|
-
function equals$
|
|
152
|
+
function equals$3(existing, incoming) {
|
|
153
153
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
return true;
|
|
157
157
|
}
|
|
158
|
-
const ingest$
|
|
158
|
+
const ingest$3 = function RuleLibraryTagMappingsReadOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
159
159
|
if (process.env.NODE_ENV !== 'production') {
|
|
160
|
-
const validateError = validate$
|
|
160
|
+
const validateError = validate$5(input);
|
|
161
161
|
if (validateError !== null) {
|
|
162
162
|
throw validateError;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
const key = keyBuilderFromType$
|
|
166
|
-
const ttlToUse = TTL$
|
|
167
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
165
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
166
|
+
const ttlToUse = TTL$3;
|
|
167
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "contextrules", VERSION$3, RepresentationType$3, equals$3);
|
|
168
168
|
return createLink(key);
|
|
169
169
|
};
|
|
170
|
-
function getTypeCacheKeys$
|
|
170
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
171
171
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
172
|
-
const rootKey = keyBuilderFromType$
|
|
172
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
173
173
|
rootKeySet.set(rootKey, {
|
|
174
174
|
namespace: keyPrefix,
|
|
175
|
-
representationName: RepresentationType$
|
|
175
|
+
representationName: RepresentationType$3,
|
|
176
176
|
mergeable: false
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
const TTL$
|
|
181
|
-
const VERSION$
|
|
182
|
-
function validate$
|
|
180
|
+
const TTL$2 = 1000;
|
|
181
|
+
const VERSION$2 = "3839d94c828e170861b071d1d1fe5292";
|
|
182
|
+
function validate$4(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationList') {
|
|
183
183
|
const v_error = (() => {
|
|
184
184
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
185
185
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -192,7 +192,7 @@ function validate$2(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationL
|
|
|
192
192
|
for (let i = 0; i < obj_ruleLibraryTagMappings.length; i++) {
|
|
193
193
|
const obj_ruleLibraryTagMappings_item = obj_ruleLibraryTagMappings[i];
|
|
194
194
|
const path_ruleLibraryTagMappings_item = path_ruleLibraryTagMappings + '[' + i + ']';
|
|
195
|
-
const referencepath_ruleLibraryTagMappings_itemValidationError = validate$
|
|
195
|
+
const referencepath_ruleLibraryTagMappings_itemValidationError = validate$5(obj_ruleLibraryTagMappings_item, path_ruleLibraryTagMappings_item);
|
|
196
196
|
if (referencepath_ruleLibraryTagMappings_itemValidationError !== null) {
|
|
197
197
|
let message = 'Object doesn\'t match RuleLibraryTagMappingsReadOutputRepresentation (at "' + path_ruleLibraryTagMappings_item + '")\n';
|
|
198
198
|
message += referencepath_ruleLibraryTagMappings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -202,62 +202,62 @@ function validate$2(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationL
|
|
|
202
202
|
})();
|
|
203
203
|
return v_error === undefined ? null : v_error;
|
|
204
204
|
}
|
|
205
|
-
const RepresentationType$
|
|
206
|
-
function normalize$
|
|
205
|
+
const RepresentationType$2 = 'RuleLibraryTagMappingsReadOutputRepresentationList';
|
|
206
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
207
207
|
return input;
|
|
208
208
|
}
|
|
209
|
-
const select$
|
|
209
|
+
const select$7 = function RuleLibraryTagMappingsReadOutputRepresentationListSelect() {
|
|
210
210
|
return {
|
|
211
211
|
kind: 'Fragment',
|
|
212
|
-
version: VERSION$
|
|
212
|
+
version: VERSION$2,
|
|
213
213
|
private: [],
|
|
214
214
|
opaque: true
|
|
215
215
|
};
|
|
216
216
|
};
|
|
217
|
-
function equals$
|
|
217
|
+
function equals$2(existing, incoming) {
|
|
218
218
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
219
219
|
return false;
|
|
220
220
|
}
|
|
221
221
|
return true;
|
|
222
222
|
}
|
|
223
|
-
const ingest$
|
|
223
|
+
const ingest$2 = function RuleLibraryTagMappingsReadOutputRepresentationListIngest(input, path, luvio, store, timestamp) {
|
|
224
224
|
if (process.env.NODE_ENV !== 'production') {
|
|
225
|
-
const validateError = validate$
|
|
225
|
+
const validateError = validate$4(input);
|
|
226
226
|
if (validateError !== null) {
|
|
227
227
|
throw validateError;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
const key = path.fullPath;
|
|
231
|
-
const ttlToUse = TTL$
|
|
232
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
231
|
+
const ttlToUse = TTL$2;
|
|
232
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "contextrules", VERSION$2, RepresentationType$2, equals$2);
|
|
233
233
|
return createLink(key);
|
|
234
234
|
};
|
|
235
|
-
function getTypeCacheKeys$
|
|
235
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
236
236
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
237
237
|
const rootKey = fullPathFactory();
|
|
238
238
|
rootKeySet.set(rootKey, {
|
|
239
239
|
namespace: keyPrefix,
|
|
240
|
-
representationName: RepresentationType$
|
|
240
|
+
representationName: RepresentationType$2,
|
|
241
241
|
mergeable: false
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
function select$
|
|
246
|
-
return select$
|
|
245
|
+
function select$6(luvio, params) {
|
|
246
|
+
return select$7();
|
|
247
247
|
}
|
|
248
|
-
function keyBuilder$
|
|
248
|
+
function keyBuilder$8(luvio, params) {
|
|
249
249
|
return keyPrefix + '::RuleLibraryTagMappingsReadOutputRepresentationList:(' + 'ruleLibraryApiName:' + params.urlParams.ruleLibraryApiName + ',' + 'versionNumber:' + params.urlParams.versionNumber + ')';
|
|
250
250
|
}
|
|
251
|
-
function getResponseCacheKeys$
|
|
252
|
-
getTypeCacheKeys$
|
|
251
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
252
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
253
253
|
}
|
|
254
|
-
function ingestSuccess$
|
|
254
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
255
255
|
const { body } = response;
|
|
256
|
-
const key = keyBuilder$
|
|
257
|
-
luvio.storeIngest(key, ingest$
|
|
256
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
257
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
258
258
|
const snapshot = luvio.storeLookup({
|
|
259
259
|
recordId: key,
|
|
260
|
-
node: select$
|
|
260
|
+
node: select$6(),
|
|
261
261
|
variables: {},
|
|
262
262
|
}, snapshotRefresh);
|
|
263
263
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -268,19 +268,19 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
268
268
|
deepFreeze(snapshot.data);
|
|
269
269
|
return snapshot;
|
|
270
270
|
}
|
|
271
|
-
function ingestError$
|
|
272
|
-
const key = keyBuilder$
|
|
271
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
272
|
+
const key = keyBuilder$8(luvio, params);
|
|
273
273
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
274
274
|
const storeMetadataParams = {
|
|
275
|
-
ttl: TTL$
|
|
275
|
+
ttl: TTL$2,
|
|
276
276
|
namespace: keyPrefix,
|
|
277
|
-
version: VERSION$
|
|
278
|
-
representationName: RepresentationType$
|
|
277
|
+
version: VERSION$2,
|
|
278
|
+
representationName: RepresentationType$2
|
|
279
279
|
};
|
|
280
280
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
281
281
|
return errorSnapshot;
|
|
282
282
|
}
|
|
283
|
-
function createResourceRequest$
|
|
283
|
+
function createResourceRequest$5(config) {
|
|
284
284
|
const headers = {};
|
|
285
285
|
return {
|
|
286
286
|
baseUri: '/services/data/v62.0',
|
|
@@ -294,94 +294,94 @@ function createResourceRequest$4(config) {
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
const adapterName$
|
|
297
|
+
const adapterName$5 = 'getContextTagMappings';
|
|
298
298
|
const getContextTagMappings_ConfigPropertyMetadata = [
|
|
299
299
|
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
300
300
|
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
301
301
|
];
|
|
302
|
-
const getContextTagMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
303
|
-
const createResourceParams$
|
|
304
|
-
function keyBuilder$
|
|
305
|
-
const resourceParams = createResourceParams$
|
|
306
|
-
return keyBuilder$
|
|
302
|
+
const getContextTagMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getContextTagMappings_ConfigPropertyMetadata);
|
|
303
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$6(getContextTagMappings_ConfigPropertyMetadata);
|
|
304
|
+
function keyBuilder$7(luvio, config) {
|
|
305
|
+
const resourceParams = createResourceParams$5(config);
|
|
306
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
307
307
|
}
|
|
308
|
-
function typeCheckConfig$
|
|
308
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
309
309
|
const config = {};
|
|
310
|
-
typeCheckConfig$
|
|
310
|
+
typeCheckConfig$6(untrustedConfig, config, getContextTagMappings_ConfigPropertyMetadata);
|
|
311
311
|
return config;
|
|
312
312
|
}
|
|
313
|
-
function validateAdapterConfig$
|
|
313
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
314
314
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
315
315
|
return null;
|
|
316
316
|
}
|
|
317
317
|
if (process.env.NODE_ENV !== 'production') {
|
|
318
318
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
319
319
|
}
|
|
320
|
-
const config = typeCheckConfig$
|
|
320
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
321
321
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
322
322
|
return null;
|
|
323
323
|
}
|
|
324
324
|
return config;
|
|
325
325
|
}
|
|
326
|
-
function adapterFragment$
|
|
327
|
-
createResourceParams$
|
|
328
|
-
return select$
|
|
326
|
+
function adapterFragment$2(luvio, config) {
|
|
327
|
+
createResourceParams$5(config);
|
|
328
|
+
return select$6();
|
|
329
329
|
}
|
|
330
|
-
function onFetchResponseSuccess$
|
|
331
|
-
const snapshot = ingestSuccess$
|
|
330
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
331
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
332
332
|
config,
|
|
333
|
-
resolve: () => buildNetworkSnapshot$
|
|
333
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
334
334
|
});
|
|
335
335
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
336
336
|
}
|
|
337
|
-
function onFetchResponseError$
|
|
338
|
-
const snapshot = ingestError$
|
|
337
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
338
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
339
339
|
config,
|
|
340
|
-
resolve: () => buildNetworkSnapshot$
|
|
340
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
341
341
|
});
|
|
342
342
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
343
343
|
}
|
|
344
|
-
function buildNetworkSnapshot$
|
|
345
|
-
const resourceParams = createResourceParams$
|
|
346
|
-
const request = createResourceRequest$
|
|
344
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
345
|
+
const resourceParams = createResourceParams$5(config);
|
|
346
|
+
const request = createResourceRequest$5(resourceParams);
|
|
347
347
|
return luvio.dispatchResourceRequest(request, options)
|
|
348
348
|
.then((response) => {
|
|
349
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
349
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
350
350
|
const cache = new StoreKeyMap();
|
|
351
|
-
getResponseCacheKeys$
|
|
351
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
352
352
|
return cache;
|
|
353
353
|
});
|
|
354
354
|
}, (response) => {
|
|
355
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
355
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
function buildNetworkSnapshotCachePolicy$
|
|
359
|
-
return buildNetworkSnapshotCachePolicy$
|
|
358
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
359
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
360
360
|
}
|
|
361
|
-
function buildCachedSnapshotCachePolicy$
|
|
361
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
362
362
|
const { luvio, config } = context;
|
|
363
363
|
const selector = {
|
|
364
|
-
recordId: keyBuilder$
|
|
365
|
-
node: adapterFragment$
|
|
364
|
+
recordId: keyBuilder$7(luvio, config),
|
|
365
|
+
node: adapterFragment$2(luvio, config),
|
|
366
366
|
variables: {},
|
|
367
367
|
};
|
|
368
368
|
const cacheSnapshot = storeLookup(selector, {
|
|
369
369
|
config,
|
|
370
|
-
resolve: () => buildNetworkSnapshot$
|
|
370
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
371
371
|
});
|
|
372
372
|
return cacheSnapshot;
|
|
373
373
|
}
|
|
374
374
|
const getContextTagMappingsAdapterFactory = (luvio) => function contextrules__getContextTagMappings(untrustedConfig, requestContext) {
|
|
375
|
-
const config = validateAdapterConfig$
|
|
375
|
+
const config = validateAdapterConfig$5(untrustedConfig, getContextTagMappings_ConfigPropertyNames);
|
|
376
376
|
// Invalid or incomplete config
|
|
377
377
|
if (config === null) {
|
|
378
378
|
return null;
|
|
379
379
|
}
|
|
380
380
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
381
|
-
buildCachedSnapshotCachePolicy$
|
|
381
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
382
382
|
};
|
|
383
383
|
|
|
384
|
-
function validate$
|
|
384
|
+
function validate$3(obj, path = 'RuleLibraryTagMappingsListWrapperRepresentation') {
|
|
385
385
|
const v_error = (() => {
|
|
386
386
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
387
387
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -402,9 +402,9 @@ function validate$1(obj, path = 'RuleLibraryTagMappingsListWrapperRepresentation
|
|
|
402
402
|
return v_error === undefined ? null : v_error;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
const TTL = 1000;
|
|
406
|
-
const VERSION = "7dab3fcadff55a173b214b22d1670519";
|
|
407
|
-
function validate(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation') {
|
|
405
|
+
const TTL$1 = 1000;
|
|
406
|
+
const VERSION$1 = "7dab3fcadff55a173b214b22d1670519";
|
|
407
|
+
function validate$2(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation') {
|
|
408
408
|
const v_error = (() => {
|
|
409
409
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
410
410
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -424,68 +424,68 @@ function validate(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputRepresent
|
|
|
424
424
|
})();
|
|
425
425
|
return v_error === undefined ? null : v_error;
|
|
426
426
|
}
|
|
427
|
-
const RepresentationType = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation';
|
|
428
|
-
function keyBuilder$
|
|
429
|
-
return keyPrefix + '::' + RepresentationType + ':' + '[' + config.id.join(',') + ']';
|
|
427
|
+
const RepresentationType$1 = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation';
|
|
428
|
+
function keyBuilder$6(luvio, config) {
|
|
429
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + '[' + config.id.join(',') + ']';
|
|
430
430
|
}
|
|
431
|
-
function keyBuilderFromType(luvio, object) {
|
|
431
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
432
432
|
const keyParams = {
|
|
433
433
|
id: object.ids
|
|
434
434
|
};
|
|
435
|
-
return keyBuilder$
|
|
435
|
+
return keyBuilder$6(luvio, keyParams);
|
|
436
436
|
}
|
|
437
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
437
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
438
438
|
return input;
|
|
439
439
|
}
|
|
440
|
-
const select$
|
|
440
|
+
const select$5 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationSelect() {
|
|
441
441
|
return {
|
|
442
442
|
kind: 'Fragment',
|
|
443
|
-
version: VERSION,
|
|
443
|
+
version: VERSION$1,
|
|
444
444
|
private: [],
|
|
445
445
|
opaque: true
|
|
446
446
|
};
|
|
447
447
|
};
|
|
448
|
-
function equals(existing, incoming) {
|
|
448
|
+
function equals$1(existing, incoming) {
|
|
449
449
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
450
450
|
return false;
|
|
451
451
|
}
|
|
452
452
|
return true;
|
|
453
453
|
}
|
|
454
|
-
const ingest = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
454
|
+
const ingest$1 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
455
455
|
if (process.env.NODE_ENV !== 'production') {
|
|
456
|
-
const validateError = validate(input);
|
|
456
|
+
const validateError = validate$2(input);
|
|
457
457
|
if (validateError !== null) {
|
|
458
458
|
throw validateError;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
const key = keyBuilderFromType(luvio, input);
|
|
462
|
-
const ttlToUse = TTL;
|
|
463
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "contextrules", VERSION, RepresentationType, equals);
|
|
461
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
462
|
+
const ttlToUse = TTL$1;
|
|
463
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "contextrules", VERSION$1, RepresentationType$1, equals$1);
|
|
464
464
|
return createLink(key);
|
|
465
465
|
};
|
|
466
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
466
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
467
467
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
468
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
468
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
469
469
|
rootKeySet.set(rootKey, {
|
|
470
470
|
namespace: keyPrefix,
|
|
471
|
-
representationName: RepresentationType,
|
|
471
|
+
representationName: RepresentationType$1,
|
|
472
472
|
mergeable: false
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
function select$
|
|
477
|
-
return select$
|
|
476
|
+
function select$4(luvio, params) {
|
|
477
|
+
return select$5();
|
|
478
478
|
}
|
|
479
|
-
function getResponseCacheKeys$
|
|
480
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
479
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
480
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
481
481
|
}
|
|
482
|
-
function ingestSuccess$
|
|
482
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
483
483
|
const { body } = response;
|
|
484
|
-
const key = keyBuilderFromType(luvio, body);
|
|
485
|
-
luvio.storeIngest(key, ingest, body);
|
|
484
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
485
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
486
486
|
const snapshot = luvio.storeLookup({
|
|
487
487
|
recordId: key,
|
|
488
|
-
node: select$
|
|
488
|
+
node: select$4(),
|
|
489
489
|
variables: {},
|
|
490
490
|
});
|
|
491
491
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -496,7 +496,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
496
496
|
deepFreeze(snapshot.data);
|
|
497
497
|
return snapshot;
|
|
498
498
|
}
|
|
499
|
-
function createResourceRequest$
|
|
499
|
+
function createResourceRequest$4(config) {
|
|
500
500
|
const headers = {};
|
|
501
501
|
return {
|
|
502
502
|
baseUri: '/services/data/v62.0',
|
|
@@ -510,48 +510,48 @@ function createResourceRequest$3(config) {
|
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
const adapterName$
|
|
513
|
+
const adapterName$4 = 'updateContextTagMapping';
|
|
514
514
|
const updateContextTagMapping_ConfigPropertyMetadata = [
|
|
515
515
|
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
516
516
|
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
517
517
|
generateParamConfigMetadata('contextTagMappings', true, 2 /* Body */, 4 /* Unsupported */),
|
|
518
518
|
];
|
|
519
|
-
const updateContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
520
|
-
const createResourceParams$
|
|
521
|
-
function typeCheckConfig$
|
|
519
|
+
const updateContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, updateContextTagMapping_ConfigPropertyMetadata);
|
|
520
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$6(updateContextTagMapping_ConfigPropertyMetadata);
|
|
521
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
522
522
|
const config = {};
|
|
523
|
-
typeCheckConfig$
|
|
523
|
+
typeCheckConfig$6(untrustedConfig, config, updateContextTagMapping_ConfigPropertyMetadata);
|
|
524
524
|
const untrustedConfig_contextTagMappings = untrustedConfig.contextTagMappings;
|
|
525
|
-
const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$
|
|
525
|
+
const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$3(untrustedConfig_contextTagMappings);
|
|
526
526
|
if (referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError === null) {
|
|
527
527
|
config.contextTagMappings = untrustedConfig_contextTagMappings;
|
|
528
528
|
}
|
|
529
529
|
return config;
|
|
530
530
|
}
|
|
531
|
-
function validateAdapterConfig$
|
|
531
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
532
532
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
533
533
|
return null;
|
|
534
534
|
}
|
|
535
535
|
if (process.env.NODE_ENV !== 'production') {
|
|
536
536
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
537
537
|
}
|
|
538
|
-
const config = typeCheckConfig$
|
|
538
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
539
539
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
540
540
|
return null;
|
|
541
541
|
}
|
|
542
542
|
return config;
|
|
543
543
|
}
|
|
544
|
-
function buildNetworkSnapshot$
|
|
545
|
-
const resourceParams = createResourceParams$
|
|
546
|
-
const request = createResourceRequest$
|
|
544
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
545
|
+
const resourceParams = createResourceParams$4(config);
|
|
546
|
+
const request = createResourceRequest$4(resourceParams);
|
|
547
547
|
return luvio.dispatchResourceRequest(request, options)
|
|
548
548
|
.then((response) => {
|
|
549
549
|
return luvio.handleSuccessResponse(() => {
|
|
550
|
-
const snapshot = ingestSuccess$
|
|
550
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
551
551
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
552
552
|
}, () => {
|
|
553
553
|
const cache = new StoreKeyMap();
|
|
554
|
-
getResponseCacheKeys$
|
|
554
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
555
555
|
return cache;
|
|
556
556
|
});
|
|
557
557
|
}, (response) => {
|
|
@@ -561,28 +561,28 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
561
561
|
}
|
|
562
562
|
const updateContextTagMappingAdapterFactory = (luvio) => {
|
|
563
563
|
return function updateContextTagMapping(untrustedConfig) {
|
|
564
|
-
const config = validateAdapterConfig$
|
|
564
|
+
const config = validateAdapterConfig$4(untrustedConfig, updateContextTagMapping_ConfigPropertyNames);
|
|
565
565
|
// Invalid or incomplete config
|
|
566
566
|
if (config === null) {
|
|
567
567
|
throw new Error('Invalid config for "updateContextTagMapping"');
|
|
568
568
|
}
|
|
569
|
-
return buildNetworkSnapshot$
|
|
569
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
570
570
|
};
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
-
function select$
|
|
574
|
-
return select$
|
|
573
|
+
function select$3(luvio, params) {
|
|
574
|
+
return select$5();
|
|
575
575
|
}
|
|
576
|
-
function getResponseCacheKeys$
|
|
577
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
576
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
577
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
578
578
|
}
|
|
579
|
-
function ingestSuccess$
|
|
579
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
580
580
|
const { body } = response;
|
|
581
|
-
const key = keyBuilderFromType(luvio, body);
|
|
582
|
-
luvio.storeIngest(key, ingest, body);
|
|
581
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
582
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
583
583
|
const snapshot = luvio.storeLookup({
|
|
584
584
|
recordId: key,
|
|
585
|
-
node: select$
|
|
585
|
+
node: select$3(),
|
|
586
586
|
variables: {},
|
|
587
587
|
});
|
|
588
588
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -593,7 +593,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
593
593
|
deepFreeze(snapshot.data);
|
|
594
594
|
return snapshot;
|
|
595
595
|
}
|
|
596
|
-
function createResourceRequest$
|
|
596
|
+
function createResourceRequest$3(config) {
|
|
597
597
|
const headers = {};
|
|
598
598
|
return {
|
|
599
599
|
baseUri: '/services/data/v62.0',
|
|
@@ -607,48 +607,48 @@ function createResourceRequest$2(config) {
|
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
609
|
|
|
610
|
-
const adapterName$
|
|
610
|
+
const adapterName$3 = 'createContextTagMapping';
|
|
611
611
|
const createContextTagMapping_ConfigPropertyMetadata = [
|
|
612
612
|
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
613
613
|
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
614
614
|
generateParamConfigMetadata('contextTagMappings', true, 2 /* Body */, 4 /* Unsupported */),
|
|
615
615
|
];
|
|
616
|
-
const createContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
617
|
-
const createResourceParams$
|
|
618
|
-
function typeCheckConfig$
|
|
616
|
+
const createContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createContextTagMapping_ConfigPropertyMetadata);
|
|
617
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$6(createContextTagMapping_ConfigPropertyMetadata);
|
|
618
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
619
619
|
const config = {};
|
|
620
|
-
typeCheckConfig$
|
|
620
|
+
typeCheckConfig$6(untrustedConfig, config, createContextTagMapping_ConfigPropertyMetadata);
|
|
621
621
|
const untrustedConfig_contextTagMappings = untrustedConfig.contextTagMappings;
|
|
622
|
-
const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$
|
|
622
|
+
const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$3(untrustedConfig_contextTagMappings);
|
|
623
623
|
if (referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError === null) {
|
|
624
624
|
config.contextTagMappings = untrustedConfig_contextTagMappings;
|
|
625
625
|
}
|
|
626
626
|
return config;
|
|
627
627
|
}
|
|
628
|
-
function validateAdapterConfig$
|
|
628
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
629
629
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
630
630
|
return null;
|
|
631
631
|
}
|
|
632
632
|
if (process.env.NODE_ENV !== 'production') {
|
|
633
633
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
634
634
|
}
|
|
635
|
-
const config = typeCheckConfig$
|
|
635
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
636
636
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
637
637
|
return null;
|
|
638
638
|
}
|
|
639
639
|
return config;
|
|
640
640
|
}
|
|
641
|
-
function buildNetworkSnapshot$
|
|
642
|
-
const resourceParams = createResourceParams$
|
|
643
|
-
const request = createResourceRequest$
|
|
641
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
642
|
+
const resourceParams = createResourceParams$3(config);
|
|
643
|
+
const request = createResourceRequest$3(resourceParams);
|
|
644
644
|
return luvio.dispatchResourceRequest(request, options)
|
|
645
645
|
.then((response) => {
|
|
646
646
|
return luvio.handleSuccessResponse(() => {
|
|
647
|
-
const snapshot = ingestSuccess$
|
|
647
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
648
648
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
649
649
|
}, () => {
|
|
650
650
|
const cache = new StoreKeyMap();
|
|
651
|
-
getResponseCacheKeys$
|
|
651
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
652
652
|
return cache;
|
|
653
653
|
});
|
|
654
654
|
}, (response) => {
|
|
@@ -658,33 +658,33 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
658
658
|
}
|
|
659
659
|
const createContextTagMappingAdapterFactory = (luvio) => {
|
|
660
660
|
return function createContextTagMapping(untrustedConfig) {
|
|
661
|
-
const config = validateAdapterConfig$
|
|
661
|
+
const config = validateAdapterConfig$3(untrustedConfig, createContextTagMapping_ConfigPropertyNames);
|
|
662
662
|
// Invalid or incomplete config
|
|
663
663
|
if (config === null) {
|
|
664
664
|
throw new Error('Invalid config for "createContextTagMapping"');
|
|
665
665
|
}
|
|
666
|
-
return buildNetworkSnapshot$
|
|
666
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
667
667
|
};
|
|
668
668
|
};
|
|
669
669
|
|
|
670
|
-
function keyBuilder$
|
|
671
|
-
return keyBuilder$
|
|
670
|
+
function keyBuilder$5(luvio, params) {
|
|
671
|
+
return keyBuilder$9(luvio, {
|
|
672
672
|
id: params.urlParams.mappingName
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
|
-
function getResponseCacheKeys$
|
|
676
|
-
const key = keyBuilder$
|
|
675
|
+
function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
|
|
676
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
677
677
|
cacheKeyMap.set(key, {
|
|
678
678
|
namespace: keyPrefix,
|
|
679
|
-
representationName: RepresentationType$
|
|
679
|
+
representationName: RepresentationType$3,
|
|
680
680
|
mergeable: false
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
function evictSuccess(luvio, resourceParams) {
|
|
684
|
-
const key = keyBuilder$
|
|
684
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
685
685
|
luvio.storeEvict(key);
|
|
686
686
|
}
|
|
687
|
-
function createResourceRequest$
|
|
687
|
+
function createResourceRequest$2(config) {
|
|
688
688
|
const headers = {};
|
|
689
689
|
return {
|
|
690
690
|
baseUri: '/services/data/v62.0',
|
|
@@ -698,35 +698,35 @@ function createResourceRequest$1(config) {
|
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
-
const adapterName$
|
|
701
|
+
const adapterName$2 = 'deleteContextTagMapping';
|
|
702
702
|
const deleteContextTagMapping_ConfigPropertyMetadata = [
|
|
703
703
|
generateParamConfigMetadata('mappingName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
704
704
|
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
705
705
|
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
706
706
|
];
|
|
707
|
-
const deleteContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
708
|
-
const createResourceParams$
|
|
709
|
-
function typeCheckConfig$
|
|
707
|
+
const deleteContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, deleteContextTagMapping_ConfigPropertyMetadata);
|
|
708
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$6(deleteContextTagMapping_ConfigPropertyMetadata);
|
|
709
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
710
710
|
const config = {};
|
|
711
|
-
typeCheckConfig$
|
|
711
|
+
typeCheckConfig$6(untrustedConfig, config, deleteContextTagMapping_ConfigPropertyMetadata);
|
|
712
712
|
return config;
|
|
713
713
|
}
|
|
714
|
-
function validateAdapterConfig$
|
|
714
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
715
715
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
716
716
|
return null;
|
|
717
717
|
}
|
|
718
718
|
if (process.env.NODE_ENV !== 'production') {
|
|
719
719
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
720
720
|
}
|
|
721
|
-
const config = typeCheckConfig$
|
|
721
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
722
722
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
723
723
|
return null;
|
|
724
724
|
}
|
|
725
725
|
return config;
|
|
726
726
|
}
|
|
727
|
-
function buildNetworkSnapshot$
|
|
728
|
-
const resourceParams = createResourceParams$
|
|
729
|
-
const request = createResourceRequest$
|
|
727
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
728
|
+
const resourceParams = createResourceParams$2(config);
|
|
729
|
+
const request = createResourceRequest$2(resourceParams);
|
|
730
730
|
return luvio.dispatchResourceRequest(request, options)
|
|
731
731
|
.then(() => {
|
|
732
732
|
return luvio.handleSuccessResponse(() => {
|
|
@@ -734,7 +734,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
734
734
|
return luvio.storeBroadcast();
|
|
735
735
|
}, () => {
|
|
736
736
|
const cache = new StoreKeyMap();
|
|
737
|
-
getResponseCacheKeys$
|
|
737
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams);
|
|
738
738
|
return cache;
|
|
739
739
|
});
|
|
740
740
|
}, (response) => {
|
|
@@ -744,30 +744,289 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
744
744
|
}
|
|
745
745
|
const deleteContextTagMappingAdapterFactory = (luvio) => {
|
|
746
746
|
return function contextrulesdeleteContextTagMapping(untrustedConfig) {
|
|
747
|
-
const config = validateAdapterConfig$
|
|
747
|
+
const config = validateAdapterConfig$2(untrustedConfig, deleteContextTagMapping_ConfigPropertyNames);
|
|
748
748
|
// Invalid or incomplete config
|
|
749
749
|
if (config === null) {
|
|
750
|
-
throw new Error(`Invalid config for "${adapterName$
|
|
750
|
+
throw new Error(`Invalid config for "${adapterName$2}"`);
|
|
751
|
+
}
|
|
752
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
function select$2(luvio, params) {
|
|
757
|
+
return select$8();
|
|
758
|
+
}
|
|
759
|
+
function keyBuilder$4(luvio, params) {
|
|
760
|
+
return keyBuilder$9(luvio, {
|
|
761
|
+
id: params.urlParams.mappingName
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
765
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
766
|
+
}
|
|
767
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
768
|
+
const { body } = response;
|
|
769
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
770
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
771
|
+
const snapshot = luvio.storeLookup({
|
|
772
|
+
recordId: key,
|
|
773
|
+
node: select$2(),
|
|
774
|
+
variables: {},
|
|
775
|
+
}, snapshotRefresh);
|
|
776
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
777
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
778
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
751
779
|
}
|
|
752
|
-
|
|
780
|
+
}
|
|
781
|
+
deepFreeze(snapshot.data);
|
|
782
|
+
return snapshot;
|
|
783
|
+
}
|
|
784
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
785
|
+
const key = keyBuilder$4(luvio, params);
|
|
786
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
787
|
+
const storeMetadataParams = {
|
|
788
|
+
ttl: TTL$3,
|
|
789
|
+
namespace: keyPrefix,
|
|
790
|
+
version: VERSION$3,
|
|
791
|
+
representationName: RepresentationType$3
|
|
792
|
+
};
|
|
793
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
794
|
+
return errorSnapshot;
|
|
795
|
+
}
|
|
796
|
+
function createResourceRequest$1(config) {
|
|
797
|
+
const headers = {};
|
|
798
|
+
return {
|
|
799
|
+
baseUri: '/services/data/v62.0',
|
|
800
|
+
basePath: '/connect/context-rules/context-tag-mappings/rule-library-api-name/' + config.urlParams.ruleLibraryApiName + '/version-number/' + config.urlParams.versionNumber + '/mapping-name/' + config.urlParams.mappingName + '',
|
|
801
|
+
method: 'get',
|
|
802
|
+
body: null,
|
|
803
|
+
urlParams: config.urlParams,
|
|
804
|
+
queryParams: {},
|
|
805
|
+
headers,
|
|
806
|
+
priority: 'normal',
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
const adapterName$1 = 'getContextTagMapping';
|
|
811
|
+
const getContextTagMapping_ConfigPropertyMetadata = [
|
|
812
|
+
generateParamConfigMetadata('mappingName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
813
|
+
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
814
|
+
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
815
|
+
];
|
|
816
|
+
const getContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getContextTagMapping_ConfigPropertyMetadata);
|
|
817
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$6(getContextTagMapping_ConfigPropertyMetadata);
|
|
818
|
+
function keyBuilder$3(luvio, config) {
|
|
819
|
+
const resourceParams = createResourceParams$1(config);
|
|
820
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
821
|
+
}
|
|
822
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
823
|
+
const config = {};
|
|
824
|
+
typeCheckConfig$6(untrustedConfig, config, getContextTagMapping_ConfigPropertyMetadata);
|
|
825
|
+
return config;
|
|
826
|
+
}
|
|
827
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
828
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
829
|
+
return null;
|
|
830
|
+
}
|
|
831
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
832
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
833
|
+
}
|
|
834
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
835
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
return config;
|
|
839
|
+
}
|
|
840
|
+
function adapterFragment$1(luvio, config) {
|
|
841
|
+
createResourceParams$1(config);
|
|
842
|
+
return select$2();
|
|
843
|
+
}
|
|
844
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
845
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
846
|
+
config,
|
|
847
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
848
|
+
});
|
|
849
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
850
|
+
}
|
|
851
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
852
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
853
|
+
config,
|
|
854
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
855
|
+
});
|
|
856
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
857
|
+
}
|
|
858
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
859
|
+
const resourceParams = createResourceParams$1(config);
|
|
860
|
+
const request = createResourceRequest$1(resourceParams);
|
|
861
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
862
|
+
.then((response) => {
|
|
863
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
864
|
+
const cache = new StoreKeyMap();
|
|
865
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
866
|
+
return cache;
|
|
867
|
+
});
|
|
868
|
+
}, (response) => {
|
|
869
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
873
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
874
|
+
}
|
|
875
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
876
|
+
const { luvio, config } = context;
|
|
877
|
+
const selector = {
|
|
878
|
+
recordId: keyBuilder$3(luvio, config),
|
|
879
|
+
node: adapterFragment$1(luvio, config),
|
|
880
|
+
variables: {},
|
|
881
|
+
};
|
|
882
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
883
|
+
config,
|
|
884
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
885
|
+
});
|
|
886
|
+
return cacheSnapshot;
|
|
887
|
+
}
|
|
888
|
+
const getContextTagMappingAdapterFactory = (luvio) => function contextrules__getContextTagMapping(untrustedConfig, requestContext) {
|
|
889
|
+
const config = validateAdapterConfig$1(untrustedConfig, getContextTagMapping_ConfigPropertyNames);
|
|
890
|
+
// Invalid or incomplete config
|
|
891
|
+
if (config === null) {
|
|
892
|
+
return null;
|
|
893
|
+
}
|
|
894
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
895
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
function validate$1(obj, path = 'UsageSubtypeOutputRepresentation') {
|
|
899
|
+
const v_error = (() => {
|
|
900
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
901
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
902
|
+
}
|
|
903
|
+
const obj_subtypeMappingNames = obj.subtypeMappingNames;
|
|
904
|
+
const path_subtypeMappingNames = path + '.subtypeMappingNames';
|
|
905
|
+
if (!ArrayIsArray(obj_subtypeMappingNames)) {
|
|
906
|
+
return new TypeError('Expected "array" but received "' + typeof obj_subtypeMappingNames + '" (at "' + path_subtypeMappingNames + '")');
|
|
907
|
+
}
|
|
908
|
+
for (let i = 0; i < obj_subtypeMappingNames.length; i++) {
|
|
909
|
+
const obj_subtypeMappingNames_item = obj_subtypeMappingNames[i];
|
|
910
|
+
const path_subtypeMappingNames_item = path_subtypeMappingNames + '[' + i + ']';
|
|
911
|
+
if (typeof obj_subtypeMappingNames_item !== 'string') {
|
|
912
|
+
return new TypeError('Expected "string" but received "' + typeof obj_subtypeMappingNames_item + '" (at "' + path_subtypeMappingNames_item + '")');
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const obj_usageSubtype = obj.usageSubtype;
|
|
916
|
+
const path_usageSubtype = path + '.usageSubtype';
|
|
917
|
+
if (typeof obj_usageSubtype !== 'string') {
|
|
918
|
+
return new TypeError('Expected "string" but received "' + typeof obj_usageSubtype + '" (at "' + path_usageSubtype + '")');
|
|
919
|
+
}
|
|
920
|
+
})();
|
|
921
|
+
return v_error === undefined ? null : v_error;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
const TTL = 1000;
|
|
925
|
+
const VERSION = "19586883f36a2f3e5aa88a8708d670b4";
|
|
926
|
+
function validate(obj, path = 'UsageTypeOutputRepresentation') {
|
|
927
|
+
const v_error = (() => {
|
|
928
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
929
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
930
|
+
}
|
|
931
|
+
const obj_mappingNames = obj.mappingNames;
|
|
932
|
+
const path_mappingNames = path + '.mappingNames';
|
|
933
|
+
if (!ArrayIsArray(obj_mappingNames)) {
|
|
934
|
+
return new TypeError('Expected "array" but received "' + typeof obj_mappingNames + '" (at "' + path_mappingNames + '")');
|
|
935
|
+
}
|
|
936
|
+
for (let i = 0; i < obj_mappingNames.length; i++) {
|
|
937
|
+
const obj_mappingNames_item = obj_mappingNames[i];
|
|
938
|
+
const path_mappingNames_item = path_mappingNames + '[' + i + ']';
|
|
939
|
+
if (typeof obj_mappingNames_item !== 'string') {
|
|
940
|
+
return new TypeError('Expected "string" but received "' + typeof obj_mappingNames_item + '" (at "' + path_mappingNames_item + '")');
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
const obj_usageSubtypes = obj.usageSubtypes;
|
|
944
|
+
const path_usageSubtypes = path + '.usageSubtypes';
|
|
945
|
+
if (!ArrayIsArray(obj_usageSubtypes)) {
|
|
946
|
+
return new TypeError('Expected "array" but received "' + typeof obj_usageSubtypes + '" (at "' + path_usageSubtypes + '")');
|
|
947
|
+
}
|
|
948
|
+
for (let i = 0; i < obj_usageSubtypes.length; i++) {
|
|
949
|
+
const obj_usageSubtypes_item = obj_usageSubtypes[i];
|
|
950
|
+
const path_usageSubtypes_item = path_usageSubtypes + '[' + i + ']';
|
|
951
|
+
const referencepath_usageSubtypes_itemValidationError = validate$1(obj_usageSubtypes_item, path_usageSubtypes_item);
|
|
952
|
+
if (referencepath_usageSubtypes_itemValidationError !== null) {
|
|
953
|
+
let message = 'Object doesn\'t match UsageSubtypeOutputRepresentation (at "' + path_usageSubtypes_item + '")\n';
|
|
954
|
+
message += referencepath_usageSubtypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
955
|
+
return new TypeError(message);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
const obj_usageType = obj.usageType;
|
|
959
|
+
const path_usageType = path + '.usageType';
|
|
960
|
+
if (typeof obj_usageType !== 'string') {
|
|
961
|
+
return new TypeError('Expected "string" but received "' + typeof obj_usageType + '" (at "' + path_usageType + '")');
|
|
962
|
+
}
|
|
963
|
+
})();
|
|
964
|
+
return v_error === undefined ? null : v_error;
|
|
965
|
+
}
|
|
966
|
+
const RepresentationType = 'UsageTypeOutputRepresentation';
|
|
967
|
+
function keyBuilder$2(luvio, config) {
|
|
968
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
969
|
+
}
|
|
970
|
+
function keyBuilderFromType(luvio, object) {
|
|
971
|
+
const keyParams = {
|
|
972
|
+
id: object.usageType
|
|
973
|
+
};
|
|
974
|
+
return keyBuilder$2(luvio, keyParams);
|
|
975
|
+
}
|
|
976
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
977
|
+
return input;
|
|
978
|
+
}
|
|
979
|
+
const select$1 = function UsageTypeOutputRepresentationSelect() {
|
|
980
|
+
return {
|
|
981
|
+
kind: 'Fragment',
|
|
982
|
+
version: VERSION,
|
|
983
|
+
private: [],
|
|
984
|
+
opaque: true
|
|
753
985
|
};
|
|
754
986
|
};
|
|
987
|
+
function equals(existing, incoming) {
|
|
988
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
return true;
|
|
992
|
+
}
|
|
993
|
+
const ingest = function UsageTypeOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
994
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
995
|
+
const validateError = validate(input);
|
|
996
|
+
if (validateError !== null) {
|
|
997
|
+
throw validateError;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1001
|
+
const ttlToUse = TTL;
|
|
1002
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "contextrules", VERSION, RepresentationType, equals);
|
|
1003
|
+
return createLink(key);
|
|
1004
|
+
};
|
|
1005
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1006
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1007
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1008
|
+
rootKeySet.set(rootKey, {
|
|
1009
|
+
namespace: keyPrefix,
|
|
1010
|
+
representationName: RepresentationType,
|
|
1011
|
+
mergeable: false
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
755
1014
|
|
|
756
1015
|
function select(luvio, params) {
|
|
757
|
-
return select$
|
|
1016
|
+
return select$1();
|
|
758
1017
|
}
|
|
759
1018
|
function keyBuilder$1(luvio, params) {
|
|
760
|
-
return keyBuilder$
|
|
761
|
-
id: params.urlParams.
|
|
1019
|
+
return keyBuilder$2(luvio, {
|
|
1020
|
+
id: params.urlParams.usageType
|
|
762
1021
|
});
|
|
763
1022
|
}
|
|
764
1023
|
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
765
|
-
getTypeCacheKeys
|
|
1024
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
766
1025
|
}
|
|
767
1026
|
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
768
1027
|
const { body } = response;
|
|
769
1028
|
const key = keyBuilder$1(luvio, resourceParams);
|
|
770
|
-
luvio.storeIngest(key, ingest
|
|
1029
|
+
luvio.storeIngest(key, ingest, body);
|
|
771
1030
|
const snapshot = luvio.storeLookup({
|
|
772
1031
|
recordId: key,
|
|
773
1032
|
node: select(),
|
|
@@ -785,10 +1044,10 @@ function ingestError(luvio, params, error, snapshotRefresh) {
|
|
|
785
1044
|
const key = keyBuilder$1(luvio, params);
|
|
786
1045
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
787
1046
|
const storeMetadataParams = {
|
|
788
|
-
ttl: TTL
|
|
1047
|
+
ttl: TTL,
|
|
789
1048
|
namespace: keyPrefix,
|
|
790
|
-
version: VERSION
|
|
791
|
-
representationName: RepresentationType
|
|
1049
|
+
version: VERSION,
|
|
1050
|
+
representationName: RepresentationType
|
|
792
1051
|
};
|
|
793
1052
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
794
1053
|
return errorSnapshot;
|
|
@@ -797,7 +1056,7 @@ function createResourceRequest(config) {
|
|
|
797
1056
|
const headers = {};
|
|
798
1057
|
return {
|
|
799
1058
|
baseUri: '/services/data/v62.0',
|
|
800
|
-
basePath: '/connect/context-rules/
|
|
1059
|
+
basePath: '/connect/context-rules/usage-types/' + config.urlParams.usageType + '',
|
|
801
1060
|
method: 'get',
|
|
802
1061
|
body: null,
|
|
803
1062
|
urlParams: config.urlParams,
|
|
@@ -807,21 +1066,19 @@ function createResourceRequest(config) {
|
|
|
807
1066
|
};
|
|
808
1067
|
}
|
|
809
1068
|
|
|
810
|
-
const adapterName = '
|
|
811
|
-
const
|
|
812
|
-
generateParamConfigMetadata('
|
|
813
|
-
generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
814
|
-
generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1069
|
+
const adapterName = 'getUsageTypeDetail';
|
|
1070
|
+
const getUsageTypeDetail_ConfigPropertyMetadata = [
|
|
1071
|
+
generateParamConfigMetadata('usageType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
815
1072
|
];
|
|
816
|
-
const
|
|
817
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1073
|
+
const getUsageTypeDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getUsageTypeDetail_ConfigPropertyMetadata);
|
|
1074
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$6(getUsageTypeDetail_ConfigPropertyMetadata);
|
|
818
1075
|
function keyBuilder(luvio, config) {
|
|
819
1076
|
const resourceParams = createResourceParams(config);
|
|
820
1077
|
return keyBuilder$1(luvio, resourceParams);
|
|
821
1078
|
}
|
|
822
1079
|
function typeCheckConfig(untrustedConfig) {
|
|
823
1080
|
const config = {};
|
|
824
|
-
typeCheckConfig$
|
|
1081
|
+
typeCheckConfig$6(untrustedConfig, config, getUsageTypeDetail_ConfigPropertyMetadata);
|
|
825
1082
|
return config;
|
|
826
1083
|
}
|
|
827
1084
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -870,7 +1127,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
870
1127
|
});
|
|
871
1128
|
}
|
|
872
1129
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
873
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1130
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
874
1131
|
}
|
|
875
1132
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
876
1133
|
const { luvio, config } = context;
|
|
@@ -885,8 +1142,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
885
1142
|
});
|
|
886
1143
|
return cacheSnapshot;
|
|
887
1144
|
}
|
|
888
|
-
const
|
|
889
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
1145
|
+
const getUsageTypeDetailAdapterFactory = (luvio) => function contextrules__getUsageTypeDetail(untrustedConfig, requestContext) {
|
|
1146
|
+
const config = validateAdapterConfig(untrustedConfig, getUsageTypeDetail_ConfigPropertyNames);
|
|
890
1147
|
// Invalid or incomplete config
|
|
891
1148
|
if (config === null) {
|
|
892
1149
|
return null;
|
|
@@ -895,4 +1152,4 @@ const getContextTagMappingAdapterFactory = (luvio) => function contextrules__get
|
|
|
895
1152
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
896
1153
|
};
|
|
897
1154
|
|
|
898
|
-
export { createContextTagMappingAdapterFactory, deleteContextTagMappingAdapterFactory, getContextTagMappingAdapterFactory, getContextTagMappingsAdapterFactory, updateContextTagMappingAdapterFactory };
|
|
1155
|
+
export { createContextTagMappingAdapterFactory, deleteContextTagMappingAdapterFactory, getContextTagMappingAdapterFactory, getContextTagMappingsAdapterFactory, getUsageTypeDetailAdapterFactory, updateContextTagMappingAdapterFactory };
|