@salesforce/lds-adapters-platform-scale-center 1.124.1 → 1.124.3

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.
@@ -1,309 +0,0 @@
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["platformScale-center"] = {}, global.engine));
11
- })(this, (function (exports, engine) { 'use strict';
12
-
13
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
14
- const { keys: ObjectKeys, freeze: ObjectFreeze, create: ObjectCreate } = 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(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 = 'ScaleCenter';
56
-
57
- const { isArray: ArrayIsArray } = Array;
58
- function createLink(ref) {
59
- return {
60
- __ref: engine.serializeStructuredKey(ref),
61
- };
62
- }
63
-
64
- const TTL = 30000;
65
- const VERSION = "b8f014d0e9442d4f93f4eec945f0b6e4";
66
- function validate(obj, path = 'ScaleCenterMetricDataRepresentation') {
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_response = obj.response;
72
- const path_response = path + '.response';
73
- if (typeof obj_response !== 'string') {
74
- return new TypeError('Expected "string" but received "' + typeof obj_response + '" (at "' + path_response + '")');
75
- }
76
- })();
77
- return v_error === undefined ? null : v_error;
78
- }
79
- const RepresentationType = 'ScaleCenterMetricDataRepresentation';
80
- function normalize(input, existing, path, luvio, store, timestamp) {
81
- return input;
82
- }
83
- const select$1 = function ScaleCenterMetricDataRepresentationSelect() {
84
- return {
85
- kind: 'Fragment',
86
- version: VERSION,
87
- private: [],
88
- selections: [
89
- {
90
- name: 'response',
91
- kind: 'Scalar'
92
- }
93
- ]
94
- };
95
- };
96
- function equals(existing, incoming) {
97
- const existing_response = existing.response;
98
- const incoming_response = incoming.response;
99
- if (!(existing_response === incoming_response)) {
100
- return false;
101
- }
102
- return true;
103
- }
104
- const ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, luvio, store, timestamp) {
105
- if (process.env.NODE_ENV !== 'production') {
106
- const validateError = validate(input);
107
- if (validateError !== null) {
108
- throw validateError;
109
- }
110
- }
111
- const key = path.fullPath;
112
- const existingRecord = store.readEntry(key);
113
- const ttlToUse = TTL;
114
- let incomingRecord = normalize(input, store.readEntry(key), {
115
- fullPath: key,
116
- parent: path.parent,
117
- propertyName: path.propertyName,
118
- ttl: ttlToUse
119
- });
120
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
121
- luvio.storePublish(key, incomingRecord);
122
- }
123
- {
124
- const storeMetadataParams = {
125
- ttl: ttlToUse,
126
- namespace: "ScaleCenter",
127
- version: VERSION,
128
- representationName: RepresentationType,
129
- };
130
- luvio.publishStoreMetadata(key, storeMetadataParams);
131
- }
132
- return createLink(key);
133
- };
134
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
135
- const rootKeySet = new engine.StoreKeyMap();
136
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
137
- const rootKey = fullPathFactory();
138
- rootKeySet.set(rootKey, {
139
- namespace: keyPrefix,
140
- representationName: RepresentationType,
141
- mergeable: false
142
- });
143
- return rootKeySet;
144
- }
145
-
146
- function select(luvio, params) {
147
- return select$1();
148
- }
149
- function keyBuilder$1(luvio, params) {
150
- return keyPrefix + '::ScaleCenterMetricDataRepresentation:(' + 'request:' + params.queryParams.request + ')';
151
- }
152
- function getResponseCacheKeys(luvio, resourceParams, response) {
153
- return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
154
- }
155
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
156
- const { body } = response;
157
- const key = keyBuilder$1(luvio, resourceParams);
158
- luvio.storeIngest(key, ingest, body);
159
- const snapshot = luvio.storeLookup({
160
- recordId: key,
161
- node: select(),
162
- variables: {},
163
- }, snapshotRefresh);
164
- if (process.env.NODE_ENV !== 'production') {
165
- if (snapshot.state !== 'Fulfilled') {
166
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
167
- }
168
- }
169
- return snapshot;
170
- }
171
- function ingestError(luvio, params, error, snapshotRefresh) {
172
- const key = keyBuilder$1(luvio, params);
173
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
174
- const storeMetadataParams = {
175
- ttl: TTL,
176
- namespace: keyPrefix,
177
- version: VERSION,
178
- representationName: RepresentationType
179
- };
180
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
181
- return errorSnapshot;
182
- }
183
- function createResourceRequest(config) {
184
- const headers = {};
185
- return {
186
- baseUri: '/services/data/v58.0',
187
- basePath: '/scalecenter/metrics/query',
188
- method: 'get',
189
- body: null,
190
- urlParams: {},
191
- queryParams: config.queryParams,
192
- headers,
193
- priority: 'normal',
194
- };
195
- }
196
-
197
- const queryMetrics_ConfigPropertyNames = {
198
- displayName: 'queryMetrics',
199
- parameters: {
200
- required: [],
201
- optional: ['request']
202
- }
203
- };
204
- function createResourceParams(config) {
205
- const resourceParams = {
206
- queryParams: {
207
- request: config.request
208
- }
209
- };
210
- return resourceParams;
211
- }
212
- function keyBuilder(luvio, config) {
213
- const resourceParams = createResourceParams(config);
214
- return keyBuilder$1(luvio, resourceParams);
215
- }
216
- function typeCheckConfig(untrustedConfig) {
217
- const config = {};
218
- const untrustedConfig_request = untrustedConfig.request;
219
- if (typeof untrustedConfig_request === 'string') {
220
- config.request = untrustedConfig_request;
221
- }
222
- return config;
223
- }
224
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
225
- if (!untrustedIsObject(untrustedConfig)) {
226
- return null;
227
- }
228
- if (process.env.NODE_ENV !== 'production') {
229
- validateConfig(untrustedConfig, configPropertyNames);
230
- }
231
- const config = typeCheckConfig(untrustedConfig);
232
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
233
- return null;
234
- }
235
- return config;
236
- }
237
- function adapterFragment(luvio, config) {
238
- createResourceParams(config);
239
- return select();
240
- }
241
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
242
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
243
- config,
244
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
245
- });
246
- return luvio.storeBroadcast().then(() => snapshot);
247
- }
248
- function onFetchResponseError(luvio, config, resourceParams, response) {
249
- const snapshot = ingestError(luvio, resourceParams, response, {
250
- config,
251
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
252
- });
253
- return luvio.storeBroadcast().then(() => snapshot);
254
- }
255
- function buildNetworkSnapshot(luvio, config, options) {
256
- const resourceParams = createResourceParams(config);
257
- const request = createResourceRequest(resourceParams);
258
- return luvio.dispatchResourceRequest(request, options)
259
- .then((response) => {
260
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
261
- }, (response) => {
262
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
263
- });
264
- }
265
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
266
- const { luvio, config } = context;
267
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
268
- const dispatchOptions = {
269
- resourceRequestContext: {
270
- requestCorrelator,
271
- luvioRequestMethod: undefined,
272
- },
273
- eventObservers
274
- };
275
- if (networkPriority !== 'normal') {
276
- dispatchOptions.overrides = {
277
- priority: networkPriority
278
- };
279
- }
280
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
281
- }
282
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
283
- const { luvio, config } = context;
284
- const selector = {
285
- recordId: keyBuilder(luvio, config),
286
- node: adapterFragment(luvio, config),
287
- variables: {},
288
- };
289
- const cacheSnapshot = storeLookup(selector, {
290
- config,
291
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
292
- });
293
- return cacheSnapshot;
294
- }
295
- const queryMetricsAdapterFactory = (luvio) => function ScaleCenter__queryMetrics(untrustedConfig, requestContext) {
296
- const config = validateAdapterConfig(untrustedConfig, queryMetrics_ConfigPropertyNames);
297
- // Invalid or incomplete config
298
- if (config === null) {
299
- return null;
300
- }
301
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
302
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
303
- };
304
-
305
- exports.queryMetricsAdapterFactory = queryMetricsAdapterFactory;
306
-
307
- Object.defineProperty(exports, '__esModule', { value: true });
308
-
309
- }));
@@ -1,310 +0,0 @@
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["platformScale-center"] = {}, global.engine));
11
- })(this, (function (exports, engine) { 'use strict';
12
-
13
- var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
- var ObjectKeys = Object.keys;
15
- var ArrayIsArray$1 = Array.isArray;
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
- var displayName = adapter.displayName;
25
- var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
- if (config === undefined ||
27
- required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
- throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
- }
30
- if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
- throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
- }
33
- if (unsupported !== undefined &&
34
- unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
- throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
- }
37
- var supported = required.concat(optional);
38
- if (ObjectKeys(config).some(function (key) { return !supported.includes(key); })) {
39
- throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(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(function (req) { return req in config; });
47
- }
48
- var snapshotRefreshOptions = {
49
- overrides: {
50
- headers: {
51
- 'Cache-Control': 'no-cache',
52
- },
53
- }
54
- };
55
- var keyPrefix = 'ScaleCenter';
56
-
57
- var ArrayIsArray = Array.isArray;
58
- function createLink(ref) {
59
- return {
60
- __ref: engine.serializeStructuredKey(ref),
61
- };
62
- }
63
-
64
- var TTL = 30000;
65
- var VERSION = "b8f014d0e9442d4f93f4eec945f0b6e4";
66
- function validate(obj, path) {
67
- if (path === void 0) { path = 'ScaleCenterMetricDataRepresentation'; }
68
- var v_error = (function () {
69
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
70
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
71
- }
72
- var obj_response = obj.response;
73
- var path_response = path + '.response';
74
- if (typeof obj_response !== 'string') {
75
- return new TypeError('Expected "string" but received "' + typeof obj_response + '" (at "' + path_response + '")');
76
- }
77
- })();
78
- return v_error === undefined ? null : v_error;
79
- }
80
- var RepresentationType = 'ScaleCenterMetricDataRepresentation';
81
- function normalize(input, existing, path, luvio, store, timestamp) {
82
- return input;
83
- }
84
- var select$1 = function ScaleCenterMetricDataRepresentationSelect() {
85
- return {
86
- kind: 'Fragment',
87
- version: VERSION,
88
- private: [],
89
- selections: [
90
- {
91
- name: 'response',
92
- kind: 'Scalar'
93
- }
94
- ]
95
- };
96
- };
97
- function equals(existing, incoming) {
98
- var existing_response = existing.response;
99
- var incoming_response = incoming.response;
100
- if (!(existing_response === incoming_response)) {
101
- return false;
102
- }
103
- return true;
104
- }
105
- var ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, luvio, store, timestamp) {
106
- if (process.env.NODE_ENV !== 'production') {
107
- var validateError = validate(input);
108
- if (validateError !== null) {
109
- throw validateError;
110
- }
111
- }
112
- var key = path.fullPath;
113
- var existingRecord = store.readEntry(key);
114
- var ttlToUse = TTL;
115
- var incomingRecord = normalize(input, store.readEntry(key), {
116
- fullPath: key,
117
- parent: path.parent,
118
- propertyName: path.propertyName,
119
- ttl: ttlToUse
120
- });
121
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
122
- luvio.storePublish(key, incomingRecord);
123
- }
124
- {
125
- var storeMetadataParams = {
126
- ttl: ttlToUse,
127
- namespace: "ScaleCenter",
128
- version: VERSION,
129
- representationName: RepresentationType,
130
- };
131
- luvio.publishStoreMetadata(key, storeMetadataParams);
132
- }
133
- return createLink(key);
134
- };
135
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
136
- var rootKeySet = new engine.StoreKeyMap();
137
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
138
- var rootKey = fullPathFactory();
139
- rootKeySet.set(rootKey, {
140
- namespace: keyPrefix,
141
- representationName: RepresentationType,
142
- mergeable: false
143
- });
144
- return rootKeySet;
145
- }
146
-
147
- function select(luvio, params) {
148
- return select$1();
149
- }
150
- function keyBuilder$1(luvio, params) {
151
- return keyPrefix + '::ScaleCenterMetricDataRepresentation:(' + 'request:' + params.queryParams.request + ')';
152
- }
153
- function getResponseCacheKeys(luvio, resourceParams, response) {
154
- return getTypeCacheKeys(luvio, response, function () { return keyBuilder$1(luvio, resourceParams); });
155
- }
156
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
157
- var body = response.body;
158
- var key = keyBuilder$1(luvio, resourceParams);
159
- luvio.storeIngest(key, ingest, body);
160
- var snapshot = luvio.storeLookup({
161
- recordId: key,
162
- node: select(),
163
- variables: {},
164
- }, snapshotRefresh);
165
- if (process.env.NODE_ENV !== 'production') {
166
- if (snapshot.state !== 'Fulfilled') {
167
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
168
- }
169
- }
170
- return snapshot;
171
- }
172
- function ingestError(luvio, params, error, snapshotRefresh) {
173
- var key = keyBuilder$1(luvio, params);
174
- var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
175
- var storeMetadataParams = {
176
- ttl: TTL,
177
- namespace: keyPrefix,
178
- version: VERSION,
179
- representationName: RepresentationType
180
- };
181
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
182
- return errorSnapshot;
183
- }
184
- function createResourceRequest(config) {
185
- var headers = {};
186
- return {
187
- baseUri: '/services/data/v58.0',
188
- basePath: '/scalecenter/metrics/query',
189
- method: 'get',
190
- body: null,
191
- urlParams: {},
192
- queryParams: config.queryParams,
193
- headers: headers,
194
- priority: 'normal',
195
- };
196
- }
197
-
198
- var queryMetrics_ConfigPropertyNames = {
199
- displayName: 'queryMetrics',
200
- parameters: {
201
- required: [],
202
- optional: ['request']
203
- }
204
- };
205
- function createResourceParams(config) {
206
- var resourceParams = {
207
- queryParams: {
208
- request: config.request
209
- }
210
- };
211
- return resourceParams;
212
- }
213
- function keyBuilder(luvio, config) {
214
- var resourceParams = createResourceParams(config);
215
- return keyBuilder$1(luvio, resourceParams);
216
- }
217
- function typeCheckConfig(untrustedConfig) {
218
- var config = {};
219
- var untrustedConfig_request = untrustedConfig.request;
220
- if (typeof untrustedConfig_request === 'string') {
221
- config.request = untrustedConfig_request;
222
- }
223
- return config;
224
- }
225
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
226
- if (!untrustedIsObject(untrustedConfig)) {
227
- return null;
228
- }
229
- if (process.env.NODE_ENV !== 'production') {
230
- validateConfig(untrustedConfig, configPropertyNames);
231
- }
232
- var config = typeCheckConfig(untrustedConfig);
233
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
234
- return null;
235
- }
236
- return config;
237
- }
238
- function adapterFragment(luvio, config) {
239
- createResourceParams(config);
240
- return select();
241
- }
242
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
243
- var snapshot = ingestSuccess(luvio, resourceParams, response, {
244
- config: config,
245
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
246
- });
247
- return luvio.storeBroadcast().then(function () { return snapshot; });
248
- }
249
- function onFetchResponseError(luvio, config, resourceParams, response) {
250
- var snapshot = ingestError(luvio, resourceParams, response, {
251
- config: config,
252
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
253
- });
254
- return luvio.storeBroadcast().then(function () { return snapshot; });
255
- }
256
- function buildNetworkSnapshot(luvio, config, options) {
257
- var resourceParams = createResourceParams(config);
258
- var request = createResourceRequest(resourceParams);
259
- return luvio.dispatchResourceRequest(request, options)
260
- .then(function (response) {
261
- return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
262
- }, function (response) {
263
- return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
264
- });
265
- }
266
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
267
- var luvio = context.luvio, config = context.config;
268
- var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
269
- var dispatchOptions = {
270
- resourceRequestContext: {
271
- requestCorrelator: requestCorrelator,
272
- luvioRequestMethod: undefined,
273
- },
274
- eventObservers: eventObservers
275
- };
276
- if (networkPriority !== 'normal') {
277
- dispatchOptions.overrides = {
278
- priority: networkPriority
279
- };
280
- }
281
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
282
- }
283
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
284
- var luvio = context.luvio, config = context.config;
285
- var selector = {
286
- recordId: keyBuilder(luvio, config),
287
- node: adapterFragment(luvio, config),
288
- variables: {},
289
- };
290
- var cacheSnapshot = storeLookup(selector, {
291
- config: config,
292
- resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
293
- });
294
- return cacheSnapshot;
295
- }
296
- var queryMetricsAdapterFactory = function (luvio) { return function ScaleCenter__queryMetrics(untrustedConfig, requestContext) {
297
- var config = validateAdapterConfig(untrustedConfig, queryMetrics_ConfigPropertyNames);
298
- // Invalid or incomplete config
299
- if (config === null) {
300
- return null;
301
- }
302
- return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
303
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
304
- }; };
305
-
306
- exports.queryMetricsAdapterFactory = queryMetricsAdapterFactory;
307
-
308
- Object.defineProperty(exports, '__esModule', { value: true });
309
-
310
- }));