@salesforce/lds-adapters-analytics-wave-private 1.213.0 → 1.213.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.
@@ -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$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 = 'WAVE';
52
70
 
53
71
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
@@ -130,26 +148,8 @@ const ingest = function SoqlQueryResultRepresentationIngest(input, path, luvio,
130
148
  }
131
149
  }
132
150
  const key = path.fullPath;
133
- const existingRecord = store.readEntry(key);
134
151
  const ttlToUse = TTL;
135
- let incomingRecord = normalize(input, store.readEntry(key), {
136
- fullPath: key,
137
- parent: path.parent,
138
- propertyName: path.propertyName,
139
- ttl: ttlToUse
140
- });
141
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
142
- luvio.storePublish(key, incomingRecord);
143
- }
144
- {
145
- const storeMetadataParams = {
146
- ttl: ttlToUse,
147
- namespace: "WAVE",
148
- version: VERSION,
149
- representationName: RepresentationType,
150
- };
151
- luvio.publishStoreMetadata(key, storeMetadataParams);
152
- }
152
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "WAVE", VERSION, RepresentationType, equals);
153
153
  return createLink(key);
154
154
  };
155
155
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -214,13 +214,11 @@ function createResourceRequest(config) {
214
214
  };
215
215
  }
216
216
 
217
- const executeSoqlQueryPost_ConfigPropertyNames = {
218
- displayName: 'executeSoqlQueryPost',
219
- parameters: {
220
- required: ['query'],
221
- optional: []
222
- }
223
- };
217
+ const adapterName = 'executeSoqlQueryPost';
218
+ const executeSoqlQueryPost_ConfigPropertyMetadata = [
219
+ generateParamConfigMetadata('query', true),
220
+ ];
221
+ const executeSoqlQueryPost_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, executeSoqlQueryPost_ConfigPropertyMetadata);
224
222
  function createResourceParams(config) {
225
223
  const resourceParams = {
226
224
  body: {
@@ -286,21 +284,7 @@ function buildNetworkSnapshot(luvio, config, options) {
286
284
  });
287
285
  }
288
286
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
289
- const { luvio, config } = context;
290
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
291
- const dispatchOptions = {
292
- resourceRequestContext: {
293
- requestCorrelator,
294
- luvioRequestMethod: 'get',
295
- },
296
- eventObservers
297
- };
298
- if (networkPriority !== 'normal') {
299
- dispatchOptions.overrides = {
300
- priority: networkPriority
301
- };
302
- }
303
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
287
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
304
288
  }
305
289
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
306
290
  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 = "WAVE";
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
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_postWaveSoql_ResourceRequestConfig } from '../resources/postWaveSoql';
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 { SoqlQueryResultRepresentation as types_SoqlQueryResultRepresentation_SoqlQueryResultRepresentation } from '../types/SoqlQueryResultRepresentation';
5
5
  export declare const adapterName = "executeSoqlQueryPost";
6
+ export declare const executeSoqlQueryPost_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const executeSoqlQueryPost_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface ExecuteSoqlQueryPostConfig {
8
9
  query: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-analytics-wave-private",
3
- "version": "1.213.0",
3
+ "version": "1.213.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The Einstein Analytics family of APIs that are not publically exposed",
6
6
  "main": "dist/es/es2018/analytics-wave-private.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$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 = 'WAVE';
62
80
 
63
81
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
@@ -140,26 +158,8 @@ const ingest = function SoqlQueryResultRepresentationIngest(input, path, luvio,
140
158
  }
141
159
  }
142
160
  const key = path.fullPath;
143
- const existingRecord = store.readEntry(key);
144
161
  const ttlToUse = TTL;
145
- let incomingRecord = normalize(input, store.readEntry(key), {
146
- fullPath: key,
147
- parent: path.parent,
148
- propertyName: path.propertyName,
149
- ttl: ttlToUse
150
- });
151
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
152
- luvio.storePublish(key, incomingRecord);
153
- }
154
- {
155
- const storeMetadataParams = {
156
- ttl: ttlToUse,
157
- namespace: "WAVE",
158
- version: VERSION,
159
- representationName: RepresentationType,
160
- };
161
- luvio.publishStoreMetadata(key, storeMetadataParams);
162
- }
162
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "WAVE", VERSION, RepresentationType, equals);
163
163
  return createLink(key);
164
164
  };
165
165
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -224,13 +224,11 @@ function createResourceRequest(config) {
224
224
  };
225
225
  }
226
226
 
227
- const executeSoqlQueryPost_ConfigPropertyNames = {
228
- displayName: 'executeSoqlQueryPost',
229
- parameters: {
230
- required: ['query'],
231
- optional: []
232
- }
233
- };
227
+ const adapterName = 'executeSoqlQueryPost';
228
+ const executeSoqlQueryPost_ConfigPropertyMetadata = [
229
+ generateParamConfigMetadata('query', true),
230
+ ];
231
+ const executeSoqlQueryPost_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, executeSoqlQueryPost_ConfigPropertyMetadata);
234
232
  function createResourceParams(config) {
235
233
  const resourceParams = {
236
234
  body: {
@@ -296,21 +294,7 @@ function buildNetworkSnapshot(luvio, config, options) {
296
294
  });
297
295
  }
298
296
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
299
- const { luvio, config } = context;
300
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
301
- const dispatchOptions = {
302
- resourceRequestContext: {
303
- requestCorrelator,
304
- luvioRequestMethod: 'get',
305
- },
306
- eventObservers
307
- };
308
- if (networkPriority !== 'normal') {
309
- dispatchOptions.overrides = {
310
- priority: networkPriority
311
- };
312
- }
313
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
297
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, 'get', false);
314
298
  }
315
299
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
316
300
  const { luvio, config } = context;
@@ -357,4 +341,4 @@ withDefaultLuvio((luvio) => {
357
341
  });
358
342
 
359
343
  export { executeSoqlQueryPost, executeSoqlQueryPost_imperative };
360
- // version: 1.213.0-951602080
344
+ // version: 1.213.2-1eb996209