@salesforce/lds-adapters-platform-enablement 1.245.0 → 1.246.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$3, typeCheckConfig as typeCheckConfig$5, StoreKeyMap, createResourceParams as createResourceParams$5 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$5, 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;
@@ -132,7 +132,7 @@ function validate$4(obj, path = 'EnablementProgramSummaryItemRepresentation') {
132
132
  })();
133
133
  return v_error === undefined ? null : v_error;
134
134
  }
135
- const select$9 = function EnablementProgramSummaryItemRepresentationSelect() {
135
+ const select$b = function EnablementProgramSummaryItemRepresentationSelect() {
136
136
  return {
137
137
  kind: 'Fragment',
138
138
  version: VERSION$4,
@@ -494,8 +494,8 @@ function validate$3(obj, path = 'EnablementProgramSummaryMilestoneRepresentation
494
494
  })();
495
495
  return v_error === undefined ? null : v_error;
496
496
  }
497
- const select$8 = function EnablementProgramSummaryMilestoneRepresentationSelect() {
498
- const { selections: EnablementProgramSummaryItemRepresentationSelections } = select$9();
497
+ const select$a = function EnablementProgramSummaryMilestoneRepresentationSelect() {
498
+ const { selections: EnablementProgramSummaryItemRepresentationSelections } = select$b();
499
499
  return {
500
500
  kind: 'Fragment',
501
501
  version: VERSION$3,
@@ -840,20 +840,20 @@ function validate$2(obj, path = 'EnablementProgramSummaryRepresentation') {
840
840
  return v_error === undefined ? null : v_error;
841
841
  }
842
842
  const RepresentationType$2 = 'EnablementProgramSummaryRepresentation';
843
- function keyBuilder$7(luvio, config) {
843
+ function keyBuilder$b(luvio, config) {
844
844
  return keyPrefix + '::' + RepresentationType$2 + ':' + (config.enablement_program_id === null ? '' : config.enablement_program_id);
845
845
  }
846
846
  function keyBuilderFromType$1(luvio, object) {
847
847
  const keyParams = {
848
848
  enablement_program_id: object.id
849
849
  };
850
- return keyBuilder$7(luvio, keyParams);
850
+ return keyBuilder$b(luvio, keyParams);
851
851
  }
852
852
  function normalize$2(input, existing, path, luvio, store, timestamp) {
853
853
  return input;
854
854
  }
855
- const select$7 = function EnablementProgramSummaryRepresentationSelect() {
856
- const { selections: EnablementProgramSummaryMilestoneRepresentation__selections, opaque: EnablementProgramSummaryMilestoneRepresentation__opaque, } = select$8();
855
+ const select$9 = function EnablementProgramSummaryRepresentationSelect() {
856
+ const { selections: EnablementProgramSummaryMilestoneRepresentation__selections, opaque: EnablementProgramSummaryMilestoneRepresentation__opaque, } = select$a();
857
857
  return {
858
858
  kind: 'Fragment',
859
859
  version: VERSION$2,
@@ -1043,7 +1043,7 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
1043
1043
  }
1044
1044
  return input;
1045
1045
  }
1046
- const select$6 = function EnablementProgramSummaryListRepresentationSelect() {
1046
+ const select$8 = function EnablementProgramSummaryListRepresentationSelect() {
1047
1047
  return {
1048
1048
  kind: 'Fragment',
1049
1049
  version: VERSION$1,
@@ -1057,7 +1057,7 @@ const select$6 = function EnablementProgramSummaryListRepresentationSelect() {
1057
1057
  name: 'programSummaryList',
1058
1058
  kind: 'Link',
1059
1059
  plural: true,
1060
- fragment: select$7()
1060
+ fragment: select$9()
1061
1061
  }
1062
1062
  ]
1063
1063
  };
@@ -1106,22 +1106,22 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1106
1106
  }
1107
1107
  }
1108
1108
 
1109
- function select$5(luvio, params) {
1110
- return select$6();
1109
+ function select$7(luvio, params) {
1110
+ return select$8();
1111
1111
  }
1112
- function keyBuilder$6(luvio, params) {
1112
+ function keyBuilder$a(luvio, params) {
1113
1113
  return keyPrefix + '::EnablementProgramSummaryListRepresentation:(' + 'filter:' + params.queryParams.filter + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'communityId:' + params.urlParams.communityId + ')';
1114
1114
  }
1115
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1116
- getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
1115
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
1116
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
1117
1117
  }
1118
- function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1118
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
1119
1119
  const { body } = response;
1120
- const key = keyBuilder$6(luvio, resourceParams);
1120
+ const key = keyBuilder$a(luvio, resourceParams);
1121
1121
  luvio.storeIngest(key, ingest$1, body);
1122
1122
  const snapshot = luvio.storeLookup({
1123
1123
  recordId: key,
1124
- node: select$5(),
1124
+ node: select$7(),
1125
1125
  variables: {},
1126
1126
  }, snapshotRefresh);
1127
1127
  if (process.env.NODE_ENV !== 'production') {
@@ -1132,13 +1132,13 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1132
1132
  deepFreeze(snapshot.data);
1133
1133
  return snapshot;
1134
1134
  }
1135
- function ingestError$2(luvio, params, error, snapshotRefresh) {
1136
- const key = keyBuilder$6(luvio, params);
1135
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
1136
+ const key = keyBuilder$a(luvio, params);
1137
1137
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1138
1138
  luvio.storeIngestError(key, errorSnapshot);
1139
1139
  return errorSnapshot;
1140
1140
  }
1141
- function createResourceRequest$4(config) {
1141
+ function createResourceRequest$6(config) {
1142
1142
  const headers = {};
1143
1143
  return {
1144
1144
  baseUri: '/services/data/v60.0',
@@ -1152,181 +1152,113 @@ function createResourceRequest$4(config) {
1152
1152
  };
1153
1153
  }
1154
1154
 
1155
- const adapterName$4 = 'getAssignedEnablementProgramSummaryForCommunity';
1155
+ const adapterName$6 = 'getAssignedEnablementProgramSummaryForCommunity';
1156
1156
  const getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata = [
1157
1157
  generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
1158
1158
  generateParamConfigMetadata('filter', false, 1 /* QueryParameter */, 0 /* String */),
1159
1159
  generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
1160
1160
  generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
1161
1161
  ];
1162
- const getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1163
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1164
- function keyBuilder$5(luvio, config) {
1165
- const resourceParams = createResourceParams$4(config);
1166
- return keyBuilder$6(luvio, resourceParams);
1162
+ const getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1163
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1164
+ function keyBuilder$9(luvio, config) {
1165
+ const resourceParams = createResourceParams$6(config);
1166
+ return keyBuilder$a(luvio, resourceParams);
1167
1167
  }
1168
- function typeCheckConfig$4(untrustedConfig) {
1168
+ function typeCheckConfig$6(untrustedConfig) {
1169
1169
  const config = {};
1170
- typeCheckConfig$5(untrustedConfig, config, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1170
+ typeCheckConfig$7(untrustedConfig, config, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyMetadata);
1171
1171
  return config;
1172
1172
  }
1173
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1173
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
1174
1174
  if (!untrustedIsObject(untrustedConfig)) {
1175
1175
  return null;
1176
1176
  }
1177
1177
  if (process.env.NODE_ENV !== 'production') {
1178
1178
  validateConfig(untrustedConfig, configPropertyNames);
1179
1179
  }
1180
- const config = typeCheckConfig$4(untrustedConfig);
1180
+ const config = typeCheckConfig$6(untrustedConfig);
1181
1181
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1182
1182
  return null;
1183
1183
  }
1184
1184
  return config;
1185
1185
  }
1186
- function adapterFragment$2(luvio, config) {
1187
- createResourceParams$4(config);
1188
- return select$5();
1186
+ function adapterFragment$4(luvio, config) {
1187
+ createResourceParams$6(config);
1188
+ return select$7();
1189
1189
  }
1190
- function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1191
- const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
1190
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
1191
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
1192
1192
  config,
1193
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1193
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1194
1194
  });
1195
1195
  return luvio.storeBroadcast().then(() => snapshot);
1196
1196
  }
1197
- function onFetchResponseError$2(luvio, config, resourceParams, response) {
1198
- const snapshot = ingestError$2(luvio, resourceParams, response, {
1197
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
1198
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
1199
1199
  config,
1200
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1200
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1201
1201
  });
1202
1202
  return luvio.storeBroadcast().then(() => snapshot);
1203
1203
  }
1204
- function buildNetworkSnapshot$4(luvio, config, options) {
1205
- const resourceParams = createResourceParams$4(config);
1206
- const request = createResourceRequest$4(resourceParams);
1204
+ function buildNetworkSnapshot$6(luvio, config, options) {
1205
+ const resourceParams = createResourceParams$6(config);
1206
+ const request = createResourceRequest$6(resourceParams);
1207
1207
  return luvio.dispatchResourceRequest(request, options)
1208
1208
  .then((response) => {
1209
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
1209
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
1210
1210
  const cache = new StoreKeyMap();
1211
- getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1211
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
1212
1212
  return cache;
1213
1213
  });
1214
1214
  }, (response) => {
1215
- return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1215
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
1216
1216
  });
1217
1217
  }
1218
- function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1219
- return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
1218
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
1219
+ return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
1220
1220
  }
1221
- function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1221
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
1222
1222
  const { luvio, config } = context;
1223
1223
  const selector = {
1224
- recordId: keyBuilder$5(luvio, config),
1225
- node: adapterFragment$2(luvio, config),
1224
+ recordId: keyBuilder$9(luvio, config),
1225
+ node: adapterFragment$4(luvio, config),
1226
1226
  variables: {},
1227
1227
  };
1228
1228
  const cacheSnapshot = storeLookup(selector, {
1229
1229
  config,
1230
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1230
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1231
1231
  });
1232
1232
  return cacheSnapshot;
1233
1233
  }
1234
1234
  const getAssignedEnablementProgramSummaryForCommunityAdapterFactory = (luvio) => function enablement__getAssignedEnablementProgramSummaryForCommunity(untrustedConfig, requestContext) {
1235
- const config = validateAdapterConfig$4(untrustedConfig, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyNames);
1235
+ const config = validateAdapterConfig$6(untrustedConfig, getAssignedEnablementProgramSummaryForCommunity_ConfigPropertyNames);
1236
1236
  // Invalid or incomplete config
1237
1237
  if (config === null) {
1238
1238
  return null;
1239
1239
  }
1240
1240
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1241
- buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1241
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
1242
1242
  };
1243
1243
 
1244
- const TTL = 15000;
1245
- const VERSION = "f87a4ca2a25d6b000ce11b00273a58f4";
1246
- function validate(obj, path = 'EnablementProgramSelfEnrollmentRepresentation') {
1247
- const v_error = (() => {
1248
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1249
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1250
- }
1251
- const obj_learningItemAssignmentId = obj.learningItemAssignmentId;
1252
- const path_learningItemAssignmentId = path + '.learningItemAssignmentId';
1253
- if (typeof obj_learningItemAssignmentId !== 'string') {
1254
- return new TypeError('Expected "string" but received "' + typeof obj_learningItemAssignmentId + '" (at "' + path_learningItemAssignmentId + '")');
1255
- }
1256
- })();
1257
- return v_error === undefined ? null : v_error;
1258
- }
1259
- const RepresentationType = 'EnablementProgramSelfEnrollmentRepresentation';
1260
- function keyBuilder$4(luvio, config) {
1261
- return keyPrefix + '::' + RepresentationType + ':' + config.learning_item_assignment_id;
1262
- }
1263
- function keyBuilderFromType(luvio, object) {
1264
- const keyParams = {
1265
- learning_item_assignment_id: object.learningItemAssignmentId
1266
- };
1267
- return keyBuilder$4(luvio, keyParams);
1268
- }
1269
- function normalize(input, existing, path, luvio, store, timestamp) {
1270
- return input;
1271
- }
1272
- const select$4 = function EnablementProgramSelfEnrollmentRepresentationSelect() {
1273
- return {
1274
- kind: 'Fragment',
1275
- version: VERSION,
1276
- private: [],
1277
- selections: [
1278
- {
1279
- name: 'learningItemAssignmentId',
1280
- kind: 'Scalar'
1281
- }
1282
- ]
1283
- };
1284
- };
1285
- function equals(existing, incoming) {
1286
- const existing_learningItemAssignmentId = existing.learningItemAssignmentId;
1287
- const incoming_learningItemAssignmentId = incoming.learningItemAssignmentId;
1288
- if (!(existing_learningItemAssignmentId === incoming_learningItemAssignmentId)) {
1289
- return false;
1290
- }
1291
- return true;
1292
- }
1293
- const ingest = function EnablementProgramSelfEnrollmentRepresentationIngest(input, path, luvio, store, timestamp) {
1294
- if (process.env.NODE_ENV !== 'production') {
1295
- const validateError = validate(input);
1296
- if (validateError !== null) {
1297
- throw validateError;
1298
- }
1299
- }
1300
- const key = keyBuilderFromType(luvio, input);
1301
- const ttlToUse = TTL;
1302
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "enablement", VERSION, RepresentationType, equals);
1303
- return createLink(key);
1304
- };
1305
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1306
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1307
- const rootKey = keyBuilderFromType(luvio, input);
1308
- rootKeySet.set(rootKey, {
1309
- namespace: keyPrefix,
1310
- representationName: RepresentationType,
1311
- mergeable: false
1312
- });
1244
+ function select$6(luvio, params) {
1245
+ return select$8();
1313
1246
  }
1314
-
1315
- function select$3(luvio, params) {
1316
- return select$4();
1247
+ function keyBuilder$8(luvio, params) {
1248
+ return keyPrefix + '::EnablementProgramSummaryListRepresentation:(' + 'filter:' + params.queryParams.filter + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'communityId:' + params.urlParams.communityId + ')';
1317
1249
  }
1318
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1319
- getTypeCacheKeys(storeKeyMap, luvio, response);
1250
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
1251
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
1320
1252
  }
1321
- function ingestSuccess$3(luvio, resourceParams, response) {
1253
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
1322
1254
  const { body } = response;
1323
- const key = keyBuilderFromType(luvio, body);
1324
- luvio.storeIngest(key, ingest, body);
1255
+ const key = keyBuilder$8(luvio, resourceParams);
1256
+ luvio.storeIngest(key, ingest$1, body);
1325
1257
  const snapshot = luvio.storeLookup({
1326
1258
  recordId: key,
1327
- node: select$3(),
1259
+ node: select$6(),
1328
1260
  variables: {},
1329
- });
1261
+ }, snapshotRefresh);
1330
1262
  if (process.env.NODE_ENV !== 'production') {
1331
1263
  if (snapshot.state !== 'Fulfilled') {
1332
1264
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -1335,88 +1267,133 @@ function ingestSuccess$3(luvio, resourceParams, response) {
1335
1267
  deepFreeze(snapshot.data);
1336
1268
  return snapshot;
1337
1269
  }
1338
- function createResourceRequest$3(config) {
1270
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
1271
+ const key = keyBuilder$8(luvio, params);
1272
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1273
+ luvio.storeIngestError(key, errorSnapshot);
1274
+ return errorSnapshot;
1275
+ }
1276
+ function createResourceRequest$5(config) {
1339
1277
  const headers = {};
1340
1278
  return {
1341
1279
  baseUri: '/services/data/v60.0',
1342
- basePath: '/connect/enablement/program/actions/enroll/' + config.urlParams.enablementProgramId + '',
1343
- method: 'post',
1280
+ basePath: '/connect/communities/' + config.urlParams.communityId + '/enablement/program/summary/collection',
1281
+ method: 'get',
1344
1282
  body: null,
1345
1283
  urlParams: config.urlParams,
1346
- queryParams: {},
1284
+ queryParams: config.queryParams,
1347
1285
  headers,
1348
1286
  priority: 'normal',
1349
1287
  };
1350
1288
  }
1351
1289
 
1352
- const adapterName$3 = 'selfEnrollInEnablementProgram';
1353
- const selfEnrollInEnablementProgram_ConfigPropertyMetadata = [
1354
- generateParamConfigMetadata('enablementProgramId', true, 0 /* UrlParameter */, 0 /* String */),
1290
+ const adapterName$5 = 'getProgramSummaryCollectionForCommunity';
1291
+ const getProgramSummaryCollectionForCommunity_ConfigPropertyMetadata = [
1292
+ generateParamConfigMetadata('communityId', true, 0 /* UrlParameter */, 0 /* String */),
1293
+ generateParamConfigMetadata('filter', false, 1 /* QueryParameter */, 0 /* String */),
1294
+ generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
1295
+ generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
1355
1296
  ];
1356
- const selfEnrollInEnablementProgram_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1357
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1358
- function typeCheckConfig$3(untrustedConfig) {
1297
+ const getProgramSummaryCollectionForCommunity_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getProgramSummaryCollectionForCommunity_ConfigPropertyMetadata);
1298
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getProgramSummaryCollectionForCommunity_ConfigPropertyMetadata);
1299
+ function keyBuilder$7(luvio, config) {
1300
+ const resourceParams = createResourceParams$5(config);
1301
+ return keyBuilder$8(luvio, resourceParams);
1302
+ }
1303
+ function typeCheckConfig$5(untrustedConfig) {
1359
1304
  const config = {};
1360
- typeCheckConfig$5(untrustedConfig, config, selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1305
+ typeCheckConfig$7(untrustedConfig, config, getProgramSummaryCollectionForCommunity_ConfigPropertyMetadata);
1361
1306
  return config;
1362
1307
  }
1363
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1308
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1364
1309
  if (!untrustedIsObject(untrustedConfig)) {
1365
1310
  return null;
1366
1311
  }
1367
1312
  if (process.env.NODE_ENV !== 'production') {
1368
1313
  validateConfig(untrustedConfig, configPropertyNames);
1369
1314
  }
1370
- const config = typeCheckConfig$3(untrustedConfig);
1315
+ const config = typeCheckConfig$5(untrustedConfig);
1371
1316
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1372
1317
  return null;
1373
1318
  }
1374
1319
  return config;
1375
1320
  }
1376
- function buildNetworkSnapshot$3(luvio, config, options) {
1377
- const resourceParams = createResourceParams$3(config);
1378
- const request = createResourceRequest$3(resourceParams);
1321
+ function adapterFragment$3(luvio, config) {
1322
+ createResourceParams$5(config);
1323
+ return select$6();
1324
+ }
1325
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
1326
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
1327
+ config,
1328
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1329
+ });
1330
+ return luvio.storeBroadcast().then(() => snapshot);
1331
+ }
1332
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
1333
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
1334
+ config,
1335
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1336
+ });
1337
+ return luvio.storeBroadcast().then(() => snapshot);
1338
+ }
1339
+ function buildNetworkSnapshot$5(luvio, config, options) {
1340
+ const resourceParams = createResourceParams$5(config);
1341
+ const request = createResourceRequest$5(resourceParams);
1379
1342
  return luvio.dispatchResourceRequest(request, options)
1380
1343
  .then((response) => {
1381
- return luvio.handleSuccessResponse(() => {
1382
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1383
- return luvio.storeBroadcast().then(() => snapshot);
1384
- }, () => {
1344
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
1385
1345
  const cache = new StoreKeyMap();
1386
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1346
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
1387
1347
  return cache;
1388
1348
  });
1389
1349
  }, (response) => {
1390
- deepFreeze(response);
1391
- throw response;
1350
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
1392
1351
  });
1393
1352
  }
1394
- const selfEnrollInEnablementProgramAdapterFactory = (luvio) => {
1395
- return function selfEnrollInEnablementProgram(untrustedConfig) {
1396
- const config = validateAdapterConfig$3(untrustedConfig, selfEnrollInEnablementProgram_ConfigPropertyNames);
1397
- // Invalid or incomplete config
1398
- if (config === null) {
1399
- throw new Error('Invalid config for "selfEnrollInEnablementProgram"');
1400
- }
1401
- return buildNetworkSnapshot$3(luvio, config);
1353
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
1354
+ return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
1355
+ }
1356
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
1357
+ const { luvio, config } = context;
1358
+ const selector = {
1359
+ recordId: keyBuilder$7(luvio, config),
1360
+ node: adapterFragment$3(luvio, config),
1361
+ variables: {},
1402
1362
  };
1363
+ const cacheSnapshot = storeLookup(selector, {
1364
+ config,
1365
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
1366
+ });
1367
+ return cacheSnapshot;
1368
+ }
1369
+ const getProgramSummaryCollectionForCommunityAdapterFactory = (luvio) => function enablement__getProgramSummaryCollectionForCommunity(untrustedConfig, requestContext) {
1370
+ const config = validateAdapterConfig$5(untrustedConfig, getProgramSummaryCollectionForCommunity_ConfigPropertyNames);
1371
+ // Invalid or incomplete config
1372
+ if (config === null) {
1373
+ return null;
1374
+ }
1375
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1376
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
1403
1377
  };
1404
1378
 
1405
- function select$2(luvio, params) {
1406
- return select$4();
1379
+ function select$5(luvio, params) {
1380
+ return select$8();
1407
1381
  }
1408
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1409
- getTypeCacheKeys(storeKeyMap, luvio, response);
1382
+ function keyBuilder$6(luvio, params) {
1383
+ return keyPrefix + '::EnablementProgramSummaryListRepresentation:(' + 'filter:' + params.queryParams.filter + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ')';
1384
+ }
1385
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1386
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
1410
1387
  }
1411
- function ingestSuccess$2(luvio, resourceParams, response) {
1388
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1412
1389
  const { body } = response;
1413
- const key = keyBuilderFromType(luvio, body);
1414
- luvio.storeIngest(key, ingest, body);
1390
+ const key = keyBuilder$6(luvio, resourceParams);
1391
+ luvio.storeIngest(key, ingest$1, body);
1415
1392
  const snapshot = luvio.storeLookup({
1416
1393
  recordId: key,
1417
- node: select$2(),
1394
+ node: select$5(),
1418
1395
  variables: {},
1419
- });
1396
+ }, snapshotRefresh);
1420
1397
  if (process.env.NODE_ENV !== 'production') {
1421
1398
  if (snapshot.state !== 'Fulfilled') {
1422
1399
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -1425,89 +1402,130 @@ function ingestSuccess$2(luvio, resourceParams, response) {
1425
1402
  deepFreeze(snapshot.data);
1426
1403
  return snapshot;
1427
1404
  }
1428
- function createResourceRequest$2(config) {
1405
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1406
+ const key = keyBuilder$6(luvio, params);
1407
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1408
+ luvio.storeIngestError(key, errorSnapshot);
1409
+ return errorSnapshot;
1410
+ }
1411
+ function createResourceRequest$4(config) {
1429
1412
  const headers = {};
1430
1413
  return {
1431
1414
  baseUri: '/services/data/v60.0',
1432
- basePath: '/connect/enablement/program/actions/unenroll/' + config.urlParams.enablementProgramId + '',
1433
- method: 'post',
1415
+ basePath: '/connect/enablement/program/summary/assigned',
1416
+ method: 'get',
1434
1417
  body: null,
1435
- urlParams: config.urlParams,
1436
- queryParams: {},
1418
+ urlParams: {},
1419
+ queryParams: config.queryParams,
1437
1420
  headers,
1438
1421
  priority: 'normal',
1439
1422
  };
1440
1423
  }
1441
1424
 
1442
- const adapterName$2 = 'unenrollFromEnablementProgram';
1443
- const unenrollFromEnablementProgram_ConfigPropertyMetadata = [
1444
- generateParamConfigMetadata('enablementProgramId', true, 0 /* UrlParameter */, 0 /* String */),
1425
+ const adapterName$4 = 'getAssignedEnablementProgramSummary';
1426
+ const getAssignedEnablementProgramSummary_ConfigPropertyMetadata = [
1427
+ generateParamConfigMetadata('filter', false, 1 /* QueryParameter */, 0 /* String */),
1428
+ generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
1429
+ generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
1445
1430
  ];
1446
- const unenrollFromEnablementProgram_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, unenrollFromEnablementProgram_ConfigPropertyMetadata);
1447
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(unenrollFromEnablementProgram_ConfigPropertyMetadata);
1448
- function typeCheckConfig$2(untrustedConfig) {
1431
+ const getAssignedEnablementProgramSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1432
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1433
+ function keyBuilder$5(luvio, config) {
1434
+ const resourceParams = createResourceParams$4(config);
1435
+ return keyBuilder$6(luvio, resourceParams);
1436
+ }
1437
+ function typeCheckConfig$4(untrustedConfig) {
1449
1438
  const config = {};
1450
- typeCheckConfig$5(untrustedConfig, config, unenrollFromEnablementProgram_ConfigPropertyMetadata);
1439
+ typeCheckConfig$7(untrustedConfig, config, getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1451
1440
  return config;
1452
1441
  }
1453
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1442
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1454
1443
  if (!untrustedIsObject(untrustedConfig)) {
1455
1444
  return null;
1456
1445
  }
1457
1446
  if (process.env.NODE_ENV !== 'production') {
1458
1447
  validateConfig(untrustedConfig, configPropertyNames);
1459
1448
  }
1460
- const config = typeCheckConfig$2(untrustedConfig);
1449
+ const config = typeCheckConfig$4(untrustedConfig);
1461
1450
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1462
1451
  return null;
1463
1452
  }
1464
1453
  return config;
1465
1454
  }
1466
- function buildNetworkSnapshot$2(luvio, config, options) {
1467
- const resourceParams = createResourceParams$2(config);
1468
- const request = createResourceRequest$2(resourceParams);
1455
+ function adapterFragment$2(luvio, config) {
1456
+ createResourceParams$4(config);
1457
+ return select$5();
1458
+ }
1459
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1460
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
1461
+ config,
1462
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1463
+ });
1464
+ return luvio.storeBroadcast().then(() => snapshot);
1465
+ }
1466
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1467
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1468
+ config,
1469
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1470
+ });
1471
+ return luvio.storeBroadcast().then(() => snapshot);
1472
+ }
1473
+ function buildNetworkSnapshot$4(luvio, config, options) {
1474
+ const resourceParams = createResourceParams$4(config);
1475
+ const request = createResourceRequest$4(resourceParams);
1469
1476
  return luvio.dispatchResourceRequest(request, options)
1470
1477
  .then((response) => {
1471
- return luvio.handleSuccessResponse(() => {
1472
- const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1473
- return luvio.storeBroadcast().then(() => snapshot);
1474
- }, () => {
1478
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
1475
1479
  const cache = new StoreKeyMap();
1476
- getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1480
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1477
1481
  return cache;
1478
1482
  });
1479
1483
  }, (response) => {
1480
- deepFreeze(response);
1481
- throw response;
1484
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1482
1485
  });
1483
1486
  }
1484
- const unenrollFromEnablementProgramAdapterFactory = (luvio) => {
1485
- return function unenrollFromEnablementProgram(untrustedConfig) {
1486
- const config = validateAdapterConfig$2(untrustedConfig, unenrollFromEnablementProgram_ConfigPropertyNames);
1487
- // Invalid or incomplete config
1488
- if (config === null) {
1489
- throw new Error('Invalid config for "unenrollFromEnablementProgram"');
1490
- }
1491
- return buildNetworkSnapshot$2(luvio, config);
1487
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1488
+ return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
1489
+ }
1490
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1491
+ const { luvio, config } = context;
1492
+ const selector = {
1493
+ recordId: keyBuilder$5(luvio, config),
1494
+ node: adapterFragment$2(luvio, config),
1495
+ variables: {},
1492
1496
  };
1497
+ const cacheSnapshot = storeLookup(selector, {
1498
+ config,
1499
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1500
+ });
1501
+ return cacheSnapshot;
1502
+ }
1503
+ const getAssignedEnablementProgramSummaryAdapterFactory = (luvio) => function enablement__getAssignedEnablementProgramSummary(untrustedConfig, requestContext) {
1504
+ const config = validateAdapterConfig$4(untrustedConfig, getAssignedEnablementProgramSummary_ConfigPropertyNames);
1505
+ // Invalid or incomplete config
1506
+ if (config === null) {
1507
+ return null;
1508
+ }
1509
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1510
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1493
1511
  };
1494
1512
 
1495
- function select$1(luvio, params) {
1496
- return select$6();
1513
+ function select$4(luvio, params) {
1514
+ return select$8();
1497
1515
  }
1498
- function keyBuilder$3(luvio, params) {
1516
+ function keyBuilder$4(luvio, params) {
1499
1517
  return keyPrefix + '::EnablementProgramSummaryListRepresentation:(' + 'filter:' + params.queryParams.filter + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ')';
1500
1518
  }
1501
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1502
- getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
1519
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1520
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
1503
1521
  }
1504
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1522
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
1505
1523
  const { body } = response;
1506
- const key = keyBuilder$3(luvio, resourceParams);
1524
+ const key = keyBuilder$4(luvio, resourceParams);
1507
1525
  luvio.storeIngest(key, ingest$1, body);
1508
1526
  const snapshot = luvio.storeLookup({
1509
1527
  recordId: key,
1510
- node: select$1(),
1528
+ node: select$4(),
1511
1529
  variables: {},
1512
1530
  }, snapshotRefresh);
1513
1531
  if (process.env.NODE_ENV !== 'production') {
@@ -1519,16 +1537,16 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1519
1537
  return snapshot;
1520
1538
  }
1521
1539
  function ingestError$1(luvio, params, error, snapshotRefresh) {
1522
- const key = keyBuilder$3(luvio, params);
1540
+ const key = keyBuilder$4(luvio, params);
1523
1541
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1524
1542
  luvio.storeIngestError(key, errorSnapshot);
1525
1543
  return errorSnapshot;
1526
1544
  }
1527
- function createResourceRequest$1(config) {
1545
+ function createResourceRequest$3(config) {
1528
1546
  const headers = {};
1529
1547
  return {
1530
1548
  baseUri: '/services/data/v60.0',
1531
- basePath: '/connect/enablement/program/summary/assigned',
1549
+ basePath: '/connect/enablement/program/summary/collection',
1532
1550
  method: 'get',
1533
1551
  body: null,
1534
1552
  urlParams: {},
@@ -1538,62 +1556,62 @@ function createResourceRequest$1(config) {
1538
1556
  };
1539
1557
  }
1540
1558
 
1541
- const adapterName$1 = 'getAssignedEnablementProgramSummary';
1542
- const getAssignedEnablementProgramSummary_ConfigPropertyMetadata = [
1559
+ const adapterName$3 = 'getProgramSummaryCollection';
1560
+ const getProgramSummaryCollection_ConfigPropertyMetadata = [
1543
1561
  generateParamConfigMetadata('filter', false, 1 /* QueryParameter */, 0 /* String */),
1544
1562
  generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
1545
1563
  generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
1546
1564
  ];
1547
- const getAssignedEnablementProgramSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1548
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1549
- function keyBuilder$2(luvio, config) {
1550
- const resourceParams = createResourceParams$1(config);
1551
- return keyBuilder$3(luvio, resourceParams);
1565
+ const getProgramSummaryCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getProgramSummaryCollection_ConfigPropertyMetadata);
1566
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getProgramSummaryCollection_ConfigPropertyMetadata);
1567
+ function keyBuilder$3(luvio, config) {
1568
+ const resourceParams = createResourceParams$3(config);
1569
+ return keyBuilder$4(luvio, resourceParams);
1552
1570
  }
1553
- function typeCheckConfig$1(untrustedConfig) {
1571
+ function typeCheckConfig$3(untrustedConfig) {
1554
1572
  const config = {};
1555
- typeCheckConfig$5(untrustedConfig, config, getAssignedEnablementProgramSummary_ConfigPropertyMetadata);
1573
+ typeCheckConfig$7(untrustedConfig, config, getProgramSummaryCollection_ConfigPropertyMetadata);
1556
1574
  return config;
1557
1575
  }
1558
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1576
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1559
1577
  if (!untrustedIsObject(untrustedConfig)) {
1560
1578
  return null;
1561
1579
  }
1562
1580
  if (process.env.NODE_ENV !== 'production') {
1563
1581
  validateConfig(untrustedConfig, configPropertyNames);
1564
1582
  }
1565
- const config = typeCheckConfig$1(untrustedConfig);
1583
+ const config = typeCheckConfig$3(untrustedConfig);
1566
1584
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1567
1585
  return null;
1568
1586
  }
1569
1587
  return config;
1570
1588
  }
1571
1589
  function adapterFragment$1(luvio, config) {
1572
- createResourceParams$1(config);
1573
- return select$1();
1590
+ createResourceParams$3(config);
1591
+ return select$4();
1574
1592
  }
1575
1593
  function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1576
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1594
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
1577
1595
  config,
1578
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1596
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1579
1597
  });
1580
1598
  return luvio.storeBroadcast().then(() => snapshot);
1581
1599
  }
1582
1600
  function onFetchResponseError$1(luvio, config, resourceParams, response) {
1583
1601
  const snapshot = ingestError$1(luvio, resourceParams, response, {
1584
1602
  config,
1585
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1603
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1586
1604
  });
1587
1605
  return luvio.storeBroadcast().then(() => snapshot);
1588
1606
  }
1589
- function buildNetworkSnapshot$1(luvio, config, options) {
1590
- const resourceParams = createResourceParams$1(config);
1591
- const request = createResourceRequest$1(resourceParams);
1607
+ function buildNetworkSnapshot$3(luvio, config, options) {
1608
+ const resourceParams = createResourceParams$3(config);
1609
+ const request = createResourceRequest$3(resourceParams);
1592
1610
  return luvio.dispatchResourceRequest(request, options)
1593
1611
  .then((response) => {
1594
1612
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1595
1613
  const cache = new StoreKeyMap();
1596
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1614
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1597
1615
  return cache;
1598
1616
  });
1599
1617
  }, (response) => {
@@ -1601,23 +1619,23 @@ function buildNetworkSnapshot$1(luvio, config, options) {
1601
1619
  });
1602
1620
  }
1603
1621
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1604
- return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1622
+ return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
1605
1623
  }
1606
1624
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1607
1625
  const { luvio, config } = context;
1608
1626
  const selector = {
1609
- recordId: keyBuilder$2(luvio, config),
1627
+ recordId: keyBuilder$3(luvio, config),
1610
1628
  node: adapterFragment$1(luvio, config),
1611
1629
  variables: {},
1612
1630
  };
1613
1631
  const cacheSnapshot = storeLookup(selector, {
1614
1632
  config,
1615
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1633
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1616
1634
  });
1617
1635
  return cacheSnapshot;
1618
1636
  }
1619
- const getAssignedEnablementProgramSummaryAdapterFactory = (luvio) => function enablement__getAssignedEnablementProgramSummary(untrustedConfig, requestContext) {
1620
- const config = validateAdapterConfig$1(untrustedConfig, getAssignedEnablementProgramSummary_ConfigPropertyNames);
1637
+ const getProgramSummaryCollectionAdapterFactory = (luvio) => function enablement__getProgramSummaryCollection(untrustedConfig, requestContext) {
1638
+ const config = validateAdapterConfig$3(untrustedConfig, getProgramSummaryCollection_ConfigPropertyNames);
1621
1639
  // Invalid or incomplete config
1622
1640
  if (config === null) {
1623
1641
  return null;
@@ -1626,24 +1644,24 @@ const getAssignedEnablementProgramSummaryAdapterFactory = (luvio) => function en
1626
1644
  buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1627
1645
  };
1628
1646
 
1629
- function select(luvio, params) {
1630
- return select$7();
1647
+ function select$3(luvio, params) {
1648
+ return select$9();
1631
1649
  }
1632
- function keyBuilder$1(luvio, params) {
1633
- return keyBuilder$7(luvio, {
1650
+ function keyBuilder$2(luvio, params) {
1651
+ return keyBuilder$b(luvio, {
1634
1652
  enablement_program_id: params.urlParams.enablementProgramId
1635
1653
  });
1636
1654
  }
1637
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1655
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1638
1656
  getTypeCacheKeys$2(storeKeyMap, luvio, response);
1639
1657
  }
1640
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1658
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1641
1659
  const { body } = response;
1642
- const key = keyBuilder$1(luvio, resourceParams);
1660
+ const key = keyBuilder$2(luvio, resourceParams);
1643
1661
  luvio.storeIngest(key, ingest$2, body);
1644
1662
  const snapshot = luvio.storeLookup({
1645
1663
  recordId: key,
1646
- node: select(),
1664
+ node: select$3(),
1647
1665
  variables: {},
1648
1666
  }, snapshotRefresh);
1649
1667
  if (process.env.NODE_ENV !== 'production') {
@@ -1655,7 +1673,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1655
1673
  return snapshot;
1656
1674
  }
1657
1675
  function ingestError(luvio, params, error, snapshotRefresh) {
1658
- const key = keyBuilder$1(luvio, params);
1676
+ const key = keyBuilder$2(luvio, params);
1659
1677
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1660
1678
  const storeMetadataParams = {
1661
1679
  ttl: TTL$1,
@@ -1666,7 +1684,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
1666
1684
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1667
1685
  return errorSnapshot;
1668
1686
  }
1669
- function createResourceRequest(config) {
1687
+ function createResourceRequest$2(config) {
1670
1688
  const headers = {};
1671
1689
  return {
1672
1690
  baseUri: '/services/data/v60.0',
@@ -1680,61 +1698,61 @@ function createResourceRequest(config) {
1680
1698
  };
1681
1699
  }
1682
1700
 
1683
- const adapterName = 'getEnablementProgramSummary';
1701
+ const adapterName$2 = 'getEnablementProgramSummary';
1684
1702
  const getEnablementProgramSummary_ConfigPropertyMetadata = [
1685
1703
  generateParamConfigMetadata('enablementProgramId', true, 0 /* UrlParameter */, 0 /* String */),
1686
1704
  generateParamConfigMetadata('includeProgress', false, 1 /* QueryParameter */, 1 /* Boolean */),
1687
1705
  ];
1688
- const getEnablementProgramSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getEnablementProgramSummary_ConfigPropertyMetadata);
1689
- const createResourceParams = /*#__PURE__*/ createResourceParams$5(getEnablementProgramSummary_ConfigPropertyMetadata);
1690
- function keyBuilder(luvio, config) {
1691
- const resourceParams = createResourceParams(config);
1692
- return keyBuilder$1(luvio, resourceParams);
1706
+ const getEnablementProgramSummary_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getEnablementProgramSummary_ConfigPropertyMetadata);
1707
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getEnablementProgramSummary_ConfigPropertyMetadata);
1708
+ function keyBuilder$1(luvio, config) {
1709
+ const resourceParams = createResourceParams$2(config);
1710
+ return keyBuilder$2(luvio, resourceParams);
1693
1711
  }
1694
- function typeCheckConfig(untrustedConfig) {
1712
+ function typeCheckConfig$2(untrustedConfig) {
1695
1713
  const config = {};
1696
- typeCheckConfig$5(untrustedConfig, config, getEnablementProgramSummary_ConfigPropertyMetadata);
1714
+ typeCheckConfig$7(untrustedConfig, config, getEnablementProgramSummary_ConfigPropertyMetadata);
1697
1715
  return config;
1698
1716
  }
1699
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1717
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1700
1718
  if (!untrustedIsObject(untrustedConfig)) {
1701
1719
  return null;
1702
1720
  }
1703
1721
  if (process.env.NODE_ENV !== 'production') {
1704
1722
  validateConfig(untrustedConfig, configPropertyNames);
1705
1723
  }
1706
- const config = typeCheckConfig(untrustedConfig);
1724
+ const config = typeCheckConfig$2(untrustedConfig);
1707
1725
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1708
1726
  return null;
1709
1727
  }
1710
1728
  return config;
1711
1729
  }
1712
1730
  function adapterFragment(luvio, config) {
1713
- createResourceParams(config);
1714
- return select();
1731
+ createResourceParams$2(config);
1732
+ return select$3();
1715
1733
  }
1716
1734
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1717
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
1735
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1718
1736
  config,
1719
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1737
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1720
1738
  });
1721
1739
  return luvio.storeBroadcast().then(() => snapshot);
1722
1740
  }
1723
1741
  function onFetchResponseError(luvio, config, resourceParams, response) {
1724
1742
  const snapshot = ingestError(luvio, resourceParams, response, {
1725
1743
  config,
1726
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1744
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1727
1745
  });
1728
1746
  return luvio.storeBroadcast().then(() => snapshot);
1729
1747
  }
1730
- function buildNetworkSnapshot(luvio, config, options) {
1731
- const resourceParams = createResourceParams(config);
1732
- const request = createResourceRequest(resourceParams);
1748
+ function buildNetworkSnapshot$2(luvio, config, options) {
1749
+ const resourceParams = createResourceParams$2(config);
1750
+ const request = createResourceRequest$2(resourceParams);
1733
1751
  return luvio.dispatchResourceRequest(request, options)
1734
1752
  .then((response) => {
1735
1753
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1736
1754
  const cache = new StoreKeyMap();
1737
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1755
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1738
1756
  return cache;
1739
1757
  });
1740
1758
  }, (response) => {
@@ -1742,23 +1760,23 @@ function buildNetworkSnapshot(luvio, config, options) {
1742
1760
  });
1743
1761
  }
1744
1762
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1745
- return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1763
+ return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
1746
1764
  }
1747
1765
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
1748
1766
  const { luvio, config } = context;
1749
1767
  const selector = {
1750
- recordId: keyBuilder(luvio, config),
1768
+ recordId: keyBuilder$1(luvio, config),
1751
1769
  node: adapterFragment(luvio, config),
1752
1770
  variables: {},
1753
1771
  };
1754
1772
  const cacheSnapshot = storeLookup(selector, {
1755
1773
  config,
1756
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1774
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1757
1775
  });
1758
1776
  return cacheSnapshot;
1759
1777
  }
1760
1778
  const getEnablementProgramSummaryAdapterFactory = (luvio) => function enablement__getEnablementProgramSummary(untrustedConfig, requestContext) {
1761
- const config = validateAdapterConfig(untrustedConfig, getEnablementProgramSummary_ConfigPropertyNames);
1779
+ const config = validateAdapterConfig$2(untrustedConfig, getEnablementProgramSummary_ConfigPropertyNames);
1762
1780
  // Invalid or incomplete config
1763
1781
  if (config === null) {
1764
1782
  return null;
@@ -1767,4 +1785,255 @@ const getEnablementProgramSummaryAdapterFactory = (luvio) => function enablement
1767
1785
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1768
1786
  };
1769
1787
 
1770
- export { getAssignedEnablementProgramSummaryAdapterFactory, getAssignedEnablementProgramSummaryForCommunityAdapterFactory, getEnablementProgramSummaryAdapterFactory, selfEnrollInEnablementProgramAdapterFactory, unenrollFromEnablementProgramAdapterFactory };
1788
+ const TTL = 15000;
1789
+ const VERSION = "f87a4ca2a25d6b000ce11b00273a58f4";
1790
+ function validate(obj, path = 'EnablementProgramSelfEnrollmentRepresentation') {
1791
+ const v_error = (() => {
1792
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1793
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1794
+ }
1795
+ const obj_learningItemAssignmentId = obj.learningItemAssignmentId;
1796
+ const path_learningItemAssignmentId = path + '.learningItemAssignmentId';
1797
+ if (typeof obj_learningItemAssignmentId !== 'string') {
1798
+ return new TypeError('Expected "string" but received "' + typeof obj_learningItemAssignmentId + '" (at "' + path_learningItemAssignmentId + '")');
1799
+ }
1800
+ })();
1801
+ return v_error === undefined ? null : v_error;
1802
+ }
1803
+ const RepresentationType = 'EnablementProgramSelfEnrollmentRepresentation';
1804
+ function keyBuilder(luvio, config) {
1805
+ return keyPrefix + '::' + RepresentationType + ':' + config.learning_item_assignment_id;
1806
+ }
1807
+ function keyBuilderFromType(luvio, object) {
1808
+ const keyParams = {
1809
+ learning_item_assignment_id: object.learningItemAssignmentId
1810
+ };
1811
+ return keyBuilder(luvio, keyParams);
1812
+ }
1813
+ function normalize(input, existing, path, luvio, store, timestamp) {
1814
+ return input;
1815
+ }
1816
+ const select$2 = function EnablementProgramSelfEnrollmentRepresentationSelect() {
1817
+ return {
1818
+ kind: 'Fragment',
1819
+ version: VERSION,
1820
+ private: [],
1821
+ selections: [
1822
+ {
1823
+ name: 'learningItemAssignmentId',
1824
+ kind: 'Scalar'
1825
+ }
1826
+ ]
1827
+ };
1828
+ };
1829
+ function equals(existing, incoming) {
1830
+ const existing_learningItemAssignmentId = existing.learningItemAssignmentId;
1831
+ const incoming_learningItemAssignmentId = incoming.learningItemAssignmentId;
1832
+ if (!(existing_learningItemAssignmentId === incoming_learningItemAssignmentId)) {
1833
+ return false;
1834
+ }
1835
+ return true;
1836
+ }
1837
+ const ingest = function EnablementProgramSelfEnrollmentRepresentationIngest(input, path, luvio, store, timestamp) {
1838
+ if (process.env.NODE_ENV !== 'production') {
1839
+ const validateError = validate(input);
1840
+ if (validateError !== null) {
1841
+ throw validateError;
1842
+ }
1843
+ }
1844
+ const key = keyBuilderFromType(luvio, input);
1845
+ const ttlToUse = TTL;
1846
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "enablement", VERSION, RepresentationType, equals);
1847
+ return createLink(key);
1848
+ };
1849
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1850
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1851
+ const rootKey = keyBuilderFromType(luvio, input);
1852
+ rootKeySet.set(rootKey, {
1853
+ namespace: keyPrefix,
1854
+ representationName: RepresentationType,
1855
+ mergeable: false
1856
+ });
1857
+ }
1858
+
1859
+ function select$1(luvio, params) {
1860
+ return select$2();
1861
+ }
1862
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1863
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1864
+ }
1865
+ function ingestSuccess$1(luvio, resourceParams, response) {
1866
+ const { body } = response;
1867
+ const key = keyBuilderFromType(luvio, body);
1868
+ luvio.storeIngest(key, ingest, body);
1869
+ const snapshot = luvio.storeLookup({
1870
+ recordId: key,
1871
+ node: select$1(),
1872
+ variables: {},
1873
+ });
1874
+ if (process.env.NODE_ENV !== 'production') {
1875
+ if (snapshot.state !== 'Fulfilled') {
1876
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1877
+ }
1878
+ }
1879
+ deepFreeze(snapshot.data);
1880
+ return snapshot;
1881
+ }
1882
+ function createResourceRequest$1(config) {
1883
+ const headers = {};
1884
+ return {
1885
+ baseUri: '/services/data/v60.0',
1886
+ basePath: '/connect/enablement/program/' + config.urlParams.enablementProgramId + '/actions/enroll',
1887
+ method: 'post',
1888
+ body: null,
1889
+ urlParams: config.urlParams,
1890
+ queryParams: {},
1891
+ headers,
1892
+ priority: 'normal',
1893
+ };
1894
+ }
1895
+
1896
+ const adapterName$1 = 'selfEnrollInEnablementProgram';
1897
+ const selfEnrollInEnablementProgram_ConfigPropertyMetadata = [
1898
+ generateParamConfigMetadata('enablementProgramId', true, 0 /* UrlParameter */, 0 /* String */),
1899
+ ];
1900
+ const selfEnrollInEnablementProgram_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1901
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1902
+ function typeCheckConfig$1(untrustedConfig) {
1903
+ const config = {};
1904
+ typeCheckConfig$7(untrustedConfig, config, selfEnrollInEnablementProgram_ConfigPropertyMetadata);
1905
+ return config;
1906
+ }
1907
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1908
+ if (!untrustedIsObject(untrustedConfig)) {
1909
+ return null;
1910
+ }
1911
+ if (process.env.NODE_ENV !== 'production') {
1912
+ validateConfig(untrustedConfig, configPropertyNames);
1913
+ }
1914
+ const config = typeCheckConfig$1(untrustedConfig);
1915
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1916
+ return null;
1917
+ }
1918
+ return config;
1919
+ }
1920
+ function buildNetworkSnapshot$1(luvio, config, options) {
1921
+ const resourceParams = createResourceParams$1(config);
1922
+ const request = createResourceRequest$1(resourceParams);
1923
+ return luvio.dispatchResourceRequest(request, options)
1924
+ .then((response) => {
1925
+ return luvio.handleSuccessResponse(() => {
1926
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1927
+ return luvio.storeBroadcast().then(() => snapshot);
1928
+ }, () => {
1929
+ const cache = new StoreKeyMap();
1930
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1931
+ return cache;
1932
+ });
1933
+ }, (response) => {
1934
+ deepFreeze(response);
1935
+ throw response;
1936
+ });
1937
+ }
1938
+ const selfEnrollInEnablementProgramAdapterFactory = (luvio) => {
1939
+ return function selfEnrollInEnablementProgram(untrustedConfig) {
1940
+ const config = validateAdapterConfig$1(untrustedConfig, selfEnrollInEnablementProgram_ConfigPropertyNames);
1941
+ // Invalid or incomplete config
1942
+ if (config === null) {
1943
+ throw new Error('Invalid config for "selfEnrollInEnablementProgram"');
1944
+ }
1945
+ return buildNetworkSnapshot$1(luvio, config);
1946
+ };
1947
+ };
1948
+
1949
+ function select(luvio, params) {
1950
+ return select$2();
1951
+ }
1952
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1953
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1954
+ }
1955
+ function ingestSuccess(luvio, resourceParams, response) {
1956
+ const { body } = response;
1957
+ const key = keyBuilderFromType(luvio, body);
1958
+ luvio.storeIngest(key, ingest, body);
1959
+ const snapshot = luvio.storeLookup({
1960
+ recordId: key,
1961
+ node: select(),
1962
+ variables: {},
1963
+ });
1964
+ if (process.env.NODE_ENV !== 'production') {
1965
+ if (snapshot.state !== 'Fulfilled') {
1966
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1967
+ }
1968
+ }
1969
+ deepFreeze(snapshot.data);
1970
+ return snapshot;
1971
+ }
1972
+ function createResourceRequest(config) {
1973
+ const headers = {};
1974
+ return {
1975
+ baseUri: '/services/data/v60.0',
1976
+ basePath: '/connect/enablement/program/' + config.urlParams.enablementProgramId + '/actions/unenroll',
1977
+ method: 'post',
1978
+ body: null,
1979
+ urlParams: config.urlParams,
1980
+ queryParams: {},
1981
+ headers,
1982
+ priority: 'normal',
1983
+ };
1984
+ }
1985
+
1986
+ const adapterName = 'unenrollFromEnablementProgram';
1987
+ const unenrollFromEnablementProgram_ConfigPropertyMetadata = [
1988
+ generateParamConfigMetadata('enablementProgramId', true, 0 /* UrlParameter */, 0 /* String */),
1989
+ ];
1990
+ const unenrollFromEnablementProgram_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, unenrollFromEnablementProgram_ConfigPropertyMetadata);
1991
+ const createResourceParams = /*#__PURE__*/ createResourceParams$7(unenrollFromEnablementProgram_ConfigPropertyMetadata);
1992
+ function typeCheckConfig(untrustedConfig) {
1993
+ const config = {};
1994
+ typeCheckConfig$7(untrustedConfig, config, unenrollFromEnablementProgram_ConfigPropertyMetadata);
1995
+ return config;
1996
+ }
1997
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1998
+ if (!untrustedIsObject(untrustedConfig)) {
1999
+ return null;
2000
+ }
2001
+ if (process.env.NODE_ENV !== 'production') {
2002
+ validateConfig(untrustedConfig, configPropertyNames);
2003
+ }
2004
+ const config = typeCheckConfig(untrustedConfig);
2005
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2006
+ return null;
2007
+ }
2008
+ return config;
2009
+ }
2010
+ function buildNetworkSnapshot(luvio, config, options) {
2011
+ const resourceParams = createResourceParams(config);
2012
+ const request = createResourceRequest(resourceParams);
2013
+ return luvio.dispatchResourceRequest(request, options)
2014
+ .then((response) => {
2015
+ return luvio.handleSuccessResponse(() => {
2016
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
2017
+ return luvio.storeBroadcast().then(() => snapshot);
2018
+ }, () => {
2019
+ const cache = new StoreKeyMap();
2020
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
2021
+ return cache;
2022
+ });
2023
+ }, (response) => {
2024
+ deepFreeze(response);
2025
+ throw response;
2026
+ });
2027
+ }
2028
+ const unenrollFromEnablementProgramAdapterFactory = (luvio) => {
2029
+ return function unenrollFromEnablementProgram(untrustedConfig) {
2030
+ const config = validateAdapterConfig(untrustedConfig, unenrollFromEnablementProgram_ConfigPropertyNames);
2031
+ // Invalid or incomplete config
2032
+ if (config === null) {
2033
+ throw new Error('Invalid config for "unenrollFromEnablementProgram"');
2034
+ }
2035
+ return buildNetworkSnapshot(luvio, config);
2036
+ };
2037
+ };
2038
+
2039
+ export { getAssignedEnablementProgramSummaryAdapterFactory, getAssignedEnablementProgramSummaryForCommunityAdapterFactory, getEnablementProgramSummaryAdapterFactory, getProgramSummaryCollectionAdapterFactory, getProgramSummaryCollectionForCommunityAdapterFactory, selfEnrollInEnablementProgramAdapterFactory, unenrollFromEnablementProgramAdapterFactory };