@salesforce/lds-adapters-industries-fieldset 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, 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 = 'fieldset';
52
70
 
53
71
  const { isArray: ArrayIsArray } = Array;
@@ -147,26 +165,8 @@ const ingest = function FieldSetsOutputRepresentationIngest(input, path, luvio,
147
165
  }
148
166
  }
149
167
  const key = keyBuilderFromType(luvio, input);
150
- const existingRecord = store.readEntry(key);
151
168
  const ttlToUse = TTL;
152
- let incomingRecord = normalize(input, store.readEntry(key), {
153
- fullPath: key,
154
- parent: path.parent,
155
- propertyName: path.propertyName,
156
- ttl: ttlToUse
157
- });
158
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
159
- luvio.storePublish(key, incomingRecord);
160
- }
161
- {
162
- const storeMetadataParams = {
163
- ttl: ttlToUse,
164
- namespace: "fieldset",
165
- version: VERSION,
166
- representationName: RepresentationType,
167
- };
168
- luvio.publishStoreMetadata(key, storeMetadataParams);
169
- }
169
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "fieldset", VERSION, RepresentationType, equals);
170
170
  return createLink(key);
171
171
  };
172
172
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -233,13 +233,11 @@ function createResourceRequest(config) {
233
233
  };
234
234
  }
235
235
 
236
- const getFieldSets_ConfigPropertyNames = {
237
- displayName: 'getFieldSets',
238
- parameters: {
239
- required: ['objectName'],
240
- optional: []
241
- }
242
- };
236
+ const adapterName = 'getFieldSets';
237
+ const getFieldSets_ConfigPropertyMetadata = [
238
+ generateParamConfigMetadata('objectName', true),
239
+ ];
240
+ const getFieldSets_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getFieldSets_ConfigPropertyMetadata);
243
241
  function createResourceParams(config) {
244
242
  const resourceParams = {
245
243
  urlParams: {
@@ -305,21 +303,7 @@ function buildNetworkSnapshot(luvio, config, options) {
305
303
  });
306
304
  }
307
305
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
308
- const { luvio, config } = context;
309
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
310
- const dispatchOptions = {
311
- resourceRequestContext: {
312
- requestCorrelator,
313
- luvioRequestMethod: undefined,
314
- },
315
- eventObservers
316
- };
317
- if (networkPriority !== 'normal') {
318
- dispatchOptions.overrides = {
319
- priority: networkPriority
320
- };
321
- }
322
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
306
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
323
307
  }
324
308
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
325
309
  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 = "fieldset";
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } 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, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectFieldsetByObjectName_ResourceRequestConfig } from '../resources/getConnectFieldsetByObjectName';
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 { FieldSetsOutputRepresentation as types_FieldSetsOutputRepresentation_FieldSetsOutputRepresentation, KeyParams as types_FieldSetsOutputRepresentation_KeyParams } from '../types/FieldSetsOutputRepresentation';
5
5
  export declare const adapterName = "getFieldSets";
6
+ export declare const getFieldSets_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getFieldSets_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetFieldSetsConfig {
8
9
  objectName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-fieldset",
3
- "version": "1.213.0",
3
+ "version": "1.213.2",
4
4
  "description": "Field Set",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/industries-fieldset.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, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars } 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 = 'fieldset';
62
80
 
63
81
  const { isArray: ArrayIsArray } = Array;
@@ -157,26 +175,8 @@ const ingest = function FieldSetsOutputRepresentationIngest(input, path, luvio,
157
175
  }
158
176
  }
159
177
  const key = keyBuilderFromType(luvio, input);
160
- const existingRecord = store.readEntry(key);
161
178
  const ttlToUse = TTL;
162
- let incomingRecord = normalize(input, store.readEntry(key), {
163
- fullPath: key,
164
- parent: path.parent,
165
- propertyName: path.propertyName,
166
- ttl: ttlToUse
167
- });
168
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
169
- luvio.storePublish(key, incomingRecord);
170
- }
171
- {
172
- const storeMetadataParams = {
173
- ttl: ttlToUse,
174
- namespace: "fieldset",
175
- version: VERSION,
176
- representationName: RepresentationType,
177
- };
178
- luvio.publishStoreMetadata(key, storeMetadataParams);
179
- }
179
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "fieldset", VERSION, RepresentationType, equals);
180
180
  return createLink(key);
181
181
  };
182
182
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -250,13 +250,11 @@ function createResourceRequestFromRepresentation(representation) {
250
250
  return createResourceRequest(config);
251
251
  }
252
252
 
253
- const getFieldSets_ConfigPropertyNames = {
254
- displayName: 'getFieldSets',
255
- parameters: {
256
- required: ['objectName'],
257
- optional: []
258
- }
259
- };
253
+ const adapterName = 'getFieldSets';
254
+ const getFieldSets_ConfigPropertyMetadata = [
255
+ generateParamConfigMetadata('objectName', true),
256
+ ];
257
+ const getFieldSets_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getFieldSets_ConfigPropertyMetadata);
260
258
  function createResourceParams(config) {
261
259
  const resourceParams = {
262
260
  urlParams: {
@@ -322,21 +320,7 @@ function buildNetworkSnapshot(luvio, config, options) {
322
320
  });
323
321
  }
324
322
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
325
- const { luvio, config } = context;
326
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
327
- const dispatchOptions = {
328
- resourceRequestContext: {
329
- requestCorrelator,
330
- luvioRequestMethod: undefined,
331
- },
332
- eventObservers
333
- };
334
- if (networkPriority !== 'normal') {
335
- dispatchOptions.overrides = {
336
- priority: networkPriority
337
- };
338
- }
339
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
323
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
340
324
  }
341
325
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
342
326
  const { luvio, config } = context;
@@ -420,4 +404,4 @@ withDefaultLuvio((luvio) => {
420
404
  });
421
405
 
422
406
  export { getFieldSets, getFieldSetsNotifyChange, getFieldSets_imperative };
423
- // version: 1.213.0-951602080
407
+ // version: 1.213.2-1eb996209