@salesforce/lds-adapters-industries-sustainability-reference-data-v2 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, typeCheckScalars, StoreKeyMap } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, StoreKeyMap } 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 = 'sustainability-reference-data-v2';
52
70
 
53
71
  const { isArray: ArrayIsArray } = Array;
@@ -240,26 +258,8 @@ const ingest$1 = function FetchEntityVersionOutputRepresentationIngest(input, pa
240
258
  }
241
259
  }
242
260
  const key = path.fullPath;
243
- const existingRecord = store.readEntry(key);
244
261
  const ttlToUse = TTL$1;
245
- let incomingRecord = normalize$1(input, store.readEntry(key), {
246
- fullPath: key,
247
- parent: path.parent,
248
- propertyName: path.propertyName,
249
- ttl: ttlToUse
250
- });
251
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
252
- luvio.storePublish(key, incomingRecord);
253
- }
254
- {
255
- const storeMetadataParams = {
256
- ttl: ttlToUse,
257
- namespace: "sustainability-reference-data-v2",
258
- version: VERSION$1,
259
- representationName: RepresentationType$1,
260
- };
261
- luvio.publishStoreMetadata(key, storeMetadataParams);
262
- }
262
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "sustainability-reference-data-v2", VERSION$1, RepresentationType$1, equals$1);
263
263
  return createLink(key);
264
264
  };
265
265
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -324,13 +324,15 @@ function createResourceRequest$1(config) {
324
324
  };
325
325
  }
326
326
 
327
- const getEntityVersion_ConfigPropertyNames = {
328
- displayName: 'getEntityVersion',
329
- parameters: {
330
- required: ['entitySection', 'referenceDataSource'],
331
- optional: ['loadType', 'order', 'size']
332
- }
333
- };
327
+ const adapterName$1 = 'getEntityVersion';
328
+ const getEntityVersion_ConfigPropertyMetadata = [
329
+ generateParamConfigMetadata('entitySection', true),
330
+ generateParamConfigMetadata('referenceDataSource', true),
331
+ generateParamConfigMetadata('loadType', false),
332
+ generateParamConfigMetadata('order', false),
333
+ generateParamConfigMetadata('size', false),
334
+ ];
335
+ const getEntityVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getEntityVersion_ConfigPropertyMetadata);
334
336
  function createResourceParams$1(config) {
335
337
  const resourceParams = {
336
338
  urlParams: {
@@ -403,21 +405,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
403
405
  });
404
406
  }
405
407
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
406
- const { luvio, config } = context;
407
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
408
- const dispatchOptions = {
409
- resourceRequestContext: {
410
- requestCorrelator,
411
- luvioRequestMethod: undefined,
412
- },
413
- eventObservers
414
- };
415
- if (networkPriority !== 'normal') {
416
- dispatchOptions.overrides = {
417
- priority: networkPriority
418
- };
419
- }
420
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
408
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
421
409
  }
422
410
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
423
411
  const { luvio, config } = context;
@@ -550,26 +538,8 @@ const ingest = function UploadEntityVersionOutputRepresentationIngest(input, pat
550
538
  }
551
539
  }
552
540
  const key = keyBuilderFromType(luvio, input);
553
- const existingRecord = store.readEntry(key);
554
541
  const ttlToUse = TTL;
555
- let incomingRecord = normalize(input, store.readEntry(key), {
556
- fullPath: key,
557
- parent: path.parent,
558
- propertyName: path.propertyName,
559
- ttl: ttlToUse
560
- });
561
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
562
- luvio.storePublish(key, incomingRecord);
563
- }
564
- {
565
- const storeMetadataParams = {
566
- ttl: ttlToUse,
567
- namespace: "sustainability-reference-data-v2",
568
- version: VERSION,
569
- representationName: RepresentationType,
570
- };
571
- luvio.publishStoreMetadata(key, storeMetadataParams);
572
- }
542
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sustainability-reference-data-v2", VERSION, RepresentationType, equals);
573
543
  return createLink(key);
574
544
  };
575
545
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -619,13 +589,11 @@ function createResourceRequest(config) {
619
589
  };
620
590
  }
621
591
 
622
- const uploadEntityVersion_ConfigPropertyNames = {
623
- displayName: 'uploadEntityVersion',
624
- parameters: {
625
- required: ['uploadEntityInput'],
626
- optional: []
627
- }
628
- };
592
+ const adapterName = 'uploadEntityVersion';
593
+ const uploadEntityVersion_ConfigPropertyMetadata = [
594
+ generateParamConfigMetadata('uploadEntityInput', true),
595
+ ];
596
+ const uploadEntityVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, uploadEntityVersion_ConfigPropertyMetadata);
629
597
  function createResourceParams(config) {
630
598
  const resourceParams = {
631
599
  body: {
@@ -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 = "sustainability-reference-data-v2";
@@ -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_getConnectSustainabilityReferenceDataV2EntitySectionDataSourceVersionByEntitySectionAndReferenceDataSource_ResourceRequestConfig } from '../resources/getConnectSustainabilityReferenceDataV2EntitySectionDataSourceVersionByEntitySectionAndReferenceDataSource';
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 { FetchEntityVersionOutputRepresentation as types_FetchEntityVersionOutputRepresentation_FetchEntityVersionOutputRepresentation } from '../types/FetchEntityVersionOutputRepresentation';
5
5
  export declare const adapterName = "getEntityVersion";
6
+ export declare const getEntityVersion_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getEntityVersion_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetEntityVersionConfig {
8
9
  entitySection: string;
@@ -1,9 +1,10 @@
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, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, 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 { UploadEntityVersionInputRepresentation as types_UploadEntityVersionInputRepresentation_UploadEntityVersionInputRepresentation } from '../types/UploadEntityVersionInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_putConnectSustainabilityReferenceDataV2EntityVersionUpload_ResourceRequestConfig } from '../resources/putConnectSustainabilityReferenceDataV2EntityVersionUpload';
4
- import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
5
5
  import { UploadEntityVersionOutputRepresentation as types_UploadEntityVersionOutputRepresentation_UploadEntityVersionOutputRepresentation } from '../types/UploadEntityVersionOutputRepresentation';
6
6
  export declare const adapterName = "uploadEntityVersion";
7
+ export declare const uploadEntityVersion_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const uploadEntityVersion_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface UploadEntityVersionConfig {
9
10
  uploadEntityInput: types_UploadEntityVersionInputRepresentation_UploadEntityVersionInputRepresentation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-sustainability-reference-data-v2",
3
- "version": "1.213.0",
3
+ "version": "1.213.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "sustainability-reference-data-v2",
6
6
  "main": "dist/es/es2018/industries-sustainability-reference-data-v2.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$1, 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 = 'sustainability-reference-data-v2';
62
80
 
63
81
  const { isArray: ArrayIsArray } = Array;
@@ -250,26 +268,8 @@ const ingest$1 = function FetchEntityVersionOutputRepresentationIngest(input, pa
250
268
  }
251
269
  }
252
270
  const key = path.fullPath;
253
- const existingRecord = store.readEntry(key);
254
271
  const ttlToUse = TTL$1;
255
- let incomingRecord = normalize$1(input, store.readEntry(key), {
256
- fullPath: key,
257
- parent: path.parent,
258
- propertyName: path.propertyName,
259
- ttl: ttlToUse
260
- });
261
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
262
- luvio.storePublish(key, incomingRecord);
263
- }
264
- {
265
- const storeMetadataParams = {
266
- ttl: ttlToUse,
267
- namespace: "sustainability-reference-data-v2",
268
- version: VERSION$1,
269
- representationName: RepresentationType$1,
270
- };
271
- luvio.publishStoreMetadata(key, storeMetadataParams);
272
- }
272
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "sustainability-reference-data-v2", VERSION$1, RepresentationType$1, equals$1);
273
273
  return createLink(key);
274
274
  };
275
275
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -334,13 +334,15 @@ function createResourceRequest$1(config) {
334
334
  };
335
335
  }
336
336
 
337
- const getEntityVersion_ConfigPropertyNames = {
338
- displayName: 'getEntityVersion',
339
- parameters: {
340
- required: ['entitySection', 'referenceDataSource'],
341
- optional: ['loadType', 'order', 'size']
342
- }
343
- };
337
+ const adapterName$1 = 'getEntityVersion';
338
+ const getEntityVersion_ConfigPropertyMetadata = [
339
+ generateParamConfigMetadata('entitySection', true),
340
+ generateParamConfigMetadata('referenceDataSource', true),
341
+ generateParamConfigMetadata('loadType', false),
342
+ generateParamConfigMetadata('order', false),
343
+ generateParamConfigMetadata('size', false),
344
+ ];
345
+ const getEntityVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getEntityVersion_ConfigPropertyMetadata);
344
346
  function createResourceParams$1(config) {
345
347
  const resourceParams = {
346
348
  urlParams: {
@@ -413,21 +415,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
413
415
  });
414
416
  }
415
417
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
416
- const { luvio, config } = context;
417
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
418
- const dispatchOptions = {
419
- resourceRequestContext: {
420
- requestCorrelator,
421
- luvioRequestMethod: undefined,
422
- },
423
- eventObservers
424
- };
425
- if (networkPriority !== 'normal') {
426
- dispatchOptions.overrides = {
427
- priority: networkPriority
428
- };
429
- }
430
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
418
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
431
419
  }
432
420
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
433
421
  const { luvio, config } = context;
@@ -560,26 +548,8 @@ const ingest = function UploadEntityVersionOutputRepresentationIngest(input, pat
560
548
  }
561
549
  }
562
550
  const key = keyBuilderFromType(luvio, input);
563
- const existingRecord = store.readEntry(key);
564
551
  const ttlToUse = TTL;
565
- let incomingRecord = normalize(input, store.readEntry(key), {
566
- fullPath: key,
567
- parent: path.parent,
568
- propertyName: path.propertyName,
569
- ttl: ttlToUse
570
- });
571
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
572
- luvio.storePublish(key, incomingRecord);
573
- }
574
- {
575
- const storeMetadataParams = {
576
- ttl: ttlToUse,
577
- namespace: "sustainability-reference-data-v2",
578
- version: VERSION,
579
- representationName: RepresentationType,
580
- };
581
- luvio.publishStoreMetadata(key, storeMetadataParams);
582
- }
552
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sustainability-reference-data-v2", VERSION, RepresentationType, equals);
583
553
  return createLink(key);
584
554
  };
585
555
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -629,13 +599,11 @@ function createResourceRequest(config) {
629
599
  };
630
600
  }
631
601
 
632
- const uploadEntityVersion_ConfigPropertyNames = {
633
- displayName: 'uploadEntityVersion',
634
- parameters: {
635
- required: ['uploadEntityInput'],
636
- optional: []
637
- }
638
- };
602
+ const adapterName = 'uploadEntityVersion';
603
+ const uploadEntityVersion_ConfigPropertyMetadata = [
604
+ generateParamConfigMetadata('uploadEntityInput', true),
605
+ ];
606
+ const uploadEntityVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, uploadEntityVersion_ConfigPropertyMetadata);
639
607
  function createResourceParams(config) {
640
608
  const resourceParams = {
641
609
  body: {
@@ -724,4 +692,4 @@ withDefaultLuvio((luvio) => {
724
692
  });
725
693
 
726
694
  export { getEntityVersion, getEntityVersion_imperative, uploadEntityVersion };
727
- // version: 1.213.0-951602080
695
+ // version: 1.213.1-79de10fe1