@salesforce/lds-adapters-industries-materialityassessment 1.213.0 → 1.213.2

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, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -41,6 +41,24 @@ function untrustedIsObject(untrusted) {
41
41
  function areRequiredParametersPresent(config, configPropertyNames) {
42
42
  return configPropertyNames.parameters.required.every(req => req in config);
43
43
  }
44
+ function generateParamConfigMetadata(name, required, coerceFn) {
45
+ return {
46
+ name,
47
+ required,
48
+ coerceFn,
49
+ };
50
+ }
51
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
52
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
53
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
54
+ return {
55
+ displayName,
56
+ parameters: {
57
+ required,
58
+ optional,
59
+ }
60
+ };
61
+ }
44
62
  const keyPrefix = 'MaterialityAssessment';
45
63
 
46
64
  const { isArray: ArrayIsArray } = Array;
@@ -106,26 +124,8 @@ const ingest = function PerformCalculationDetailRepresentationIngest(input, path
106
124
  }
107
125
  }
108
126
  const key = keyBuilderFromType(luvio, input);
109
- const existingRecord = store.readEntry(key);
110
127
  const ttlToUse = TTL;
111
- let incomingRecord = normalize(input, store.readEntry(key), {
112
- fullPath: key,
113
- parent: path.parent,
114
- propertyName: path.propertyName,
115
- ttl: ttlToUse
116
- });
117
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
118
- luvio.storePublish(key, incomingRecord);
119
- }
120
- {
121
- const storeMetadataParams = {
122
- ttl: ttlToUse,
123
- namespace: "MaterialityAssessment",
124
- version: VERSION,
125
- representationName: RepresentationType,
126
- };
127
- luvio.publishStoreMetadata(key, storeMetadataParams);
128
- }
128
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "MaterialityAssessment", VERSION, RepresentationType, equals);
129
129
  return createLink(key);
130
130
  };
131
131
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -175,13 +175,11 @@ function createResourceRequest(config) {
175
175
  };
176
176
  }
177
177
 
178
- const postPerformCalculation_ConfigPropertyNames = {
179
- displayName: 'postPerformCalculation',
180
- parameters: {
181
- required: ['materialityAssessmentId'],
182
- optional: []
183
- }
184
- };
178
+ const adapterName = 'postPerformCalculation';
179
+ const postPerformCalculation_ConfigPropertyMetadata = [
180
+ generateParamConfigMetadata('materialityAssessmentId', true),
181
+ ];
182
+ const postPerformCalculation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postPerformCalculation_ConfigPropertyMetadata);
185
183
  function createResourceParams(config) {
186
184
  const resourceParams = {
187
185
  urlParams: {
@@ -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 = "MaterialityAssessment";
@@ -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, 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 { ResourceRequestConfig as resources_postConnectMaterialityassessmentCalculateByMaterialityAssessmentId_ResourceRequestConfig } from '../resources/postConnectMaterialityassessmentCalculateByMaterialityAssessmentId';
3
- import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { PerformCalculationDetailRepresentation as types_PerformCalculationDetailRepresentation_PerformCalculationDetailRepresentation } from '../types/PerformCalculationDetailRepresentation';
5
5
  export declare const adapterName = "postPerformCalculation";
6
+ export declare const postPerformCalculation_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const postPerformCalculation_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface PostPerformCalculationConfig {
8
9
  materialityAssessmentId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-materialityassessment",
3
- "version": "1.213.0",
3
+ "version": "1.213.2",
4
4
  "description": "connect endpoints for materiality assessment",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/industries-materialityassessment.js",
package/sfdc/index.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  /* proxy-compat-disable */
15
15
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
16
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
17
17
 
18
18
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
19
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -50,6 +50,24 @@ function untrustedIsObject(untrusted) {
50
50
  function areRequiredParametersPresent(config, configPropertyNames) {
51
51
  return configPropertyNames.parameters.required.every(req => req in config);
52
52
  }
53
+ function generateParamConfigMetadata(name, required, coerceFn) {
54
+ return {
55
+ name,
56
+ required,
57
+ coerceFn,
58
+ };
59
+ }
60
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
61
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
62
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
63
+ return {
64
+ displayName,
65
+ parameters: {
66
+ required,
67
+ optional,
68
+ }
69
+ };
70
+ }
53
71
  const keyPrefix = 'MaterialityAssessment';
54
72
 
55
73
  const { isArray: ArrayIsArray } = Array;
@@ -115,26 +133,8 @@ const ingest = function PerformCalculationDetailRepresentationIngest(input, path
115
133
  }
116
134
  }
117
135
  const key = keyBuilderFromType(luvio, input);
118
- const existingRecord = store.readEntry(key);
119
136
  const ttlToUse = TTL;
120
- let incomingRecord = normalize(input, store.readEntry(key), {
121
- fullPath: key,
122
- parent: path.parent,
123
- propertyName: path.propertyName,
124
- ttl: ttlToUse
125
- });
126
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
127
- luvio.storePublish(key, incomingRecord);
128
- }
129
- {
130
- const storeMetadataParams = {
131
- ttl: ttlToUse,
132
- namespace: "MaterialityAssessment",
133
- version: VERSION,
134
- representationName: RepresentationType,
135
- };
136
- luvio.publishStoreMetadata(key, storeMetadataParams);
137
- }
137
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "MaterialityAssessment", VERSION, RepresentationType, equals);
138
138
  return createLink(key);
139
139
  };
140
140
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -184,13 +184,11 @@ function createResourceRequest(config) {
184
184
  };
185
185
  }
186
186
 
187
- const postPerformCalculation_ConfigPropertyNames = {
188
- displayName: 'postPerformCalculation',
189
- parameters: {
190
- required: ['materialityAssessmentId'],
191
- optional: []
192
- }
193
- };
187
+ const adapterName = 'postPerformCalculation';
188
+ const postPerformCalculation_ConfigPropertyMetadata = [
189
+ generateParamConfigMetadata('materialityAssessmentId', true),
190
+ ];
191
+ const postPerformCalculation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postPerformCalculation_ConfigPropertyMetadata);
194
192
  function createResourceParams(config) {
195
193
  const resourceParams = {
196
194
  urlParams: {
@@ -266,4 +264,4 @@ withDefaultLuvio((luvio) => {
266
264
  });
267
265
 
268
266
  export { postPerformCalculation };
269
- // version: 1.213.0-951602080
267
+ // version: 1.213.2-1eb996209