@salesforce/lds-adapters-revenue-place-quote 1.169.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, StoreKeyMap, deepFreeze } from '@luvio/engine';
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;
@@ -196,8 +196,7 @@ const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio,
196
196
  }
197
197
  return createLink(key);
198
198
  };
199
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
200
- const rootKeySet = new StoreKeyMap();
199
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
201
200
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
202
201
  const rootKey = keyBuilderFromType(luvio, input);
203
202
  rootKeySet.set(rootKey, {
@@ -205,14 +204,13 @@ function getTypeCacheKeys(luvio, input, fullPathFactory) {
205
204
  representationName: RepresentationType,
206
205
  mergeable: false
207
206
  });
208
- return rootKeySet;
209
207
  }
210
208
 
211
209
  function select(luvio, params) {
212
210
  return select$1();
213
211
  }
214
- function getResponseCacheKeys(luvio, resourceParams, response) {
215
- return getTypeCacheKeys(luvio, response);
212
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
213
+ getTypeCacheKeys(storeKeyMap, luvio, response);
216
214
  }
217
215
  function ingestSuccess(luvio, resourceParams, response) {
218
216
  const { body } = response;
@@ -290,7 +288,11 @@ function buildNetworkSnapshot(luvio, config, options) {
290
288
  return luvio.handleSuccessResponse(() => {
291
289
  const snapshot = ingestSuccess(luvio, resourceParams, response);
292
290
  return luvio.storeBroadcast().then(() => snapshot);
293
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
291
+ }, () => {
292
+ const cache = new StoreKeyMap();
293
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
294
+ return cache;
295
+ });
294
296
  }, (response) => {
295
297
  deepFreeze(response);
296
298
  throw response;
@@ -1,5 +1,5 @@
1
1
  import { PlaceQuoteInputRepresentation as types_PlaceQuoteInputRepresentation_PlaceQuoteInputRepresentation } from '../types/PlaceQuoteInputRepresentation';
2
- import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, FetchResponse as $64$luvio_engine_FetchResponse, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
2
+ import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, FetchResponse as $64$luvio_engine_FetchResponse, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
3
3
  import { PlaceQuoteOutputRepresentation as types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation } from '../types/PlaceQuoteOutputRepresentation';
4
4
  export interface ResourceRequestConfig {
5
5
  body: {
@@ -7,7 +7,7 @@ export interface ResourceRequestConfig {
7
7
  };
8
8
  }
9
9
  export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
10
- export declare function getResponseCacheKeys(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation): $64$luvio_engine_DurableStoreKeyMetadataMap;
10
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation): void;
11
11
  export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_PlaceQuoteOutputRepresentation_PlaceQuoteOutputRepresentation, any>;
12
12
  export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
13
13
  export default createResourceRequest;
@@ -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, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
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 VERSION = "81b80dc423701677916b6c10ff7f2695";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
@@ -6,7 +6,7 @@ export declare function normalize(input: PlaceQuoteErrorResponseRepresentation,
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: PlaceQuoteErrorResponseRepresentationNormalized, incoming: PlaceQuoteErrorResponseRepresentationNormalized): boolean;
8
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
9
- export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteErrorResponseRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
9
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: PlaceQuoteErrorResponseRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
10
  /**
11
11
  * Error response representation
12
12
  *
@@ -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, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
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 VERSION = "5156b5e9455c223122d51fea6284e011";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
@@ -6,7 +6,7 @@ export declare function normalize(input: PlaceQuoteInputRepresentation, existing
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: PlaceQuoteInputRepresentationNormalized, incoming: PlaceQuoteInputRepresentationNormalized): boolean;
8
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
9
- export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
9
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
10
  /**
11
11
  * Input representation for place quote.
12
12
  *
@@ -1,5 +1,5 @@
1
1
  import { PlaceQuoteInputRepresentation as PlaceQuoteInputRepresentation_PlaceQuoteInputRepresentation } from './PlaceQuoteInputRepresentation';
2
- 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, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
2
+ 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';
3
3
  export declare const VERSION = "37f5819e43ff2bb119ab42371ea28276";
4
4
  export declare function validate(obj: any, path?: string): TypeError | null;
5
5
  export declare const RepresentationType: string;
@@ -7,7 +7,7 @@ export declare function normalize(input: PlaceQuoteInputWrapperRepresentation, e
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: PlaceQuoteInputWrapperRepresentationNormalized, incoming: PlaceQuoteInputWrapperRepresentationNormalized): boolean;
9
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
- export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
10
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
11
11
  /**
12
12
  * Wrapper for place quote input representation
13
13
  *
@@ -17,7 +17,7 @@ export declare function normalize(input: PlaceQuoteOutputRepresentation, existin
17
17
  export declare const select: () => $64$luvio_engine_BaseFragment;
18
18
  export declare function equals(existing: PlaceQuoteOutputRepresentationNormalized, incoming: PlaceQuoteOutputRepresentationNormalized): boolean;
19
19
  export declare const ingest: $64$luvio_engine_ResourceIngest;
20
- export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
20
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: PlaceQuoteOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
21
21
  /**
22
22
  * Place Quote output representation
23
23
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-revenue-place-quote",
3
- "version": "1.169.0",
3
+ "version": "1.170.1",
4
4
  "description": "Place Quote API for partial items and price/taxation updates async",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/revenue-place-quote.js",
package/sfdc/index.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  /* proxy-compat-disable */
15
15
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, StoreKeyMap, deepFreeze } from 'force/luvioEngine';
16
+ import { serializeStructuredKey, deepFreeze, StoreKeyMap } from 'force/luvioEngine';
17
17
 
18
18
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
19
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -205,8 +205,7 @@ const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio,
205
205
  }
206
206
  return createLink(key);
207
207
  };
208
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
209
- const rootKeySet = new StoreKeyMap();
208
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
210
209
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
211
210
  const rootKey = keyBuilderFromType(luvio, input);
212
211
  rootKeySet.set(rootKey, {
@@ -214,14 +213,13 @@ function getTypeCacheKeys(luvio, input, fullPathFactory) {
214
213
  representationName: RepresentationType,
215
214
  mergeable: false
216
215
  });
217
- return rootKeySet;
218
216
  }
219
217
 
220
218
  function select(luvio, params) {
221
219
  return select$1();
222
220
  }
223
- function getResponseCacheKeys(luvio, resourceParams, response) {
224
- return getTypeCacheKeys(luvio, response);
221
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
222
+ getTypeCacheKeys(storeKeyMap, luvio, response);
225
223
  }
226
224
  function ingestSuccess(luvio, resourceParams, response) {
227
225
  const { body } = response;
@@ -299,7 +297,11 @@ function buildNetworkSnapshot(luvio, config, options) {
299
297
  return luvio.handleSuccessResponse(() => {
300
298
  const snapshot = ingestSuccess(luvio, resourceParams, response);
301
299
  return luvio.storeBroadcast().then(() => snapshot);
302
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
300
+ }, () => {
301
+ const cache = new StoreKeyMap();
302
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
303
+ return cache;
304
+ });
303
305
  }, (response) => {
304
306
  deepFreeze(response);
305
307
  throw response;
@@ -334,4 +336,4 @@ withDefaultLuvio((luvio) => {
334
336
  });
335
337
 
336
338
  export { updateQuote };
337
- // version: 1.169.0-0c8c3dc31
339
+ // version: 1.170.1-5fb216cf1