@salesforce/lds-adapters-sales-enablement-program 1.213.0 → 1.213.1

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, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -48,6 +48,24 @@ const snapshotRefreshOptions = {
48
48
  },
49
49
  }
50
50
  };
51
+ function generateParamConfigMetadata(name, required, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ coerceFn,
56
+ };
57
+ }
58
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
59
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
60
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
61
+ return {
62
+ displayName,
63
+ parameters: {
64
+ required,
65
+ optional,
66
+ }
67
+ };
68
+ }
51
69
  const keyPrefix = 'enablement-program';
52
70
 
53
71
  const { isArray: ArrayIsArray } = Array;
@@ -201,26 +219,8 @@ const ingest$1 = function ProgramTemplateListRepresentationIngest(input, path, l
201
219
  }
202
220
  }
203
221
  const key = path.fullPath;
204
- const existingRecord = store.readEntry(key);
205
222
  const ttlToUse = TTL$1;
206
- let incomingRecord = normalize$1(input, store.readEntry(key), {
207
- fullPath: key,
208
- parent: path.parent,
209
- propertyName: path.propertyName,
210
- ttl: ttlToUse
211
- });
212
- if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
213
- luvio.storePublish(key, incomingRecord);
214
- }
215
- {
216
- const storeMetadataParams = {
217
- ttl: ttlToUse,
218
- namespace: "enablement-program",
219
- version: VERSION$3,
220
- representationName: RepresentationType$1,
221
- };
222
- luvio.publishStoreMetadata(key, storeMetadataParams);
223
- }
223
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "enablement-program", VERSION$3, RepresentationType$1, equals$3);
224
224
  return createLink(key);
225
225
  };
226
226
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -285,13 +285,9 @@ function createResourceRequest$1(config) {
285
285
  };
286
286
  }
287
287
 
288
- const getProgramTemplates_ConfigPropertyNames = {
289
- displayName: 'getProgramTemplates',
290
- parameters: {
291
- required: [],
292
- optional: []
293
- }
294
- };
288
+ const adapterName$1 = 'getProgramTemplates';
289
+ const getProgramTemplates_ConfigPropertyMetadata = [];
290
+ const getProgramTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProgramTemplates_ConfigPropertyMetadata);
295
291
  function createResourceParams$1(config) {
296
292
  const resourceParams = {};
297
293
  return resourceParams;
@@ -348,21 +344,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
348
344
  });
349
345
  }
350
346
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
351
- const { luvio, config } = context;
352
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
353
- const dispatchOptions = {
354
- resourceRequestContext: {
355
- requestCorrelator,
356
- luvioRequestMethod: undefined,
357
- },
358
- eventObservers
359
- };
360
- if (networkPriority !== 'normal') {
361
- dispatchOptions.overrides = {
362
- priority: networkPriority
363
- };
364
- }
365
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
347
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
366
348
  }
367
349
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
368
350
  const { luvio, config } = context;
@@ -1391,26 +1373,8 @@ const ingest = function EnablementProgramRepresentationIngest(input, path, luvio
1391
1373
  }
1392
1374
  }
1393
1375
  const key = path.fullPath;
1394
- const existingRecord = store.readEntry(key);
1395
1376
  const ttlToUse = TTL;
1396
- let incomingRecord = normalize(input, store.readEntry(key), {
1397
- fullPath: key,
1398
- parent: path.parent,
1399
- propertyName: path.propertyName,
1400
- ttl: ttlToUse
1401
- });
1402
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1403
- luvio.storePublish(key, incomingRecord);
1404
- }
1405
- {
1406
- const storeMetadataParams = {
1407
- ttl: ttlToUse,
1408
- namespace: "enablement-program",
1409
- version: VERSION,
1410
- representationName: RepresentationType,
1411
- };
1412
- luvio.publishStoreMetadata(key, storeMetadataParams);
1413
- }
1377
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "enablement-program", VERSION, RepresentationType, equals);
1414
1378
  return createLink(key);
1415
1379
  };
1416
1380
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -1475,13 +1439,11 @@ function createResourceRequest(config) {
1475
1439
  };
1476
1440
  }
1477
1441
 
1478
- const getProgramTemplate_ConfigPropertyNames = {
1479
- displayName: 'getProgramTemplate',
1480
- parameters: {
1481
- required: ['programTemplateName'],
1482
- optional: []
1483
- }
1484
- };
1442
+ const adapterName = 'getProgramTemplate';
1443
+ const getProgramTemplate_ConfigPropertyMetadata = [
1444
+ generateParamConfigMetadata('programTemplateName', true),
1445
+ ];
1446
+ const getProgramTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProgramTemplate_ConfigPropertyMetadata);
1485
1447
  function createResourceParams(config) {
1486
1448
  const resourceParams = {
1487
1449
  urlParams: {
@@ -1547,21 +1509,7 @@ function buildNetworkSnapshot(luvio, config, options) {
1547
1509
  });
1548
1510
  }
1549
1511
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1550
- const { luvio, config } = context;
1551
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1552
- const dispatchOptions = {
1553
- resourceRequestContext: {
1554
- requestCorrelator,
1555
- luvioRequestMethod: undefined,
1556
- },
1557
- eventObservers
1558
- };
1559
- if (networkPriority !== 'normal') {
1560
- dispatchOptions.overrides = {
1561
- priority: networkPriority
1562
- };
1563
- }
1564
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
1512
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1565
1513
  }
1566
1514
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
1567
1515
  const { luvio, config } = context;
@@ -1,4 +1,4 @@
1
- import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot } from '@luvio/engine';
1
+ import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
2
2
  export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
3
3
  declare const ObjectKeys: {
4
4
  (o: object): string[];
@@ -57,4 +57,6 @@ export declare const snapshotRefreshOptions: {
57
57
  export declare function stableJSONStringify(node: any): string | undefined;
58
58
  export declare function getFetchResponseStatusText(status: number): string;
59
59
  export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
60
+ export declare function generateParamConfigMetadata(name: string, required: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
61
+ export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
60
62
  export declare const keyPrefix = "enablement-program";
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectEnablementProgramTemplateByProgramTemplateName_ResourceRequestConfig } from '../resources/getConnectEnablementProgramTemplateByProgramTemplateName';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { EnablementProgramRepresentation as types_EnablementProgramRepresentation_EnablementProgramRepresentation } from '../types/EnablementProgramRepresentation';
5
5
  export declare const adapterName = "getProgramTemplate";
6
+ export declare const getProgramTemplate_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProgramTemplate_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProgramTemplateConfig {
8
9
  programTemplateName: string;
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectEnablementProgramTemplate_ResourceRequestConfig } from '../resources/getConnectEnablementProgramTemplate';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ProgramTemplateListRepresentation as types_ProgramTemplateListRepresentation_ProgramTemplateListRepresentation } from '../types/ProgramTemplateListRepresentation';
5
5
  export declare const adapterName = "getProgramTemplates";
6
+ export declare const getProgramTemplates_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProgramTemplates_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProgramTemplatesConfig {
8
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sales-enablement-program",
3
- "version": "1.213.0",
3
+ "version": "1.213.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "This set of adapters are used to interface and communicate with the connect-api for specific operations on sales enablement program.",
6
6
  "main": "dist/es/es2018/sales-enablement-program.js",
package/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { serializeStructuredKey, deepFreeze, typeCheckScalars, StoreKeyMap } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckScalars, StoreKeyMap } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -58,6 +58,24 @@ const snapshotRefreshOptions = {
58
58
  },
59
59
  }
60
60
  };
61
+ function generateParamConfigMetadata(name, required, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ coerceFn,
66
+ };
67
+ }
68
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
69
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
70
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
71
+ return {
72
+ displayName,
73
+ parameters: {
74
+ required,
75
+ optional,
76
+ }
77
+ };
78
+ }
61
79
  const keyPrefix = 'enablement-program';
62
80
 
63
81
  const { isArray: ArrayIsArray } = Array;
@@ -1085,26 +1103,8 @@ const ingest$1 = function EnablementProgramRepresentationIngest(input, path, luv
1085
1103
  }
1086
1104
  }
1087
1105
  const key = path.fullPath;
1088
- const existingRecord = store.readEntry(key);
1089
1106
  const ttlToUse = TTL$1;
1090
- let incomingRecord = normalize$1(input, store.readEntry(key), {
1091
- fullPath: key,
1092
- parent: path.parent,
1093
- propertyName: path.propertyName,
1094
- ttl: ttlToUse
1095
- });
1096
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
1097
- luvio.storePublish(key, incomingRecord);
1098
- }
1099
- {
1100
- const storeMetadataParams = {
1101
- ttl: ttlToUse,
1102
- namespace: "enablement-program",
1103
- version: VERSION$2,
1104
- representationName: RepresentationType$1,
1105
- };
1106
- luvio.publishStoreMetadata(key, storeMetadataParams);
1107
- }
1107
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "enablement-program", VERSION$2, RepresentationType$1, equals$2);
1108
1108
  return createLink(key);
1109
1109
  };
1110
1110
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -1169,13 +1169,11 @@ function createResourceRequest$1(config) {
1169
1169
  };
1170
1170
  }
1171
1171
 
1172
- const getProgramTemplate_ConfigPropertyNames = {
1173
- displayName: 'getProgramTemplate',
1174
- parameters: {
1175
- required: ['programTemplateName'],
1176
- optional: []
1177
- }
1178
- };
1172
+ const adapterName$1 = 'getProgramTemplate';
1173
+ const getProgramTemplate_ConfigPropertyMetadata = [
1174
+ generateParamConfigMetadata('programTemplateName', true),
1175
+ ];
1176
+ const getProgramTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProgramTemplate_ConfigPropertyMetadata);
1179
1177
  function createResourceParams$1(config) {
1180
1178
  const resourceParams = {
1181
1179
  urlParams: {
@@ -1241,21 +1239,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
1241
1239
  });
1242
1240
  }
1243
1241
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1244
- const { luvio, config } = context;
1245
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1246
- const dispatchOptions = {
1247
- resourceRequestContext: {
1248
- requestCorrelator,
1249
- luvioRequestMethod: undefined,
1250
- },
1251
- eventObservers
1252
- };
1253
- if (networkPriority !== 'normal') {
1254
- dispatchOptions.overrides = {
1255
- priority: networkPriority
1256
- };
1257
- }
1258
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1242
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1259
1243
  }
1260
1244
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1261
1245
  const { luvio, config } = context;
@@ -1410,26 +1394,8 @@ const ingest = function ProgramTemplateListRepresentationIngest(input, path, luv
1410
1394
  }
1411
1395
  }
1412
1396
  const key = path.fullPath;
1413
- const existingRecord = store.readEntry(key);
1414
1397
  const ttlToUse = TTL;
1415
- let incomingRecord = normalize(input, store.readEntry(key), {
1416
- fullPath: key,
1417
- parent: path.parent,
1418
- propertyName: path.propertyName,
1419
- ttl: ttlToUse
1420
- });
1421
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1422
- luvio.storePublish(key, incomingRecord);
1423
- }
1424
- {
1425
- const storeMetadataParams = {
1426
- ttl: ttlToUse,
1427
- namespace: "enablement-program",
1428
- version: VERSION,
1429
- representationName: RepresentationType,
1430
- };
1431
- luvio.publishStoreMetadata(key, storeMetadataParams);
1432
- }
1398
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "enablement-program", VERSION, RepresentationType, equals);
1433
1399
  return createLink(key);
1434
1400
  };
1435
1401
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -1494,13 +1460,9 @@ function createResourceRequest(config) {
1494
1460
  };
1495
1461
  }
1496
1462
 
1497
- const getProgramTemplates_ConfigPropertyNames = {
1498
- displayName: 'getProgramTemplates',
1499
- parameters: {
1500
- required: [],
1501
- optional: []
1502
- }
1503
- };
1463
+ const adapterName = 'getProgramTemplates';
1464
+ const getProgramTemplates_ConfigPropertyMetadata = [];
1465
+ const getProgramTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProgramTemplates_ConfigPropertyMetadata);
1504
1466
  function createResourceParams(config) {
1505
1467
  const resourceParams = {};
1506
1468
  return resourceParams;
@@ -1557,21 +1519,7 @@ function buildNetworkSnapshot(luvio, config, options) {
1557
1519
  });
1558
1520
  }
1559
1521
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1560
- const { luvio, config } = context;
1561
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1562
- const dispatchOptions = {
1563
- resourceRequestContext: {
1564
- requestCorrelator,
1565
- luvioRequestMethod: undefined,
1566
- },
1567
- eventObservers
1568
- };
1569
- if (networkPriority !== 'normal') {
1570
- dispatchOptions.overrides = {
1571
- priority: networkPriority
1572
- };
1573
- }
1574
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
1522
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1575
1523
  }
1576
1524
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
1577
1525
  const { luvio, config } = context;
@@ -1626,4 +1574,4 @@ withDefaultLuvio((luvio) => {
1626
1574
  });
1627
1575
 
1628
1576
  export { getProgramTemplate, getProgramTemplate_imperative, getProgramTemplates, getProgramTemplates_imperative };
1629
- // version: 1.213.0-951602080
1577
+ // version: 1.213.1-79de10fe1