@salesforce/lds-adapters-platform-scale-center 1.170.0 → 1.170.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,
|
|
7
|
+
import { serializeStructuredKey, deepFreeze, StoreKeyMap } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -127,8 +127,7 @@ const ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, l
|
|
|
127
127
|
}
|
|
128
128
|
return createLink(key);
|
|
129
129
|
};
|
|
130
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
131
|
-
const rootKeySet = new StoreKeyMap();
|
|
130
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
132
131
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
133
132
|
const rootKey = fullPathFactory();
|
|
134
133
|
rootKeySet.set(rootKey, {
|
|
@@ -136,7 +135,6 @@ function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
|
136
135
|
representationName: RepresentationType,
|
|
137
136
|
mergeable: false
|
|
138
137
|
});
|
|
139
|
-
return rootKeySet;
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
function select(luvio, params) {
|
|
@@ -145,8 +143,8 @@ function select(luvio, params) {
|
|
|
145
143
|
function keyBuilder$1(luvio, params) {
|
|
146
144
|
return keyPrefix + '::ScaleCenterMetricDataRepresentation:(' + 'request:' + params.queryParams.request + ')';
|
|
147
145
|
}
|
|
148
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
149
|
-
|
|
146
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
147
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
150
148
|
}
|
|
151
149
|
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
152
150
|
const { body } = response;
|
|
@@ -254,7 +252,11 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
254
252
|
const request = createResourceRequest(resourceParams);
|
|
255
253
|
return luvio.dispatchResourceRequest(request, options)
|
|
256
254
|
.then((response) => {
|
|
257
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () =>
|
|
255
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
256
|
+
const cache = new StoreKeyMap();
|
|
257
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
258
|
+
return cache;
|
|
259
|
+
});
|
|
258
260
|
}, (response) => {
|
|
259
261
|
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
260
262
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata,
|
|
1
|
+
import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, FetchResponse as $64$luvio_engine_FetchResponse, SnapshotRefresh as $64$luvio_engine_SnapshotRefresh, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ErrorResponse as $64$luvio_engine_ErrorResponse, ErrorSnapshot as $64$luvio_engine_ErrorSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
|
|
2
2
|
import { ScaleCenterMetricDataRepresentation as types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation } from '../types/ScaleCenterMetricDataRepresentation';
|
|
3
3
|
export interface ResourceRequestConfig {
|
|
4
4
|
queryParams: {
|
|
@@ -8,7 +8,7 @@ export interface ResourceRequestConfig {
|
|
|
8
8
|
export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
|
|
9
9
|
export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
|
|
10
10
|
export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
|
|
11
|
-
export declare function getResponseCacheKeys(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation):
|
|
11
|
+
export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation): void;
|
|
12
12
|
export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation, any>;
|
|
13
13
|
export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation>): $64$luvio_engine_ErrorSnapshot;
|
|
14
14
|
export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest,
|
|
1
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
2
|
export declare const TTL = 30000;
|
|
3
3
|
export declare const VERSION = "b8f014d0e9442d4f93f4eec945f0b6e4";
|
|
4
4
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
@@ -7,7 +7,7 @@ export declare function normalize(input: ScaleCenterMetricDataRepresentation, ex
|
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: ScaleCenterMetricDataRepresentationNormalized, incoming: ScaleCenterMetricDataRepresentationNormalized): boolean;
|
|
9
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
|
-
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ScaleCenterMetricDataRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata):
|
|
10
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ScaleCenterMetricDataRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
11
11
|
/**
|
|
12
12
|
* Metrics data for Scale Center
|
|
13
13
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-platform-scale-center",
|
|
3
|
-
"version": "1.170.
|
|
3
|
+
"version": "1.170.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS Adapter for Scale Center observability metrics and insights",
|
|
6
6
|
"main": "dist/es/es2018/platform-scale-center.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,
|
|
17
|
+
import { serializeStructuredKey, deepFreeze, StoreKeyMap } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -137,8 +137,7 @@ const ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, l
|
|
|
137
137
|
}
|
|
138
138
|
return createLink(key);
|
|
139
139
|
};
|
|
140
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
141
|
-
const rootKeySet = new StoreKeyMap();
|
|
140
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
142
141
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
143
142
|
const rootKey = fullPathFactory();
|
|
144
143
|
rootKeySet.set(rootKey, {
|
|
@@ -146,7 +145,6 @@ function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
|
146
145
|
representationName: RepresentationType,
|
|
147
146
|
mergeable: false
|
|
148
147
|
});
|
|
149
|
-
return rootKeySet;
|
|
150
148
|
}
|
|
151
149
|
|
|
152
150
|
function select(luvio, params) {
|
|
@@ -155,8 +153,8 @@ function select(luvio, params) {
|
|
|
155
153
|
function keyBuilder$1(luvio, params) {
|
|
156
154
|
return keyPrefix + '::ScaleCenterMetricDataRepresentation:(' + 'request:' + params.queryParams.request + ')';
|
|
157
155
|
}
|
|
158
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
159
|
-
|
|
156
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
157
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
160
158
|
}
|
|
161
159
|
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
162
160
|
const { body } = response;
|
|
@@ -264,7 +262,11 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
264
262
|
const request = createResourceRequest(resourceParams);
|
|
265
263
|
return luvio.dispatchResourceRequest(request, options)
|
|
266
264
|
.then((response) => {
|
|
267
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () =>
|
|
265
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
266
|
+
const cache = new StoreKeyMap();
|
|
267
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
268
|
+
return cache;
|
|
269
|
+
});
|
|
268
270
|
}, (response) => {
|
|
269
271
|
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
270
272
|
});
|
|
@@ -331,4 +333,4 @@ withDefaultLuvio((luvio) => {
|
|
|
331
333
|
});
|
|
332
334
|
|
|
333
335
|
export { queryMetrics, queryMetrics_imperative };
|
|
334
|
-
// version: 1.170.
|
|
336
|
+
// version: 1.170.1-5fb216cf1
|