@salesforce/lds-adapters-cdp-engmt-config 1.348.0 → 1.349.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.
@@ -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$2, typeCheckConfig as typeCheckConfig$5, StoreKeyMap, createResourceParams as createResourceParams$5 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$7, StoreKeyMap, createResourceParams as createResourceParams$7 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -156,7 +156,7 @@ const RepresentationType$2 = 'EngagementSignalCollectionRepresentation';
156
156
  function normalize$2(input, existing, path, luvio, store, timestamp) {
157
157
  return input;
158
158
  }
159
- const select$8 = function EngagementSignalCollectionRepresentationSelect() {
159
+ const select$9 = function EngagementSignalCollectionRepresentationSelect() {
160
160
  return {
161
161
  kind: 'Fragment',
162
162
  version: VERSION$4,
@@ -241,22 +241,22 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
241
241
  });
242
242
  }
243
243
 
244
- function select$7(luvio, params) {
245
- return select$8();
244
+ function select$8(luvio, params) {
245
+ return select$9();
246
246
  }
247
- function keyBuilder$6(luvio, params) {
247
+ function keyBuilder$9(luvio, params) {
248
248
  return keyPrefix + '::EngagementSignalCollectionRepresentation:(' + 'dataspaceName:' + params.queryParams.dataspaceName + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'profileDataGraphName:' + params.queryParams.profileDataGraphName + ')';
249
249
  }
250
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
251
- getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
250
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
251
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
252
252
  }
253
- function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
253
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
254
254
  const { body } = response;
255
- const key = keyBuilder$6(luvio, resourceParams);
255
+ const key = keyBuilder$9(luvio, resourceParams);
256
256
  luvio.storeIngest(key, ingest$2, body);
257
257
  const snapshot = luvio.storeLookup({
258
258
  recordId: key,
259
- node: select$7(),
259
+ node: select$8(),
260
260
  variables: {},
261
261
  }, snapshotRefresh);
262
262
  if (process.env.NODE_ENV !== 'production') {
@@ -267,8 +267,8 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
267
267
  deepFreeze(snapshot.data);
268
268
  return snapshot;
269
269
  }
270
- function ingestError$1(luvio, params, error, snapshotRefresh) {
271
- const key = keyBuilder$6(luvio, params);
270
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
271
+ const key = keyBuilder$9(luvio, params);
272
272
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
273
273
  const storeMetadataParams = {
274
274
  ttl: TTL$2,
@@ -279,7 +279,7 @@ function ingestError$1(luvio, params, error, snapshotRefresh) {
279
279
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
280
280
  return errorSnapshot;
281
281
  }
282
- function createResourceRequest$4(config) {
282
+ function createResourceRequest$6(config) {
283
283
  const headers = {};
284
284
  return {
285
285
  baseUri: '/services/data/v64.0',
@@ -293,93 +293,93 @@ function createResourceRequest$4(config) {
293
293
  };
294
294
  }
295
295
 
296
- const adapterName$4 = 'getEngagementSignals';
296
+ const adapterName$6 = 'getEngagementSignals';
297
297
  const getEngagementSignals_ConfigPropertyMetadata = [
298
298
  generateParamConfigMetadata('dataspaceName', false, 1 /* QueryParameter */, 0 /* String */),
299
299
  generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
300
300
  generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
301
301
  generateParamConfigMetadata('profileDataGraphName', false, 1 /* QueryParameter */, 0 /* String */),
302
302
  ];
303
- const getEngagementSignals_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getEngagementSignals_ConfigPropertyMetadata);
304
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(getEngagementSignals_ConfigPropertyMetadata);
305
- function keyBuilder$5(luvio, config) {
306
- const resourceParams = createResourceParams$4(config);
307
- return keyBuilder$6(luvio, resourceParams);
303
+ const getEngagementSignals_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getEngagementSignals_ConfigPropertyMetadata);
304
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getEngagementSignals_ConfigPropertyMetadata);
305
+ function keyBuilder$8(luvio, config) {
306
+ const resourceParams = createResourceParams$6(config);
307
+ return keyBuilder$9(luvio, resourceParams);
308
308
  }
309
- function typeCheckConfig$4(untrustedConfig) {
309
+ function typeCheckConfig$6(untrustedConfig) {
310
310
  const config = {};
311
- typeCheckConfig$5(untrustedConfig, config, getEngagementSignals_ConfigPropertyMetadata);
311
+ typeCheckConfig$7(untrustedConfig, config, getEngagementSignals_ConfigPropertyMetadata);
312
312
  return config;
313
313
  }
314
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
314
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
315
315
  if (!untrustedIsObject(untrustedConfig)) {
316
316
  return null;
317
317
  }
318
318
  if (process.env.NODE_ENV !== 'production') {
319
319
  validateConfig(untrustedConfig, configPropertyNames);
320
320
  }
321
- const config = typeCheckConfig$4(untrustedConfig);
321
+ const config = typeCheckConfig$6(untrustedConfig);
322
322
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
323
323
  return null;
324
324
  }
325
325
  return config;
326
326
  }
327
- function adapterFragment$1(luvio, config) {
328
- createResourceParams$4(config);
329
- return select$7();
327
+ function adapterFragment$2(luvio, config) {
328
+ createResourceParams$6(config);
329
+ return select$8();
330
330
  }
331
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
332
- const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
331
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
332
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
333
333
  config,
334
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
334
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
335
335
  });
336
336
  return luvio.storeBroadcast().then(() => snapshot);
337
337
  }
338
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
339
- const snapshot = ingestError$1(luvio, resourceParams, response, {
338
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
339
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
340
340
  config,
341
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
341
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
342
342
  });
343
343
  return luvio.storeBroadcast().then(() => snapshot);
344
344
  }
345
- function buildNetworkSnapshot$4(luvio, config, options) {
346
- const resourceParams = createResourceParams$4(config);
347
- const request = createResourceRequest$4(resourceParams);
345
+ function buildNetworkSnapshot$6(luvio, config, options) {
346
+ const resourceParams = createResourceParams$6(config);
347
+ const request = createResourceRequest$6(resourceParams);
348
348
  return luvio.dispatchResourceRequest(request, options)
349
349
  .then((response) => {
350
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
350
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
351
351
  const cache = new StoreKeyMap();
352
- getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
352
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
353
353
  return cache;
354
354
  });
355
355
  }, (response) => {
356
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
356
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
357
357
  });
358
358
  }
359
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
360
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
359
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
360
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
361
361
  }
362
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
362
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
363
363
  const { luvio, config } = context;
364
364
  const selector = {
365
- recordId: keyBuilder$5(luvio, config),
366
- node: adapterFragment$1(luvio, config),
365
+ recordId: keyBuilder$8(luvio, config),
366
+ node: adapterFragment$2(luvio, config),
367
367
  variables: {},
368
368
  };
369
369
  const cacheSnapshot = storeLookup(selector, {
370
370
  config,
371
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
371
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
372
372
  });
373
373
  return cacheSnapshot;
374
374
  }
375
375
  const getEngagementSignalsAdapterFactory = (luvio) => function engmtConfig__getEngagementSignals(untrustedConfig, requestContext) {
376
- const config = validateAdapterConfig$4(untrustedConfig, getEngagementSignals_ConfigPropertyNames);
376
+ const config = validateAdapterConfig$6(untrustedConfig, getEngagementSignals_ConfigPropertyNames);
377
377
  // Invalid or incomplete config
378
378
  if (config === null) {
379
379
  return null;
380
380
  }
381
381
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
382
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
382
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
383
383
  };
384
384
 
385
385
  const VERSION$3 = "8f73e1515e2fe09097e6618181bf923a";
@@ -408,7 +408,7 @@ function validate$3(obj, path = 'EngagementSignalFilterGroupRepresentation') {
408
408
  })();
409
409
  return v_error === undefined ? null : v_error;
410
410
  }
411
- const select$6 = function EngagementSignalFilterGroupRepresentationSelect() {
411
+ const select$7 = function EngagementSignalFilterGroupRepresentationSelect() {
412
412
  return {
413
413
  kind: 'Fragment',
414
414
  version: VERSION$3,
@@ -469,7 +469,7 @@ function validate$2(obj, path = 'EngagementSignalRateMetricRepresentation') {
469
469
  })();
470
470
  return v_error === undefined ? null : v_error;
471
471
  }
472
- const select$5 = function EngagementSignalRateMetricRepresentationSelect() {
472
+ const select$6 = function EngagementSignalRateMetricRepresentationSelect() {
473
473
  return {
474
474
  kind: 'Fragment',
475
475
  version: VERSION$2,
@@ -540,19 +540,19 @@ function validate$1(obj, path = 'EngagementSignalMetricRepresentation') {
540
540
  return v_error === undefined ? null : v_error;
541
541
  }
542
542
  const RepresentationType$1 = 'EngagementSignalMetricRepresentation';
543
- function keyBuilder$4(luvio, config) {
543
+ function keyBuilder$7(luvio, config) {
544
544
  return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
545
545
  }
546
546
  function keyBuilderFromType$1(luvio, object) {
547
547
  const keyParams = {
548
548
  id: object.id
549
549
  };
550
- return keyBuilder$4(luvio, keyParams);
550
+ return keyBuilder$7(luvio, keyParams);
551
551
  }
552
552
  function normalize$1(input, existing, path, luvio, store, timestamp) {
553
553
  return input;
554
554
  }
555
- const select$4 = function EngagementSignalMetricRepresentationSelect() {
555
+ const select$5 = function EngagementSignalMetricRepresentationSelect() {
556
556
  return {
557
557
  kind: 'Fragment',
558
558
  version: VERSION$1,
@@ -743,14 +743,14 @@ function validate(obj, path = 'EngagementSignalRepresentation') {
743
743
  return v_error === undefined ? null : v_error;
744
744
  }
745
745
  const RepresentationType = 'EngagementSignalRepresentation';
746
- function keyBuilder$3(luvio, config) {
746
+ function keyBuilder$6(luvio, config) {
747
747
  return keyPrefix + '::' + RepresentationType + ':' + config.id;
748
748
  }
749
749
  function keyBuilderFromType(luvio, object) {
750
750
  const keyParams = {
751
751
  id: object.id
752
752
  };
753
- return keyBuilder$3(luvio, keyParams);
753
+ return keyBuilder$6(luvio, keyParams);
754
754
  }
755
755
  function normalize(input, existing, path, luvio, store, timestamp) {
756
756
  const input_metrics = input.metrics;
@@ -773,9 +773,9 @@ function normalize(input, existing, path, luvio, store, timestamp) {
773
773
  }
774
774
  return input;
775
775
  }
776
- const select$3 = function EngagementSignalRepresentationSelect() {
777
- const { selections: EngagementSignalFilterGroupRepresentation__selections, opaque: EngagementSignalFilterGroupRepresentation__opaque, } = select$6();
778
- const { selections: EngagementSignalRateMetricRepresentation__selections, opaque: EngagementSignalRateMetricRepresentation__opaque, } = select$5();
776
+ const select$4 = function EngagementSignalRepresentationSelect() {
777
+ const { selections: EngagementSignalFilterGroupRepresentation__selections, opaque: EngagementSignalFilterGroupRepresentation__opaque, } = select$7();
778
+ const { selections: EngagementSignalRateMetricRepresentation__selections, opaque: EngagementSignalRateMetricRepresentation__opaque, } = select$6();
779
779
  return {
780
780
  kind: 'Fragment',
781
781
  version: VERSION,
@@ -815,7 +815,7 @@ const select$3 = function EngagementSignalRepresentationSelect() {
815
815
  kind: 'Link',
816
816
  plural: true,
817
817
  required: false,
818
- fragment: select$4()
818
+ fragment: select$5()
819
819
  },
820
820
  {
821
821
  name: 'name',
@@ -1006,19 +1006,19 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1006
1006
  }
1007
1007
  }
1008
1008
 
1009
- function select$2(luvio, params) {
1010
- return select$3();
1009
+ function select$3(luvio, params) {
1010
+ return select$4();
1011
1011
  }
1012
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1012
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
1013
1013
  getTypeCacheKeys(storeKeyMap, luvio, response);
1014
1014
  }
1015
- function ingestSuccess$2(luvio, resourceParams, response) {
1015
+ function ingestSuccess$3(luvio, resourceParams, response) {
1016
1016
  const { body } = response;
1017
1017
  const key = keyBuilderFromType(luvio, body);
1018
1018
  luvio.storeIngest(key, ingest, body);
1019
1019
  const snapshot = luvio.storeLookup({
1020
1020
  recordId: key,
1021
- node: select$2(),
1021
+ node: select$3(),
1022
1022
  variables: {},
1023
1023
  });
1024
1024
  if (process.env.NODE_ENV !== 'production') {
@@ -1029,7 +1029,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
1029
1029
  deepFreeze(snapshot.data);
1030
1030
  return snapshot;
1031
1031
  }
1032
- function createResourceRequest$3(config) {
1032
+ function createResourceRequest$5(config) {
1033
1033
  const headers = {};
1034
1034
  return {
1035
1035
  baseUri: '/services/data/v64.0',
@@ -1043,7 +1043,7 @@ function createResourceRequest$3(config) {
1043
1043
  };
1044
1044
  }
1045
1045
 
1046
- const adapterName$3 = 'createEngagementSignal';
1046
+ const adapterName$5 = 'createEngagementSignal';
1047
1047
  const createEngagementSignal_ConfigPropertyMetadata = [
1048
1048
  generateParamConfigMetadata('catalogIdField', false, 2 /* Body */, 4 /* Unsupported */),
1049
1049
  generateParamConfigMetadata('dataSpaceName', true, 2 /* Body */, 0 /* String */),
@@ -1059,11 +1059,11 @@ const createEngagementSignal_ConfigPropertyMetadata = [
1059
1059
  generateParamConfigMetadata('uniqueIdentifier', true, 2 /* Body */, 4 /* Unsupported */),
1060
1060
  generateParamConfigMetadata('userIdField', true, 2 /* Body */, 4 /* Unsupported */),
1061
1061
  ];
1062
- const createEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createEngagementSignal_ConfigPropertyMetadata);
1063
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(createEngagementSignal_ConfigPropertyMetadata);
1064
- function typeCheckConfig$3(untrustedConfig) {
1062
+ const createEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createEngagementSignal_ConfigPropertyMetadata);
1063
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(createEngagementSignal_ConfigPropertyMetadata);
1064
+ function typeCheckConfig$5(untrustedConfig) {
1065
1065
  const config = {};
1066
- typeCheckConfig$5(untrustedConfig, config, createEngagementSignal_ConfigPropertyMetadata);
1066
+ typeCheckConfig$7(untrustedConfig, config, createEngagementSignal_ConfigPropertyMetadata);
1067
1067
  const untrustedConfig_catalogIdField = untrustedConfig.catalogIdField;
1068
1068
  config.catalogIdField = untrustedConfig_catalogIdField;
1069
1069
  const untrustedConfig_distinctFields = untrustedConfig.distinctFields;
@@ -1110,30 +1110,30 @@ function typeCheckConfig$3(untrustedConfig) {
1110
1110
  config.userIdField = untrustedConfig_userIdField;
1111
1111
  return config;
1112
1112
  }
1113
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1113
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1114
1114
  if (!untrustedIsObject(untrustedConfig)) {
1115
1115
  return null;
1116
1116
  }
1117
1117
  if (process.env.NODE_ENV !== 'production') {
1118
1118
  validateConfig(untrustedConfig, configPropertyNames);
1119
1119
  }
1120
- const config = typeCheckConfig$3(untrustedConfig);
1120
+ const config = typeCheckConfig$5(untrustedConfig);
1121
1121
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1122
1122
  return null;
1123
1123
  }
1124
1124
  return config;
1125
1125
  }
1126
- function buildNetworkSnapshot$3(luvio, config, options) {
1127
- const resourceParams = createResourceParams$3(config);
1128
- const request = createResourceRequest$3(resourceParams);
1126
+ function buildNetworkSnapshot$5(luvio, config, options) {
1127
+ const resourceParams = createResourceParams$5(config);
1128
+ const request = createResourceRequest$5(resourceParams);
1129
1129
  return luvio.dispatchResourceRequest(request, options)
1130
1130
  .then((response) => {
1131
1131
  return luvio.handleSuccessResponse(() => {
1132
- const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1132
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1133
1133
  return luvio.storeBroadcast().then(() => snapshot);
1134
1134
  }, () => {
1135
1135
  const cache = new StoreKeyMap();
1136
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1136
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
1137
1137
  return cache;
1138
1138
  });
1139
1139
  }, (response) => {
@@ -1143,33 +1143,33 @@ function buildNetworkSnapshot$3(luvio, config, options) {
1143
1143
  }
1144
1144
  const createEngagementSignalAdapterFactory = (luvio) => {
1145
1145
  return function createEngagementSignal(untrustedConfig) {
1146
- const config = validateAdapterConfig$3(untrustedConfig, createEngagementSignal_ConfigPropertyNames);
1146
+ const config = validateAdapterConfig$5(untrustedConfig, createEngagementSignal_ConfigPropertyNames);
1147
1147
  // Invalid or incomplete config
1148
1148
  if (config === null) {
1149
1149
  throw new Error('Invalid config for "createEngagementSignal"');
1150
1150
  }
1151
- return buildNetworkSnapshot$3(luvio, config);
1151
+ return buildNetworkSnapshot$5(luvio, config);
1152
1152
  };
1153
1153
  };
1154
1154
 
1155
- function keyBuilder$2(luvio, params) {
1156
- return keyBuilder$3(luvio, {
1155
+ function keyBuilder$5(luvio, params) {
1156
+ return keyBuilder$6(luvio, {
1157
1157
  id: params.urlParams.engagementSignalId
1158
1158
  });
1159
1159
  }
1160
- function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
1161
- const key = keyBuilder$2(luvio, resourceParams);
1160
+ function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
1161
+ const key = keyBuilder$5(luvio, resourceParams);
1162
1162
  cacheKeyMap.set(key, {
1163
1163
  namespace: keyPrefix,
1164
1164
  representationName: RepresentationType,
1165
1165
  mergeable: false
1166
1166
  });
1167
1167
  }
1168
- function evictSuccess(luvio, resourceParams) {
1169
- const key = keyBuilder$2(luvio, resourceParams);
1168
+ function evictSuccess$1(luvio, resourceParams) {
1169
+ const key = keyBuilder$5(luvio, resourceParams);
1170
1170
  luvio.storeEvict(key);
1171
1171
  }
1172
- function createResourceRequest$2(config) {
1172
+ function createResourceRequest$4(config) {
1173
1173
  const headers = {};
1174
1174
  return {
1175
1175
  baseUri: '/services/data/v64.0',
@@ -1183,41 +1183,41 @@ function createResourceRequest$2(config) {
1183
1183
  };
1184
1184
  }
1185
1185
 
1186
- const adapterName$2 = 'deleteEngagementSignal';
1186
+ const adapterName$4 = 'deleteEngagementSignal';
1187
1187
  const deleteEngagementSignal_ConfigPropertyMetadata = [
1188
1188
  generateParamConfigMetadata('engagementSignalId', true, 0 /* UrlParameter */, 0 /* String */),
1189
1189
  ];
1190
- const deleteEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, deleteEngagementSignal_ConfigPropertyMetadata);
1191
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(deleteEngagementSignal_ConfigPropertyMetadata);
1192
- function typeCheckConfig$2(untrustedConfig) {
1190
+ const deleteEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deleteEngagementSignal_ConfigPropertyMetadata);
1191
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(deleteEngagementSignal_ConfigPropertyMetadata);
1192
+ function typeCheckConfig$4(untrustedConfig) {
1193
1193
  const config = {};
1194
- typeCheckConfig$5(untrustedConfig, config, deleteEngagementSignal_ConfigPropertyMetadata);
1194
+ typeCheckConfig$7(untrustedConfig, config, deleteEngagementSignal_ConfigPropertyMetadata);
1195
1195
  return config;
1196
1196
  }
1197
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1197
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1198
1198
  if (!untrustedIsObject(untrustedConfig)) {
1199
1199
  return null;
1200
1200
  }
1201
1201
  if (process.env.NODE_ENV !== 'production') {
1202
1202
  validateConfig(untrustedConfig, configPropertyNames);
1203
1203
  }
1204
- const config = typeCheckConfig$2(untrustedConfig);
1204
+ const config = typeCheckConfig$4(untrustedConfig);
1205
1205
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1206
1206
  return null;
1207
1207
  }
1208
1208
  return config;
1209
1209
  }
1210
- function buildNetworkSnapshot$2(luvio, config, options) {
1211
- const resourceParams = createResourceParams$2(config);
1212
- const request = createResourceRequest$2(resourceParams);
1210
+ function buildNetworkSnapshot$4(luvio, config, options) {
1211
+ const resourceParams = createResourceParams$4(config);
1212
+ const request = createResourceRequest$4(resourceParams);
1213
1213
  return luvio.dispatchResourceRequest(request, options)
1214
1214
  .then(() => {
1215
1215
  return luvio.handleSuccessResponse(() => {
1216
- evictSuccess(luvio, resourceParams);
1216
+ evictSuccess$1(luvio, resourceParams);
1217
1217
  return luvio.storeBroadcast();
1218
1218
  }, () => {
1219
1219
  const cache = new StoreKeyMap();
1220
- getResponseCacheKeys$2(cache, luvio, resourceParams);
1220
+ getResponseCacheKeys$4(cache, luvio, resourceParams);
1221
1221
  return cache;
1222
1222
  });
1223
1223
  }, (response) => {
@@ -1227,33 +1227,33 @@ function buildNetworkSnapshot$2(luvio, config, options) {
1227
1227
  }
1228
1228
  const deleteEngagementSignalAdapterFactory = (luvio) => {
1229
1229
  return function engmtConfigdeleteEngagementSignal(untrustedConfig) {
1230
- const config = validateAdapterConfig$2(untrustedConfig, deleteEngagementSignal_ConfigPropertyNames);
1230
+ const config = validateAdapterConfig$4(untrustedConfig, deleteEngagementSignal_ConfigPropertyNames);
1231
1231
  // Invalid or incomplete config
1232
1232
  if (config === null) {
1233
- throw new Error(`Invalid config for "${adapterName$2}"`);
1233
+ throw new Error(`Invalid config for "${adapterName$4}"`);
1234
1234
  }
1235
- return buildNetworkSnapshot$2(luvio, config);
1235
+ return buildNetworkSnapshot$4(luvio, config);
1236
1236
  };
1237
1237
  };
1238
1238
 
1239
- function select$1(luvio, params) {
1240
- return select$3();
1239
+ function select$2(luvio, params) {
1240
+ return select$4();
1241
1241
  }
1242
- function keyBuilder$1(luvio, params) {
1243
- return keyBuilder$3(luvio, {
1242
+ function keyBuilder$4(luvio, params) {
1243
+ return keyBuilder$6(luvio, {
1244
1244
  id: params.urlParams.engagementSignalId
1245
1245
  });
1246
1246
  }
1247
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1247
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1248
1248
  getTypeCacheKeys(storeKeyMap, luvio, response);
1249
1249
  }
1250
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1250
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1251
1251
  const { body } = response;
1252
- const key = keyBuilder$1(luvio, resourceParams);
1252
+ const key = keyBuilder$4(luvio, resourceParams);
1253
1253
  luvio.storeIngest(key, ingest, body);
1254
1254
  const snapshot = luvio.storeLookup({
1255
1255
  recordId: key,
1256
- node: select$1(),
1256
+ node: select$2(),
1257
1257
  variables: {},
1258
1258
  }, snapshotRefresh);
1259
1259
  if (process.env.NODE_ENV !== 'production') {
@@ -1264,8 +1264,8 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1264
1264
  deepFreeze(snapshot.data);
1265
1265
  return snapshot;
1266
1266
  }
1267
- function ingestError(luvio, params, error, snapshotRefresh) {
1268
- const key = keyBuilder$1(luvio, params);
1267
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1268
+ const key = keyBuilder$4(luvio, params);
1269
1269
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1270
1270
  const storeMetadataParams = {
1271
1271
  ttl: TTL,
@@ -1276,7 +1276,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
1276
1276
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1277
1277
  return errorSnapshot;
1278
1278
  }
1279
- function createResourceRequest$1(config) {
1279
+ function createResourceRequest$3(config) {
1280
1280
  const headers = {};
1281
1281
  return {
1282
1282
  baseUri: '/services/data/v64.0',
@@ -1290,105 +1290,105 @@ function createResourceRequest$1(config) {
1290
1290
  };
1291
1291
  }
1292
1292
 
1293
- const adapterName$1 = 'getEngagementSignal';
1293
+ const adapterName$3 = 'getEngagementSignal';
1294
1294
  const getEngagementSignal_ConfigPropertyMetadata = [
1295
1295
  generateParamConfigMetadata('engagementSignalId', true, 0 /* UrlParameter */, 0 /* String */),
1296
1296
  ];
1297
- const getEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getEngagementSignal_ConfigPropertyMetadata);
1298
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getEngagementSignal_ConfigPropertyMetadata);
1299
- function keyBuilder(luvio, config) {
1300
- const resourceParams = createResourceParams$1(config);
1301
- return keyBuilder$1(luvio, resourceParams);
1297
+ const getEngagementSignal_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getEngagementSignal_ConfigPropertyMetadata);
1298
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getEngagementSignal_ConfigPropertyMetadata);
1299
+ function keyBuilder$3(luvio, config) {
1300
+ const resourceParams = createResourceParams$3(config);
1301
+ return keyBuilder$4(luvio, resourceParams);
1302
1302
  }
1303
- function typeCheckConfig$1(untrustedConfig) {
1303
+ function typeCheckConfig$3(untrustedConfig) {
1304
1304
  const config = {};
1305
- typeCheckConfig$5(untrustedConfig, config, getEngagementSignal_ConfigPropertyMetadata);
1305
+ typeCheckConfig$7(untrustedConfig, config, getEngagementSignal_ConfigPropertyMetadata);
1306
1306
  return config;
1307
1307
  }
1308
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1308
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1309
1309
  if (!untrustedIsObject(untrustedConfig)) {
1310
1310
  return null;
1311
1311
  }
1312
1312
  if (process.env.NODE_ENV !== 'production') {
1313
1313
  validateConfig(untrustedConfig, configPropertyNames);
1314
1314
  }
1315
- const config = typeCheckConfig$1(untrustedConfig);
1315
+ const config = typeCheckConfig$3(untrustedConfig);
1316
1316
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1317
1317
  return null;
1318
1318
  }
1319
1319
  return config;
1320
1320
  }
1321
- function adapterFragment(luvio, config) {
1322
- createResourceParams$1(config);
1323
- return select$1();
1321
+ function adapterFragment$1(luvio, config) {
1322
+ createResourceParams$3(config);
1323
+ return select$2();
1324
1324
  }
1325
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1326
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1325
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1326
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1327
1327
  config,
1328
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1328
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1329
1329
  });
1330
1330
  return luvio.storeBroadcast().then(() => snapshot);
1331
1331
  }
1332
- function onFetchResponseError(luvio, config, resourceParams, response) {
1333
- const snapshot = ingestError(luvio, resourceParams, response, {
1332
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1333
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1334
1334
  config,
1335
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1335
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1336
1336
  });
1337
1337
  return luvio.storeBroadcast().then(() => snapshot);
1338
1338
  }
1339
- function buildNetworkSnapshot$1(luvio, config, options) {
1340
- const resourceParams = createResourceParams$1(config);
1341
- const request = createResourceRequest$1(resourceParams);
1339
+ function buildNetworkSnapshot$3(luvio, config, options) {
1340
+ const resourceParams = createResourceParams$3(config);
1341
+ const request = createResourceRequest$3(resourceParams);
1342
1342
  return luvio.dispatchResourceRequest(request, options)
1343
1343
  .then((response) => {
1344
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1344
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1345
1345
  const cache = new StoreKeyMap();
1346
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1346
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1347
1347
  return cache;
1348
1348
  });
1349
1349
  }, (response) => {
1350
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1350
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1351
1351
  });
1352
1352
  }
1353
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1354
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1353
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1354
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
1355
1355
  }
1356
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
1356
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1357
1357
  const { luvio, config } = context;
1358
1358
  const selector = {
1359
- recordId: keyBuilder(luvio, config),
1360
- node: adapterFragment(luvio, config),
1359
+ recordId: keyBuilder$3(luvio, config),
1360
+ node: adapterFragment$1(luvio, config),
1361
1361
  variables: {},
1362
1362
  };
1363
1363
  const cacheSnapshot = storeLookup(selector, {
1364
1364
  config,
1365
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1365
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1366
1366
  });
1367
1367
  return cacheSnapshot;
1368
1368
  }
1369
1369
  const getEngagementSignalAdapterFactory = (luvio) => function engmtConfig__getEngagementSignal(untrustedConfig, requestContext) {
1370
- const config = validateAdapterConfig$1(untrustedConfig, getEngagementSignal_ConfigPropertyNames);
1370
+ const config = validateAdapterConfig$3(untrustedConfig, getEngagementSignal_ConfigPropertyNames);
1371
1371
  // Invalid or incomplete config
1372
1372
  if (config === null) {
1373
1373
  return null;
1374
1374
  }
1375
1375
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1376
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1376
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1377
1377
  };
1378
1378
 
1379
- function select(luvio, params) {
1380
- return select$4();
1379
+ function select$1(luvio, params) {
1380
+ return select$5();
1381
1381
  }
1382
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1382
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1383
1383
  getTypeCacheKeys$1(storeKeyMap, luvio, response);
1384
1384
  }
1385
- function ingestSuccess(luvio, resourceParams, response) {
1385
+ function ingestSuccess$1(luvio, resourceParams, response) {
1386
1386
  const { body } = response;
1387
1387
  const key = keyBuilderFromType$1(luvio, body);
1388
1388
  luvio.storeIngest(key, ingest$1, body);
1389
1389
  const snapshot = luvio.storeLookup({
1390
1390
  recordId: key,
1391
- node: select(),
1391
+ node: select$1(),
1392
1392
  variables: {},
1393
1393
  });
1394
1394
  if (process.env.NODE_ENV !== 'production') {
@@ -1399,7 +1399,7 @@ function ingestSuccess(luvio, resourceParams, response) {
1399
1399
  deepFreeze(snapshot.data);
1400
1400
  return snapshot;
1401
1401
  }
1402
- function createResourceRequest(config) {
1402
+ function createResourceRequest$2(config) {
1403
1403
  const headers = {};
1404
1404
  return {
1405
1405
  baseUri: '/services/data/v64.0',
@@ -1413,7 +1413,7 @@ function createResourceRequest(config) {
1413
1413
  };
1414
1414
  }
1415
1415
 
1416
- const adapterName = 'createEngagementSignalMetric';
1416
+ const adapterName$2 = 'createEngagementSignalMetric';
1417
1417
  const createEngagementSignalMetric_ConfigPropertyMetadata = [
1418
1418
  generateParamConfigMetadata('engagementSignalId', true, 0 /* UrlParameter */, 0 /* String */),
1419
1419
  generateParamConfigMetadata('aggregateFunction', true, 2 /* Body */, 0 /* String */),
@@ -1422,39 +1422,39 @@ const createEngagementSignalMetric_ConfigPropertyMetadata = [
1422
1422
  generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1423
1423
  generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
1424
1424
  ];
1425
- const createEngagementSignalMetric_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createEngagementSignalMetric_ConfigPropertyMetadata);
1426
- const createResourceParams = /*#__PURE__*/ createResourceParams$5(createEngagementSignalMetric_ConfigPropertyMetadata);
1427
- function typeCheckConfig(untrustedConfig) {
1425
+ const createEngagementSignalMetric_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createEngagementSignalMetric_ConfigPropertyMetadata);
1426
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(createEngagementSignalMetric_ConfigPropertyMetadata);
1427
+ function typeCheckConfig$2(untrustedConfig) {
1428
1428
  const config = {};
1429
- typeCheckConfig$5(untrustedConfig, config, createEngagementSignalMetric_ConfigPropertyMetadata);
1429
+ typeCheckConfig$7(untrustedConfig, config, createEngagementSignalMetric_ConfigPropertyMetadata);
1430
1430
  const untrustedConfig_field = untrustedConfig.field;
1431
1431
  config.field = untrustedConfig_field;
1432
1432
  return config;
1433
1433
  }
1434
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1434
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1435
1435
  if (!untrustedIsObject(untrustedConfig)) {
1436
1436
  return null;
1437
1437
  }
1438
1438
  if (process.env.NODE_ENV !== 'production') {
1439
1439
  validateConfig(untrustedConfig, configPropertyNames);
1440
1440
  }
1441
- const config = typeCheckConfig(untrustedConfig);
1441
+ const config = typeCheckConfig$2(untrustedConfig);
1442
1442
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1443
1443
  return null;
1444
1444
  }
1445
1445
  return config;
1446
1446
  }
1447
- function buildNetworkSnapshot(luvio, config, options) {
1448
- const resourceParams = createResourceParams(config);
1449
- const request = createResourceRequest(resourceParams);
1447
+ function buildNetworkSnapshot$2(luvio, config, options) {
1448
+ const resourceParams = createResourceParams$2(config);
1449
+ const request = createResourceRequest$2(resourceParams);
1450
1450
  return luvio.dispatchResourceRequest(request, options)
1451
1451
  .then((response) => {
1452
1452
  return luvio.handleSuccessResponse(() => {
1453
- const snapshot = ingestSuccess(luvio, resourceParams, response);
1453
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1454
1454
  return luvio.storeBroadcast().then(() => snapshot);
1455
1455
  }, () => {
1456
1456
  const cache = new StoreKeyMap();
1457
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1457
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1458
1458
  return cache;
1459
1459
  });
1460
1460
  }, (response) => {
@@ -1464,13 +1464,239 @@ function buildNetworkSnapshot(luvio, config, options) {
1464
1464
  }
1465
1465
  const createEngagementSignalMetricAdapterFactory = (luvio) => {
1466
1466
  return function createEngagementSignalMetric(untrustedConfig) {
1467
- const config = validateAdapterConfig(untrustedConfig, createEngagementSignalMetric_ConfigPropertyNames);
1467
+ const config = validateAdapterConfig$2(untrustedConfig, createEngagementSignalMetric_ConfigPropertyNames);
1468
1468
  // Invalid or incomplete config
1469
1469
  if (config === null) {
1470
1470
  throw new Error('Invalid config for "createEngagementSignalMetric"');
1471
1471
  }
1472
- return buildNetworkSnapshot(luvio, config);
1472
+ return buildNetworkSnapshot$2(luvio, config);
1473
+ };
1474
+ };
1475
+
1476
+ function keyBuilder$2(luvio, params) {
1477
+ return keyBuilder$7(luvio, {
1478
+ id: params.urlParams.engagementSignalMetricId
1479
+ });
1480
+ }
1481
+ function getResponseCacheKeys$1(cacheKeyMap, luvio, resourceParams) {
1482
+ const key = keyBuilder$2(luvio, resourceParams);
1483
+ cacheKeyMap.set(key, {
1484
+ namespace: keyPrefix,
1485
+ representationName: RepresentationType$1,
1486
+ mergeable: false
1487
+ });
1488
+ }
1489
+ function evictSuccess(luvio, resourceParams) {
1490
+ const key = keyBuilder$2(luvio, resourceParams);
1491
+ luvio.storeEvict(key);
1492
+ }
1493
+ function createResourceRequest$1(config) {
1494
+ const headers = {};
1495
+ return {
1496
+ baseUri: '/services/data/v64.0',
1497
+ basePath: '/personalization/engagement-signals/' + config.urlParams.engagementSignalId + '/metrics/' + config.urlParams.engagementSignalMetricId + '',
1498
+ method: 'delete',
1499
+ body: null,
1500
+ urlParams: config.urlParams,
1501
+ queryParams: {},
1502
+ headers,
1503
+ priority: 'normal',
1504
+ };
1505
+ }
1506
+
1507
+ const adapterName$1 = 'deleteEngagementSignalMetric';
1508
+ const deleteEngagementSignalMetric_ConfigPropertyMetadata = [
1509
+ generateParamConfigMetadata('engagementSignalId', true, 0 /* UrlParameter */, 0 /* String */),
1510
+ generateParamConfigMetadata('engagementSignalMetricId', true, 0 /* UrlParameter */, 0 /* String */),
1511
+ ];
1512
+ const deleteEngagementSignalMetric_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, deleteEngagementSignalMetric_ConfigPropertyMetadata);
1513
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(deleteEngagementSignalMetric_ConfigPropertyMetadata);
1514
+ function typeCheckConfig$1(untrustedConfig) {
1515
+ const config = {};
1516
+ typeCheckConfig$7(untrustedConfig, config, deleteEngagementSignalMetric_ConfigPropertyMetadata);
1517
+ return config;
1518
+ }
1519
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1520
+ if (!untrustedIsObject(untrustedConfig)) {
1521
+ return null;
1522
+ }
1523
+ if (process.env.NODE_ENV !== 'production') {
1524
+ validateConfig(untrustedConfig, configPropertyNames);
1525
+ }
1526
+ const config = typeCheckConfig$1(untrustedConfig);
1527
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1528
+ return null;
1529
+ }
1530
+ return config;
1531
+ }
1532
+ function buildNetworkSnapshot$1(luvio, config, options) {
1533
+ const resourceParams = createResourceParams$1(config);
1534
+ const request = createResourceRequest$1(resourceParams);
1535
+ return luvio.dispatchResourceRequest(request, options)
1536
+ .then(() => {
1537
+ return luvio.handleSuccessResponse(() => {
1538
+ evictSuccess(luvio, resourceParams);
1539
+ return luvio.storeBroadcast();
1540
+ }, () => {
1541
+ const cache = new StoreKeyMap();
1542
+ getResponseCacheKeys$1(cache, luvio, resourceParams);
1543
+ return cache;
1544
+ });
1545
+ }, (response) => {
1546
+ deepFreeze(response);
1547
+ throw response;
1548
+ });
1549
+ }
1550
+ const deleteEngagementSignalMetricAdapterFactory = (luvio) => {
1551
+ return function engmtConfigdeleteEngagementSignalMetric(untrustedConfig) {
1552
+ const config = validateAdapterConfig$1(untrustedConfig, deleteEngagementSignalMetric_ConfigPropertyNames);
1553
+ // Invalid or incomplete config
1554
+ if (config === null) {
1555
+ throw new Error(`Invalid config for "${adapterName$1}"`);
1556
+ }
1557
+ return buildNetworkSnapshot$1(luvio, config);
1558
+ };
1559
+ };
1560
+
1561
+ function select(luvio, params) {
1562
+ return select$5();
1563
+ }
1564
+ function keyBuilder$1(luvio, params) {
1565
+ return keyBuilder$7(luvio, {
1566
+ id: params.urlParams.engagementSignalMetricId
1567
+ });
1568
+ }
1569
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1570
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
1571
+ }
1572
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1573
+ const { body } = response;
1574
+ const key = keyBuilder$1(luvio, resourceParams);
1575
+ luvio.storeIngest(key, ingest$1, body);
1576
+ const snapshot = luvio.storeLookup({
1577
+ recordId: key,
1578
+ node: select(),
1579
+ variables: {},
1580
+ }, snapshotRefresh);
1581
+ if (process.env.NODE_ENV !== 'production') {
1582
+ if (snapshot.state !== 'Fulfilled') {
1583
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1584
+ }
1585
+ }
1586
+ deepFreeze(snapshot.data);
1587
+ return snapshot;
1588
+ }
1589
+ function ingestError(luvio, params, error, snapshotRefresh) {
1590
+ const key = keyBuilder$1(luvio, params);
1591
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1592
+ const storeMetadataParams = {
1593
+ ttl: TTL$1,
1594
+ namespace: keyPrefix,
1595
+ version: VERSION$1,
1596
+ representationName: RepresentationType$1
1597
+ };
1598
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1599
+ return errorSnapshot;
1600
+ }
1601
+ function createResourceRequest(config) {
1602
+ const headers = {};
1603
+ return {
1604
+ baseUri: '/services/data/v64.0',
1605
+ basePath: '/personalization/engagement-signals/' + config.urlParams.engagementSignalId + '/metrics/' + config.urlParams.engagementSignalMetricId + '',
1606
+ method: 'get',
1607
+ body: null,
1608
+ urlParams: config.urlParams,
1609
+ queryParams: {},
1610
+ headers,
1611
+ priority: 'normal',
1473
1612
  };
1613
+ }
1614
+
1615
+ const adapterName = 'getEngagementSignalMetric';
1616
+ const getEngagementSignalMetric_ConfigPropertyMetadata = [
1617
+ generateParamConfigMetadata('engagementSignalId', true, 0 /* UrlParameter */, 0 /* String */),
1618
+ generateParamConfigMetadata('engagementSignalMetricId', true, 0 /* UrlParameter */, 0 /* String */),
1619
+ ];
1620
+ const getEngagementSignalMetric_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getEngagementSignalMetric_ConfigPropertyMetadata);
1621
+ const createResourceParams = /*#__PURE__*/ createResourceParams$7(getEngagementSignalMetric_ConfigPropertyMetadata);
1622
+ function keyBuilder(luvio, config) {
1623
+ const resourceParams = createResourceParams(config);
1624
+ return keyBuilder$1(luvio, resourceParams);
1625
+ }
1626
+ function typeCheckConfig(untrustedConfig) {
1627
+ const config = {};
1628
+ typeCheckConfig$7(untrustedConfig, config, getEngagementSignalMetric_ConfigPropertyMetadata);
1629
+ return config;
1630
+ }
1631
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1632
+ if (!untrustedIsObject(untrustedConfig)) {
1633
+ return null;
1634
+ }
1635
+ if (process.env.NODE_ENV !== 'production') {
1636
+ validateConfig(untrustedConfig, configPropertyNames);
1637
+ }
1638
+ const config = typeCheckConfig(untrustedConfig);
1639
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1640
+ return null;
1641
+ }
1642
+ return config;
1643
+ }
1644
+ function adapterFragment(luvio, config) {
1645
+ createResourceParams(config);
1646
+ return select();
1647
+ }
1648
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1649
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1650
+ config,
1651
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1652
+ });
1653
+ return luvio.storeBroadcast().then(() => snapshot);
1654
+ }
1655
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1656
+ const snapshot = ingestError(luvio, resourceParams, response, {
1657
+ config,
1658
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1659
+ });
1660
+ return luvio.storeBroadcast().then(() => snapshot);
1661
+ }
1662
+ function buildNetworkSnapshot(luvio, config, options) {
1663
+ const resourceParams = createResourceParams(config);
1664
+ const request = createResourceRequest(resourceParams);
1665
+ return luvio.dispatchResourceRequest(request, options)
1666
+ .then((response) => {
1667
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1668
+ const cache = new StoreKeyMap();
1669
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1670
+ return cache;
1671
+ });
1672
+ }, (response) => {
1673
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1674
+ });
1675
+ }
1676
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1677
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1678
+ }
1679
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1680
+ const { luvio, config } = context;
1681
+ const selector = {
1682
+ recordId: keyBuilder(luvio, config),
1683
+ node: adapterFragment(luvio, config),
1684
+ variables: {},
1685
+ };
1686
+ const cacheSnapshot = storeLookup(selector, {
1687
+ config,
1688
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1689
+ });
1690
+ return cacheSnapshot;
1691
+ }
1692
+ const getEngagementSignalMetricAdapterFactory = (luvio) => function engmtConfig__getEngagementSignalMetric(untrustedConfig, requestContext) {
1693
+ const config = validateAdapterConfig(untrustedConfig, getEngagementSignalMetric_ConfigPropertyNames);
1694
+ // Invalid or incomplete config
1695
+ if (config === null) {
1696
+ return null;
1697
+ }
1698
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1699
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1474
1700
  };
1475
1701
 
1476
- export { createEngagementSignalAdapterFactory, createEngagementSignalMetricAdapterFactory, deleteEngagementSignalAdapterFactory, getEngagementSignalAdapterFactory, getEngagementSignalsAdapterFactory };
1702
+ export { createEngagementSignalAdapterFactory, createEngagementSignalMetricAdapterFactory, deleteEngagementSignalAdapterFactory, deleteEngagementSignalMetricAdapterFactory, getEngagementSignalAdapterFactory, getEngagementSignalMetricAdapterFactory, getEngagementSignalsAdapterFactory };