@salesforce/lds-adapters-industries-serviceprocess 1.299.0 → 1.301.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, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -80,21 +80,7 @@ function createLink(ref) {
80
80
  };
81
81
  }
82
82
 
83
- function validate$3(obj, path = 'GenericObjectOutput') {
84
- const v_error = (() => {
85
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
86
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
87
- }
88
- const obj_value = obj.value;
89
- const path_value = path + '.value';
90
- if (obj_value === undefined) {
91
- return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
92
- }
93
- })();
94
- return v_error === undefined ? null : v_error;
95
- }
96
-
97
- function validate$2(obj, path = 'AttributeRepresentation') {
83
+ function validate$5(obj, path = 'AttributeRepresentation') {
98
84
  const v_error = (() => {
99
85
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
100
86
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -122,7 +108,7 @@ function validate$2(obj, path = 'AttributeRepresentation') {
122
108
  for (let i = 0; i < obj_childAttributes.length; i++) {
123
109
  const obj_childAttributes_item = obj_childAttributes[i];
124
110
  const path_childAttributes_item = path_childAttributes + '[' + i + ']';
125
- const referencepath_childAttributes_itemValidationError = validate$2(obj_childAttributes_item, path_childAttributes_item);
111
+ const referencepath_childAttributes_itemValidationError = validate$5(obj_childAttributes_item, path_childAttributes_item);
126
112
  if (referencepath_childAttributes_itemValidationError !== null) {
127
113
  let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_childAttributes_item + '")\n';
128
114
  message += referencepath_childAttributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -143,6 +129,271 @@ function validate$2(obj, path = 'AttributeRepresentation') {
143
129
  return v_error === undefined ? null : v_error;
144
130
  }
145
131
 
132
+ function validate$4(obj, path = 'GenericObjectOutput') {
133
+ const v_error = (() => {
134
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
135
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
136
+ }
137
+ const obj_value = obj.value;
138
+ const path_value = path + '.value';
139
+ if (obj_value === undefined) {
140
+ return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
141
+ }
142
+ })();
143
+ return v_error === undefined ? null : v_error;
144
+ }
145
+
146
+ function validate$3(obj, path = 'ServiceProcessDependencyDetails') {
147
+ const v_error = (() => {
148
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
149
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
150
+ }
151
+ const obj_details = obj.details;
152
+ const path_details = path + '.details';
153
+ const referencepath_detailsValidationError = validate$4(obj_details, path_details);
154
+ if (referencepath_detailsValidationError !== null) {
155
+ let message = 'Object doesn\'t match GenericObjectOutput (at "' + path_details + '")\n';
156
+ message += referencepath_detailsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
157
+ return new TypeError(message);
158
+ }
159
+ const obj_type = obj.type;
160
+ const path_type = path + '.type';
161
+ if (typeof obj_type !== 'string') {
162
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
163
+ }
164
+ })();
165
+ return v_error === undefined ? null : v_error;
166
+ }
167
+
168
+ const TTL$1 = 300000;
169
+ const VERSION$1 = "33ba038f6b7bf9bf829de107f3cb7bfd";
170
+ function validate$2(obj, path = 'ServiceProcessDefinitionRepresentation') {
171
+ const v_error = (() => {
172
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
173
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
174
+ }
175
+ const obj_attributes = obj.attributes;
176
+ const path_attributes = path + '.attributes';
177
+ if (!ArrayIsArray(obj_attributes)) {
178
+ return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
179
+ }
180
+ for (let i = 0; i < obj_attributes.length; i++) {
181
+ const obj_attributes_item = obj_attributes[i];
182
+ const path_attributes_item = path_attributes + '[' + i + ']';
183
+ const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
184
+ if (referencepath_attributes_itemValidationError !== null) {
185
+ let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_attributes_item + '")\n';
186
+ message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
187
+ return new TypeError(message);
188
+ }
189
+ }
190
+ const obj_serviceProcessDefinitionMap = obj.serviceProcessDefinitionMap;
191
+ const path_serviceProcessDefinitionMap = path + '.serviceProcessDefinitionMap';
192
+ if (typeof obj_serviceProcessDefinitionMap !== 'object' || ArrayIsArray(obj_serviceProcessDefinitionMap) || obj_serviceProcessDefinitionMap === null) {
193
+ return new TypeError('Expected "object" but received "' + typeof obj_serviceProcessDefinitionMap + '" (at "' + path_serviceProcessDefinitionMap + '")');
194
+ }
195
+ const obj_serviceProcessDefinitionMap_keys = ObjectKeys(obj_serviceProcessDefinitionMap);
196
+ for (let i = 0; i < obj_serviceProcessDefinitionMap_keys.length; i++) {
197
+ const key = obj_serviceProcessDefinitionMap_keys[i];
198
+ const obj_serviceProcessDefinitionMap_prop = obj_serviceProcessDefinitionMap[key];
199
+ const path_serviceProcessDefinitionMap_prop = path_serviceProcessDefinitionMap + '["' + key + '"]';
200
+ if (!ArrayIsArray(obj_serviceProcessDefinitionMap_prop)) {
201
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceProcessDefinitionMap_prop + '" (at "' + path_serviceProcessDefinitionMap_prop + '")');
202
+ }
203
+ for (let i = 0; i < obj_serviceProcessDefinitionMap_prop.length; i++) {
204
+ const obj_serviceProcessDefinitionMap_prop_item = obj_serviceProcessDefinitionMap_prop[i];
205
+ const path_serviceProcessDefinitionMap_prop_item = path_serviceProcessDefinitionMap_prop + '[' + i + ']';
206
+ const referencepath_serviceProcessDefinitionMap_prop_itemValidationError = validate$3(obj_serviceProcessDefinitionMap_prop_item, path_serviceProcessDefinitionMap_prop_item);
207
+ if (referencepath_serviceProcessDefinitionMap_prop_itemValidationError !== null) {
208
+ let message = 'Object doesn\'t match ServiceProcessDependencyDetails (at "' + path_serviceProcessDefinitionMap_prop_item + '")\n';
209
+ message += referencepath_serviceProcessDefinitionMap_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
210
+ return new TypeError(message);
211
+ }
212
+ }
213
+ }
214
+ })();
215
+ return v_error === undefined ? null : v_error;
216
+ }
217
+ const RepresentationType$1 = 'ServiceProcessDefinitionRepresentation';
218
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
219
+ return input;
220
+ }
221
+ const select$3 = function ServiceProcessDefinitionRepresentationSelect() {
222
+ return {
223
+ kind: 'Fragment',
224
+ version: VERSION$1,
225
+ private: [],
226
+ opaque: true
227
+ };
228
+ };
229
+ function equals$1(existing, incoming) {
230
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
231
+ return false;
232
+ }
233
+ return true;
234
+ }
235
+ const ingest$1 = function ServiceProcessDefinitionRepresentationIngest(input, path, luvio, store, timestamp) {
236
+ if (process.env.NODE_ENV !== 'production') {
237
+ const validateError = validate$2(input);
238
+ if (validateError !== null) {
239
+ throw validateError;
240
+ }
241
+ }
242
+ const key = path.fullPath;
243
+ const ttlToUse = TTL$1;
244
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "serviceprocess", VERSION$1, RepresentationType$1, equals$1);
245
+ return createLink(key);
246
+ };
247
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
248
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
249
+ const rootKey = fullPathFactory();
250
+ rootKeySet.set(rootKey, {
251
+ namespace: keyPrefix,
252
+ representationName: RepresentationType$1,
253
+ mergeable: false
254
+ });
255
+ }
256
+
257
+ function select$2(luvio, params) {
258
+ return select$3();
259
+ }
260
+ function keyBuilder$3(luvio, params) {
261
+ return keyPrefix + '::ServiceProcessDefinitionRepresentation:(' + 'includeAttributes:' + params.queryParams.includeAttributes + ',' + 'productId:' + params.queryParams.productId + ',' + 'serviceProcessDefinitionId:' + params.queryParams.serviceProcessDefinitionId + ')';
262
+ }
263
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
264
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
265
+ }
266
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
267
+ const { body } = response;
268
+ const key = keyBuilder$3(luvio, resourceParams);
269
+ luvio.storeIngest(key, ingest$1, body);
270
+ const snapshot = luvio.storeLookup({
271
+ recordId: key,
272
+ node: select$2(),
273
+ variables: {},
274
+ }, snapshotRefresh);
275
+ if (process.env.NODE_ENV !== 'production') {
276
+ if (snapshot.state !== 'Fulfilled') {
277
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
278
+ }
279
+ }
280
+ deepFreeze(snapshot.data);
281
+ return snapshot;
282
+ }
283
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
284
+ const key = keyBuilder$3(luvio, params);
285
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
286
+ const storeMetadataParams = {
287
+ ttl: TTL$1,
288
+ namespace: keyPrefix,
289
+ version: VERSION$1,
290
+ representationName: RepresentationType$1
291
+ };
292
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
293
+ return errorSnapshot;
294
+ }
295
+ function createResourceRequest$1(config) {
296
+ const headers = {};
297
+ return {
298
+ baseUri: '/services/data/v62.0',
299
+ basePath: '/connect/service-excellence/service-process-definition',
300
+ method: 'get',
301
+ body: null,
302
+ urlParams: {},
303
+ queryParams: config.queryParams,
304
+ headers,
305
+ priority: 'normal',
306
+ };
307
+ }
308
+
309
+ const adapterName$1 = 'fetchServiceProcessDefinition';
310
+ const fetchServiceProcessDefinition_ConfigPropertyMetadata = [
311
+ generateParamConfigMetadata('includeAttributes', false, 1 /* QueryParameter */, 1 /* Boolean */),
312
+ generateParamConfigMetadata('productId', false, 1 /* QueryParameter */, 0 /* String */),
313
+ generateParamConfigMetadata('serviceProcessDefinitionId', false, 1 /* QueryParameter */, 0 /* String */),
314
+ ];
315
+ const fetchServiceProcessDefinition_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, fetchServiceProcessDefinition_ConfigPropertyMetadata);
316
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(fetchServiceProcessDefinition_ConfigPropertyMetadata);
317
+ function keyBuilder$2(luvio, config) {
318
+ const resourceParams = createResourceParams$1(config);
319
+ return keyBuilder$3(luvio, resourceParams);
320
+ }
321
+ function typeCheckConfig$1(untrustedConfig) {
322
+ const config = {};
323
+ typeCheckConfig$2(untrustedConfig, config, fetchServiceProcessDefinition_ConfigPropertyMetadata);
324
+ return config;
325
+ }
326
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
327
+ if (!untrustedIsObject(untrustedConfig)) {
328
+ return null;
329
+ }
330
+ if (process.env.NODE_ENV !== 'production') {
331
+ validateConfig(untrustedConfig, configPropertyNames);
332
+ }
333
+ const config = typeCheckConfig$1(untrustedConfig);
334
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
335
+ return null;
336
+ }
337
+ return config;
338
+ }
339
+ function adapterFragment$1(luvio, config) {
340
+ createResourceParams$1(config);
341
+ return select$2();
342
+ }
343
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
344
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
345
+ config,
346
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
347
+ });
348
+ return luvio.storeBroadcast().then(() => snapshot);
349
+ }
350
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
351
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
352
+ config,
353
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
354
+ });
355
+ return luvio.storeBroadcast().then(() => snapshot);
356
+ }
357
+ function buildNetworkSnapshot$1(luvio, config, options) {
358
+ const resourceParams = createResourceParams$1(config);
359
+ const request = createResourceRequest$1(resourceParams);
360
+ return luvio.dispatchResourceRequest(request, options)
361
+ .then((response) => {
362
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
363
+ const cache = new StoreKeyMap();
364
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
365
+ return cache;
366
+ });
367
+ }, (response) => {
368
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
369
+ });
370
+ }
371
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
372
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
373
+ }
374
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
375
+ const { luvio, config } = context;
376
+ const selector = {
377
+ recordId: keyBuilder$2(luvio, config),
378
+ node: adapterFragment$1(luvio, config),
379
+ variables: {},
380
+ };
381
+ const cacheSnapshot = storeLookup(selector, {
382
+ config,
383
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
384
+ });
385
+ return cacheSnapshot;
386
+ }
387
+ const fetchServiceProcessDefinitionAdapterFactory = (luvio) => function serviceprocess__fetchServiceProcessDefinition(untrustedConfig, requestContext) {
388
+ const config = validateAdapterConfig$1(untrustedConfig, fetchServiceProcessDefinition_ConfigPropertyNames);
389
+ // Invalid or incomplete config
390
+ if (config === null) {
391
+ return null;
392
+ }
393
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
394
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
395
+ };
396
+
146
397
  function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
147
398
  const v_error = (() => {
148
399
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -161,7 +412,7 @@ function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
161
412
  for (let i = 0; i < obj_attributes.length; i++) {
162
413
  const obj_attributes_item = obj_attributes[i];
163
414
  const path_attributes_item = path_attributes + '[' + i + ']';
164
- const referencepath_attributes_itemValidationError = validate$2(obj_attributes_item, path_attributes_item);
415
+ const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
165
416
  if (referencepath_attributes_itemValidationError !== null) {
166
417
  let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_attributes_item + '")\n';
167
418
  message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -204,7 +455,7 @@ function validate(obj, path = 'ServiceProcessRequestLayoutDataRepresentation') {
204
455
  const key = obj_data_keys[i];
205
456
  const obj_data_prop = obj_data[key];
206
457
  const path_data_prop = path_data + '["' + key + '"]';
207
- const referencepath_data_propValidationError = validate$3(obj_data_prop, path_data_prop);
458
+ const referencepath_data_propValidationError = validate$4(obj_data_prop, path_data_prop);
208
459
  if (referencepath_data_propValidationError !== null) {
209
460
  let message = 'Object doesn\'t match GenericObjectOutput (at "' + path_data_prop + '")\n';
210
461
  message += referencepath_data_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -326,14 +577,14 @@ const getCaseServiceProcessLayoutData_ConfigPropertyMetadata = [
326
577
  generateParamConfigMetadata('Id', true, 0 /* UrlParameter */, 0 /* String */),
327
578
  ];
328
579
  const getCaseServiceProcessLayoutData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
329
- const createResourceParams = /*#__PURE__*/ createResourceParams$1(getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
580
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
330
581
  function keyBuilder(luvio, config) {
331
582
  const resourceParams = createResourceParams(config);
332
583
  return keyBuilder$1(luvio, resourceParams);
333
584
  }
334
585
  function typeCheckConfig(untrustedConfig) {
335
586
  const config = {};
336
- typeCheckConfig$1(untrustedConfig, config, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
587
+ typeCheckConfig$2(untrustedConfig, config, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
337
588
  return config;
338
589
  }
339
590
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -382,7 +633,7 @@ function buildNetworkSnapshot(luvio, config, options) {
382
633
  });
383
634
  }
384
635
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
385
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
636
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
386
637
  }
387
638
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
388
639
  const { luvio, config } = context;
@@ -407,4 +658,4 @@ const getCaseServiceProcessLayoutDataAdapterFactory = (luvio) => function servic
407
658
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
408
659
  };
409
660
 
410
- export { getCaseServiceProcessLayoutDataAdapterFactory };
661
+ export { fetchServiceProcessDefinitionAdapterFactory, getCaseServiceProcessLayoutDataAdapterFactory };
@@ -0,0 +1,29 @@
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_getConnectServiceExcellenceServiceProcessDefinition_ResourceRequestConfig } from '../resources/getConnectServiceExcellenceServiceProcessDefinition';
4
+ import { ServiceProcessDefinitionRepresentation as types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation } from '../types/ServiceProcessDefinitionRepresentation';
5
+ export declare const adapterName = "fetchServiceProcessDefinition";
6
+ export declare const fetchServiceProcessDefinition_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const fetchServiceProcessDefinition_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface FetchServiceProcessDefinitionConfig {
9
+ includeAttributes?: boolean;
10
+ productId?: string;
11
+ serviceProcessDefinitionId?: string;
12
+ }
13
+ export declare const createResourceParams: (config: FetchServiceProcessDefinitionConfig) => resources_getConnectServiceExcellenceServiceProcessDefinition_ResourceRequestConfig;
14
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig): string;
15
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig): $64$luvio_engine_NormalizedKeyMetadata;
16
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<FetchServiceProcessDefinitionConfig>): adapter$45$utils_Untrusted<FetchServiceProcessDefinitionConfig>;
17
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): FetchServiceProcessDefinitionConfig | null;
18
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig): $64$luvio_engine_Fragment;
19
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig): $64$luvio_engine_Snapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>;
20
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig, resourceParams: resources_getConnectServiceExcellenceServiceProcessDefinition_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>>;
21
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig, resourceParams: resources_getConnectServiceExcellenceServiceProcessDefinition_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
22
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: FetchServiceProcessDefinitionConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>>;
23
+ export type BuildSnapshotContext = {
24
+ luvio: $64$luvio_engine_Luvio;
25
+ config: FetchServiceProcessDefinitionConfig;
26
+ };
27
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>>;
28
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>): $64$luvio_engine_Snapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>;
29
+ export declare const fetchServiceProcessDefinitionAdapterFactory: $64$luvio_engine_AdapterFactory<FetchServiceProcessDefinitionConfig, types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>;
@@ -1 +1,2 @@
1
+ export { fetchServiceProcessDefinitionAdapterFactory } from '../adapters/fetchServiceProcessDefinition';
1
2
  export { getCaseServiceProcessLayoutDataAdapterFactory } from '../adapters/getCaseServiceProcessLayoutData';
@@ -1,3 +1,5 @@
1
+ declare let fetchServiceProcessDefinition: any;
1
2
  declare let getCaseServiceProcessLayoutData: any;
3
+ declare let fetchServiceProcessDefinition_imperative: any;
2
4
  declare let getCaseServiceProcessLayoutData_imperative: any;
3
- export { getCaseServiceProcessLayoutData, getCaseServiceProcessLayoutData_imperative };
5
+ export { fetchServiceProcessDefinition, getCaseServiceProcessLayoutData, fetchServiceProcessDefinition_imperative, getCaseServiceProcessLayoutData_imperative, };
@@ -0,0 +1,17 @@
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 { ServiceProcessDefinitionRepresentation as types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation } from '../types/ServiceProcessDefinitionRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ queryParams: {
5
+ includeAttributes?: boolean;
6
+ productId?: string;
7
+ serviceProcessDefinitionId?: string;
8
+ };
9
+ }
10
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
11
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
12
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
13
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation): void;
14
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation, any>;
15
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ServiceProcessDefinitionRepresentation_ServiceProcessDefinitionRepresentation>): $64$luvio_engine_ErrorSnapshot;
16
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
17
+ export default createResourceRequest;
@@ -0,0 +1,38 @@
1
+ import { AttributeRepresentation as AttributeRepresentation_AttributeRepresentation } from './AttributeRepresentation';
2
+ import { ServiceProcessDependencyDetails as ServiceProcessDependencyDetails_ServiceProcessDependencyDetails } from './ServiceProcessDependencyDetails';
3
+ 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';
4
+ export declare const TTL = 300000;
5
+ export declare const VERSION = "33ba038f6b7bf9bf829de107f3cb7bfd";
6
+ export declare function validate(obj: any, path?: string): TypeError | null;
7
+ export declare const RepresentationType: string;
8
+ export declare function normalize(input: ServiceProcessDefinitionRepresentation, existing: ServiceProcessDefinitionRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ServiceProcessDefinitionRepresentationNormalized;
9
+ export declare const select: () => $64$luvio_engine_BaseFragment;
10
+ export declare function equals(existing: ServiceProcessDefinitionRepresentationNormalized, incoming: ServiceProcessDefinitionRepresentationNormalized): boolean;
11
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
12
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ServiceProcessDefinitionRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
13
+ /**
14
+ * Service Process Definition representation
15
+ *
16
+ * Keys:
17
+ * (none)
18
+ */
19
+ export interface ServiceProcessDefinitionRepresentationNormalized {
20
+ /** get service process attributes */
21
+ attributes: Array<AttributeRepresentation_AttributeRepresentation>;
22
+ /** service process dependency details */
23
+ serviceProcessDefinitionMap: {
24
+ [key: string]: Array<ServiceProcessDependencyDetails_ServiceProcessDependencyDetails>;
25
+ };
26
+ }
27
+ /**
28
+ * Service Process Definition representation
29
+ *
30
+ * Keys:
31
+ * (none)
32
+ */
33
+ export interface ServiceProcessDefinitionRepresentation {
34
+ attributes: Array<AttributeRepresentation_AttributeRepresentation>;
35
+ serviceProcessDefinitionMap: {
36
+ [key: string]: Array<ServiceProcessDependencyDetails_ServiceProcessDependencyDetails>;
37
+ };
38
+ }
@@ -0,0 +1,32 @@
1
+ import { GenericObjectOutput as GenericObjectOutput_GenericObjectOutput } from './GenericObjectOutput';
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
+ export declare const VERSION = "ec4bff13cf4da5d6d15c0209df7265fe";
4
+ export declare function validate(obj: any, path?: string): TypeError | null;
5
+ export declare const RepresentationType: string;
6
+ export declare function normalize(input: ServiceProcessDependencyDetails, existing: ServiceProcessDependencyDetailsNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ServiceProcessDependencyDetailsNormalized;
7
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
8
+ export declare function equals(existing: ServiceProcessDependencyDetailsNormalized, incoming: ServiceProcessDependencyDetailsNormalized): boolean;
9
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
10
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ServiceProcessDependencyDetails, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
11
+ /**
12
+ * Service catalog Dependency representation
13
+ *
14
+ * Keys:
15
+ * (none)
16
+ */
17
+ export interface ServiceProcessDependencyDetailsNormalized {
18
+ /** service process dependency details */
19
+ details: GenericObjectOutput_GenericObjectOutput;
20
+ /** service process dependency type */
21
+ type: string;
22
+ }
23
+ /**
24
+ * Service catalog Dependency representation
25
+ *
26
+ * Keys:
27
+ * (none)
28
+ */
29
+ export interface ServiceProcessDependencyDetails {
30
+ details: GenericObjectOutput_GenericObjectOutput;
31
+ type: string;
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-serviceprocess",
3
- "version": "1.299.0",
3
+ "version": "1.301.0",
4
4
  "description": "Connect apis for fetching and updating service processes",
5
5
  "license": "MIT",
6
6
  "main": "dist/es/es2018/industries-serviceprocess.js",
@@ -27,7 +27,7 @@
27
27
  "saksham.bhayana@salesforce.com"
28
28
  ],
29
29
  "scripts": {
30
- "build": "yarn build:services",
30
+ "build": "yarn build:raml && yarn build:services",
31
31
  "build:karma": "rollup --bundleConfigAsCjs --config rollup.config.karma.js",
32
32
  "build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
33
33
  "build:services": "rollup --bundleConfigAsCjs --config rollup.config.js",
@@ -35,14 +35,15 @@
35
35
  "release:core": "../../scripts/release/core.js --adapter=lds-adapters-industries-serviceprocess",
36
36
  "release:corejar": "yarn build && packages/core-build/scripts/core.js --adapter=lds-adapters-industries-serviceprocess",
37
37
  "start": "nx build:karma && karma start",
38
- "test": "nx build:karma && karma start --single-run"
38
+ "test": "nx build:karma && karma start --single-run",
39
+ "test:unit": "jest --config=./jest.config.js"
39
40
  },
40
41
  "dependencies": {
41
- "@salesforce/lds-bindings": "^1.299.0"
42
+ "@salesforce/lds-bindings": "^1.301.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@salesforce/lds-compiler-plugins": "^1.299.0",
45
- "@salesforce/lds-karma": "^1.299.0"
45
+ "@salesforce/lds-compiler-plugins": "^1.301.0",
46
+ "@salesforce/lds-karma": "^1.301.0"
46
47
  },
47
48
  "nx": {
48
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, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -90,21 +90,7 @@ function createLink(ref) {
90
90
  };
91
91
  }
92
92
 
93
- function validate$3(obj, path = 'GenericObjectOutput') {
94
- const v_error = (() => {
95
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
96
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
97
- }
98
- const obj_value = obj.value;
99
- const path_value = path + '.value';
100
- if (obj_value === undefined) {
101
- return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
102
- }
103
- })();
104
- return v_error === undefined ? null : v_error;
105
- }
106
-
107
- function validate$2(obj, path = 'AttributeRepresentation') {
93
+ function validate$5(obj, path = 'AttributeRepresentation') {
108
94
  const v_error = (() => {
109
95
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
110
96
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -132,7 +118,7 @@ function validate$2(obj, path = 'AttributeRepresentation') {
132
118
  for (let i = 0; i < obj_childAttributes.length; i++) {
133
119
  const obj_childAttributes_item = obj_childAttributes[i];
134
120
  const path_childAttributes_item = path_childAttributes + '[' + i + ']';
135
- const referencepath_childAttributes_itemValidationError = validate$2(obj_childAttributes_item, path_childAttributes_item);
121
+ const referencepath_childAttributes_itemValidationError = validate$5(obj_childAttributes_item, path_childAttributes_item);
136
122
  if (referencepath_childAttributes_itemValidationError !== null) {
137
123
  let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_childAttributes_item + '")\n';
138
124
  message += referencepath_childAttributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -153,6 +139,271 @@ function validate$2(obj, path = 'AttributeRepresentation') {
153
139
  return v_error === undefined ? null : v_error;
154
140
  }
155
141
 
142
+ function validate$4(obj, path = 'GenericObjectOutput') {
143
+ const v_error = (() => {
144
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
145
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
146
+ }
147
+ const obj_value = obj.value;
148
+ const path_value = path + '.value';
149
+ if (obj_value === undefined) {
150
+ return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
151
+ }
152
+ })();
153
+ return v_error === undefined ? null : v_error;
154
+ }
155
+
156
+ function validate$3(obj, path = 'ServiceProcessDependencyDetails') {
157
+ const v_error = (() => {
158
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
159
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
160
+ }
161
+ const obj_details = obj.details;
162
+ const path_details = path + '.details';
163
+ const referencepath_detailsValidationError = validate$4(obj_details, path_details);
164
+ if (referencepath_detailsValidationError !== null) {
165
+ let message = 'Object doesn\'t match GenericObjectOutput (at "' + path_details + '")\n';
166
+ message += referencepath_detailsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
167
+ return new TypeError(message);
168
+ }
169
+ const obj_type = obj.type;
170
+ const path_type = path + '.type';
171
+ if (typeof obj_type !== 'string') {
172
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
173
+ }
174
+ })();
175
+ return v_error === undefined ? null : v_error;
176
+ }
177
+
178
+ const TTL$1 = 300000;
179
+ const VERSION$1 = "33ba038f6b7bf9bf829de107f3cb7bfd";
180
+ function validate$2(obj, path = 'ServiceProcessDefinitionRepresentation') {
181
+ const v_error = (() => {
182
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
183
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
184
+ }
185
+ const obj_attributes = obj.attributes;
186
+ const path_attributes = path + '.attributes';
187
+ if (!ArrayIsArray(obj_attributes)) {
188
+ return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
189
+ }
190
+ for (let i = 0; i < obj_attributes.length; i++) {
191
+ const obj_attributes_item = obj_attributes[i];
192
+ const path_attributes_item = path_attributes + '[' + i + ']';
193
+ const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
194
+ if (referencepath_attributes_itemValidationError !== null) {
195
+ let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_attributes_item + '")\n';
196
+ message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
197
+ return new TypeError(message);
198
+ }
199
+ }
200
+ const obj_serviceProcessDefinitionMap = obj.serviceProcessDefinitionMap;
201
+ const path_serviceProcessDefinitionMap = path + '.serviceProcessDefinitionMap';
202
+ if (typeof obj_serviceProcessDefinitionMap !== 'object' || ArrayIsArray(obj_serviceProcessDefinitionMap) || obj_serviceProcessDefinitionMap === null) {
203
+ return new TypeError('Expected "object" but received "' + typeof obj_serviceProcessDefinitionMap + '" (at "' + path_serviceProcessDefinitionMap + '")');
204
+ }
205
+ const obj_serviceProcessDefinitionMap_keys = ObjectKeys(obj_serviceProcessDefinitionMap);
206
+ for (let i = 0; i < obj_serviceProcessDefinitionMap_keys.length; i++) {
207
+ const key = obj_serviceProcessDefinitionMap_keys[i];
208
+ const obj_serviceProcessDefinitionMap_prop = obj_serviceProcessDefinitionMap[key];
209
+ const path_serviceProcessDefinitionMap_prop = path_serviceProcessDefinitionMap + '["' + key + '"]';
210
+ if (!ArrayIsArray(obj_serviceProcessDefinitionMap_prop)) {
211
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceProcessDefinitionMap_prop + '" (at "' + path_serviceProcessDefinitionMap_prop + '")');
212
+ }
213
+ for (let i = 0; i < obj_serviceProcessDefinitionMap_prop.length; i++) {
214
+ const obj_serviceProcessDefinitionMap_prop_item = obj_serviceProcessDefinitionMap_prop[i];
215
+ const path_serviceProcessDefinitionMap_prop_item = path_serviceProcessDefinitionMap_prop + '[' + i + ']';
216
+ const referencepath_serviceProcessDefinitionMap_prop_itemValidationError = validate$3(obj_serviceProcessDefinitionMap_prop_item, path_serviceProcessDefinitionMap_prop_item);
217
+ if (referencepath_serviceProcessDefinitionMap_prop_itemValidationError !== null) {
218
+ let message = 'Object doesn\'t match ServiceProcessDependencyDetails (at "' + path_serviceProcessDefinitionMap_prop_item + '")\n';
219
+ message += referencepath_serviceProcessDefinitionMap_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
220
+ return new TypeError(message);
221
+ }
222
+ }
223
+ }
224
+ })();
225
+ return v_error === undefined ? null : v_error;
226
+ }
227
+ const RepresentationType$1 = 'ServiceProcessDefinitionRepresentation';
228
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
229
+ return input;
230
+ }
231
+ const select$3 = function ServiceProcessDefinitionRepresentationSelect() {
232
+ return {
233
+ kind: 'Fragment',
234
+ version: VERSION$1,
235
+ private: [],
236
+ opaque: true
237
+ };
238
+ };
239
+ function equals$1(existing, incoming) {
240
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
241
+ return false;
242
+ }
243
+ return true;
244
+ }
245
+ const ingest$1 = function ServiceProcessDefinitionRepresentationIngest(input, path, luvio, store, timestamp) {
246
+ if (process.env.NODE_ENV !== 'production') {
247
+ const validateError = validate$2(input);
248
+ if (validateError !== null) {
249
+ throw validateError;
250
+ }
251
+ }
252
+ const key = path.fullPath;
253
+ const ttlToUse = TTL$1;
254
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "serviceprocess", VERSION$1, RepresentationType$1, equals$1);
255
+ return createLink(key);
256
+ };
257
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
258
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
259
+ const rootKey = fullPathFactory();
260
+ rootKeySet.set(rootKey, {
261
+ namespace: keyPrefix,
262
+ representationName: RepresentationType$1,
263
+ mergeable: false
264
+ });
265
+ }
266
+
267
+ function select$2(luvio, params) {
268
+ return select$3();
269
+ }
270
+ function keyBuilder$3(luvio, params) {
271
+ return keyPrefix + '::ServiceProcessDefinitionRepresentation:(' + 'includeAttributes:' + params.queryParams.includeAttributes + ',' + 'productId:' + params.queryParams.productId + ',' + 'serviceProcessDefinitionId:' + params.queryParams.serviceProcessDefinitionId + ')';
272
+ }
273
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
274
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
275
+ }
276
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
277
+ const { body } = response;
278
+ const key = keyBuilder$3(luvio, resourceParams);
279
+ luvio.storeIngest(key, ingest$1, body);
280
+ const snapshot = luvio.storeLookup({
281
+ recordId: key,
282
+ node: select$2(),
283
+ variables: {},
284
+ }, snapshotRefresh);
285
+ if (process.env.NODE_ENV !== 'production') {
286
+ if (snapshot.state !== 'Fulfilled') {
287
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
288
+ }
289
+ }
290
+ deepFreeze(snapshot.data);
291
+ return snapshot;
292
+ }
293
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
294
+ const key = keyBuilder$3(luvio, params);
295
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
296
+ const storeMetadataParams = {
297
+ ttl: TTL$1,
298
+ namespace: keyPrefix,
299
+ version: VERSION$1,
300
+ representationName: RepresentationType$1
301
+ };
302
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
303
+ return errorSnapshot;
304
+ }
305
+ function createResourceRequest$1(config) {
306
+ const headers = {};
307
+ return {
308
+ baseUri: '/services/data/v62.0',
309
+ basePath: '/connect/service-excellence/service-process-definition',
310
+ method: 'get',
311
+ body: null,
312
+ urlParams: {},
313
+ queryParams: config.queryParams,
314
+ headers,
315
+ priority: 'normal',
316
+ };
317
+ }
318
+
319
+ const adapterName$1 = 'fetchServiceProcessDefinition';
320
+ const fetchServiceProcessDefinition_ConfigPropertyMetadata = [
321
+ generateParamConfigMetadata('includeAttributes', false, 1 /* QueryParameter */, 1 /* Boolean */),
322
+ generateParamConfigMetadata('productId', false, 1 /* QueryParameter */, 0 /* String */),
323
+ generateParamConfigMetadata('serviceProcessDefinitionId', false, 1 /* QueryParameter */, 0 /* String */),
324
+ ];
325
+ const fetchServiceProcessDefinition_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, fetchServiceProcessDefinition_ConfigPropertyMetadata);
326
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(fetchServiceProcessDefinition_ConfigPropertyMetadata);
327
+ function keyBuilder$2(luvio, config) {
328
+ const resourceParams = createResourceParams$1(config);
329
+ return keyBuilder$3(luvio, resourceParams);
330
+ }
331
+ function typeCheckConfig$1(untrustedConfig) {
332
+ const config = {};
333
+ typeCheckConfig$2(untrustedConfig, config, fetchServiceProcessDefinition_ConfigPropertyMetadata);
334
+ return config;
335
+ }
336
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
337
+ if (!untrustedIsObject(untrustedConfig)) {
338
+ return null;
339
+ }
340
+ if (process.env.NODE_ENV !== 'production') {
341
+ validateConfig(untrustedConfig, configPropertyNames);
342
+ }
343
+ const config = typeCheckConfig$1(untrustedConfig);
344
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
345
+ return null;
346
+ }
347
+ return config;
348
+ }
349
+ function adapterFragment$1(luvio, config) {
350
+ createResourceParams$1(config);
351
+ return select$2();
352
+ }
353
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
354
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
355
+ config,
356
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
357
+ });
358
+ return luvio.storeBroadcast().then(() => snapshot);
359
+ }
360
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
361
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
362
+ config,
363
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
364
+ });
365
+ return luvio.storeBroadcast().then(() => snapshot);
366
+ }
367
+ function buildNetworkSnapshot$1(luvio, config, options) {
368
+ const resourceParams = createResourceParams$1(config);
369
+ const request = createResourceRequest$1(resourceParams);
370
+ return luvio.dispatchResourceRequest(request, options)
371
+ .then((response) => {
372
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
373
+ const cache = new StoreKeyMap();
374
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
375
+ return cache;
376
+ });
377
+ }, (response) => {
378
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
379
+ });
380
+ }
381
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
382
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
383
+ }
384
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
385
+ const { luvio, config } = context;
386
+ const selector = {
387
+ recordId: keyBuilder$2(luvio, config),
388
+ node: adapterFragment$1(luvio, config),
389
+ variables: {},
390
+ };
391
+ const cacheSnapshot = storeLookup(selector, {
392
+ config,
393
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
394
+ });
395
+ return cacheSnapshot;
396
+ }
397
+ const fetchServiceProcessDefinitionAdapterFactory = (luvio) => function serviceprocess__fetchServiceProcessDefinition(untrustedConfig, requestContext) {
398
+ const config = validateAdapterConfig$1(untrustedConfig, fetchServiceProcessDefinition_ConfigPropertyNames);
399
+ // Invalid or incomplete config
400
+ if (config === null) {
401
+ return null;
402
+ }
403
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
404
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
405
+ };
406
+
156
407
  function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
157
408
  const v_error = (() => {
158
409
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -171,7 +422,7 @@ function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
171
422
  for (let i = 0; i < obj_attributes.length; i++) {
172
423
  const obj_attributes_item = obj_attributes[i];
173
424
  const path_attributes_item = path_attributes + '[' + i + ']';
174
- const referencepath_attributes_itemValidationError = validate$2(obj_attributes_item, path_attributes_item);
425
+ const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
175
426
  if (referencepath_attributes_itemValidationError !== null) {
176
427
  let message = 'Object doesn\'t match AttributeRepresentation (at "' + path_attributes_item + '")\n';
177
428
  message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -214,7 +465,7 @@ function validate(obj, path = 'ServiceProcessRequestLayoutDataRepresentation') {
214
465
  const key = obj_data_keys[i];
215
466
  const obj_data_prop = obj_data[key];
216
467
  const path_data_prop = path_data + '["' + key + '"]';
217
- const referencepath_data_propValidationError = validate$3(obj_data_prop, path_data_prop);
468
+ const referencepath_data_propValidationError = validate$4(obj_data_prop, path_data_prop);
218
469
  if (referencepath_data_propValidationError !== null) {
219
470
  let message = 'Object doesn\'t match GenericObjectOutput (at "' + path_data_prop + '")\n';
220
471
  message += referencepath_data_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -336,14 +587,14 @@ const getCaseServiceProcessLayoutData_ConfigPropertyMetadata = [
336
587
  generateParamConfigMetadata('Id', true, 0 /* UrlParameter */, 0 /* String */),
337
588
  ];
338
589
  const getCaseServiceProcessLayoutData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
339
- const createResourceParams = /*#__PURE__*/ createResourceParams$1(getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
590
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
340
591
  function keyBuilder(luvio, config) {
341
592
  const resourceParams = createResourceParams(config);
342
593
  return keyBuilder$1(luvio, resourceParams);
343
594
  }
344
595
  function typeCheckConfig(untrustedConfig) {
345
596
  const config = {};
346
- typeCheckConfig$1(untrustedConfig, config, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
597
+ typeCheckConfig$2(untrustedConfig, config, getCaseServiceProcessLayoutData_ConfigPropertyMetadata);
347
598
  return config;
348
599
  }
349
600
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -392,7 +643,7 @@ function buildNetworkSnapshot(luvio, config, options) {
392
643
  });
393
644
  }
394
645
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
395
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
646
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
396
647
  }
397
648
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
398
649
  const { luvio, config } = context;
@@ -417,10 +668,17 @@ const getCaseServiceProcessLayoutDataAdapterFactory = (luvio) => function servic
417
668
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
418
669
  };
419
670
 
671
+ let fetchServiceProcessDefinition;
420
672
  let getCaseServiceProcessLayoutData;
421
673
  // Imperative GET Adapters
674
+ let fetchServiceProcessDefinition_imperative;
422
675
  let getCaseServiceProcessLayoutData_imperative;
423
676
  // Adapter Metadata
677
+ const fetchServiceProcessDefinitionMetadata = {
678
+ apiFamily: 'serviceprocess',
679
+ name: 'fetchServiceProcessDefinition',
680
+ ttl: 300000,
681
+ };
424
682
  const getCaseServiceProcessLayoutDataMetadata = {
425
683
  apiFamily: 'serviceprocess',
426
684
  name: 'getCaseServiceProcessLayoutData',
@@ -429,18 +687,25 @@ const getCaseServiceProcessLayoutDataMetadata = {
429
687
  // Notify Update Available
430
688
  function bindExportsTo(luvio) {
431
689
  // LDS Adapters
690
+ const fetchServiceProcessDefinition_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'fetchServiceProcessDefinition', fetchServiceProcessDefinitionAdapterFactory), fetchServiceProcessDefinitionMetadata);
432
691
  const getCaseServiceProcessLayoutData_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCaseServiceProcessLayoutData', getCaseServiceProcessLayoutDataAdapterFactory), getCaseServiceProcessLayoutDataMetadata);
433
692
  return {
693
+ fetchServiceProcessDefinition: createWireAdapterConstructor(luvio, fetchServiceProcessDefinition_ldsAdapter, fetchServiceProcessDefinitionMetadata),
434
694
  getCaseServiceProcessLayoutData: createWireAdapterConstructor(luvio, getCaseServiceProcessLayoutData_ldsAdapter, getCaseServiceProcessLayoutDataMetadata),
435
695
  // Imperative GET Adapters
696
+ fetchServiceProcessDefinition_imperative: createImperativeAdapter(luvio, fetchServiceProcessDefinition_ldsAdapter, fetchServiceProcessDefinitionMetadata),
436
697
  getCaseServiceProcessLayoutData_imperative: createImperativeAdapter(luvio, getCaseServiceProcessLayoutData_ldsAdapter, getCaseServiceProcessLayoutDataMetadata),
437
698
  // Notify Update Availables
438
699
  };
439
700
  }
440
701
  withDefaultLuvio((luvio) => {
441
- ({ getCaseServiceProcessLayoutData, getCaseServiceProcessLayoutData_imperative } =
442
- bindExportsTo(luvio));
702
+ ({
703
+ fetchServiceProcessDefinition,
704
+ getCaseServiceProcessLayoutData,
705
+ fetchServiceProcessDefinition_imperative,
706
+ getCaseServiceProcessLayoutData_imperative,
707
+ } = bindExportsTo(luvio));
443
708
  });
444
709
 
445
- export { getCaseServiceProcessLayoutData, getCaseServiceProcessLayoutData_imperative };
446
- // version: 1.299.0-161c48605a
710
+ export { fetchServiceProcessDefinition, fetchServiceProcessDefinition_imperative, getCaseServiceProcessLayoutData, getCaseServiceProcessLayoutData_imperative };
711
+ // version: 1.301.0-4216dc9d10
package/src/raml/api.raml CHANGED
@@ -56,6 +56,33 @@ types:
56
56
  value:
57
57
  description: Value
58
58
  type: any
59
+ ServiceProcessDefinitionRepresentation:
60
+ description: Service Process Definition representation
61
+ type: object
62
+ properties:
63
+ attributes:
64
+ description: get service process attributes
65
+ type: array
66
+ items:
67
+ type: AttributeRepresentation
68
+ serviceProcessDefinitionMap:
69
+ description: service process dependency details
70
+ type: object
71
+ properties:
72
+ //:
73
+ type: array
74
+ items:
75
+ type: ServiceProcessDependencyDetails
76
+ ServiceProcessDependencyDetails:
77
+ description: Service catalog Dependency representation
78
+ type: object
79
+ properties:
80
+ details:
81
+ description: service process dependency details
82
+ type: GenericObjectOutput
83
+ type:
84
+ description: service process dependency type
85
+ type: string
59
86
  ServiceProcessRequestLayoutDataRepresentation:
60
87
  description: Service process layout data output representation
61
88
  type: object
@@ -92,18 +119,40 @@ types:
92
119
  sortOrder:
93
120
  description: svc catalog item group order
94
121
  type: string
95
- /connect/service-excellence/service-catalog-request:
96
- /layout-data/case/{Id}:
122
+
123
+ /connect/service-excellence:
124
+ /service-process-definition:
97
125
  get:
98
- displayName: getServiceProcessLayoutData
99
- description: get svc catalog request layout data
126
+ displayName: fetchServiceProcessDefinition
127
+ description: get service process definition
100
128
  responses:
101
129
  '200':
102
130
  description: Success
103
131
  body:
104
132
  application/json:
105
- type: ServiceProcessRequestLayoutDataRepresentation
106
- uriParameters:
107
- Id:
108
- type: string
109
- required: true
133
+ type: ServiceProcessDefinitionRepresentation
134
+ queryParameters:
135
+ includeAttributes:
136
+ type: boolean
137
+ required: false
138
+ productId:
139
+ type: string
140
+ required: false
141
+ serviceProcessDefinitionId:
142
+ type: string
143
+ required: false
144
+ /service-catalog-request:
145
+ /layout-data/case/{Id}:
146
+ get:
147
+ displayName: getServiceProcessLayoutData
148
+ description: get svc catalog request layout data
149
+ responses:
150
+ '200':
151
+ description: Success
152
+ body:
153
+ application/json:
154
+ type: ServiceProcessRequestLayoutDataRepresentation
155
+ uriParameters:
156
+ Id:
157
+ type: string
158
+ required: true
@@ -11,8 +11,16 @@ types:
11
11
  ServiceProcessRequestLayoutDataRepresentation:
12
12
  (luvio.ttl): 60000
13
13
  (luvio.opaque): true
14
+ ServiceProcessDefinitionRepresentation:
15
+ (luvio.opaque): true
16
+ (luvio.ttl): 300000
14
17
 
15
- /connect/service-excellence/service-catalog-request/layout-data/case/{Id}:
16
- get:
17
- (luvio.adapter):
18
- name: getCaseServiceProcessLayoutData
18
+ /connect/service-excellence:
19
+ /service-catalog-request/layout-data/case/{Id}:
20
+ get:
21
+ (luvio.adapter):
22
+ name: getCaseServiceProcessLayoutData
23
+ /service-process-definition:
24
+ get:
25
+ (luvio.adapter):
26
+ name: fetchServiceProcessDefinition