@salesforce/lds-adapters-industries-tearsheet 1.100.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.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-tearsheet.js +353 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/getTearsheets.d.ts +29 -0
- package/dist/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +3 -0
- package/dist/types/src/generated/resources/getConnectFinancialservicesTearsheetsByAccountId.d.ts +20 -0
- package/dist/types/src/generated/types/TearsheetListRepresentation.d.ts +31 -0
- package/dist/types/src/generated/types/TearsheetRepresentation.d.ts +32 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-tearsheet.js +361 -0
- package/dist/umd/es5/industries-tearsheet.js +363 -0
- package/package.json +70 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +385 -0
- package/src/raml/api.raml +69 -0
- package/src/raml/luvio.raml +18 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const ObjectFreeze: {
|
|
3
|
+
<T extends Function>(f: T): T;
|
|
4
|
+
<T_1 extends {
|
|
5
|
+
[idx: string]: object | U | null | undefined;
|
|
6
|
+
}, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>;
|
|
7
|
+
<T_2>(o: T_2): Readonly<T_2>;
|
|
8
|
+
}, ObjectKeys: {
|
|
9
|
+
(o: object): string[];
|
|
10
|
+
(o: {}): string[];
|
|
11
|
+
}, ObjectCreate: {
|
|
12
|
+
(o: object | null): any;
|
|
13
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
14
|
+
}, ObjectAssign: {
|
|
15
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
16
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
17
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
18
|
+
(target: object, ...sources: any[]): any;
|
|
19
|
+
};
|
|
20
|
+
export declare const ArrayIsArray: (arg: any) => arg is any[];
|
|
21
|
+
export declare const JSONStringify: {
|
|
22
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
23
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
24
|
+
};
|
|
25
|
+
type AllowedPrimitives = boolean | string | number | Date | null;
|
|
26
|
+
type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
|
|
27
|
+
export type RecursivePartial<T> = null | {
|
|
28
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> | null : Value<T[P]> | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (itemA: U, itemB: U) => boolean | void): boolean;
|
|
31
|
+
export declare function equalsObject<U, V extends {
|
|
32
|
+
[key: string]: U;
|
|
33
|
+
}>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
|
|
34
|
+
export declare function deepFreeze(value: any): void;
|
|
35
|
+
export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
|
|
36
|
+
__ref: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function assignMetadataLink(entry: any, metadataKey: string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
(function (global, factory) {
|
|
8
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
9
|
+
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
10
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.industriesTearsheet = {}, global.engine));
|
|
11
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
+
|
|
13
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
14
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
15
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an adapter config is well-formed.
|
|
18
|
+
* @param config The config to validate.
|
|
19
|
+
* @param adapter The adapter validation configuration.
|
|
20
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
+
*/
|
|
23
|
+
function validateConfig(config, adapter, oneOf) {
|
|
24
|
+
const { displayName } = adapter;
|
|
25
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
26
|
+
if (config === undefined ||
|
|
27
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
28
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
if (unsupported !== undefined &&
|
|
34
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
const supported = required.concat(optional);
|
|
38
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
39
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function untrustedIsObject(untrusted) {
|
|
43
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
+
}
|
|
45
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
47
|
+
}
|
|
48
|
+
const snapshotRefreshOptions = {
|
|
49
|
+
overrides: {
|
|
50
|
+
headers: {
|
|
51
|
+
'Cache-Control': 'no-cache',
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const keyPrefix = 'tearsheet';
|
|
56
|
+
|
|
57
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
58
|
+
const { isArray: ArrayIsArray } = Array;
|
|
59
|
+
const { stringify: JSONStringify } = JSON;
|
|
60
|
+
function createLink(ref) {
|
|
61
|
+
return {
|
|
62
|
+
__ref: engine.serializeStructuredKey(ref),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function validate$1(obj, path = 'TearsheetRepresentation') {
|
|
67
|
+
const v_error = (() => {
|
|
68
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
69
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
70
|
+
}
|
|
71
|
+
const obj_id = obj.id;
|
|
72
|
+
const path_id = path + '.id';
|
|
73
|
+
if (typeof obj_id !== 'string') {
|
|
74
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
75
|
+
}
|
|
76
|
+
const obj_title = obj.title;
|
|
77
|
+
const path_title = path + '.title';
|
|
78
|
+
if (typeof obj_title !== 'string') {
|
|
79
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
80
|
+
}
|
|
81
|
+
})();
|
|
82
|
+
return v_error === undefined ? null : v_error;
|
|
83
|
+
}
|
|
84
|
+
function deepFreeze$1(input) {
|
|
85
|
+
ObjectFreeze(input);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const TTL = 1000;
|
|
89
|
+
const VERSION = "33cf28595aef16a27da68accf962bce3";
|
|
90
|
+
function validate(obj, path = 'TearsheetListRepresentation') {
|
|
91
|
+
const v_error = (() => {
|
|
92
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
93
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
94
|
+
}
|
|
95
|
+
const obj_data = obj.data;
|
|
96
|
+
const path_data = path + '.data';
|
|
97
|
+
if (!ArrayIsArray(obj_data)) {
|
|
98
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
99
|
+
}
|
|
100
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
101
|
+
const obj_data_item = obj_data[i];
|
|
102
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
103
|
+
const referencepath_data_itemValidationError = validate$1(obj_data_item, path_data_item);
|
|
104
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
105
|
+
let message = 'Object doesn\'t match TearsheetRepresentation (at "' + path_data_item + '")\n';
|
|
106
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
107
|
+
return new TypeError(message);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
return v_error === undefined ? null : v_error;
|
|
112
|
+
}
|
|
113
|
+
const RepresentationType = 'TearsheetListRepresentation';
|
|
114
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
115
|
+
return input;
|
|
116
|
+
}
|
|
117
|
+
const select$1 = function TearsheetListRepresentationSelect() {
|
|
118
|
+
return {
|
|
119
|
+
kind: 'Fragment',
|
|
120
|
+
version: VERSION,
|
|
121
|
+
private: [],
|
|
122
|
+
opaque: true
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
function equals(existing, incoming) {
|
|
126
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
function deepFreeze(input) {
|
|
132
|
+
const input_data = input.data;
|
|
133
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
134
|
+
const input_data_item = input_data[i];
|
|
135
|
+
deepFreeze$1(input_data_item);
|
|
136
|
+
}
|
|
137
|
+
ObjectFreeze(input_data);
|
|
138
|
+
ObjectFreeze(input);
|
|
139
|
+
}
|
|
140
|
+
const ingest = function TearsheetListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
141
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
142
|
+
const validateError = validate(input);
|
|
143
|
+
if (validateError !== null) {
|
|
144
|
+
throw validateError;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const key = path.fullPath;
|
|
148
|
+
const existingRecord = store.readEntry(key);
|
|
149
|
+
const ttlToUse = TTL;
|
|
150
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
151
|
+
fullPath: key,
|
|
152
|
+
parent: path.parent,
|
|
153
|
+
propertyName: path.propertyName,
|
|
154
|
+
ttl: ttlToUse
|
|
155
|
+
});
|
|
156
|
+
deepFreeze(input);
|
|
157
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
158
|
+
luvio.storePublish(key, incomingRecord);
|
|
159
|
+
}
|
|
160
|
+
{
|
|
161
|
+
const storeMetadataParams = {
|
|
162
|
+
ttl: ttlToUse,
|
|
163
|
+
namespace: "tearsheet",
|
|
164
|
+
version: VERSION,
|
|
165
|
+
representationName: RepresentationType,
|
|
166
|
+
};
|
|
167
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
168
|
+
}
|
|
169
|
+
return createLink(key);
|
|
170
|
+
};
|
|
171
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
172
|
+
const rootKeySet = new engine.StoreKeyMap();
|
|
173
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
174
|
+
const rootKey = fullPathFactory();
|
|
175
|
+
rootKeySet.set(rootKey, {
|
|
176
|
+
namespace: keyPrefix,
|
|
177
|
+
representationName: RepresentationType,
|
|
178
|
+
mergeable: false
|
|
179
|
+
});
|
|
180
|
+
return rootKeySet;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function select(luvio, params) {
|
|
184
|
+
return select$1();
|
|
185
|
+
}
|
|
186
|
+
function keyBuilder$1(luvio, params) {
|
|
187
|
+
return keyPrefix + '::TearsheetListRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'templateType:' + params.queryParams.templateType + ',' + 'accountId:' + params.urlParams.accountId + ')';
|
|
188
|
+
}
|
|
189
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
190
|
+
return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
191
|
+
}
|
|
192
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
193
|
+
const { body } = response;
|
|
194
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
195
|
+
luvio.storeIngest(key, ingest, body);
|
|
196
|
+
const snapshot = luvio.storeLookup({
|
|
197
|
+
recordId: key,
|
|
198
|
+
node: select(),
|
|
199
|
+
variables: {},
|
|
200
|
+
}, snapshotRefresh);
|
|
201
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
202
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
203
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return snapshot;
|
|
207
|
+
}
|
|
208
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
209
|
+
const key = keyBuilder$1(luvio, params);
|
|
210
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
211
|
+
const storeMetadataParams = {
|
|
212
|
+
ttl: TTL,
|
|
213
|
+
namespace: keyPrefix,
|
|
214
|
+
version: VERSION,
|
|
215
|
+
representationName: RepresentationType
|
|
216
|
+
};
|
|
217
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
218
|
+
return errorSnapshot;
|
|
219
|
+
}
|
|
220
|
+
function createResourceRequest(config) {
|
|
221
|
+
const headers = {};
|
|
222
|
+
return {
|
|
223
|
+
baseUri: '/services/data/v58.0',
|
|
224
|
+
basePath: '/connect/financialservices/tearsheets/' + config.urlParams.accountId + '',
|
|
225
|
+
method: 'get',
|
|
226
|
+
body: null,
|
|
227
|
+
urlParams: config.urlParams,
|
|
228
|
+
queryParams: config.queryParams,
|
|
229
|
+
headers,
|
|
230
|
+
priority: 'normal',
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const getTearsheets_ConfigPropertyNames = {
|
|
235
|
+
displayName: 'getTearsheets',
|
|
236
|
+
parameters: {
|
|
237
|
+
required: ['accountId'],
|
|
238
|
+
optional: ['limit', 'offset', 'templateType']
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
function createResourceParams(config) {
|
|
242
|
+
const resourceParams = {
|
|
243
|
+
urlParams: {
|
|
244
|
+
accountId: config.accountId
|
|
245
|
+
},
|
|
246
|
+
queryParams: {
|
|
247
|
+
limit: config.limit, offset: config.offset, templateType: config.templateType
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
return resourceParams;
|
|
251
|
+
}
|
|
252
|
+
function keyBuilder(luvio, config) {
|
|
253
|
+
const resourceParams = createResourceParams(config);
|
|
254
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
255
|
+
}
|
|
256
|
+
function typeCheckConfig(untrustedConfig) {
|
|
257
|
+
const config = {};
|
|
258
|
+
const untrustedConfig_accountId = untrustedConfig.accountId;
|
|
259
|
+
if (typeof untrustedConfig_accountId === 'string') {
|
|
260
|
+
config.accountId = untrustedConfig_accountId;
|
|
261
|
+
}
|
|
262
|
+
const untrustedConfig_limit = untrustedConfig.limit;
|
|
263
|
+
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
264
|
+
config.limit = untrustedConfig_limit;
|
|
265
|
+
}
|
|
266
|
+
const untrustedConfig_offset = untrustedConfig.offset;
|
|
267
|
+
if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
|
|
268
|
+
config.offset = untrustedConfig_offset;
|
|
269
|
+
}
|
|
270
|
+
const untrustedConfig_templateType = untrustedConfig.templateType;
|
|
271
|
+
if (typeof untrustedConfig_templateType === 'string') {
|
|
272
|
+
config.templateType = untrustedConfig_templateType;
|
|
273
|
+
}
|
|
274
|
+
return config;
|
|
275
|
+
}
|
|
276
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
277
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
281
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
282
|
+
}
|
|
283
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
284
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
return config;
|
|
288
|
+
}
|
|
289
|
+
function adapterFragment(luvio, config) {
|
|
290
|
+
createResourceParams(config);
|
|
291
|
+
return select();
|
|
292
|
+
}
|
|
293
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
294
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
295
|
+
config,
|
|
296
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
297
|
+
});
|
|
298
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
299
|
+
}
|
|
300
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
301
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
302
|
+
config,
|
|
303
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
304
|
+
});
|
|
305
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
306
|
+
}
|
|
307
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
308
|
+
const resourceParams = createResourceParams(config);
|
|
309
|
+
const request = createResourceRequest(resourceParams);
|
|
310
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
311
|
+
.then((response) => {
|
|
312
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
313
|
+
}, (response) => {
|
|
314
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
318
|
+
const { luvio, config } = context;
|
|
319
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
320
|
+
const dispatchOptions = {
|
|
321
|
+
resourceRequestContext: {
|
|
322
|
+
requestCorrelator,
|
|
323
|
+
luvioRequestMethod: undefined,
|
|
324
|
+
},
|
|
325
|
+
eventObservers
|
|
326
|
+
};
|
|
327
|
+
if (networkPriority !== 'normal') {
|
|
328
|
+
dispatchOptions.overrides = {
|
|
329
|
+
priority: networkPriority
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
333
|
+
}
|
|
334
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
335
|
+
const { luvio, config } = context;
|
|
336
|
+
const selector = {
|
|
337
|
+
recordId: keyBuilder(luvio, config),
|
|
338
|
+
node: adapterFragment(luvio, config),
|
|
339
|
+
variables: {},
|
|
340
|
+
};
|
|
341
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
342
|
+
config,
|
|
343
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
344
|
+
});
|
|
345
|
+
return cacheSnapshot;
|
|
346
|
+
}
|
|
347
|
+
const getTearsheetsAdapterFactory = (luvio) => function tearsheet__getTearsheets(untrustedConfig, requestContext) {
|
|
348
|
+
const config = validateAdapterConfig(untrustedConfig, getTearsheets_ConfigPropertyNames);
|
|
349
|
+
// Invalid or incomplete config
|
|
350
|
+
if (config === null) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
354
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
exports.getTearsheetsAdapterFactory = getTearsheetsAdapterFactory;
|
|
358
|
+
|
|
359
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
360
|
+
|
|
361
|
+
}));
|