@salesforce/lds-adapters-industries-dfo 1.343.0 → 1.344.0

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, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$3, StoreKeyMap, createResourceParams as createResourceParams$3 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -81,16 +81,16 @@ function createLink(ref) {
81
81
  }
82
82
 
83
83
  const TTL$2 = 1000;
84
- const VERSION$2 = "07ece60a92b63ace8c767498695db517";
84
+ const VERSION$2 = "6276c05f3d390d7a92e532aadaf4abd2";
85
85
  function validate$2(obj, path = 'DroDecompositionViewerGetOutputRepresentation') {
86
86
  const v_error = (() => {
87
87
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
88
88
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
89
89
  }
90
- const obj_statusCode = obj.statusCode;
91
- const path_statusCode = path + '.statusCode';
92
- if (typeof obj_statusCode !== 'string') {
93
- return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
90
+ const obj_statusMessage = obj.statusMessage;
91
+ const path_statusMessage = path + '.statusMessage';
92
+ if (typeof obj_statusMessage !== 'string') {
93
+ return new TypeError('Expected "string" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
94
94
  }
95
95
  const obj_values = obj.values;
96
96
  const path_values = path + '.values';
@@ -110,15 +110,6 @@ function validate$2(obj, path = 'DroDecompositionViewerGetOutputRepresentation')
110
110
  return v_error === undefined ? null : v_error;
111
111
  }
112
112
  const RepresentationType$2 = 'DroDecompositionViewerGetOutputRepresentation';
113
- function keyBuilder$3(luvio, config) {
114
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.message;
115
- }
116
- function keyBuilderFromType$1(luvio, object) {
117
- const keyParams = {
118
- message: object.statusCode
119
- };
120
- return keyBuilder$3(luvio, keyParams);
121
- }
122
113
  function normalize$2(input, existing, path, luvio, store, timestamp) {
123
114
  return input;
124
115
  }
@@ -143,14 +134,14 @@ const ingest$2 = function DroDecompositionViewerGetOutputRepresentationIngest(in
143
134
  throw validateError;
144
135
  }
145
136
  }
146
- const key = keyBuilderFromType$1(luvio, input);
137
+ const key = path.fullPath;
147
138
  const ttlToUse = TTL$2;
148
139
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "dfo", VERSION$2, RepresentationType$2, equals$2);
149
140
  return createLink(key);
150
141
  };
151
142
  function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
152
143
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
153
- const rootKey = keyBuilderFromType$1(luvio, input);
144
+ const rootKey = fullPathFactory();
154
145
  rootKeySet.set(rootKey, {
155
146
  namespace: keyPrefix,
156
147
  representationName: RepresentationType$2,
@@ -161,18 +152,21 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
161
152
  function select$4(luvio, params) {
162
153
  return select$5();
163
154
  }
155
+ function keyBuilder$4(luvio, params) {
156
+ return keyPrefix + '::DroDecompositionViewerGetOutputRepresentation:(' + 'salesTransactionId:' + params.urlParams.salesTransactionId + ',' + 'typeOfData:' + params.urlParams.typeOfData + ')';
157
+ }
164
158
  function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
165
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
159
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
166
160
  }
167
- function ingestSuccess$2(luvio, resourceParams, response) {
161
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
168
162
  const { body } = response;
169
- const key = keyBuilderFromType$1(luvio, body);
163
+ const key = keyBuilder$4(luvio, resourceParams);
170
164
  luvio.storeIngest(key, ingest$2, body);
171
165
  const snapshot = luvio.storeLookup({
172
166
  recordId: key,
173
167
  node: select$4(),
174
168
  variables: {},
175
- });
169
+ }, snapshotRefresh);
176
170
  if (process.env.NODE_ENV !== 'production') {
177
171
  if (snapshot.state !== 'Fulfilled') {
178
172
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -181,13 +175,25 @@ function ingestSuccess$2(luvio, resourceParams, response) {
181
175
  deepFreeze(snapshot.data);
182
176
  return snapshot;
183
177
  }
178
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
179
+ const key = keyBuilder$4(luvio, params);
180
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
181
+ const storeMetadataParams = {
182
+ ttl: TTL$2,
183
+ namespace: keyPrefix,
184
+ version: VERSION$2,
185
+ representationName: RepresentationType$2
186
+ };
187
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
188
+ return errorSnapshot;
189
+ }
184
190
  function createResourceRequest$2(config) {
185
191
  const headers = {};
186
192
  return {
187
193
  baseUri: '/services/data/v64.0',
188
- basePath: '/connect/dro/' + config.urlParams.salesTransactionId + '/decomposition-data',
189
- method: 'post',
190
- body: config.body,
194
+ basePath: '/connect/dro/' + config.urlParams.salesTransactionId + '/' + config.urlParams.typeOfData + '',
195
+ method: 'get',
196
+ body: null,
191
197
  urlParams: config.urlParams,
192
198
  queryParams: {},
193
199
  headers,
@@ -195,31 +201,20 @@ function createResourceRequest$2(config) {
195
201
  };
196
202
  }
197
203
 
198
- const adapterName$2 = 'postDroDecompositionViewer';
199
- const postDroDecompositionViewer_ConfigPropertyMetadata = [
204
+ const adapterName$2 = 'getDroDecompositionViewer';
205
+ const getDroDecompositionViewer_ConfigPropertyMetadata = [
200
206
  generateParamConfigMetadata('salesTransactionId', true, 0 /* UrlParameter */, 0 /* String */),
201
- generateParamConfigMetadata('values', true, 2 /* Body */, 4 /* Unsupported */),
207
+ generateParamConfigMetadata('typeOfData', true, 0 /* UrlParameter */, 0 /* String */),
202
208
  ];
203
- const postDroDecompositionViewer_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, postDroDecompositionViewer_ConfigPropertyMetadata);
204
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(postDroDecompositionViewer_ConfigPropertyMetadata);
209
+ const getDroDecompositionViewer_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDroDecompositionViewer_ConfigPropertyMetadata);
210
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(getDroDecompositionViewer_ConfigPropertyMetadata);
211
+ function keyBuilder$3(luvio, config) {
212
+ const resourceParams = createResourceParams$2(config);
213
+ return keyBuilder$4(luvio, resourceParams);
214
+ }
205
215
  function typeCheckConfig$2(untrustedConfig) {
206
216
  const config = {};
207
- typeCheckConfig$3(untrustedConfig, config, postDroDecompositionViewer_ConfigPropertyMetadata);
208
- const untrustedConfig_values = untrustedConfig.values;
209
- if (untrustedIsObject(untrustedConfig_values)) {
210
- const untrustedConfig_values_object = {};
211
- const untrustedConfig_values_keys = Object.keys(untrustedConfig_values);
212
- for (let i = 0, arrayLength = untrustedConfig_values_keys.length; i < arrayLength; i++) {
213
- const key = untrustedConfig_values_keys[i];
214
- const untrustedConfig_values_prop = untrustedConfig_values[key];
215
- if (untrustedConfig_values_object !== undefined) {
216
- untrustedConfig_values_object[key] = untrustedConfig_values_prop;
217
- }
218
- }
219
- if (untrustedConfig_values_object !== undefined && Object.keys(untrustedConfig_values_object).length >= 0) {
220
- config.values = untrustedConfig_values_object;
221
- }
222
- }
217
+ typeCheckConfig$3(untrustedConfig, config, getDroDecompositionViewer_ConfigPropertyMetadata);
223
218
  return config;
224
219
  }
225
220
  function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
@@ -235,33 +230,62 @@ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
235
230
  }
236
231
  return config;
237
232
  }
233
+ function adapterFragment$1(luvio, config) {
234
+ createResourceParams$2(config);
235
+ return select$4();
236
+ }
237
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
238
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
239
+ config,
240
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
241
+ });
242
+ return luvio.storeBroadcast().then(() => snapshot);
243
+ }
244
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
245
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
246
+ config,
247
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
248
+ });
249
+ return luvio.storeBroadcast().then(() => snapshot);
250
+ }
238
251
  function buildNetworkSnapshot$2(luvio, config, options) {
239
252
  const resourceParams = createResourceParams$2(config);
240
253
  const request = createResourceRequest$2(resourceParams);
241
254
  return luvio.dispatchResourceRequest(request, options)
242
255
  .then((response) => {
243
- return luvio.handleSuccessResponse(() => {
244
- const snapshot = ingestSuccess$2(luvio, resourceParams, response);
245
- return luvio.storeBroadcast().then(() => snapshot);
246
- }, () => {
256
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
247
257
  const cache = new StoreKeyMap();
248
258
  getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
249
259
  return cache;
250
260
  });
251
261
  }, (response) => {
252
- deepFreeze(response);
253
- throw response;
262
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
254
263
  });
255
264
  }
256
- const postDroDecompositionViewerAdapterFactory = (luvio) => {
257
- return function postDroDecompositionViewer(untrustedConfig) {
258
- const config = validateAdapterConfig$2(untrustedConfig, postDroDecompositionViewer_ConfigPropertyNames);
259
- // Invalid or incomplete config
260
- if (config === null) {
261
- throw new Error('Invalid config for "postDroDecompositionViewer"');
262
- }
263
- return buildNetworkSnapshot$2(luvio, config);
265
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
266
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
267
+ }
268
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
269
+ const { luvio, config } = context;
270
+ const selector = {
271
+ recordId: keyBuilder$3(luvio, config),
272
+ node: adapterFragment$1(luvio, config),
273
+ variables: {},
264
274
  };
275
+ const cacheSnapshot = storeLookup(selector, {
276
+ config,
277
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
278
+ });
279
+ return cacheSnapshot;
280
+ }
281
+ const getDroDecompositionViewerAdapterFactory = (luvio) => function dfo__getDroDecompositionViewer(untrustedConfig, requestContext) {
282
+ const config = validateAdapterConfig$2(untrustedConfig, getDroDecompositionViewer_ConfigPropertyNames);
283
+ // Invalid or incomplete config
284
+ if (config === null) {
285
+ return null;
286
+ }
287
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
288
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
265
289
  };
266
290
 
267
291
  const TTL$1 = 1000;
@@ -438,7 +462,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
438
462
  });
439
463
  }
440
464
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
441
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
465
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
442
466
  }
443
467
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
444
468
  const { luvio, config } = context;
@@ -633,4 +657,4 @@ const putDfoConfigInfoAdapterFactory = (luvio) => {
633
657
  };
634
658
  };
635
659
 
636
- export { getDfoConfigInfoAdapterFactory, postDroDecompositionViewerAdapterFactory, putDfoConfigInfoAdapterFactory };
660
+ export { getDfoConfigInfoAdapterFactory, getDroDecompositionViewerAdapterFactory, putDfoConfigInfoAdapterFactory };
@@ -0,0 +1,28 @@
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';
3
+ import { ResourceRequestConfig as resources_getConnectDroBySalesTransactionIdAndTypeOfData_ResourceRequestConfig } from '../resources/getConnectDroBySalesTransactionIdAndTypeOfData';
4
+ import { DroDecompositionViewerGetOutputRepresentation as types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation } from '../types/DroDecompositionViewerGetOutputRepresentation';
5
+ export declare const adapterName = "getDroDecompositionViewer";
6
+ export declare const getDroDecompositionViewer_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const getDroDecompositionViewer_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface GetDroDecompositionViewerConfig {
9
+ salesTransactionId: string;
10
+ typeOfData: string;
11
+ }
12
+ export declare const createResourceParams: (config: GetDroDecompositionViewerConfig) => resources_getConnectDroBySalesTransactionIdAndTypeOfData_ResourceRequestConfig;
13
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig): string;
14
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig): $64$luvio_engine_NormalizedKeyMetadata;
15
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetDroDecompositionViewerConfig>): adapter$45$utils_Untrusted<GetDroDecompositionViewerConfig>;
16
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): GetDroDecompositionViewerConfig | null;
17
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig): $64$luvio_engine_Fragment;
18
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig): $64$luvio_engine_Snapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>;
19
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig, resourceParams: resources_getConnectDroBySalesTransactionIdAndTypeOfData_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>>;
20
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig, resourceParams: resources_getConnectDroBySalesTransactionIdAndTypeOfData_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
21
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: GetDroDecompositionViewerConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>>;
22
+ export type BuildSnapshotContext = {
23
+ luvio: $64$luvio_engine_Luvio;
24
+ config: GetDroDecompositionViewerConfig;
25
+ };
26
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>>;
27
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>): $64$luvio_engine_Snapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>;
28
+ export declare const getDroDecompositionViewerAdapterFactory: $64$luvio_engine_AdapterFactory<GetDroDecompositionViewerConfig, types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>;
@@ -1,3 +1,3 @@
1
- export { postDroDecompositionViewerAdapterFactory } from '../adapters/postDroDecompositionViewer';
1
+ export { getDroDecompositionViewerAdapterFactory } from '../adapters/getDroDecompositionViewer';
2
2
  export { getDfoConfigInfoAdapterFactory } from '../adapters/getDfoConfigInfo';
3
3
  export { putDfoConfigInfoAdapterFactory } from '../adapters/putDfoConfigInfo';
@@ -1,5 +1,6 @@
1
1
  declare let getDfoConfigInfo: any;
2
- declare let postDroDecompositionViewer: any;
2
+ declare let getDroDecompositionViewer: any;
3
3
  declare let putDfoConfigInfo: any;
4
4
  declare let getDfoConfigInfo_imperative: any;
5
- export { getDfoConfigInfo, postDroDecompositionViewer, putDfoConfigInfo, getDfoConfigInfo_imperative, };
5
+ declare let getDroDecompositionViewer_imperative: any;
6
+ export { getDfoConfigInfo, getDroDecompositionViewer, putDfoConfigInfo, getDfoConfigInfo_imperative, getDroDecompositionViewer_imperative, };
@@ -0,0 +1,16 @@
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
+ import { DroDecompositionViewerGetOutputRepresentation as types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation } from '../types/DroDecompositionViewerGetOutputRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ urlParams: {
5
+ salesTransactionId: string;
6
+ typeOfData: string;
7
+ };
8
+ }
9
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
10
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
11
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
12
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation): void;
13
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>;
14
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>): $64$luvio_engine_ErrorSnapshot;
15
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
16
+ export default createResourceRequest;
@@ -1,17 +1,8 @@
1
- import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, ResourceIngest as $64$luvio_engine_ResourceIngest, 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, BaseFragment as $64$luvio_engine_BaseFragment, 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 = 1000;
3
- export declare const VERSION = "07ece60a92b63ace8c767498695db517";
3
+ export declare const VERSION = "6276c05f3d390d7a92e532aadaf4abd2";
4
4
  export declare function validate(obj: any, path?: string): TypeError | null;
5
5
  export declare const RepresentationType: string;
6
- export interface KeyParams extends $64$luvio_engine_KeyMetadata {
7
- message: string;
8
- }
9
- export type DroDecompositionViewerGetOutputRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
10
- export type PartialDroDecompositionViewerGetOutputRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
11
- export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: KeyParams): string;
12
- export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: KeyParams): DroDecompositionViewerGetOutputRepresentationNormalizedKeyMetadata;
13
- export declare function keyBuilderFromType(luvio: $64$luvio_engine_Luvio, object: DroDecompositionViewerGetOutputRepresentation): string;
14
- export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine_Luvio, object: DroDecompositionViewerGetOutputRepresentation): $64$luvio_engine_NormalizedKeyMetadata;
15
6
  export declare function normalize(input: DroDecompositionViewerGetOutputRepresentation, existing: DroDecompositionViewerGetOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DroDecompositionViewerGetOutputRepresentationNormalized;
16
7
  export declare const select: () => $64$luvio_engine_BaseFragment;
17
8
  export declare function equals(existing: DroDecompositionViewerGetOutputRepresentationNormalized, incoming: DroDecompositionViewerGetOutputRepresentationNormalized): boolean;
@@ -21,11 +12,11 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
21
12
  * DRO get decomposition viewer Output Representation
22
13
  *
23
14
  * Keys:
24
- * message (string): statusCode
15
+ * (none)
25
16
  */
26
17
  export interface DroDecompositionViewerGetOutputRepresentationNormalized {
27
- /** Decomposition Viewer Response Status Code */
28
- statusCode: string;
18
+ /** Decomposition Viewer Response Status Message */
19
+ statusMessage: string;
29
20
  /** Decomposition Viewer Response */
30
21
  values: {
31
22
  [key: string]: unknown;
@@ -35,10 +26,10 @@ export interface DroDecompositionViewerGetOutputRepresentationNormalized {
35
26
  * DRO get decomposition viewer Output Representation
36
27
  *
37
28
  * Keys:
38
- * message (string): statusCode
29
+ * (none)
39
30
  */
40
31
  export interface DroDecompositionViewerGetOutputRepresentation {
41
- statusCode: string;
32
+ statusMessage: string;
42
33
  values: {
43
34
  [key: string]: unknown;
44
35
  };
@@ -1,5 +1,5 @@
1
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
- export declare const VERSION = "8f66b6335338da4d294121006cd794d2";
2
+ export declare const VERSION = "2188922bcfe7945ce733f91887ab604a";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
5
5
  export declare function normalize(input: DroDecompositionViewerInputRepresentation, existing: DroDecompositionViewerInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): DroDecompositionViewerInputRepresentationNormalized;
@@ -15,7 +15,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
15
15
  */
16
16
  export interface DroDecompositionViewerInputRepresentationNormalized {
17
17
  /** decomposition viewer related data */
18
- values: {
18
+ input: {
19
19
  [key: string]: unknown;
20
20
  };
21
21
  }
@@ -26,7 +26,7 @@ export interface DroDecompositionViewerInputRepresentationNormalized {
26
26
  * (none)
27
27
  */
28
28
  export interface DroDecompositionViewerInputRepresentation {
29
- values: {
29
+ input: {
30
30
  [key: string]: unknown;
31
31
  };
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-dfo",
3
- "version": "1.343.0",
3
+ "version": "1.344.0",
4
4
  "description": "Dynamic Fulfillment Orchestrator APIs",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/industries-dfo.js",
@@ -40,10 +40,10 @@
40
40
  "test:unit": "jest"
41
41
  },
42
42
  "dependencies": {
43
- "@salesforce/lds-bindings": "^1.343.0"
43
+ "@salesforce/lds-bindings": "^1.344.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@salesforce/lds-compiler-plugins": "^1.343.0"
46
+ "@salesforce/lds-compiler-plugins": "^1.344.0"
47
47
  },
48
48
  "nx": {
49
49
  "targets": {
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, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -157,15 +157,15 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
157
157
  function select$4(luvio, params) {
158
158
  return select$5();
159
159
  }
160
- function keyBuilder$3(luvio, params) {
160
+ function keyBuilder$4(luvio, params) {
161
161
  return keyPrefix + '::DfoConfigInfoGetOutputRepresentation:(' + ')';
162
162
  }
163
163
  function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
164
- getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$3());
164
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4());
165
165
  }
166
166
  function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
167
167
  const { body } = response;
168
- const key = keyBuilder$3();
168
+ const key = keyBuilder$4();
169
169
  luvio.storeIngest(key, ingest$2, body);
170
170
  const snapshot = luvio.storeLookup({
171
171
  recordId: key,
@@ -180,8 +180,8 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
180
180
  deepFreeze(snapshot.data);
181
181
  return snapshot;
182
182
  }
183
- function ingestError(luvio, params, error, snapshotRefresh) {
184
- const key = keyBuilder$3();
183
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
184
+ const key = keyBuilder$4();
185
185
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
186
186
  const storeMetadataParams = {
187
187
  ttl: TTL$2,
@@ -210,9 +210,9 @@ const adapterName$2 = 'getDfoConfigInfo';
210
210
  const getDfoConfigInfo_ConfigPropertyMetadata = [];
211
211
  const getDfoConfigInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDfoConfigInfo_ConfigPropertyMetadata);
212
212
  const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(getDfoConfigInfo_ConfigPropertyMetadata);
213
- function keyBuilder$2(luvio, config) {
213
+ function keyBuilder$3(luvio, config) {
214
214
  createResourceParams$2(config);
215
- return keyBuilder$3();
215
+ return keyBuilder$4();
216
216
  }
217
217
  function typeCheckConfig$2(untrustedConfig) {
218
218
  const config = {};
@@ -231,19 +231,19 @@ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
231
231
  }
232
232
  return config;
233
233
  }
234
- function adapterFragment(luvio, config) {
234
+ function adapterFragment$1(luvio, config) {
235
235
  createResourceParams$2(config);
236
236
  return select$4();
237
237
  }
238
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
238
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
239
239
  const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
240
240
  config,
241
241
  resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
242
242
  });
243
243
  return luvio.storeBroadcast().then(() => snapshot);
244
244
  }
245
- function onFetchResponseError(luvio, config, resourceParams, response) {
246
- const snapshot = ingestError(luvio, resourceParams, response, {
245
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
246
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
247
247
  config,
248
248
  resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
249
249
  });
@@ -254,23 +254,23 @@ function buildNetworkSnapshot$2(luvio, config, options) {
254
254
  const request = createResourceRequest$2();
255
255
  return luvio.dispatchResourceRequest(request, options)
256
256
  .then((response) => {
257
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
257
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
258
258
  const cache = new StoreKeyMap();
259
259
  getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
260
260
  return cache;
261
261
  });
262
262
  }, (response) => {
263
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
263
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
264
264
  });
265
265
  }
266
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
267
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
266
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
267
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
268
268
  }
269
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
269
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
270
270
  const { luvio, config } = context;
271
271
  const selector = {
272
- recordId: keyBuilder$2(luvio, config),
273
- node: adapterFragment(luvio, config),
272
+ recordId: keyBuilder$3(luvio, config),
273
+ node: adapterFragment$1(luvio, config),
274
274
  variables: {},
275
275
  };
276
276
  const cacheSnapshot = storeLookup(selector, {
@@ -286,20 +286,20 @@ const getDfoConfigInfoAdapterFactory = (luvio) => function dfo__getDfoConfigInfo
286
286
  return null;
287
287
  }
288
288
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
289
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
289
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
290
290
  };
291
291
 
292
292
  const TTL$1 = 1000;
293
- const VERSION$1 = "07ece60a92b63ace8c767498695db517";
293
+ const VERSION$1 = "6276c05f3d390d7a92e532aadaf4abd2";
294
294
  function validate$1(obj, path = 'DroDecompositionViewerGetOutputRepresentation') {
295
295
  const v_error = (() => {
296
296
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
297
297
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
298
298
  }
299
- const obj_statusCode = obj.statusCode;
300
- const path_statusCode = path + '.statusCode';
301
- if (typeof obj_statusCode !== 'string') {
302
- return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
299
+ const obj_statusMessage = obj.statusMessage;
300
+ const path_statusMessage = path + '.statusMessage';
301
+ if (typeof obj_statusMessage !== 'string') {
302
+ return new TypeError('Expected "string" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
303
303
  }
304
304
  const obj_values = obj.values;
305
305
  const path_values = path + '.values';
@@ -319,15 +319,6 @@ function validate$1(obj, path = 'DroDecompositionViewerGetOutputRepresentation')
319
319
  return v_error === undefined ? null : v_error;
320
320
  }
321
321
  const RepresentationType$1 = 'DroDecompositionViewerGetOutputRepresentation';
322
- function keyBuilder$1(luvio, config) {
323
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.message;
324
- }
325
- function keyBuilderFromType$1(luvio, object) {
326
- const keyParams = {
327
- message: object.statusCode
328
- };
329
- return keyBuilder$1(luvio, keyParams);
330
- }
331
322
  function normalize$1(input, existing, path, luvio, store, timestamp) {
332
323
  return input;
333
324
  }
@@ -352,14 +343,14 @@ const ingest$1 = function DroDecompositionViewerGetOutputRepresentationIngest(in
352
343
  throw validateError;
353
344
  }
354
345
  }
355
- const key = keyBuilderFromType$1(luvio, input);
346
+ const key = path.fullPath;
356
347
  const ttlToUse = TTL$1;
357
348
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "dfo", VERSION$1, RepresentationType$1, equals$1);
358
349
  return createLink(key);
359
350
  };
360
351
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
361
352
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
362
- const rootKey = keyBuilderFromType$1(luvio, input);
353
+ const rootKey = fullPathFactory();
363
354
  rootKeySet.set(rootKey, {
364
355
  namespace: keyPrefix,
365
356
  representationName: RepresentationType$1,
@@ -370,18 +361,21 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
370
361
  function select$2(luvio, params) {
371
362
  return select$3();
372
363
  }
364
+ function keyBuilder$2(luvio, params) {
365
+ return keyPrefix + '::DroDecompositionViewerGetOutputRepresentation:(' + 'salesTransactionId:' + params.urlParams.salesTransactionId + ',' + 'typeOfData:' + params.urlParams.typeOfData + ')';
366
+ }
373
367
  function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
374
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
368
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
375
369
  }
376
- function ingestSuccess$1(luvio, resourceParams, response) {
370
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
377
371
  const { body } = response;
378
- const key = keyBuilderFromType$1(luvio, body);
372
+ const key = keyBuilder$2(luvio, resourceParams);
379
373
  luvio.storeIngest(key, ingest$1, body);
380
374
  const snapshot = luvio.storeLookup({
381
375
  recordId: key,
382
376
  node: select$2(),
383
377
  variables: {},
384
- });
378
+ }, snapshotRefresh);
385
379
  if (process.env.NODE_ENV !== 'production') {
386
380
  if (snapshot.state !== 'Fulfilled') {
387
381
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -390,13 +384,25 @@ function ingestSuccess$1(luvio, resourceParams, response) {
390
384
  deepFreeze(snapshot.data);
391
385
  return snapshot;
392
386
  }
387
+ function ingestError(luvio, params, error, snapshotRefresh) {
388
+ const key = keyBuilder$2(luvio, params);
389
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
390
+ const storeMetadataParams = {
391
+ ttl: TTL$1,
392
+ namespace: keyPrefix,
393
+ version: VERSION$1,
394
+ representationName: RepresentationType$1
395
+ };
396
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
397
+ return errorSnapshot;
398
+ }
393
399
  function createResourceRequest$1(config) {
394
400
  const headers = {};
395
401
  return {
396
402
  baseUri: '/services/data/v64.0',
397
- basePath: '/connect/dro/' + config.urlParams.salesTransactionId + '/decomposition-data',
398
- method: 'post',
399
- body: config.body,
403
+ basePath: '/connect/dro/' + config.urlParams.salesTransactionId + '/' + config.urlParams.typeOfData + '',
404
+ method: 'get',
405
+ body: null,
400
406
  urlParams: config.urlParams,
401
407
  queryParams: {},
402
408
  headers,
@@ -404,31 +410,20 @@ function createResourceRequest$1(config) {
404
410
  };
405
411
  }
406
412
 
407
- const adapterName$1 = 'postDroDecompositionViewer';
408
- const postDroDecompositionViewer_ConfigPropertyMetadata = [
413
+ const adapterName$1 = 'getDroDecompositionViewer';
414
+ const getDroDecompositionViewer_ConfigPropertyMetadata = [
409
415
  generateParamConfigMetadata('salesTransactionId', true, 0 /* UrlParameter */, 0 /* String */),
410
- generateParamConfigMetadata('values', true, 2 /* Body */, 4 /* Unsupported */),
416
+ generateParamConfigMetadata('typeOfData', true, 0 /* UrlParameter */, 0 /* String */),
411
417
  ];
412
- const postDroDecompositionViewer_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, postDroDecompositionViewer_ConfigPropertyMetadata);
413
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(postDroDecompositionViewer_ConfigPropertyMetadata);
418
+ const getDroDecompositionViewer_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getDroDecompositionViewer_ConfigPropertyMetadata);
419
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getDroDecompositionViewer_ConfigPropertyMetadata);
420
+ function keyBuilder$1(luvio, config) {
421
+ const resourceParams = createResourceParams$1(config);
422
+ return keyBuilder$2(luvio, resourceParams);
423
+ }
414
424
  function typeCheckConfig$1(untrustedConfig) {
415
425
  const config = {};
416
- typeCheckConfig$3(untrustedConfig, config, postDroDecompositionViewer_ConfigPropertyMetadata);
417
- const untrustedConfig_values = untrustedConfig.values;
418
- if (untrustedIsObject(untrustedConfig_values)) {
419
- const untrustedConfig_values_object = {};
420
- const untrustedConfig_values_keys = Object.keys(untrustedConfig_values);
421
- for (let i = 0, arrayLength = untrustedConfig_values_keys.length; i < arrayLength; i++) {
422
- const key = untrustedConfig_values_keys[i];
423
- const untrustedConfig_values_prop = untrustedConfig_values[key];
424
- if (untrustedConfig_values_object !== undefined) {
425
- untrustedConfig_values_object[key] = untrustedConfig_values_prop;
426
- }
427
- }
428
- if (untrustedConfig_values_object !== undefined && Object.keys(untrustedConfig_values_object).length >= 0) {
429
- config.values = untrustedConfig_values_object;
430
- }
431
- }
426
+ typeCheckConfig$3(untrustedConfig, config, getDroDecompositionViewer_ConfigPropertyMetadata);
432
427
  return config;
433
428
  }
434
429
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -444,33 +439,62 @@ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
444
439
  }
445
440
  return config;
446
441
  }
442
+ function adapterFragment(luvio, config) {
443
+ createResourceParams$1(config);
444
+ return select$2();
445
+ }
446
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
447
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
448
+ config,
449
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
450
+ });
451
+ return luvio.storeBroadcast().then(() => snapshot);
452
+ }
453
+ function onFetchResponseError(luvio, config, resourceParams, response) {
454
+ const snapshot = ingestError(luvio, resourceParams, response, {
455
+ config,
456
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
457
+ });
458
+ return luvio.storeBroadcast().then(() => snapshot);
459
+ }
447
460
  function buildNetworkSnapshot$1(luvio, config, options) {
448
461
  const resourceParams = createResourceParams$1(config);
449
462
  const request = createResourceRequest$1(resourceParams);
450
463
  return luvio.dispatchResourceRequest(request, options)
451
464
  .then((response) => {
452
- return luvio.handleSuccessResponse(() => {
453
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
454
- return luvio.storeBroadcast().then(() => snapshot);
455
- }, () => {
465
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
456
466
  const cache = new StoreKeyMap();
457
467
  getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
458
468
  return cache;
459
469
  });
460
470
  }, (response) => {
461
- deepFreeze(response);
462
- throw response;
471
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
463
472
  });
464
473
  }
465
- const postDroDecompositionViewerAdapterFactory = (luvio) => {
466
- return function postDroDecompositionViewer(untrustedConfig) {
467
- const config = validateAdapterConfig$1(untrustedConfig, postDroDecompositionViewer_ConfigPropertyNames);
468
- // Invalid or incomplete config
469
- if (config === null) {
470
- throw new Error('Invalid config for "postDroDecompositionViewer"');
471
- }
472
- return buildNetworkSnapshot$1(luvio, config);
474
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
475
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
476
+ }
477
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
478
+ const { luvio, config } = context;
479
+ const selector = {
480
+ recordId: keyBuilder$1(luvio, config),
481
+ node: adapterFragment(luvio, config),
482
+ variables: {},
473
483
  };
484
+ const cacheSnapshot = storeLookup(selector, {
485
+ config,
486
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
487
+ });
488
+ return cacheSnapshot;
489
+ }
490
+ const getDroDecompositionViewerAdapterFactory = (luvio) => function dfo__getDroDecompositionViewer(untrustedConfig, requestContext) {
491
+ const config = validateAdapterConfig$1(untrustedConfig, getDroDecompositionViewer_ConfigPropertyNames);
492
+ // Invalid or incomplete config
493
+ if (config === null) {
494
+ return null;
495
+ }
496
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
497
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
474
498
  };
475
499
 
476
500
  const TTL = 1000;
@@ -644,37 +668,46 @@ const putDfoConfigInfoAdapterFactory = (luvio) => {
644
668
  };
645
669
 
646
670
  let getDfoConfigInfo;
647
- let postDroDecompositionViewer;
671
+ let getDroDecompositionViewer;
648
672
  let putDfoConfigInfo;
649
673
  // Imperative GET Adapters
650
674
  let getDfoConfigInfo_imperative;
675
+ let getDroDecompositionViewer_imperative;
651
676
  // Adapter Metadata
652
677
  const getDfoConfigInfoMetadata = { apiFamily: 'dfo', name: 'getDfoConfigInfo', ttl: 1000 };
678
+ const getDroDecompositionViewerMetadata = {
679
+ apiFamily: 'dfo',
680
+ name: 'getDroDecompositionViewer',
681
+ ttl: 1000,
682
+ };
653
683
  // Notify Update Available
654
684
  function bindExportsTo(luvio) {
655
685
  // LDS Adapters
656
686
  const getDfoConfigInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDfoConfigInfo', getDfoConfigInfoAdapterFactory), getDfoConfigInfoMetadata);
687
+ const getDroDecompositionViewer_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDroDecompositionViewer', getDroDecompositionViewerAdapterFactory), getDroDecompositionViewerMetadata);
657
688
  function unwrapSnapshotData(factory) {
658
689
  const adapter = factory(luvio);
659
690
  return (config) => adapter(config).then((snapshot) => snapshot.data);
660
691
  }
661
692
  return {
662
693
  getDfoConfigInfo: createWireAdapterConstructor(luvio, getDfoConfigInfo_ldsAdapter, getDfoConfigInfoMetadata),
663
- postDroDecompositionViewer: unwrapSnapshotData(postDroDecompositionViewerAdapterFactory),
694
+ getDroDecompositionViewer: createWireAdapterConstructor(luvio, getDroDecompositionViewer_ldsAdapter, getDroDecompositionViewerMetadata),
664
695
  putDfoConfigInfo: unwrapSnapshotData(putDfoConfigInfoAdapterFactory),
665
696
  // Imperative GET Adapters
666
697
  getDfoConfigInfo_imperative: createImperativeAdapter(luvio, getDfoConfigInfo_ldsAdapter, getDfoConfigInfoMetadata),
698
+ getDroDecompositionViewer_imperative: createImperativeAdapter(luvio, getDroDecompositionViewer_ldsAdapter, getDroDecompositionViewerMetadata),
667
699
  // Notify Update Availables
668
700
  };
669
701
  }
670
702
  withDefaultLuvio((luvio) => {
671
703
  ({
672
704
  getDfoConfigInfo,
673
- postDroDecompositionViewer,
705
+ getDroDecompositionViewer,
674
706
  putDfoConfigInfo,
675
707
  getDfoConfigInfo_imperative,
708
+ getDroDecompositionViewer_imperative,
676
709
  } = bindExportsTo(luvio));
677
710
  });
678
711
 
679
- export { getDfoConfigInfo, getDfoConfigInfo_imperative, postDroDecompositionViewer, putDfoConfigInfo };
680
- // version: 1.343.0-823df4356c
712
+ export { getDfoConfigInfo, getDfoConfigInfo_imperative, getDroDecompositionViewer, getDroDecompositionViewer_imperative, putDfoConfigInfo };
713
+ // version: 1.344.0-455da7ef74
package/src/raml/api.raml CHANGED
@@ -59,8 +59,8 @@ types:
59
59
  description: DRO get decomposition viewer Output Representation
60
60
  type: object
61
61
  properties:
62
- statusCode:
63
- description: Decomposition Viewer Response Status Code
62
+ statusMessage:
63
+ description: Decomposition Viewer Response Status Message
64
64
  type: string
65
65
  values:
66
66
  description: Decomposition Viewer Response
@@ -72,16 +72,16 @@ types:
72
72
  description: DRO Decomposition Viewer Api Input Representation
73
73
  type: object
74
74
  properties:
75
- values:
75
+ input:
76
76
  description: decomposition viewer related data
77
77
  type: object
78
78
  properties:
79
79
  //:
80
80
  type: any
81
81
  /connect:
82
- /dro/{salesTransactionId}/decomposition-data:
83
- post:
84
- displayName: postDroDecompositionViewer
82
+ /dro/{salesTransactionId}/{typeOfData}:
83
+ get:
84
+ displayName: getDroDecompositionViewer
85
85
  description: API to get Decomposition Viewer Data
86
86
  responses:
87
87
  '200':
@@ -89,14 +89,13 @@ types:
89
89
  body:
90
90
  application/json:
91
91
  type: DroDecompositionViewerGetOutputRepresentation
92
- body:
93
- application/json:
94
- type: DroDecompositionViewerInputRepresentation
95
- (oas-body-name): droDecompViewer
96
92
  uriParameters:
97
93
  salesTransactionId:
98
94
  description: SalesTransaction Id
99
95
  type: string
96
+ typeOfData:
97
+ description: Type Of Data
98
+ type: string
100
99
  /revenue/dro/configurations:
101
100
  get:
102
101
  displayName: getDfoConfigInfo
@@ -19,8 +19,6 @@ types:
19
19
  DroDecompositionViewerGetOutputRepresentation:
20
20
  (luvio.ttl): 1000
21
21
  (luvio.opaque): true
22
- (luvio.key):
23
- message: statusCode
24
22
  /connect:
25
23
  /revenue/dro/configurations:
26
24
  get:
@@ -29,7 +27,7 @@ types:
29
27
  put:
30
28
  (luvio.adapter):
31
29
  name: putDfoConfigInfo
32
- /dro/{salesTransactionId}/decomposition-data:
33
- post:
30
+ /dro/{salesTransactionId}/{typeOfData}:
31
+ get:
34
32
  (luvio.adapter):
35
- name: postDroDecompositionViewer
33
+ name: getDroDecompositionViewer
@@ -1,18 +0,0 @@
1
- import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, 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';
3
- import { ResourceRequestConfig as resources_postConnectDroDecompositionDataBySalesTransactionId_ResourceRequestConfig } from '../resources/postConnectDroDecompositionDataBySalesTransactionId';
4
- import { DroDecompositionViewerGetOutputRepresentation as types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation } from '../types/DroDecompositionViewerGetOutputRepresentation';
5
- export declare const adapterName = "postDroDecompositionViewer";
6
- export declare const postDroDecompositionViewer_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
- export declare const postDroDecompositionViewer_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
- export interface PostDroDecompositionViewerConfig {
9
- salesTransactionId: string;
10
- values: {
11
- [key: string]: unknown;
12
- };
13
- }
14
- export declare const createResourceParams: (config: PostDroDecompositionViewerConfig) => resources_postConnectDroDecompositionDataBySalesTransactionId_ResourceRequestConfig;
15
- export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<PostDroDecompositionViewerConfig>): adapter$45$utils_Untrusted<PostDroDecompositionViewerConfig>;
16
- export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): PostDroDecompositionViewerConfig | null;
17
- export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: PostDroDecompositionViewerConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>>;
18
- export declare const postDroDecompositionViewerAdapterFactory: $64$luvio_engine_AdapterFactory<PostDroDecompositionViewerConfig, types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>;
@@ -1,17 +0,0 @@
1
- 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';
2
- import { DroDecompositionViewerGetOutputRepresentation as types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation } from '../types/DroDecompositionViewerGetOutputRepresentation';
3
- export interface ResourceRequestConfig {
4
- urlParams: {
5
- salesTransactionId: string;
6
- };
7
- body: {
8
- values: {
9
- [key: string]: unknown;
10
- };
11
- };
12
- }
13
- export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
14
- export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation): void;
15
- export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_DroDecompositionViewerGetOutputRepresentation_DroDecompositionViewerGetOutputRepresentation, any>;
16
- export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
17
- export default createResourceRequest;