@salesforce/lds-adapters-cms-type 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, typeCheckArrayOfScalars, StoreKeyMap } from '@luvio/engine';
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, typeCheckArrayOfScalars, StoreKeyMap } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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 = 'CMSType';
|
|
52
70
|
|
|
53
71
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
@@ -189,26 +207,8 @@ const ingest = function ManagedContentTypeSchemaRepresentationIngest(input, path
|
|
|
189
207
|
}
|
|
190
208
|
}
|
|
191
209
|
const key = path.fullPath;
|
|
192
|
-
const existingRecord = store.readEntry(key);
|
|
193
210
|
const ttlToUse = TTL;
|
|
194
|
-
|
|
195
|
-
fullPath: key,
|
|
196
|
-
parent: path.parent,
|
|
197
|
-
propertyName: path.propertyName,
|
|
198
|
-
ttl: ttlToUse
|
|
199
|
-
});
|
|
200
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
201
|
-
luvio.storePublish(key, incomingRecord);
|
|
202
|
-
}
|
|
203
|
-
{
|
|
204
|
-
const storeMetadataParams = {
|
|
205
|
-
ttl: ttlToUse,
|
|
206
|
-
namespace: "CMSType",
|
|
207
|
-
version: VERSION,
|
|
208
|
-
representationName: RepresentationType,
|
|
209
|
-
};
|
|
210
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
211
|
-
}
|
|
211
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "CMSType", VERSION, RepresentationType, equals);
|
|
212
212
|
return createLink(key);
|
|
213
213
|
};
|
|
214
214
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -273,13 +273,14 @@ function createResourceRequest(config) {
|
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
276
|
+
const adapterName = 'getContentType';
|
|
277
|
+
const getContentType_ConfigPropertyMetadata = [
|
|
278
|
+
generateParamConfigMetadata('contentTypeFQN', true),
|
|
279
|
+
generateParamConfigMetadata('includeSchemaDefinitions', false),
|
|
280
|
+
generateParamConfigMetadata('language', false),
|
|
281
|
+
generateParamConfigMetadata('viewMode', false),
|
|
282
|
+
];
|
|
283
|
+
const getContentType_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getContentType_ConfigPropertyMetadata);
|
|
283
284
|
function createResourceParams(config) {
|
|
284
285
|
const resourceParams = {
|
|
285
286
|
urlParams: {
|
|
@@ -353,21 +354,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
353
354
|
});
|
|
354
355
|
}
|
|
355
356
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
356
|
-
|
|
357
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
358
|
-
const dispatchOptions = {
|
|
359
|
-
resourceRequestContext: {
|
|
360
|
-
requestCorrelator,
|
|
361
|
-
luvioRequestMethod: undefined,
|
|
362
|
-
},
|
|
363
|
-
eventObservers
|
|
364
|
-
};
|
|
365
|
-
if (networkPriority !== 'normal') {
|
|
366
|
-
dispatchOptions.overrides = {
|
|
367
|
-
priority: networkPriority
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
357
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
371
358
|
}
|
|
372
359
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
373
360
|
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 = "CMSType";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
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_getConnectCmsContentTypesByContentTypeFQN_ResourceRequestConfig } from '../resources/getConnectCmsContentTypesByContentTypeFQN';
|
|
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 { ManagedContentTypeSchemaRepresentation as types_ManagedContentTypeSchemaRepresentation_ManagedContentTypeSchemaRepresentation } from '../types/ManagedContentTypeSchemaRepresentation';
|
|
5
5
|
export declare const adapterName = "getContentType";
|
|
6
|
+
export declare const getContentType_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
6
7
|
export declare const getContentType_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
7
8
|
export interface GetContentTypeConfig {
|
|
8
9
|
contentTypeFQN: string;
|
package/package.json
CHANGED
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, typeCheckArrayOfScalars, StoreKeyMap } from 'force/luvioEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, typeCheckArrayOfScalars, StoreKeyMap } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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 = 'CMSType';
|
|
62
80
|
|
|
63
81
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
@@ -199,26 +217,8 @@ const ingest = function ManagedContentTypeSchemaRepresentationIngest(input, path
|
|
|
199
217
|
}
|
|
200
218
|
}
|
|
201
219
|
const key = path.fullPath;
|
|
202
|
-
const existingRecord = store.readEntry(key);
|
|
203
220
|
const ttlToUse = TTL;
|
|
204
|
-
|
|
205
|
-
fullPath: key,
|
|
206
|
-
parent: path.parent,
|
|
207
|
-
propertyName: path.propertyName,
|
|
208
|
-
ttl: ttlToUse
|
|
209
|
-
});
|
|
210
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
211
|
-
luvio.storePublish(key, incomingRecord);
|
|
212
|
-
}
|
|
213
|
-
{
|
|
214
|
-
const storeMetadataParams = {
|
|
215
|
-
ttl: ttlToUse,
|
|
216
|
-
namespace: "CMSType",
|
|
217
|
-
version: VERSION,
|
|
218
|
-
representationName: RepresentationType,
|
|
219
|
-
};
|
|
220
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
221
|
-
}
|
|
221
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "CMSType", VERSION, RepresentationType, equals);
|
|
222
222
|
return createLink(key);
|
|
223
223
|
};
|
|
224
224
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -283,13 +283,14 @@ function createResourceRequest(config) {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
286
|
+
const adapterName = 'getContentType';
|
|
287
|
+
const getContentType_ConfigPropertyMetadata = [
|
|
288
|
+
generateParamConfigMetadata('contentTypeFQN', true),
|
|
289
|
+
generateParamConfigMetadata('includeSchemaDefinitions', false),
|
|
290
|
+
generateParamConfigMetadata('language', false),
|
|
291
|
+
generateParamConfigMetadata('viewMode', false),
|
|
292
|
+
];
|
|
293
|
+
const getContentType_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getContentType_ConfigPropertyMetadata);
|
|
293
294
|
function createResourceParams(config) {
|
|
294
295
|
const resourceParams = {
|
|
295
296
|
urlParams: {
|
|
@@ -363,21 +364,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
363
364
|
});
|
|
364
365
|
}
|
|
365
366
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
366
|
-
|
|
367
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
368
|
-
const dispatchOptions = {
|
|
369
|
-
resourceRequestContext: {
|
|
370
|
-
requestCorrelator,
|
|
371
|
-
luvioRequestMethod: undefined,
|
|
372
|
-
},
|
|
373
|
-
eventObservers
|
|
374
|
-
};
|
|
375
|
-
if (networkPriority !== 'normal') {
|
|
376
|
-
dispatchOptions.overrides = {
|
|
377
|
-
priority: networkPriority
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
367
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
381
368
|
}
|
|
382
369
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
383
370
|
const { luvio, config } = context;
|
|
@@ -424,4 +411,4 @@ withDefaultLuvio((luvio) => {
|
|
|
424
411
|
});
|
|
425
412
|
|
|
426
413
|
export { getContentType, getContentType_imperative };
|
|
427
|
-
// version: 1.213.
|
|
414
|
+
// version: 1.213.1-79de10fe1
|