@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/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$5, typeCheckConfig as typeCheckConfig$5, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$6, typeCheckConfig as typeCheckConfig$6, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -89,7 +89,7 @@ function createLink(ref) {
89
89
  };
90
90
  }
91
91
 
92
- function validate$3(obj, path = 'RuleLibraryTagMappingsListWrapperRepresentation') {
92
+ function validate$5(obj, path = 'RuleLibraryTagMappingsListWrapperRepresentation') {
93
93
  const v_error = (() => {
94
94
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
95
95
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -110,9 +110,9 @@ function validate$3(obj, path = 'RuleLibraryTagMappingsListWrapperRepresentation
110
110
  return v_error === undefined ? null : v_error;
111
111
  }
112
112
 
113
- const TTL$2 = 1000;
114
- const VERSION$2 = "7dab3fcadff55a173b214b22d1670519";
115
- function validate$2(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation') {
113
+ const TTL$3 = 1000;
114
+ const VERSION$3 = "7dab3fcadff55a173b214b22d1670519";
115
+ function validate$4(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation') {
116
116
  const v_error = (() => {
117
117
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
118
118
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -132,68 +132,68 @@ function validate$2(obj, path = 'RuleLibraryTagMappingsCreateUpdateOutputReprese
132
132
  })();
133
133
  return v_error === undefined ? null : v_error;
134
134
  }
135
- const RepresentationType$2 = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation';
136
- function keyBuilder$6(luvio, config) {
137
- return keyPrefix + '::' + RepresentationType$2 + ':' + '[' + config.id.join(',') + ']';
135
+ const RepresentationType$3 = 'RuleLibraryTagMappingsCreateUpdateOutputRepresentation';
136
+ function keyBuilder$9(luvio, config) {
137
+ return keyPrefix + '::' + RepresentationType$3 + ':' + '[' + config.id.join(',') + ']';
138
138
  }
139
- function keyBuilderFromType$1(luvio, object) {
139
+ function keyBuilderFromType$2(luvio, object) {
140
140
  const keyParams = {
141
141
  id: object.ids
142
142
  };
143
- return keyBuilder$6(luvio, keyParams);
143
+ return keyBuilder$9(luvio, keyParams);
144
144
  }
145
- function normalize$2(input, existing, path, luvio, store, timestamp) {
145
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
146
146
  return input;
147
147
  }
148
- const select$6 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationSelect() {
148
+ const select$8 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationSelect() {
149
149
  return {
150
150
  kind: 'Fragment',
151
- version: VERSION$2,
151
+ version: VERSION$3,
152
152
  private: [],
153
153
  opaque: true
154
154
  };
155
155
  };
156
- function equals$2(existing, incoming) {
156
+ function equals$3(existing, incoming) {
157
157
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
158
158
  return false;
159
159
  }
160
160
  return true;
161
161
  }
162
- const ingest$2 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
162
+ const ingest$3 = function RuleLibraryTagMappingsCreateUpdateOutputRepresentationIngest(input, path, luvio, store, timestamp) {
163
163
  if (process.env.NODE_ENV !== 'production') {
164
- const validateError = validate$2(input);
164
+ const validateError = validate$4(input);
165
165
  if (validateError !== null) {
166
166
  throw validateError;
167
167
  }
168
168
  }
169
- const key = keyBuilderFromType$1(luvio, input);
170
- const ttlToUse = TTL$2;
171
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "contextrules", VERSION$2, RepresentationType$2, equals$2);
169
+ const key = keyBuilderFromType$2(luvio, input);
170
+ const ttlToUse = TTL$3;
171
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "contextrules", VERSION$3, RepresentationType$3, equals$3);
172
172
  return createLink(key);
173
173
  };
174
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
174
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
175
175
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
176
- const rootKey = keyBuilderFromType$1(luvio, input);
176
+ const rootKey = keyBuilderFromType$2(luvio, input);
177
177
  rootKeySet.set(rootKey, {
178
178
  namespace: keyPrefix,
179
- representationName: RepresentationType$2,
179
+ representationName: RepresentationType$3,
180
180
  mergeable: false
181
181
  });
182
182
  }
183
183
 
184
- function select$5(luvio, params) {
185
- return select$6();
184
+ function select$7(luvio, params) {
185
+ return select$8();
186
186
  }
187
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
188
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
187
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
188
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
189
189
  }
190
- function ingestSuccess$3(luvio, resourceParams, response) {
190
+ function ingestSuccess$4(luvio, resourceParams, response) {
191
191
  const { body } = response;
192
- const key = keyBuilderFromType$1(luvio, body);
193
- luvio.storeIngest(key, ingest$2, body);
192
+ const key = keyBuilderFromType$2(luvio, body);
193
+ luvio.storeIngest(key, ingest$3, body);
194
194
  const snapshot = luvio.storeLookup({
195
195
  recordId: key,
196
- node: select$5(),
196
+ node: select$7(),
197
197
  variables: {},
198
198
  });
199
199
  if (process.env.NODE_ENV !== 'production') {
@@ -204,7 +204,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
204
204
  deepFreeze(snapshot.data);
205
205
  return snapshot;
206
206
  }
207
- function createResourceRequest$4(config) {
207
+ function createResourceRequest$5(config) {
208
208
  const headers = {};
209
209
  return {
210
210
  baseUri: '/services/data/v62.0',
@@ -218,48 +218,48 @@ function createResourceRequest$4(config) {
218
218
  };
219
219
  }
220
220
 
221
- const adapterName$4 = 'createContextTagMapping';
221
+ const adapterName$5 = 'createContextTagMapping';
222
222
  const createContextTagMapping_ConfigPropertyMetadata = [
223
223
  generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
224
224
  generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
225
225
  generateParamConfigMetadata('contextTagMappings', true, 2 /* Body */, 4 /* Unsupported */),
226
226
  ];
227
- const createContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createContextTagMapping_ConfigPropertyMetadata);
228
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(createContextTagMapping_ConfigPropertyMetadata);
229
- function typeCheckConfig$4(untrustedConfig) {
227
+ const createContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createContextTagMapping_ConfigPropertyMetadata);
228
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$6(createContextTagMapping_ConfigPropertyMetadata);
229
+ function typeCheckConfig$5(untrustedConfig) {
230
230
  const config = {};
231
- typeCheckConfig$5(untrustedConfig, config, createContextTagMapping_ConfigPropertyMetadata);
231
+ typeCheckConfig$6(untrustedConfig, config, createContextTagMapping_ConfigPropertyMetadata);
232
232
  const untrustedConfig_contextTagMappings = untrustedConfig.contextTagMappings;
233
- const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$3(untrustedConfig_contextTagMappings);
233
+ const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$5(untrustedConfig_contextTagMappings);
234
234
  if (referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError === null) {
235
235
  config.contextTagMappings = untrustedConfig_contextTagMappings;
236
236
  }
237
237
  return config;
238
238
  }
239
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
239
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
240
240
  if (!untrustedIsObject(untrustedConfig)) {
241
241
  return null;
242
242
  }
243
243
  if (process.env.NODE_ENV !== 'production') {
244
244
  validateConfig(untrustedConfig, configPropertyNames);
245
245
  }
246
- const config = typeCheckConfig$4(untrustedConfig);
246
+ const config = typeCheckConfig$5(untrustedConfig);
247
247
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
248
248
  return null;
249
249
  }
250
250
  return config;
251
251
  }
252
- function buildNetworkSnapshot$4(luvio, config, options) {
253
- const resourceParams = createResourceParams$4(config);
254
- const request = createResourceRequest$4(resourceParams);
252
+ function buildNetworkSnapshot$5(luvio, config, options) {
253
+ const resourceParams = createResourceParams$5(config);
254
+ const request = createResourceRequest$5(resourceParams);
255
255
  return luvio.dispatchResourceRequest(request, options)
256
256
  .then((response) => {
257
257
  return luvio.handleSuccessResponse(() => {
258
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
258
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
259
259
  return luvio.storeBroadcast().then(() => snapshot);
260
260
  }, () => {
261
261
  const cache = new StoreKeyMap();
262
- getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
262
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
263
263
  return cache;
264
264
  });
265
265
  }, (response) => {
@@ -269,18 +269,18 @@ function buildNetworkSnapshot$4(luvio, config, options) {
269
269
  }
270
270
  const createContextTagMappingAdapterFactory = (luvio) => {
271
271
  return function createContextTagMapping(untrustedConfig) {
272
- const config = validateAdapterConfig$4(untrustedConfig, createContextTagMapping_ConfigPropertyNames);
272
+ const config = validateAdapterConfig$5(untrustedConfig, createContextTagMapping_ConfigPropertyNames);
273
273
  // Invalid or incomplete config
274
274
  if (config === null) {
275
275
  throw new Error('Invalid config for "createContextTagMapping"');
276
276
  }
277
- return buildNetworkSnapshot$4(luvio, config);
277
+ return buildNetworkSnapshot$5(luvio, config);
278
278
  };
279
279
  };
280
280
 
281
- const TTL$1 = 1000;
282
- const VERSION$1 = "4b7bef672f4996c31c5a042959681437";
283
- function validate$1(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentation') {
281
+ const TTL$2 = 1000;
282
+ const VERSION$2 = "4b7bef672f4996c31c5a042959681437";
283
+ function validate$3(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentation') {
284
284
  const v_error = (() => {
285
285
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
286
286
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -327,73 +327,73 @@ function validate$1(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentation'
327
327
  })();
328
328
  return v_error === undefined ? null : v_error;
329
329
  }
330
- const RepresentationType$1 = 'RuleLibraryTagMappingsReadOutputRepresentation';
331
- function keyBuilder$5(luvio, config) {
332
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
330
+ const RepresentationType$2 = 'RuleLibraryTagMappingsReadOutputRepresentation';
331
+ function keyBuilder$8(luvio, config) {
332
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
333
333
  }
334
- function keyBuilderFromType(luvio, object) {
334
+ function keyBuilderFromType$1(luvio, object) {
335
335
  const keyParams = {
336
336
  id: object.mappingName
337
337
  };
338
- return keyBuilder$5(luvio, keyParams);
338
+ return keyBuilder$8(luvio, keyParams);
339
339
  }
340
- function normalize$1(input, existing, path, luvio, store, timestamp) {
340
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
341
341
  return input;
342
342
  }
343
- const select$4 = function RuleLibraryTagMappingsReadOutputRepresentationSelect() {
343
+ const select$6 = function RuleLibraryTagMappingsReadOutputRepresentationSelect() {
344
344
  return {
345
345
  kind: 'Fragment',
346
- version: VERSION$1,
346
+ version: VERSION$2,
347
347
  private: [],
348
348
  opaque: true
349
349
  };
350
350
  };
351
- function equals$1(existing, incoming) {
351
+ function equals$2(existing, incoming) {
352
352
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
353
353
  return false;
354
354
  }
355
355
  return true;
356
356
  }
357
- const ingest$1 = function RuleLibraryTagMappingsReadOutputRepresentationIngest(input, path, luvio, store, timestamp) {
357
+ const ingest$2 = function RuleLibraryTagMappingsReadOutputRepresentationIngest(input, path, luvio, store, timestamp) {
358
358
  if (process.env.NODE_ENV !== 'production') {
359
- const validateError = validate$1(input);
359
+ const validateError = validate$3(input);
360
360
  if (validateError !== null) {
361
361
  throw validateError;
362
362
  }
363
363
  }
364
- const key = keyBuilderFromType(luvio, input);
365
- const ttlToUse = TTL$1;
366
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "contextrules", VERSION$1, RepresentationType$1, equals$1);
364
+ const key = keyBuilderFromType$1(luvio, input);
365
+ const ttlToUse = TTL$2;
366
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "contextrules", VERSION$2, RepresentationType$2, equals$2);
367
367
  return createLink(key);
368
368
  };
369
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
369
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
370
370
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
371
- const rootKey = keyBuilderFromType(luvio, input);
371
+ const rootKey = keyBuilderFromType$1(luvio, input);
372
372
  rootKeySet.set(rootKey, {
373
373
  namespace: keyPrefix,
374
- representationName: RepresentationType$1,
374
+ representationName: RepresentationType$2,
375
375
  mergeable: false
376
376
  });
377
377
  }
378
378
 
379
- function keyBuilder$4(luvio, params) {
380
- return keyBuilder$5(luvio, {
379
+ function keyBuilder$7(luvio, params) {
380
+ return keyBuilder$8(luvio, {
381
381
  id: params.urlParams.mappingName
382
382
  });
383
383
  }
384
- function getResponseCacheKeys$3(cacheKeyMap, luvio, resourceParams) {
385
- const key = keyBuilder$4(luvio, resourceParams);
384
+ function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
385
+ const key = keyBuilder$7(luvio, resourceParams);
386
386
  cacheKeyMap.set(key, {
387
387
  namespace: keyPrefix,
388
- representationName: RepresentationType$1,
388
+ representationName: RepresentationType$2,
389
389
  mergeable: false
390
390
  });
391
391
  }
392
392
  function evictSuccess(luvio, resourceParams) {
393
- const key = keyBuilder$4(luvio, resourceParams);
393
+ const key = keyBuilder$7(luvio, resourceParams);
394
394
  luvio.storeEvict(key);
395
395
  }
396
- function createResourceRequest$3(config) {
396
+ function createResourceRequest$4(config) {
397
397
  const headers = {};
398
398
  return {
399
399
  baseUri: '/services/data/v62.0',
@@ -407,35 +407,35 @@ function createResourceRequest$3(config) {
407
407
  };
408
408
  }
409
409
 
410
- const adapterName$3 = 'deleteContextTagMapping';
410
+ const adapterName$4 = 'deleteContextTagMapping';
411
411
  const deleteContextTagMapping_ConfigPropertyMetadata = [
412
412
  generateParamConfigMetadata('mappingName', true, 0 /* UrlParameter */, 0 /* String */),
413
413
  generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
414
414
  generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
415
415
  ];
416
- const deleteContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, deleteContextTagMapping_ConfigPropertyMetadata);
417
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(deleteContextTagMapping_ConfigPropertyMetadata);
418
- function typeCheckConfig$3(untrustedConfig) {
416
+ const deleteContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deleteContextTagMapping_ConfigPropertyMetadata);
417
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$6(deleteContextTagMapping_ConfigPropertyMetadata);
418
+ function typeCheckConfig$4(untrustedConfig) {
419
419
  const config = {};
420
- typeCheckConfig$5(untrustedConfig, config, deleteContextTagMapping_ConfigPropertyMetadata);
420
+ typeCheckConfig$6(untrustedConfig, config, deleteContextTagMapping_ConfigPropertyMetadata);
421
421
  return config;
422
422
  }
423
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
423
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
424
424
  if (!untrustedIsObject(untrustedConfig)) {
425
425
  return null;
426
426
  }
427
427
  if (process.env.NODE_ENV !== 'production') {
428
428
  validateConfig(untrustedConfig, configPropertyNames);
429
429
  }
430
- const config = typeCheckConfig$3(untrustedConfig);
430
+ const config = typeCheckConfig$4(untrustedConfig);
431
431
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
432
432
  return null;
433
433
  }
434
434
  return config;
435
435
  }
436
- function buildNetworkSnapshot$3(luvio, config, options) {
437
- const resourceParams = createResourceParams$3(config);
438
- const request = createResourceRequest$3(resourceParams);
436
+ function buildNetworkSnapshot$4(luvio, config, options) {
437
+ const resourceParams = createResourceParams$4(config);
438
+ const request = createResourceRequest$4(resourceParams);
439
439
  return luvio.dispatchResourceRequest(request, options)
440
440
  .then(() => {
441
441
  return luvio.handleSuccessResponse(() => {
@@ -443,7 +443,7 @@ function buildNetworkSnapshot$3(luvio, config, options) {
443
443
  return luvio.storeBroadcast();
444
444
  }, () => {
445
445
  const cache = new StoreKeyMap();
446
- getResponseCacheKeys$3(cache, luvio, resourceParams);
446
+ getResponseCacheKeys$4(cache, luvio, resourceParams);
447
447
  return cache;
448
448
  });
449
449
  }, (response) => {
@@ -453,33 +453,33 @@ function buildNetworkSnapshot$3(luvio, config, options) {
453
453
  }
454
454
  const deleteContextTagMappingAdapterFactory = (luvio) => {
455
455
  return function contextrulesdeleteContextTagMapping(untrustedConfig) {
456
- const config = validateAdapterConfig$3(untrustedConfig, deleteContextTagMapping_ConfigPropertyNames);
456
+ const config = validateAdapterConfig$4(untrustedConfig, deleteContextTagMapping_ConfigPropertyNames);
457
457
  // Invalid or incomplete config
458
458
  if (config === null) {
459
- throw new Error(`Invalid config for "${adapterName$3}"`);
459
+ throw new Error(`Invalid config for "${adapterName$4}"`);
460
460
  }
461
- return buildNetworkSnapshot$3(luvio, config);
461
+ return buildNetworkSnapshot$4(luvio, config);
462
462
  };
463
463
  };
464
464
 
465
- function select$3(luvio, params) {
466
- return select$4();
465
+ function select$5(luvio, params) {
466
+ return select$6();
467
467
  }
468
- function keyBuilder$3(luvio, params) {
469
- return keyBuilder$5(luvio, {
468
+ function keyBuilder$6(luvio, params) {
469
+ return keyBuilder$8(luvio, {
470
470
  id: params.urlParams.mappingName
471
471
  });
472
472
  }
473
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
474
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
473
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
474
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
475
475
  }
476
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
476
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
477
477
  const { body } = response;
478
- const key = keyBuilder$3(luvio, resourceParams);
479
- luvio.storeIngest(key, ingest$1, body);
478
+ const key = keyBuilder$6(luvio, resourceParams);
479
+ luvio.storeIngest(key, ingest$2, body);
480
480
  const snapshot = luvio.storeLookup({
481
481
  recordId: key,
482
- node: select$3(),
482
+ node: select$5(),
483
483
  variables: {},
484
484
  }, snapshotRefresh);
485
485
  if (process.env.NODE_ENV !== 'production') {
@@ -490,19 +490,19 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
490
490
  deepFreeze(snapshot.data);
491
491
  return snapshot;
492
492
  }
493
- function ingestError$1(luvio, params, error, snapshotRefresh) {
494
- const key = keyBuilder$3(luvio, params);
493
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
494
+ const key = keyBuilder$6(luvio, params);
495
495
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
496
496
  const storeMetadataParams = {
497
- ttl: TTL$1,
497
+ ttl: TTL$2,
498
498
  namespace: keyPrefix,
499
- version: VERSION$1,
500
- representationName: RepresentationType$1
499
+ version: VERSION$2,
500
+ representationName: RepresentationType$2
501
501
  };
502
502
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
503
503
  return errorSnapshot;
504
504
  }
505
- function createResourceRequest$2(config) {
505
+ function createResourceRequest$3(config) {
506
506
  const headers = {};
507
507
  return {
508
508
  baseUri: '/services/data/v62.0',
@@ -515,127 +515,127 @@ function createResourceRequest$2(config) {
515
515
  priority: 'normal',
516
516
  };
517
517
  }
518
- function createResourceRequestFromRepresentation(representation) {
518
+ function createResourceRequestFromRepresentation$1(representation) {
519
519
  const config = {
520
520
  urlParams: {},
521
521
  };
522
522
  config.urlParams.mappingName = representation.mappingName;
523
- return createResourceRequest$2(config);
523
+ return createResourceRequest$3(config);
524
524
  }
525
525
 
526
- const adapterName$2 = 'getContextTagMapping';
526
+ const adapterName$3 = 'getContextTagMapping';
527
527
  const getContextTagMapping_ConfigPropertyMetadata = [
528
528
  generateParamConfigMetadata('mappingName', true, 0 /* UrlParameter */, 0 /* String */),
529
529
  generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
530
530
  generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
531
531
  ];
532
- const getContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getContextTagMapping_ConfigPropertyMetadata);
533
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(getContextTagMapping_ConfigPropertyMetadata);
534
- function keyBuilder$2(luvio, config) {
535
- const resourceParams = createResourceParams$2(config);
536
- return keyBuilder$3(luvio, resourceParams);
532
+ const getContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getContextTagMapping_ConfigPropertyMetadata);
533
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$6(getContextTagMapping_ConfigPropertyMetadata);
534
+ function keyBuilder$5(luvio, config) {
535
+ const resourceParams = createResourceParams$3(config);
536
+ return keyBuilder$6(luvio, resourceParams);
537
537
  }
538
- function typeCheckConfig$2(untrustedConfig) {
538
+ function typeCheckConfig$3(untrustedConfig) {
539
539
  const config = {};
540
- typeCheckConfig$5(untrustedConfig, config, getContextTagMapping_ConfigPropertyMetadata);
540
+ typeCheckConfig$6(untrustedConfig, config, getContextTagMapping_ConfigPropertyMetadata);
541
541
  return config;
542
542
  }
543
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
543
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
544
544
  if (!untrustedIsObject(untrustedConfig)) {
545
545
  return null;
546
546
  }
547
547
  if (process.env.NODE_ENV !== 'production') {
548
548
  validateConfig(untrustedConfig, configPropertyNames);
549
549
  }
550
- const config = typeCheckConfig$2(untrustedConfig);
550
+ const config = typeCheckConfig$3(untrustedConfig);
551
551
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
552
552
  return null;
553
553
  }
554
554
  return config;
555
555
  }
556
- function adapterFragment$1(luvio, config) {
557
- createResourceParams$2(config);
558
- return select$3();
556
+ function adapterFragment$2(luvio, config) {
557
+ createResourceParams$3(config);
558
+ return select$5();
559
559
  }
560
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
561
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
560
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
561
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
562
562
  config,
563
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
563
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
564
564
  });
565
565
  return luvio.storeBroadcast().then(() => snapshot);
566
566
  }
567
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
568
- const snapshot = ingestError$1(luvio, resourceParams, response, {
567
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
568
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
569
569
  config,
570
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
570
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
571
571
  });
572
572
  return luvio.storeBroadcast().then(() => snapshot);
573
573
  }
574
- function buildNetworkSnapshot$2(luvio, config, options) {
575
- const resourceParams = createResourceParams$2(config);
576
- const request = createResourceRequest$2(resourceParams);
574
+ function buildNetworkSnapshot$3(luvio, config, options) {
575
+ const resourceParams = createResourceParams$3(config);
576
+ const request = createResourceRequest$3(resourceParams);
577
577
  return luvio.dispatchResourceRequest(request, options)
578
578
  .then((response) => {
579
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
579
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
580
580
  const cache = new StoreKeyMap();
581
- getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
581
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
582
582
  return cache;
583
583
  });
584
584
  }, (response) => {
585
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
585
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
586
586
  });
587
587
  }
588
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
589
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
588
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
589
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
590
590
  }
591
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
591
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
592
592
  const { luvio, config } = context;
593
593
  const selector = {
594
- recordId: keyBuilder$2(luvio, config),
595
- node: adapterFragment$1(luvio, config),
594
+ recordId: keyBuilder$5(luvio, config),
595
+ node: adapterFragment$2(luvio, config),
596
596
  variables: {},
597
597
  };
598
598
  const cacheSnapshot = storeLookup(selector, {
599
599
  config,
600
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
600
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
601
601
  });
602
602
  return cacheSnapshot;
603
603
  }
604
604
  const getContextTagMappingAdapterFactory = (luvio) => function contextrules__getContextTagMapping(untrustedConfig, requestContext) {
605
- const config = validateAdapterConfig$2(untrustedConfig, getContextTagMapping_ConfigPropertyNames);
605
+ const config = validateAdapterConfig$3(untrustedConfig, getContextTagMapping_ConfigPropertyNames);
606
606
  // Invalid or incomplete config
607
607
  if (config === null) {
608
608
  return null;
609
609
  }
610
610
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
611
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
611
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
612
612
  };
613
- const notifyChangeFactory = (luvio, options) => {
613
+ const notifyChangeFactory$1 = (luvio, options) => {
614
614
  return function getConnectContextRulesContextTagMappingsRuleLibraryApiNameVersionNumberMappingNameByMappingNameAndRuleLibraryApiNameAndVersionNumberNotifyChange(configs) {
615
- const keys = configs.map(c => keyBuilder$5(luvio, c));
615
+ const keys = configs.map(c => keyBuilder$8(luvio, c));
616
616
  luvio.getNotifyChangeStoreEntries(keys).then(entries => {
617
617
  for (let i = 0, len = entries.length; i < len; i++) {
618
618
  const { key, record: val } = entries[i];
619
- const refreshRequest = createResourceRequestFromRepresentation(val);
619
+ const refreshRequest = createResourceRequestFromRepresentation$1(val);
620
620
  luvio.dispatchResourceRequest(refreshRequest, options)
621
621
  .then((response) => {
622
622
  return luvio.handleSuccessResponse(() => {
623
623
  const { body } = response;
624
- luvio.storeIngest(key, ingest$1, body);
624
+ luvio.storeIngest(key, ingest$2, body);
625
625
  return luvio.storeBroadcast();
626
626
  }, () => {
627
627
  const cache = new StoreKeyMap();
628
- getTypeCacheKeys$1(cache, luvio, response.body);
628
+ getTypeCacheKeys$2(cache, luvio, response.body);
629
629
  return cache;
630
630
  });
631
631
  }, (error) => {
632
632
  return luvio.handleErrorResponse(() => {
633
633
  const errorSnapshot = luvio.errorSnapshot(error);
634
634
  luvio.storeIngestError(key, errorSnapshot, {
635
- ttl: TTL$1,
635
+ ttl: TTL$2,
636
636
  namespace: keyPrefix,
637
- version: VERSION$1,
638
- representationName: RepresentationType$1
637
+ version: VERSION$2,
638
+ representationName: RepresentationType$2
639
639
  });
640
640
  return luvio.storeBroadcast().then(() => errorSnapshot);
641
641
  });
@@ -645,9 +645,9 @@ const notifyChangeFactory = (luvio, options) => {
645
645
  };
646
646
  };
647
647
 
648
- const TTL = 1000;
649
- const VERSION = "3839d94c828e170861b071d1d1fe5292";
650
- function validate(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationList') {
648
+ const TTL$1 = 1000;
649
+ const VERSION$1 = "3839d94c828e170861b071d1d1fe5292";
650
+ function validate$2(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationList') {
651
651
  const v_error = (() => {
652
652
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
653
653
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -660,7 +660,7 @@ function validate(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationLis
660
660
  for (let i = 0; i < obj_ruleLibraryTagMappings.length; i++) {
661
661
  const obj_ruleLibraryTagMappings_item = obj_ruleLibraryTagMappings[i];
662
662
  const path_ruleLibraryTagMappings_item = path_ruleLibraryTagMappings + '[' + i + ']';
663
- const referencepath_ruleLibraryTagMappings_itemValidationError = validate$1(obj_ruleLibraryTagMappings_item, path_ruleLibraryTagMappings_item);
663
+ const referencepath_ruleLibraryTagMappings_itemValidationError = validate$3(obj_ruleLibraryTagMappings_item, path_ruleLibraryTagMappings_item);
664
664
  if (referencepath_ruleLibraryTagMappings_itemValidationError !== null) {
665
665
  let message = 'Object doesn\'t match RuleLibraryTagMappingsReadOutputRepresentation (at "' + path_ruleLibraryTagMappings_item + '")\n';
666
666
  message += referencepath_ruleLibraryTagMappings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -670,11 +670,267 @@ function validate(obj, path = 'RuleLibraryTagMappingsReadOutputRepresentationLis
670
670
  })();
671
671
  return v_error === undefined ? null : v_error;
672
672
  }
673
- const RepresentationType = 'RuleLibraryTagMappingsReadOutputRepresentationList';
673
+ const RepresentationType$1 = 'RuleLibraryTagMappingsReadOutputRepresentationList';
674
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
675
+ return input;
676
+ }
677
+ const select$4 = function RuleLibraryTagMappingsReadOutputRepresentationListSelect() {
678
+ return {
679
+ kind: 'Fragment',
680
+ version: VERSION$1,
681
+ private: [],
682
+ opaque: true
683
+ };
684
+ };
685
+ function equals$1(existing, incoming) {
686
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
687
+ return false;
688
+ }
689
+ return true;
690
+ }
691
+ const ingest$1 = function RuleLibraryTagMappingsReadOutputRepresentationListIngest(input, path, luvio, store, timestamp) {
692
+ if (process.env.NODE_ENV !== 'production') {
693
+ const validateError = validate$2(input);
694
+ if (validateError !== null) {
695
+ throw validateError;
696
+ }
697
+ }
698
+ const key = path.fullPath;
699
+ const ttlToUse = TTL$1;
700
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "contextrules", VERSION$1, RepresentationType$1, equals$1);
701
+ return createLink(key);
702
+ };
703
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
704
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
705
+ const rootKey = fullPathFactory();
706
+ rootKeySet.set(rootKey, {
707
+ namespace: keyPrefix,
708
+ representationName: RepresentationType$1,
709
+ mergeable: false
710
+ });
711
+ }
712
+
713
+ function select$3(luvio, params) {
714
+ return select$4();
715
+ }
716
+ function keyBuilder$4(luvio, params) {
717
+ return keyPrefix + '::RuleLibraryTagMappingsReadOutputRepresentationList:(' + 'ruleLibraryApiName:' + params.urlParams.ruleLibraryApiName + ',' + 'versionNumber:' + params.urlParams.versionNumber + ')';
718
+ }
719
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
720
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
721
+ }
722
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
723
+ const { body } = response;
724
+ const key = keyBuilder$4(luvio, resourceParams);
725
+ luvio.storeIngest(key, ingest$1, body);
726
+ const snapshot = luvio.storeLookup({
727
+ recordId: key,
728
+ node: select$3(),
729
+ variables: {},
730
+ }, snapshotRefresh);
731
+ if (process.env.NODE_ENV !== 'production') {
732
+ if (snapshot.state !== 'Fulfilled') {
733
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
734
+ }
735
+ }
736
+ deepFreeze(snapshot.data);
737
+ return snapshot;
738
+ }
739
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
740
+ const key = keyBuilder$4(luvio, params);
741
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
742
+ const storeMetadataParams = {
743
+ ttl: TTL$1,
744
+ namespace: keyPrefix,
745
+ version: VERSION$1,
746
+ representationName: RepresentationType$1
747
+ };
748
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
749
+ return errorSnapshot;
750
+ }
751
+ function createResourceRequest$2(config) {
752
+ const headers = {};
753
+ return {
754
+ baseUri: '/services/data/v62.0',
755
+ basePath: '/connect/context-rules/context-tag-mappings/rule-library-api-name/' + config.urlParams.ruleLibraryApiName + '/version-number/' + config.urlParams.versionNumber + '',
756
+ method: 'get',
757
+ body: null,
758
+ urlParams: config.urlParams,
759
+ queryParams: {},
760
+ headers,
761
+ priority: 'normal',
762
+ };
763
+ }
764
+
765
+ const adapterName$2 = 'getContextTagMappings';
766
+ const getContextTagMappings_ConfigPropertyMetadata = [
767
+ generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
768
+ generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
769
+ ];
770
+ const getContextTagMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getContextTagMappings_ConfigPropertyMetadata);
771
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$6(getContextTagMappings_ConfigPropertyMetadata);
772
+ function keyBuilder$3(luvio, config) {
773
+ const resourceParams = createResourceParams$2(config);
774
+ return keyBuilder$4(luvio, resourceParams);
775
+ }
776
+ function typeCheckConfig$2(untrustedConfig) {
777
+ const config = {};
778
+ typeCheckConfig$6(untrustedConfig, config, getContextTagMappings_ConfigPropertyMetadata);
779
+ return config;
780
+ }
781
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
782
+ if (!untrustedIsObject(untrustedConfig)) {
783
+ return null;
784
+ }
785
+ if (process.env.NODE_ENV !== 'production') {
786
+ validateConfig(untrustedConfig, configPropertyNames);
787
+ }
788
+ const config = typeCheckConfig$2(untrustedConfig);
789
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
790
+ return null;
791
+ }
792
+ return config;
793
+ }
794
+ function adapterFragment$1(luvio, config) {
795
+ createResourceParams$2(config);
796
+ return select$3();
797
+ }
798
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
799
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
800
+ config,
801
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
802
+ });
803
+ return luvio.storeBroadcast().then(() => snapshot);
804
+ }
805
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
806
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
807
+ config,
808
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
809
+ });
810
+ return luvio.storeBroadcast().then(() => snapshot);
811
+ }
812
+ function buildNetworkSnapshot$2(luvio, config, options) {
813
+ const resourceParams = createResourceParams$2(config);
814
+ const request = createResourceRequest$2(resourceParams);
815
+ return luvio.dispatchResourceRequest(request, options)
816
+ .then((response) => {
817
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
818
+ const cache = new StoreKeyMap();
819
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
820
+ return cache;
821
+ });
822
+ }, (response) => {
823
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
824
+ });
825
+ }
826
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
827
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
828
+ }
829
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
830
+ const { luvio, config } = context;
831
+ const selector = {
832
+ recordId: keyBuilder$3(luvio, config),
833
+ node: adapterFragment$1(luvio, config),
834
+ variables: {},
835
+ };
836
+ const cacheSnapshot = storeLookup(selector, {
837
+ config,
838
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
839
+ });
840
+ return cacheSnapshot;
841
+ }
842
+ const getContextTagMappingsAdapterFactory = (luvio) => function contextrules__getContextTagMappings(untrustedConfig, requestContext) {
843
+ const config = validateAdapterConfig$2(untrustedConfig, getContextTagMappings_ConfigPropertyNames);
844
+ // Invalid or incomplete config
845
+ if (config === null) {
846
+ return null;
847
+ }
848
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
849
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
850
+ };
851
+
852
+ function validate$1(obj, path = 'UsageSubtypeOutputRepresentation') {
853
+ const v_error = (() => {
854
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
855
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
856
+ }
857
+ const obj_subtypeMappingNames = obj.subtypeMappingNames;
858
+ const path_subtypeMappingNames = path + '.subtypeMappingNames';
859
+ if (!ArrayIsArray(obj_subtypeMappingNames)) {
860
+ return new TypeError('Expected "array" but received "' + typeof obj_subtypeMappingNames + '" (at "' + path_subtypeMappingNames + '")');
861
+ }
862
+ for (let i = 0; i < obj_subtypeMappingNames.length; i++) {
863
+ const obj_subtypeMappingNames_item = obj_subtypeMappingNames[i];
864
+ const path_subtypeMappingNames_item = path_subtypeMappingNames + '[' + i + ']';
865
+ if (typeof obj_subtypeMappingNames_item !== 'string') {
866
+ return new TypeError('Expected "string" but received "' + typeof obj_subtypeMappingNames_item + '" (at "' + path_subtypeMappingNames_item + '")');
867
+ }
868
+ }
869
+ const obj_usageSubtype = obj.usageSubtype;
870
+ const path_usageSubtype = path + '.usageSubtype';
871
+ if (typeof obj_usageSubtype !== 'string') {
872
+ return new TypeError('Expected "string" but received "' + typeof obj_usageSubtype + '" (at "' + path_usageSubtype + '")');
873
+ }
874
+ })();
875
+ return v_error === undefined ? null : v_error;
876
+ }
877
+
878
+ const TTL = 1000;
879
+ const VERSION = "19586883f36a2f3e5aa88a8708d670b4";
880
+ function validate(obj, path = 'UsageTypeOutputRepresentation') {
881
+ const v_error = (() => {
882
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
883
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
884
+ }
885
+ const obj_mappingNames = obj.mappingNames;
886
+ const path_mappingNames = path + '.mappingNames';
887
+ if (!ArrayIsArray(obj_mappingNames)) {
888
+ return new TypeError('Expected "array" but received "' + typeof obj_mappingNames + '" (at "' + path_mappingNames + '")');
889
+ }
890
+ for (let i = 0; i < obj_mappingNames.length; i++) {
891
+ const obj_mappingNames_item = obj_mappingNames[i];
892
+ const path_mappingNames_item = path_mappingNames + '[' + i + ']';
893
+ if (typeof obj_mappingNames_item !== 'string') {
894
+ return new TypeError('Expected "string" but received "' + typeof obj_mappingNames_item + '" (at "' + path_mappingNames_item + '")');
895
+ }
896
+ }
897
+ const obj_usageSubtypes = obj.usageSubtypes;
898
+ const path_usageSubtypes = path + '.usageSubtypes';
899
+ if (!ArrayIsArray(obj_usageSubtypes)) {
900
+ return new TypeError('Expected "array" but received "' + typeof obj_usageSubtypes + '" (at "' + path_usageSubtypes + '")');
901
+ }
902
+ for (let i = 0; i < obj_usageSubtypes.length; i++) {
903
+ const obj_usageSubtypes_item = obj_usageSubtypes[i];
904
+ const path_usageSubtypes_item = path_usageSubtypes + '[' + i + ']';
905
+ const referencepath_usageSubtypes_itemValidationError = validate$1(obj_usageSubtypes_item, path_usageSubtypes_item);
906
+ if (referencepath_usageSubtypes_itemValidationError !== null) {
907
+ let message = 'Object doesn\'t match UsageSubtypeOutputRepresentation (at "' + path_usageSubtypes_item + '")\n';
908
+ message += referencepath_usageSubtypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
909
+ return new TypeError(message);
910
+ }
911
+ }
912
+ const obj_usageType = obj.usageType;
913
+ const path_usageType = path + '.usageType';
914
+ if (typeof obj_usageType !== 'string') {
915
+ return new TypeError('Expected "string" but received "' + typeof obj_usageType + '" (at "' + path_usageType + '")');
916
+ }
917
+ })();
918
+ return v_error === undefined ? null : v_error;
919
+ }
920
+ const RepresentationType = 'UsageTypeOutputRepresentation';
921
+ function keyBuilder$2(luvio, config) {
922
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
923
+ }
924
+ function keyBuilderFromType(luvio, object) {
925
+ const keyParams = {
926
+ id: object.usageType
927
+ };
928
+ return keyBuilder$2(luvio, keyParams);
929
+ }
674
930
  function normalize(input, existing, path, luvio, store, timestamp) {
675
931
  return input;
676
932
  }
677
- const select$2 = function RuleLibraryTagMappingsReadOutputRepresentationListSelect() {
933
+ const select$2 = function UsageTypeOutputRepresentationSelect() {
678
934
  return {
679
935
  kind: 'Fragment',
680
936
  version: VERSION,
@@ -688,21 +944,21 @@ function equals(existing, incoming) {
688
944
  }
689
945
  return true;
690
946
  }
691
- const ingest = function RuleLibraryTagMappingsReadOutputRepresentationListIngest(input, path, luvio, store, timestamp) {
947
+ const ingest = function UsageTypeOutputRepresentationIngest(input, path, luvio, store, timestamp) {
692
948
  if (process.env.NODE_ENV !== 'production') {
693
949
  const validateError = validate(input);
694
950
  if (validateError !== null) {
695
951
  throw validateError;
696
952
  }
697
953
  }
698
- const key = path.fullPath;
954
+ const key = keyBuilderFromType(luvio, input);
699
955
  const ttlToUse = TTL;
700
956
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "contextrules", VERSION, RepresentationType, equals);
701
957
  return createLink(key);
702
958
  };
703
959
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
704
960
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
705
- const rootKey = fullPathFactory();
961
+ const rootKey = keyBuilderFromType(luvio, input);
706
962
  rootKeySet.set(rootKey, {
707
963
  namespace: keyPrefix,
708
964
  representationName: RepresentationType,
@@ -714,10 +970,12 @@ function select$1(luvio, params) {
714
970
  return select$2();
715
971
  }
716
972
  function keyBuilder$1(luvio, params) {
717
- return keyPrefix + '::RuleLibraryTagMappingsReadOutputRepresentationList:(' + 'ruleLibraryApiName:' + params.urlParams.ruleLibraryApiName + ',' + 'versionNumber:' + params.urlParams.versionNumber + ')';
973
+ return keyBuilder$2(luvio, {
974
+ id: params.urlParams.usageType
975
+ });
718
976
  }
719
977
  function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
720
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
978
+ getTypeCacheKeys(storeKeyMap, luvio, response);
721
979
  }
722
980
  function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
723
981
  const { body } = response;
@@ -752,7 +1010,7 @@ function createResourceRequest$1(config) {
752
1010
  const headers = {};
753
1011
  return {
754
1012
  baseUri: '/services/data/v62.0',
755
- basePath: '/connect/context-rules/context-tag-mappings/rule-library-api-name/' + config.urlParams.ruleLibraryApiName + '/version-number/' + config.urlParams.versionNumber + '',
1013
+ basePath: '/connect/context-rules/usage-types/' + config.urlParams.usageType + '',
756
1014
  method: 'get',
757
1015
  body: null,
758
1016
  urlParams: config.urlParams,
@@ -761,21 +1019,27 @@ function createResourceRequest$1(config) {
761
1019
  priority: 'normal',
762
1020
  };
763
1021
  }
1022
+ function createResourceRequestFromRepresentation(representation) {
1023
+ const config = {
1024
+ urlParams: {},
1025
+ };
1026
+ config.urlParams.usageType = representation.usageType;
1027
+ return createResourceRequest$1(config);
1028
+ }
764
1029
 
765
- const adapterName$1 = 'getContextTagMappings';
766
- const getContextTagMappings_ConfigPropertyMetadata = [
767
- generateParamConfigMetadata('ruleLibraryApiName', true, 0 /* UrlParameter */, 0 /* String */),
768
- generateParamConfigMetadata('versionNumber', true, 0 /* UrlParameter */, 0 /* String */),
1030
+ const adapterName$1 = 'getUsageTypeDetail';
1031
+ const getUsageTypeDetail_ConfigPropertyMetadata = [
1032
+ generateParamConfigMetadata('usageType', true, 0 /* UrlParameter */, 0 /* String */),
769
1033
  ];
770
- const getContextTagMappings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getContextTagMappings_ConfigPropertyMetadata);
771
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getContextTagMappings_ConfigPropertyMetadata);
1034
+ const getUsageTypeDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getUsageTypeDetail_ConfigPropertyMetadata);
1035
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$6(getUsageTypeDetail_ConfigPropertyMetadata);
772
1036
  function keyBuilder(luvio, config) {
773
1037
  const resourceParams = createResourceParams$1(config);
774
1038
  return keyBuilder$1(luvio, resourceParams);
775
1039
  }
776
1040
  function typeCheckConfig$1(untrustedConfig) {
777
1041
  const config = {};
778
- typeCheckConfig$5(untrustedConfig, config, getContextTagMappings_ConfigPropertyMetadata);
1042
+ typeCheckConfig$6(untrustedConfig, config, getUsageTypeDetail_ConfigPropertyMetadata);
779
1043
  return config;
780
1044
  }
781
1045
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -824,7 +1088,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
824
1088
  });
825
1089
  }
826
1090
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
827
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1091
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
828
1092
  }
829
1093
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
830
1094
  const { luvio, config } = context;
@@ -839,8 +1103,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
839
1103
  });
840
1104
  return cacheSnapshot;
841
1105
  }
842
- const getContextTagMappingsAdapterFactory = (luvio) => function contextrules__getContextTagMappings(untrustedConfig, requestContext) {
843
- const config = validateAdapterConfig$1(untrustedConfig, getContextTagMappings_ConfigPropertyNames);
1106
+ const getUsageTypeDetailAdapterFactory = (luvio) => function contextrules__getUsageTypeDetail(untrustedConfig, requestContext) {
1107
+ const config = validateAdapterConfig$1(untrustedConfig, getUsageTypeDetail_ConfigPropertyNames);
844
1108
  // Invalid or incomplete config
845
1109
  if (config === null) {
846
1110
  return null;
@@ -848,17 +1112,51 @@ const getContextTagMappingsAdapterFactory = (luvio) => function contextrules__ge
848
1112
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
849
1113
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
850
1114
  };
1115
+ const notifyChangeFactory = (luvio, options) => {
1116
+ return function getConnectContextRulesUsageTypesByUsageTypeNotifyChange(configs) {
1117
+ const keys = configs.map(c => keyBuilder$2(luvio, c));
1118
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
1119
+ for (let i = 0, len = entries.length; i < len; i++) {
1120
+ const { key, record: val } = entries[i];
1121
+ const refreshRequest = createResourceRequestFromRepresentation(val);
1122
+ luvio.dispatchResourceRequest(refreshRequest, options)
1123
+ .then((response) => {
1124
+ return luvio.handleSuccessResponse(() => {
1125
+ const { body } = response;
1126
+ luvio.storeIngest(key, ingest, body);
1127
+ return luvio.storeBroadcast();
1128
+ }, () => {
1129
+ const cache = new StoreKeyMap();
1130
+ getTypeCacheKeys(cache, luvio, response.body);
1131
+ return cache;
1132
+ });
1133
+ }, (error) => {
1134
+ return luvio.handleErrorResponse(() => {
1135
+ const errorSnapshot = luvio.errorSnapshot(error);
1136
+ luvio.storeIngestError(key, errorSnapshot, {
1137
+ ttl: TTL,
1138
+ namespace: keyPrefix,
1139
+ version: VERSION,
1140
+ representationName: RepresentationType
1141
+ });
1142
+ return luvio.storeBroadcast().then(() => errorSnapshot);
1143
+ });
1144
+ });
1145
+ }
1146
+ });
1147
+ };
1148
+ };
851
1149
 
852
1150
  function select(luvio, params) {
853
- return select$6();
1151
+ return select$8();
854
1152
  }
855
1153
  function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
856
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
1154
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
857
1155
  }
858
1156
  function ingestSuccess(luvio, resourceParams, response) {
859
1157
  const { body } = response;
860
- const key = keyBuilderFromType$1(luvio, body);
861
- luvio.storeIngest(key, ingest$2, body);
1158
+ const key = keyBuilderFromType$2(luvio, body);
1159
+ luvio.storeIngest(key, ingest$3, body);
862
1160
  const snapshot = luvio.storeLookup({
863
1161
  recordId: key,
864
1162
  node: select(),
@@ -893,12 +1191,12 @@ const updateContextTagMapping_ConfigPropertyMetadata = [
893
1191
  generateParamConfigMetadata('contextTagMappings', true, 2 /* Body */, 4 /* Unsupported */),
894
1192
  ];
895
1193
  const updateContextTagMapping_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateContextTagMapping_ConfigPropertyMetadata);
896
- const createResourceParams = /*#__PURE__*/ createResourceParams$5(updateContextTagMapping_ConfigPropertyMetadata);
1194
+ const createResourceParams = /*#__PURE__*/ createResourceParams$6(updateContextTagMapping_ConfigPropertyMetadata);
897
1195
  function typeCheckConfig(untrustedConfig) {
898
1196
  const config = {};
899
- typeCheckConfig$5(untrustedConfig, config, updateContextTagMapping_ConfigPropertyMetadata);
1197
+ typeCheckConfig$6(untrustedConfig, config, updateContextTagMapping_ConfigPropertyMetadata);
900
1198
  const untrustedConfig_contextTagMappings = untrustedConfig.contextTagMappings;
901
- const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$3(untrustedConfig_contextTagMappings);
1199
+ const referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError = validate$5(untrustedConfig_contextTagMappings);
902
1200
  if (referenceRuleLibraryTagMappingsListWrapperRepresentationValidationError === null) {
903
1201
  config.contextTagMappings = untrustedConfig_contextTagMappings;
904
1202
  }
@@ -951,10 +1249,13 @@ let deleteContextTagMapping;
951
1249
  let getContextTagMapping;
952
1250
  let getContextTagMappingNotifyChange;
953
1251
  let getContextTagMappings;
1252
+ let getUsageTypeDetail;
1253
+ let getUsageTypeDetailNotifyChange;
954
1254
  let updateContextTagMapping;
955
1255
  // Imperative GET Adapters
956
1256
  let getContextTagMapping_imperative;
957
1257
  let getContextTagMappings_imperative;
1258
+ let getUsageTypeDetail_imperative;
958
1259
  const getContextTagMappingMetadata = {
959
1260
  apiFamily: 'contextrules',
960
1261
  name: 'getContextTagMapping',
@@ -965,25 +1266,34 @@ const getContextTagMappingsMetadata = {
965
1266
  name: 'getContextTagMappings',
966
1267
  ttl: 1000,
967
1268
  };
1269
+ const getUsageTypeDetailMetadata = {
1270
+ apiFamily: 'contextrules',
1271
+ name: 'getUsageTypeDetail',
1272
+ ttl: 1000,
1273
+ };
968
1274
  // Notify Update Available
969
1275
  function bindExportsTo(luvio) {
970
1276
  // LDS Adapters
971
1277
  const getContextTagMapping_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContextTagMapping', getContextTagMappingAdapterFactory), getContextTagMappingMetadata);
972
1278
  const getContextTagMappings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContextTagMappings', getContextTagMappingsAdapterFactory), getContextTagMappingsMetadata);
1279
+ const getUsageTypeDetail_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getUsageTypeDetail', getUsageTypeDetailAdapterFactory), getUsageTypeDetailMetadata);
973
1280
  function unwrapSnapshotData(factory) {
974
1281
  const adapter = factory(luvio);
975
1282
  return (config) => adapter(config).then((snapshot) => snapshot.data);
976
1283
  }
977
1284
  return {
978
1285
  createContextTagMapping: unwrapSnapshotData(createContextTagMappingAdapterFactory),
979
- deleteContextTagMapping: createLDSAdapter(luvio, adapterName$3, deleteContextTagMappingAdapterFactory),
1286
+ deleteContextTagMapping: createLDSAdapter(luvio, adapterName$4, deleteContextTagMappingAdapterFactory),
980
1287
  getContextTagMapping: createWireAdapterConstructor(luvio, getContextTagMapping_ldsAdapter, getContextTagMappingMetadata),
981
- getContextTagMappingNotifyChange: createLDSAdapter(luvio, 'getContextTagMappingNotifyChange', notifyChangeFactory),
1288
+ getContextTagMappingNotifyChange: createLDSAdapter(luvio, 'getContextTagMappingNotifyChange', notifyChangeFactory$1),
982
1289
  getContextTagMappings: createWireAdapterConstructor(luvio, getContextTagMappings_ldsAdapter, getContextTagMappingsMetadata),
1290
+ getUsageTypeDetail: createWireAdapterConstructor(luvio, getUsageTypeDetail_ldsAdapter, getUsageTypeDetailMetadata),
1291
+ getUsageTypeDetailNotifyChange: createLDSAdapter(luvio, 'getUsageTypeDetailNotifyChange', notifyChangeFactory),
983
1292
  updateContextTagMapping: unwrapSnapshotData(updateContextTagMappingAdapterFactory),
984
1293
  // Imperative GET Adapters
985
1294
  getContextTagMapping_imperative: createImperativeAdapter(luvio, getContextTagMapping_ldsAdapter, getContextTagMappingMetadata),
986
1295
  getContextTagMappings_imperative: createImperativeAdapter(luvio, getContextTagMappings_ldsAdapter, getContextTagMappingsMetadata),
1296
+ getUsageTypeDetail_imperative: createImperativeAdapter(luvio, getUsageTypeDetail_ldsAdapter, getUsageTypeDetailMetadata),
987
1297
  // Notify Update Availables
988
1298
  };
989
1299
  }
@@ -994,11 +1304,14 @@ withDefaultLuvio((luvio) => {
994
1304
  getContextTagMapping,
995
1305
  getContextTagMappingNotifyChange,
996
1306
  getContextTagMappings,
1307
+ getUsageTypeDetail,
1308
+ getUsageTypeDetailNotifyChange,
997
1309
  updateContextTagMapping,
998
1310
  getContextTagMapping_imperative,
999
1311
  getContextTagMappings_imperative,
1312
+ getUsageTypeDetail_imperative,
1000
1313
  } = bindExportsTo(luvio));
1001
1314
  });
1002
1315
 
1003
- export { createContextTagMapping, deleteContextTagMapping, getContextTagMapping, getContextTagMappingNotifyChange, getContextTagMapping_imperative, getContextTagMappings, getContextTagMappings_imperative, updateContextTagMapping };
1004
- // version: 1.293.0-c036bce5d
1316
+ export { createContextTagMapping, deleteContextTagMapping, getContextTagMapping, getContextTagMappingNotifyChange, getContextTagMapping_imperative, getContextTagMappings, getContextTagMappings_imperative, getUsageTypeDetail, getUsageTypeDetailNotifyChange, getUsageTypeDetail_imperative, updateContextTagMapping };
1317
+ // version: 1.295.0-e85f207c7