@salesforce/lds-adapters-platform-scale-center 1.212.1 → 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, 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 = 'ScaleCenter';
|
|
52
70
|
|
|
53
71
|
const { isArray: ArrayIsArray } = Array;
|
|
@@ -105,26 +123,8 @@ const ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, l
|
|
|
105
123
|
}
|
|
106
124
|
}
|
|
107
125
|
const key = path.fullPath;
|
|
108
|
-
const existingRecord = store.readEntry(key);
|
|
109
126
|
const ttlToUse = TTL;
|
|
110
|
-
|
|
111
|
-
fullPath: key,
|
|
112
|
-
parent: path.parent,
|
|
113
|
-
propertyName: path.propertyName,
|
|
114
|
-
ttl: ttlToUse
|
|
115
|
-
});
|
|
116
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
117
|
-
luvio.storePublish(key, incomingRecord);
|
|
118
|
-
}
|
|
119
|
-
{
|
|
120
|
-
const storeMetadataParams = {
|
|
121
|
-
ttl: ttlToUse,
|
|
122
|
-
namespace: "ScaleCenter",
|
|
123
|
-
version: VERSION,
|
|
124
|
-
representationName: RepresentationType,
|
|
125
|
-
};
|
|
126
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
127
|
-
}
|
|
127
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ScaleCenter", VERSION, RepresentationType, equals);
|
|
128
128
|
return createLink(key);
|
|
129
129
|
};
|
|
130
130
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -189,13 +189,11 @@ function createResourceRequest(config) {
|
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
};
|
|
192
|
+
const adapterName = 'queryMetrics';
|
|
193
|
+
const queryMetrics_ConfigPropertyMetadata = [
|
|
194
|
+
generateParamConfigMetadata('request', false),
|
|
195
|
+
];
|
|
196
|
+
const queryMetrics_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, queryMetrics_ConfigPropertyMetadata);
|
|
199
197
|
function createResourceParams(config) {
|
|
200
198
|
const resourceParams = {
|
|
201
199
|
queryParams: {
|
|
@@ -261,21 +259,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
261
259
|
});
|
|
262
260
|
}
|
|
263
261
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
264
|
-
|
|
265
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
266
|
-
const dispatchOptions = {
|
|
267
|
-
resourceRequestContext: {
|
|
268
|
-
requestCorrelator,
|
|
269
|
-
luvioRequestMethod: undefined,
|
|
270
|
-
},
|
|
271
|
-
eventObservers
|
|
272
|
-
};
|
|
273
|
-
if (networkPriority !== 'normal') {
|
|
274
|
-
dispatchOptions.overrides = {
|
|
275
|
-
priority: networkPriority
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
262
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
279
263
|
}
|
|
280
264
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
281
265
|
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 = "ScaleCenter";
|
|
@@ -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_getScalecenterMetricsQuery_ResourceRequestConfig } from '../resources/getScalecenterMetricsQuery';
|
|
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 { ScaleCenterMetricDataRepresentation as types_ScaleCenterMetricDataRepresentation_ScaleCenterMetricDataRepresentation } from '../types/ScaleCenterMetricDataRepresentation';
|
|
5
5
|
export declare const adapterName = "queryMetrics";
|
|
6
|
+
export declare const queryMetrics_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
|
|
6
7
|
export declare const queryMetrics_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
|
|
7
8
|
export interface QueryMetricsConfig {
|
|
8
9
|
request?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-platform-scale-center",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.213.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, deepFreeze, typeCheckScalars, StoreKeyMap } from 'force/luvioEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, StoreKeyMap } 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 = 'ScaleCenter';
|
|
62
80
|
|
|
63
81
|
const { isArray: ArrayIsArray } = Array;
|
|
@@ -115,26 +133,8 @@ const ingest = function ScaleCenterMetricDataRepresentationIngest(input, path, l
|
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
const key = path.fullPath;
|
|
118
|
-
const existingRecord = store.readEntry(key);
|
|
119
136
|
const ttlToUse = TTL;
|
|
120
|
-
|
|
121
|
-
fullPath: key,
|
|
122
|
-
parent: path.parent,
|
|
123
|
-
propertyName: path.propertyName,
|
|
124
|
-
ttl: ttlToUse
|
|
125
|
-
});
|
|
126
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
127
|
-
luvio.storePublish(key, incomingRecord);
|
|
128
|
-
}
|
|
129
|
-
{
|
|
130
|
-
const storeMetadataParams = {
|
|
131
|
-
ttl: ttlToUse,
|
|
132
|
-
namespace: "ScaleCenter",
|
|
133
|
-
version: VERSION,
|
|
134
|
-
representationName: RepresentationType,
|
|
135
|
-
};
|
|
136
|
-
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
137
|
-
}
|
|
137
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ScaleCenter", VERSION, RepresentationType, equals);
|
|
138
138
|
return createLink(key);
|
|
139
139
|
};
|
|
140
140
|
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -199,13 +199,11 @@ function createResourceRequest(config) {
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
};
|
|
202
|
+
const adapterName = 'queryMetrics';
|
|
203
|
+
const queryMetrics_ConfigPropertyMetadata = [
|
|
204
|
+
generateParamConfigMetadata('request', false),
|
|
205
|
+
];
|
|
206
|
+
const queryMetrics_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, queryMetrics_ConfigPropertyMetadata);
|
|
209
207
|
function createResourceParams(config) {
|
|
210
208
|
const resourceParams = {
|
|
211
209
|
queryParams: {
|
|
@@ -271,21 +269,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
271
269
|
});
|
|
272
270
|
}
|
|
273
271
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
274
|
-
|
|
275
|
-
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
276
|
-
const dispatchOptions = {
|
|
277
|
-
resourceRequestContext: {
|
|
278
|
-
requestCorrelator,
|
|
279
|
-
luvioRequestMethod: undefined,
|
|
280
|
-
},
|
|
281
|
-
eventObservers
|
|
282
|
-
};
|
|
283
|
-
if (networkPriority !== 'normal') {
|
|
284
|
-
dispatchOptions.overrides = {
|
|
285
|
-
priority: networkPriority
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
272
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
289
273
|
}
|
|
290
274
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
291
275
|
const { luvio, config } = context;
|
|
@@ -332,4 +316,4 @@ withDefaultLuvio((luvio) => {
|
|
|
332
316
|
});
|
|
333
317
|
|
|
334
318
|
export { queryMetrics, queryMetrics_imperative };
|
|
335
|
-
// version: 1.
|
|
319
|
+
// version: 1.213.1-79de10fe1
|