@salesforce/lds-adapters-service-serviceplan 1.308.0-dev4 → 1.308.0-dev6

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.
Files changed (20) hide show
  1. package/dist/es/es2018/service-serviceplan.js +945 -187
  2. package/dist/es/es2018/types/src/generated/adapters/generateServicePlan.d.ts +21 -0
  3. package/dist/es/es2018/types/src/generated/adapters/getGenerationRequest.d.ts +27 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getServicePlan.d.ts +28 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -1
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +7 -2
  7. package/dist/es/es2018/types/src/generated/resources/getConnectServicePlanGenerationRequestsByRequestId.d.ts +15 -0
  8. package/dist/es/es2018/types/src/generated/resources/getConnectServicePlanServicePlanDetailsByRecordId.d.ts +16 -0
  9. package/dist/es/es2018/types/src/generated/resources/postConnectServicePlanGenerationRequests.d.ts +5 -4
  10. package/dist/es/es2018/types/src/generated/types/ServicePlanDetailsOutputRepresentation.d.ts +59 -0
  11. package/dist/es/es2018/types/src/generated/types/ServicePlanDetailsRepresentation.d.ts +47 -0
  12. package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationInputParamRepresentation.d.ts +3 -3
  13. package/dist/es/es2018/types/src/generated/types/{ServicePlanGenerationSyncOutputRepresentation.d.ts → ServicePlanGenerationOutputRepresentation.d.ts} +18 -20
  14. package/dist/es/es2018/types/src/generated/types/ServicePlanStepDetailsRepresentation.d.ts +40 -0
  15. package/dist/es/es2018/types/src/generated/types/ServicePlanStepRepresentation.d.ts +10 -13
  16. package/package.json +3 -3
  17. package/sfdc/index.js +1019 -192
  18. package/src/raml/api.raml +130 -21
  19. package/src/raml/luvio.raml +23 -3
  20. package/dist/es/es2018/types/src/generated/adapters/generateSync.d.ts +0 -20
package/sfdc/index.js CHANGED
@@ -12,8 +12,9 @@
12
12
  * *******************************************************************************************
13
13
  */
14
14
  /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
15
16
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from 'force/luvioEngine';
17
18
 
18
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -50,6 +51,13 @@ function untrustedIsObject(untrusted) {
50
51
  function areRequiredParametersPresent(config, configPropertyNames) {
51
52
  return configPropertyNames.parameters.required.every(req => req in config);
52
53
  }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
53
61
  function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
54
62
  return {
55
63
  name,
@@ -94,8 +102,8 @@ function createLink(ref) {
94
102
  };
95
103
  }
96
104
 
97
- const VERSION$3 = "de8249c0171ece44729fbb33b422a074";
98
- function validate$5(obj, path = 'ServicePlanStepExecutionStatusRepresentation') {
105
+ const VERSION$5 = "de8249c0171ece44729fbb33b422a074";
106
+ function validate$8(obj, path = 'ServicePlanStepExecutionStatusRepresentation') {
99
107
  const v_error = (() => {
100
108
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
101
109
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -134,48 +142,48 @@ function validate$5(obj, path = 'ServicePlanStepExecutionStatusRepresentation')
134
142
  })();
135
143
  return v_error === undefined ? null : v_error;
136
144
  }
137
- const RepresentationType$3 = 'ServicePlanStepExecutionStatusRepresentation';
138
- function normalize$3(input, existing, path, luvio, store, timestamp) {
145
+ const RepresentationType$5 = 'ServicePlanStepExecutionStatusRepresentation';
146
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
139
147
  return input;
140
148
  }
141
- const select$5 = function ServicePlanStepExecutionStatusRepresentationSelect() {
149
+ const select$9 = function ServicePlanStepExecutionStatusRepresentationSelect() {
142
150
  return {
143
151
  kind: 'Fragment',
144
- version: VERSION$3,
152
+ version: VERSION$5,
145
153
  private: [],
146
154
  opaque: true
147
155
  };
148
156
  };
149
- function equals$3(existing, incoming) {
157
+ function equals$5(existing, incoming) {
150
158
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
151
159
  return false;
152
160
  }
153
161
  return true;
154
162
  }
155
- const ingest$3 = function ServicePlanStepExecutionStatusRepresentationIngest(input, path, luvio, store, timestamp) {
163
+ const ingest$5 = function ServicePlanStepExecutionStatusRepresentationIngest(input, path, luvio, store, timestamp) {
156
164
  if (process.env.NODE_ENV !== 'production') {
157
- const validateError = validate$5(input);
165
+ const validateError = validate$8(input);
158
166
  if (validateError !== null) {
159
167
  throw validateError;
160
168
  }
161
169
  }
162
170
  const key = path.fullPath;
163
171
  const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
164
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "ServicePlan", VERSION$3, RepresentationType$3, equals$3);
172
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "ServicePlan", VERSION$5, RepresentationType$5, equals$5);
165
173
  return createLink(key);
166
174
  };
167
- function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
175
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
168
176
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
169
177
  const rootKey = fullPathFactory();
170
178
  rootKeySet.set(rootKey, {
171
179
  namespace: keyPrefix,
172
- representationName: RepresentationType$3,
180
+ representationName: RepresentationType$5,
173
181
  mergeable: false
174
182
  });
175
183
  }
176
184
 
177
- const VERSION$2 = "f3a6de28bf56634adca757ba07accf43";
178
- function validate$4(obj, path = 'ServicePlanExecutionOutputRepresentation') {
185
+ const VERSION$4 = "f3a6de28bf56634adca757ba07accf43";
186
+ function validate$7(obj, path = 'ServicePlanExecutionOutputRepresentation') {
179
187
  const v_error = (() => {
180
188
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
181
189
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -200,23 +208,23 @@ function validate$4(obj, path = 'ServicePlanExecutionOutputRepresentation') {
200
208
  })();
201
209
  return v_error === undefined ? null : v_error;
202
210
  }
203
- const RepresentationType$2 = 'ServicePlanExecutionOutputRepresentation';
204
- function keyBuilder$1(luvio, config) {
205
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
211
+ const RepresentationType$4 = 'ServicePlanExecutionOutputRepresentation';
212
+ function keyBuilder$6(luvio, config) {
213
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.id;
206
214
  }
207
- function keyBuilderFromType$1(luvio, object) {
215
+ function keyBuilderFromType$2(luvio, object) {
208
216
  const keyParams = {
209
217
  id: object.executionStatus
210
218
  };
211
- return keyBuilder$1(luvio, keyParams);
219
+ return keyBuilder$6(luvio, keyParams);
212
220
  }
213
- function normalize$2(input, existing, path, luvio, store, timestamp) {
221
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
214
222
  const input_planSteps = input.planSteps;
215
223
  const input_planSteps_id = path.fullPath + '__planSteps';
216
224
  for (let i = 0; i < input_planSteps.length; i++) {
217
225
  const input_planSteps_item = input_planSteps[i];
218
226
  let input_planSteps_item_id = input_planSteps_id + '__' + i;
219
- input_planSteps[i] = ingest$3(input_planSteps_item, {
227
+ input_planSteps[i] = ingest$5(input_planSteps_item, {
220
228
  fullPath: input_planSteps_item_id,
221
229
  propertyName: i,
222
230
  parent: {
@@ -229,10 +237,10 @@ function normalize$2(input, existing, path, luvio, store, timestamp) {
229
237
  }
230
238
  return input;
231
239
  }
232
- const select$4 = function ServicePlanExecutionOutputRepresentationSelect() {
240
+ const select$8 = function ServicePlanExecutionOutputRepresentationSelect() {
233
241
  return {
234
242
  kind: 'Fragment',
235
- version: VERSION$2,
243
+ version: VERSION$4,
236
244
  private: [],
237
245
  selections: [
238
246
  {
@@ -243,12 +251,12 @@ const select$4 = function ServicePlanExecutionOutputRepresentationSelect() {
243
251
  name: 'planSteps',
244
252
  kind: 'Link',
245
253
  plural: true,
246
- fragment: select$5()
254
+ fragment: select$9()
247
255
  }
248
256
  ]
249
257
  };
250
258
  };
251
- function equals$2(existing, incoming) {
259
+ function equals$4(existing, incoming) {
252
260
  const existing_executionStatus = existing.executionStatus;
253
261
  const incoming_executionStatus = incoming.executionStatus;
254
262
  if (!(existing_executionStatus === incoming_executionStatus)) {
@@ -266,45 +274,45 @@ function equals$2(existing, incoming) {
266
274
  }
267
275
  return true;
268
276
  }
269
- const ingest$2 = function ServicePlanExecutionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
277
+ const ingest$4 = function ServicePlanExecutionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
270
278
  if (process.env.NODE_ENV !== 'production') {
271
- const validateError = validate$4(input);
279
+ const validateError = validate$7(input);
272
280
  if (validateError !== null) {
273
281
  throw validateError;
274
282
  }
275
283
  }
276
- const key = keyBuilderFromType$1(luvio, input);
284
+ const key = keyBuilderFromType$2(luvio, input);
277
285
  const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
278
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "ServicePlan", VERSION$2, RepresentationType$2, equals$2);
286
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "ServicePlan", VERSION$4, RepresentationType$4, equals$4);
279
287
  return createLink(key);
280
288
  };
281
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
289
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
282
290
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
283
- const rootKey = keyBuilderFromType$1(luvio, input);
291
+ const rootKey = keyBuilderFromType$2(luvio, input);
284
292
  rootKeySet.set(rootKey, {
285
293
  namespace: keyPrefix,
286
- representationName: RepresentationType$2,
294
+ representationName: RepresentationType$4,
287
295
  mergeable: false
288
296
  });
289
297
  const input_planSteps_length = input.planSteps.length;
290
298
  for (let i = 0; i < input_planSteps_length; i++) {
291
- getTypeCacheKeys$3(rootKeySet, luvio, input.planSteps[i], () => '');
299
+ getTypeCacheKeys$5(rootKeySet, luvio, input.planSteps[i], () => '');
292
300
  }
293
301
  }
294
302
 
295
- function select$3(luvio, params) {
296
- return select$4();
303
+ function select$7(luvio, params) {
304
+ return select$8();
297
305
  }
298
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
299
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
306
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
307
+ getTypeCacheKeys$4(storeKeyMap, luvio, response);
300
308
  }
301
- function ingestSuccess$1(luvio, resourceParams, response) {
309
+ function ingestSuccess$3(luvio, resourceParams, response) {
302
310
  const { body } = response;
303
- const key = keyBuilderFromType$1(luvio, body);
304
- luvio.storeIngest(key, ingest$2, body);
311
+ const key = keyBuilderFromType$2(luvio, body);
312
+ luvio.storeIngest(key, ingest$4, body);
305
313
  const snapshot = luvio.storeLookup({
306
314
  recordId: key,
307
- node: select$3(),
315
+ node: select$7(),
308
316
  variables: {},
309
317
  });
310
318
  if (process.env.NODE_ENV !== 'production') {
@@ -315,7 +323,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
315
323
  deepFreeze(snapshot.data);
316
324
  return snapshot;
317
325
  }
318
- function createResourceRequest$1(config) {
326
+ function createResourceRequest$3(config) {
319
327
  const headers = {};
320
328
  return {
321
329
  baseUri: '/services/data/v62.0',
@@ -329,42 +337,42 @@ function createResourceRequest$1(config) {
329
337
  };
330
338
  }
331
339
 
332
- const adapterName$1 = 'executeServicePlan';
340
+ const adapterName$3 = 'executeServicePlan';
333
341
  const executeServicePlan_ConfigPropertyMetadata = [
334
342
  generateParamConfigMetadata('planOrStepId', true, 0 /* UrlParameter */, 0 /* String */),
335
343
  generateParamConfigMetadata('action', true, 2 /* Body */, 0 /* String */),
336
344
  ];
337
- const executeServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, executeServicePlan_ConfigPropertyMetadata);
338
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(executeServicePlan_ConfigPropertyMetadata);
339
- function typeCheckConfig$1(untrustedConfig) {
345
+ const executeServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, executeServicePlan_ConfigPropertyMetadata);
346
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(executeServicePlan_ConfigPropertyMetadata);
347
+ function typeCheckConfig$3(untrustedConfig) {
340
348
  const config = {};
341
- typeCheckConfig$2(untrustedConfig, config, executeServicePlan_ConfigPropertyMetadata);
349
+ typeCheckConfig$4(untrustedConfig, config, executeServicePlan_ConfigPropertyMetadata);
342
350
  return config;
343
351
  }
344
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
352
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
345
353
  if (!untrustedIsObject(untrustedConfig)) {
346
354
  return null;
347
355
  }
348
356
  if (process.env.NODE_ENV !== 'production') {
349
357
  validateConfig(untrustedConfig, configPropertyNames);
350
358
  }
351
- const config = typeCheckConfig$1(untrustedConfig);
359
+ const config = typeCheckConfig$3(untrustedConfig);
352
360
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
353
361
  return null;
354
362
  }
355
363
  return config;
356
364
  }
357
- function buildNetworkSnapshot$1(luvio, config, options) {
358
- const resourceParams = createResourceParams$1(config);
359
- const request = createResourceRequest$1(resourceParams);
365
+ function buildNetworkSnapshot$3(luvio, config, options) {
366
+ const resourceParams = createResourceParams$3(config);
367
+ const request = createResourceRequest$3(resourceParams);
360
368
  return luvio.dispatchResourceRequest(request, options)
361
369
  .then((response) => {
362
370
  return luvio.handleSuccessResponse(() => {
363
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
371
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
364
372
  return luvio.storeBroadcast().then(() => snapshot);
365
373
  }, () => {
366
374
  const cache = new StoreKeyMap();
367
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
375
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
368
376
  return cache;
369
377
  });
370
378
  }, (response) => {
@@ -374,16 +382,16 @@ function buildNetworkSnapshot$1(luvio, config, options) {
374
382
  }
375
383
  const executeServicePlanAdapterFactory = (luvio) => {
376
384
  return function executeServicePlan(untrustedConfig) {
377
- const config = validateAdapterConfig$1(untrustedConfig, executeServicePlan_ConfigPropertyNames);
385
+ const config = validateAdapterConfig$3(untrustedConfig, executeServicePlan_ConfigPropertyNames);
378
386
  // Invalid or incomplete config
379
387
  if (config === null) {
380
388
  throw new Error('Invalid config for "executeServicePlan"');
381
389
  }
382
- return buildNetworkSnapshot$1(luvio, config);
390
+ return buildNetworkSnapshot$3(luvio, config);
383
391
  };
384
392
  };
385
393
 
386
- function validate$3(obj, path = 'ServicePlanGenerationSessionInformationOutputRepresentation') {
394
+ function validate$6(obj, path = 'ServicePlanGenerationSessionInformationOutputRepresentation') {
387
395
  const v_error = (() => {
388
396
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
389
397
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -496,42 +504,79 @@ function validate$3(obj, path = 'ServicePlanGenerationSessionInformationOutputRe
496
504
  return v_error === undefined ? null : v_error;
497
505
  }
498
506
 
499
- function validate$2(obj, path = 'ServicePlanStepRepresentation') {
507
+ function validate$5(obj, path = 'ServicePlanStepRepresentation') {
500
508
  const v_error = (() => {
501
509
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
502
510
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
503
511
  }
504
- const obj_actionOrder = obj.actionOrder;
505
- const path_actionOrder = path + '.actionOrder';
506
- if (typeof obj_actionOrder !== 'number' || (typeof obj_actionOrder === 'number' && Math.floor(obj_actionOrder) !== obj_actionOrder)) {
507
- return new TypeError('Expected "integer" but received "' + typeof obj_actionOrder + '" (at "' + path_actionOrder + '")');
512
+ const obj_groupName = obj.groupName;
513
+ const path_groupName = path + '.groupName';
514
+ let obj_groupName_union0 = null;
515
+ const obj_groupName_union0_error = (() => {
516
+ if (typeof obj_groupName !== 'string') {
517
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
518
+ }
519
+ })();
520
+ if (obj_groupName_union0_error != null) {
521
+ obj_groupName_union0 = obj_groupName_union0_error.message;
522
+ }
523
+ let obj_groupName_union1 = null;
524
+ const obj_groupName_union1_error = (() => {
525
+ if (obj_groupName !== null) {
526
+ return new TypeError('Expected "null" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
527
+ }
528
+ })();
529
+ if (obj_groupName_union1_error != null) {
530
+ obj_groupName_union1 = obj_groupName_union1_error.message;
508
531
  }
509
- const obj_functionName = obj.functionName;
510
- const path_functionName = path + '.functionName';
511
- if (typeof obj_functionName !== 'string') {
512
- return new TypeError('Expected "string" but received "' + typeof obj_functionName + '" (at "' + path_functionName + '")');
532
+ if (obj_groupName_union0 && obj_groupName_union1) {
533
+ let message = 'Object doesn\'t match union (at "' + path_groupName + '")';
534
+ message += '\n' + obj_groupName_union0.split('\n').map((line) => '\t' + line).join('\n');
535
+ message += '\n' + obj_groupName_union1.split('\n').map((line) => '\t' + line).join('\n');
536
+ return new TypeError(message);
513
537
  }
514
538
  const obj_id = obj.id;
515
539
  const path_id = path + '.id';
516
540
  if (typeof obj_id !== 'string') {
517
541
  return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
518
542
  }
519
- const obj_relatedActionId = obj.relatedActionId;
520
- const path_relatedActionId = path + '.relatedActionId';
521
- if (typeof obj_relatedActionId !== 'string') {
522
- return new TypeError('Expected "string" but received "' + typeof obj_relatedActionId + '" (at "' + path_relatedActionId + '")');
543
+ const obj_name = obj.name;
544
+ const path_name = path + '.name';
545
+ let obj_name_union0 = null;
546
+ const obj_name_union0_error = (() => {
547
+ if (typeof obj_name !== 'string') {
548
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
549
+ }
550
+ })();
551
+ if (obj_name_union0_error != null) {
552
+ obj_name_union0 = obj_name_union0_error.message;
553
+ }
554
+ let obj_name_union1 = null;
555
+ const obj_name_union1_error = (() => {
556
+ if (obj_name !== null) {
557
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
558
+ }
559
+ })();
560
+ if (obj_name_union1_error != null) {
561
+ obj_name_union1 = obj_name_union1_error.message;
562
+ }
563
+ if (obj_name_union0 && obj_name_union1) {
564
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
565
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
566
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
567
+ return new TypeError(message);
523
568
  }
524
- const obj_summary = obj.summary;
525
- const path_summary = path + '.summary';
526
- if (typeof obj_summary !== 'string') {
527
- return new TypeError('Expected "string" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
569
+ const obj_order = obj.order;
570
+ const path_order = path + '.order';
571
+ if (typeof obj_order !== 'number' || (typeof obj_order === 'number' && Math.floor(obj_order) !== obj_order)) {
572
+ return new TypeError('Expected "integer" but received "' + typeof obj_order + '" (at "' + path_order + '")');
528
573
  }
529
574
  })();
530
575
  return v_error === undefined ? null : v_error;
531
576
  }
532
577
 
533
- const VERSION$1 = "4c0fefe9caa169c4221be369e384ee56";
534
- function validate$1(obj, path = 'ServicePlanOutputRepresentation') {
578
+ const VERSION$3 = "4c0fefe9caa169c4221be369e384ee56";
579
+ function validate$4(obj, path = 'ServicePlanOutputRepresentation') {
535
580
  const v_error = (() => {
536
581
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
537
582
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -540,7 +585,7 @@ function validate$1(obj, path = 'ServicePlanOutputRepresentation') {
540
585
  const path_copilotSessionInfo = path + '.copilotSessionInfo';
541
586
  let obj_copilotSessionInfo_union0 = null;
542
587
  const obj_copilotSessionInfo_union0_error = (() => {
543
- const referencepath_copilotSessionInfoValidationError = validate$3(obj_copilotSessionInfo, path_copilotSessionInfo);
588
+ const referencepath_copilotSessionInfoValidationError = validate$6(obj_copilotSessionInfo, path_copilotSessionInfo);
544
589
  if (referencepath_copilotSessionInfoValidationError !== null) {
545
590
  let message = 'Object doesn\'t match ServicePlanGenerationSessionInformationOutputRepresentation (at "' + path_copilotSessionInfo + '")\n';
546
591
  message += referencepath_copilotSessionInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -677,7 +722,7 @@ function validate$1(obj, path = 'ServicePlanOutputRepresentation') {
677
722
  for (let i = 0; i < obj_steps.length; i++) {
678
723
  const obj_steps_item = obj_steps[i];
679
724
  const path_steps_item = path_steps + '[' + i + ']';
680
- const referencepath_steps_itemValidationError = validate$2(obj_steps_item, path_steps_item);
725
+ const referencepath_steps_itemValidationError = validate$5(obj_steps_item, path_steps_item);
681
726
  if (referencepath_steps_itemValidationError !== null) {
682
727
  let message = 'Object doesn\'t match ServicePlanStepRepresentation (at "' + path_steps_item + '")\n';
683
728
  message += referencepath_steps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -791,49 +836,49 @@ function validate$1(obj, path = 'ServicePlanOutputRepresentation') {
791
836
  })();
792
837
  return v_error === undefined ? null : v_error;
793
838
  }
794
- const RepresentationType$1 = 'ServicePlanOutputRepresentation';
795
- function normalize$1(input, existing, path, luvio, store, timestamp) {
839
+ const RepresentationType$3 = 'ServicePlanOutputRepresentation';
840
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
796
841
  return input;
797
842
  }
798
- const select$2 = function ServicePlanOutputRepresentationSelect() {
843
+ const select$6 = function ServicePlanOutputRepresentationSelect() {
799
844
  return {
800
845
  kind: 'Fragment',
801
- version: VERSION$1,
846
+ version: VERSION$3,
802
847
  private: [],
803
848
  opaque: true
804
849
  };
805
850
  };
806
- function equals$1(existing, incoming) {
851
+ function equals$3(existing, incoming) {
807
852
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
808
853
  return false;
809
854
  }
810
855
  return true;
811
856
  }
812
- const ingest$1 = function ServicePlanOutputRepresentationIngest(input, path, luvio, store, timestamp) {
857
+ const ingest$3 = function ServicePlanOutputRepresentationIngest(input, path, luvio, store, timestamp) {
813
858
  if (process.env.NODE_ENV !== 'production') {
814
- const validateError = validate$1(input);
859
+ const validateError = validate$4(input);
815
860
  if (validateError !== null) {
816
861
  throw validateError;
817
862
  }
818
863
  }
819
864
  const key = path.fullPath;
820
865
  const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
821
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "ServicePlan", VERSION$1, RepresentationType$1, equals$1);
866
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "ServicePlan", VERSION$3, RepresentationType$3, equals$3);
822
867
  return createLink(key);
823
868
  };
824
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
869
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
825
870
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
826
871
  const rootKey = fullPathFactory();
827
872
  rootKeySet.set(rootKey, {
828
873
  namespace: keyPrefix,
829
- representationName: RepresentationType$1,
874
+ representationName: RepresentationType$3,
830
875
  mergeable: false
831
876
  });
832
877
  }
833
878
 
834
- const TTL = 1000;
835
- const VERSION = "e8180e1000b0af7a1bd8c7016fbb8ac2";
836
- function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
879
+ const TTL$1 = 1000;
880
+ const VERSION$2 = "1b54ee684d826acba0725f11c75ee33b";
881
+ function validate$3(obj, path = 'ServicePlanGenerationOutputRepresentation') {
837
882
  const v_error = (() => {
838
883
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
839
884
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -944,40 +989,35 @@ function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
944
989
  }
945
990
  const obj_plan = obj.plan;
946
991
  const path_plan = path + '.plan';
947
- if (typeof obj_plan !== 'object') {
948
- return new TypeError('Expected "object" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
949
- }
950
- const obj_reason = obj.reason;
951
- const path_reason = path + '.reason';
952
- if (typeof obj_reason !== 'string') {
953
- return new TypeError('Expected "string" but received "' + typeof obj_reason + '" (at "' + path_reason + '")');
954
- }
955
- const obj_reasonDetails = obj.reasonDetails;
956
- const path_reasonDetails = path + '.reasonDetails';
957
- let obj_reasonDetails_union0 = null;
958
- const obj_reasonDetails_union0_error = (() => {
959
- if (typeof obj_reasonDetails !== 'string') {
960
- return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
992
+ let obj_plan_union0 = null;
993
+ const obj_plan_union0_error = (() => {
994
+ if (typeof obj_plan !== 'object') {
995
+ return new TypeError('Expected "object" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
961
996
  }
962
997
  })();
963
- if (obj_reasonDetails_union0_error != null) {
964
- obj_reasonDetails_union0 = obj_reasonDetails_union0_error.message;
998
+ if (obj_plan_union0_error != null) {
999
+ obj_plan_union0 = obj_plan_union0_error.message;
965
1000
  }
966
- let obj_reasonDetails_union1 = null;
967
- const obj_reasonDetails_union1_error = (() => {
968
- if (obj_reasonDetails !== null) {
969
- return new TypeError('Expected "null" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1001
+ let obj_plan_union1 = null;
1002
+ const obj_plan_union1_error = (() => {
1003
+ if (obj_plan !== null) {
1004
+ return new TypeError('Expected "null" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
970
1005
  }
971
1006
  })();
972
- if (obj_reasonDetails_union1_error != null) {
973
- obj_reasonDetails_union1 = obj_reasonDetails_union1_error.message;
1007
+ if (obj_plan_union1_error != null) {
1008
+ obj_plan_union1 = obj_plan_union1_error.message;
974
1009
  }
975
- if (obj_reasonDetails_union0 && obj_reasonDetails_union1) {
976
- let message = 'Object doesn\'t match union (at "' + path_reasonDetails + '")';
977
- message += '\n' + obj_reasonDetails_union0.split('\n').map((line) => '\t' + line).join('\n');
978
- message += '\n' + obj_reasonDetails_union1.split('\n').map((line) => '\t' + line).join('\n');
1010
+ if (obj_plan_union0 && obj_plan_union1) {
1011
+ let message = 'Object doesn\'t match union (at "' + path_plan + '")';
1012
+ message += '\n' + obj_plan_union0.split('\n').map((line) => '\t' + line).join('\n');
1013
+ message += '\n' + obj_plan_union1.split('\n').map((line) => '\t' + line).join('\n');
979
1014
  return new TypeError(message);
980
1015
  }
1016
+ const obj_reason = obj.reason;
1017
+ const path_reason = path + '.reason';
1018
+ if (typeof obj_reason !== 'string') {
1019
+ return new TypeError('Expected "string" but received "' + typeof obj_reason + '" (at "' + path_reason + '")');
1020
+ }
981
1021
  const obj_recordId = obj.recordId;
982
1022
  const path_recordId = path + '.recordId';
983
1023
  if (typeof obj_recordId !== 'string') {
@@ -996,35 +1036,37 @@ function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
996
1036
  })();
997
1037
  return v_error === undefined ? null : v_error;
998
1038
  }
999
- const RepresentationType = 'ServicePlanGenerationSyncOutputRepresentation';
1000
- function keyBuilder(luvio, config) {
1001
- return keyPrefix + '::' + RepresentationType + ':' + config.id;
1039
+ const RepresentationType$2 = 'ServicePlanGenerationOutputRepresentation';
1040
+ function keyBuilder$5(luvio, config) {
1041
+ return keyPrefix + '::' + RepresentationType$2 + ':' + (config.id === null ? '' : config.id);
1002
1042
  }
1003
- function keyBuilderFromType(luvio, object) {
1043
+ function keyBuilderFromType$1(luvio, object) {
1004
1044
  const keyParams = {
1005
- id: object.reason
1045
+ id: object.id
1006
1046
  };
1007
- return keyBuilder(luvio, keyParams);
1047
+ return keyBuilder$5(luvio, keyParams);
1008
1048
  }
1009
- function normalize(input, existing, path, luvio, store, timestamp) {
1049
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1010
1050
  const input_plan = input.plan;
1011
1051
  const input_plan_id = path.fullPath + '__plan';
1012
- input.plan = ingest$1(input_plan, {
1013
- fullPath: input_plan_id,
1014
- propertyName: 'plan',
1015
- parent: {
1016
- data: input,
1017
- key: path.fullPath,
1018
- existing: existing,
1019
- },
1020
- ttl: path.ttl
1021
- }, luvio, store, timestamp);
1052
+ if (input_plan !== null && typeof input_plan === 'object') {
1053
+ input.plan = ingest$3(input_plan, {
1054
+ fullPath: input_plan_id,
1055
+ propertyName: 'plan',
1056
+ parent: {
1057
+ data: input,
1058
+ key: path.fullPath,
1059
+ existing: existing,
1060
+ },
1061
+ ttl: path.ttl
1062
+ }, luvio, store, timestamp);
1063
+ }
1022
1064
  return input;
1023
1065
  }
1024
- const select$1 = function ServicePlanGenerationSyncOutputRepresentationSelect() {
1066
+ const select$5 = function ServicePlanGenerationOutputRepresentationSelect() {
1025
1067
  return {
1026
1068
  kind: 'Fragment',
1027
- version: VERSION,
1069
+ version: VERSION$2,
1028
1070
  private: [],
1029
1071
  selections: [
1030
1072
  {
@@ -1046,16 +1088,13 @@ const select$1 = function ServicePlanGenerationSyncOutputRepresentationSelect()
1046
1088
  {
1047
1089
  name: 'plan',
1048
1090
  kind: 'Link',
1049
- fragment: select$2()
1091
+ nullable: true,
1092
+ fragment: select$6()
1050
1093
  },
1051
1094
  {
1052
1095
  name: 'reason',
1053
1096
  kind: 'Scalar'
1054
1097
  },
1055
- {
1056
- name: 'reasonDetails',
1057
- kind: 'Scalar'
1058
- },
1059
1098
  {
1060
1099
  name: 'recordId',
1061
1100
  kind: 'Scalar'
@@ -1071,7 +1110,7 @@ const select$1 = function ServicePlanGenerationSyncOutputRepresentationSelect()
1071
1110
  ]
1072
1111
  };
1073
1112
  };
1074
- function equals(existing, incoming) {
1113
+ function equals$2(existing, incoming) {
1075
1114
  const existing_reason = existing.reason;
1076
1115
  const incoming_reason = incoming.reason;
1077
1116
  if (!(existing_reason === incoming_reason)) {
@@ -1114,52 +1153,54 @@ function equals(existing, incoming) {
1114
1153
  }
1115
1154
  const existing_plan = existing.plan;
1116
1155
  const incoming_plan = incoming.plan;
1117
- if (!(existing_plan.__ref === incoming_plan.__ref)) {
1118
- return false;
1119
- }
1120
- const existing_reasonDetails = existing.reasonDetails;
1121
- const incoming_reasonDetails = incoming.reasonDetails;
1122
- if (!(existing_reasonDetails === incoming_reasonDetails)) {
1156
+ if (!(existing_plan === incoming_plan
1157
+ || (existing_plan != null &&
1158
+ incoming_plan != null &&
1159
+ existing_plan.__ref != null &&
1160
+ incoming_plan.__ref != null &&
1161
+ existing_plan.__ref === incoming_plan.__ref))) {
1123
1162
  return false;
1124
1163
  }
1125
1164
  return true;
1126
1165
  }
1127
- const ingest = function ServicePlanGenerationSyncOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1166
+ const ingest$2 = function ServicePlanGenerationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1128
1167
  if (process.env.NODE_ENV !== 'production') {
1129
- const validateError = validate(input);
1168
+ const validateError = validate$3(input);
1130
1169
  if (validateError !== null) {
1131
1170
  throw validateError;
1132
1171
  }
1133
1172
  }
1134
- const key = keyBuilderFromType(luvio, input);
1135
- const ttlToUse = TTL;
1136
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ServicePlan", VERSION, RepresentationType, equals);
1173
+ const key = keyBuilderFromType$1(luvio, input);
1174
+ const ttlToUse = TTL$1;
1175
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "ServicePlan", VERSION$2, RepresentationType$2, equals$2);
1137
1176
  return createLink(key);
1138
1177
  };
1139
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1178
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1140
1179
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1141
- const rootKey = keyBuilderFromType(luvio, input);
1180
+ const rootKey = keyBuilderFromType$1(luvio, input);
1142
1181
  rootKeySet.set(rootKey, {
1143
1182
  namespace: keyPrefix,
1144
- representationName: RepresentationType,
1183
+ representationName: RepresentationType$2,
1145
1184
  mergeable: false
1146
1185
  });
1147
- getTypeCacheKeys$1(rootKeySet, luvio, input.plan, () => rootKey + "__" + "plan");
1186
+ if (input.plan !== null && typeof input.plan === 'object') {
1187
+ getTypeCacheKeys$3(rootKeySet, luvio, input.plan, () => rootKey + "__" + "plan");
1188
+ }
1148
1189
  }
1149
1190
 
1150
- function select(luvio, params) {
1151
- return select$1();
1191
+ function select$4(luvio, params) {
1192
+ return select$5();
1152
1193
  }
1153
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1154
- getTypeCacheKeys(storeKeyMap, luvio, response);
1194
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1195
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1155
1196
  }
1156
- function ingestSuccess(luvio, resourceParams, response) {
1197
+ function ingestSuccess$2(luvio, resourceParams, response) {
1157
1198
  const { body } = response;
1158
- const key = keyBuilderFromType(luvio, body);
1159
- luvio.storeIngest(key, ingest, body);
1199
+ const key = keyBuilderFromType$1(luvio, body);
1200
+ luvio.storeIngest(key, ingest$2, body);
1160
1201
  const snapshot = luvio.storeLookup({
1161
1202
  recordId: key,
1162
- node: select(),
1203
+ node: select$4(),
1163
1204
  variables: {},
1164
1205
  });
1165
1206
  if (process.env.NODE_ENV !== 'production') {
@@ -1170,7 +1211,7 @@ function ingestSuccess(luvio, resourceParams, response) {
1170
1211
  deepFreeze(snapshot.data);
1171
1212
  return snapshot;
1172
1213
  }
1173
- function createResourceRequest(config) {
1214
+ function createResourceRequest$2(config) {
1174
1215
  const headers = {};
1175
1216
  return {
1176
1217
  baseUri: '/services/data/v62.0',
@@ -1184,18 +1225,19 @@ function createResourceRequest(config) {
1184
1225
  };
1185
1226
  }
1186
1227
 
1187
- const adapterName = 'generateSync';
1188
- const generateSync_ConfigPropertyMetadata = [
1228
+ const adapterName$2 = 'generateServicePlan';
1229
+ const generateServicePlan_ConfigPropertyMetadata = [
1230
+ generateParamConfigMetadata('processingMode', false, 1 /* QueryParameter */, 0 /* String */),
1189
1231
  generateParamConfigMetadata('recordId', false, 1 /* QueryParameter */, 0 /* String */),
1190
1232
  generateParamConfigMetadata('additionalContext', true, 2 /* Body */, 4 /* Unsupported */),
1191
- generateParamConfigMetadata('mode', true, 2 /* Body */, 0 /* String */),
1233
+ generateParamConfigMetadata('generationMode', true, 2 /* Body */, 0 /* String */),
1192
1234
  generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
1193
1235
  ];
1194
- const generateSync_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, generateSync_ConfigPropertyMetadata);
1195
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(generateSync_ConfigPropertyMetadata);
1196
- function typeCheckConfig(untrustedConfig) {
1236
+ const generateServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateServicePlan_ConfigPropertyMetadata);
1237
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(generateServicePlan_ConfigPropertyMetadata);
1238
+ function typeCheckConfig$2(untrustedConfig) {
1197
1239
  const config = {};
1198
- typeCheckConfig$2(untrustedConfig, config, generateSync_ConfigPropertyMetadata);
1240
+ typeCheckConfig$4(untrustedConfig, config, generateServicePlan_ConfigPropertyMetadata);
1199
1241
  const untrustedConfig_additionalContext = untrustedConfig.additionalContext;
1200
1242
  if (untrustedIsObject(untrustedConfig_additionalContext)) {
1201
1243
  const untrustedConfig_additionalContext_object = {};
@@ -1215,30 +1257,30 @@ function typeCheckConfig(untrustedConfig) {
1215
1257
  }
1216
1258
  return config;
1217
1259
  }
1218
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1260
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1219
1261
  if (!untrustedIsObject(untrustedConfig)) {
1220
1262
  return null;
1221
1263
  }
1222
1264
  if (process.env.NODE_ENV !== 'production') {
1223
1265
  validateConfig(untrustedConfig, configPropertyNames);
1224
1266
  }
1225
- const config = typeCheckConfig(untrustedConfig);
1267
+ const config = typeCheckConfig$2(untrustedConfig);
1226
1268
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1227
1269
  return null;
1228
1270
  }
1229
1271
  return config;
1230
1272
  }
1231
- function buildNetworkSnapshot(luvio, config, options) {
1232
- const resourceParams = createResourceParams(config);
1233
- const request = createResourceRequest(resourceParams);
1273
+ function buildNetworkSnapshot$2(luvio, config, options) {
1274
+ const resourceParams = createResourceParams$2(config);
1275
+ const request = createResourceRequest$2(resourceParams);
1234
1276
  return luvio.dispatchResourceRequest(request, options)
1235
1277
  .then((response) => {
1236
1278
  return luvio.handleSuccessResponse(() => {
1237
- const snapshot = ingestSuccess(luvio, resourceParams, response);
1279
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1238
1280
  return luvio.storeBroadcast().then(() => snapshot);
1239
1281
  }, () => {
1240
1282
  const cache = new StoreKeyMap();
1241
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1283
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1242
1284
  return cache;
1243
1285
  });
1244
1286
  }, (response) => {
@@ -1246,36 +1288,821 @@ function buildNetworkSnapshot(luvio, config, options) {
1246
1288
  throw response;
1247
1289
  });
1248
1290
  }
1249
- const generateSyncAdapterFactory = (luvio) => {
1250
- return function generateSync(untrustedConfig) {
1251
- const config = validateAdapterConfig(untrustedConfig, generateSync_ConfigPropertyNames);
1291
+ const generateServicePlanAdapterFactory = (luvio) => {
1292
+ return function generateServicePlan(untrustedConfig) {
1293
+ const config = validateAdapterConfig$2(untrustedConfig, generateServicePlan_ConfigPropertyNames);
1252
1294
  // Invalid or incomplete config
1253
1295
  if (config === null) {
1254
- throw new Error('Invalid config for "generateSync"');
1296
+ throw new Error('Invalid config for "generateServicePlan"');
1255
1297
  }
1256
- return buildNetworkSnapshot(luvio, config);
1298
+ return buildNetworkSnapshot$2(luvio, config);
1257
1299
  };
1258
1300
  };
1259
1301
 
1260
- let executeServicePlan;
1261
- let generateSync;
1302
+ function select$3(luvio, params) {
1303
+ return select$5();
1304
+ }
1305
+ function keyBuilder$4(luvio, params) {
1306
+ return keyBuilder$5(luvio, {
1307
+ id: params.urlParams.requestId
1308
+ });
1309
+ }
1310
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1311
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1312
+ }
1313
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1314
+ const { body } = response;
1315
+ const key = keyBuilder$4(luvio, resourceParams);
1316
+ luvio.storeIngest(key, ingest$2, body);
1317
+ const snapshot = luvio.storeLookup({
1318
+ recordId: key,
1319
+ node: select$3(),
1320
+ variables: {},
1321
+ }, snapshotRefresh);
1322
+ if (process.env.NODE_ENV !== 'production') {
1323
+ if (snapshot.state !== 'Fulfilled') {
1324
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1325
+ }
1326
+ }
1327
+ deepFreeze(snapshot.data);
1328
+ return snapshot;
1329
+ }
1330
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1331
+ const key = keyBuilder$4(luvio, params);
1332
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1333
+ const storeMetadataParams = {
1334
+ ttl: TTL$1,
1335
+ namespace: keyPrefix,
1336
+ version: VERSION$2,
1337
+ representationName: RepresentationType$2
1338
+ };
1339
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1340
+ return errorSnapshot;
1341
+ }
1342
+ function createResourceRequest$1(config) {
1343
+ const headers = {};
1344
+ return {
1345
+ baseUri: '/services/data/v62.0',
1346
+ basePath: '/connect/service-plan/generationRequests/' + config.urlParams.requestId + '',
1347
+ method: 'get',
1348
+ body: null,
1349
+ urlParams: config.urlParams,
1350
+ queryParams: {},
1351
+ headers,
1352
+ priority: 'normal',
1353
+ };
1354
+ }
1355
+
1356
+ const adapterName$1 = 'getGenerationRequest';
1357
+ const getGenerationRequest_ConfigPropertyMetadata = [
1358
+ generateParamConfigMetadata('requestId', true, 0 /* UrlParameter */, 0 /* String */),
1359
+ ];
1360
+ const getGenerationRequest_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getGenerationRequest_ConfigPropertyMetadata);
1361
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getGenerationRequest_ConfigPropertyMetadata);
1362
+ function keyBuilder$3(luvio, config) {
1363
+ const resourceParams = createResourceParams$1(config);
1364
+ return keyBuilder$4(luvio, resourceParams);
1365
+ }
1366
+ function typeCheckConfig$1(untrustedConfig) {
1367
+ const config = {};
1368
+ typeCheckConfig$4(untrustedConfig, config, getGenerationRequest_ConfigPropertyMetadata);
1369
+ return config;
1370
+ }
1371
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1372
+ if (!untrustedIsObject(untrustedConfig)) {
1373
+ return null;
1374
+ }
1375
+ if (process.env.NODE_ENV !== 'production') {
1376
+ validateConfig(untrustedConfig, configPropertyNames);
1377
+ }
1378
+ const config = typeCheckConfig$1(untrustedConfig);
1379
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1380
+ return null;
1381
+ }
1382
+ return config;
1383
+ }
1384
+ function adapterFragment$1(luvio, config) {
1385
+ createResourceParams$1(config);
1386
+ return select$3();
1387
+ }
1388
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1389
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1390
+ config,
1391
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1392
+ });
1393
+ return luvio.storeBroadcast().then(() => snapshot);
1394
+ }
1395
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1396
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1397
+ config,
1398
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1399
+ });
1400
+ return luvio.storeBroadcast().then(() => snapshot);
1401
+ }
1402
+ function buildNetworkSnapshot$1(luvio, config, options) {
1403
+ const resourceParams = createResourceParams$1(config);
1404
+ const request = createResourceRequest$1(resourceParams);
1405
+ return luvio.dispatchResourceRequest(request, options)
1406
+ .then((response) => {
1407
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1408
+ const cache = new StoreKeyMap();
1409
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1410
+ return cache;
1411
+ });
1412
+ }, (response) => {
1413
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1414
+ });
1415
+ }
1416
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1417
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1418
+ }
1419
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1420
+ const { luvio, config } = context;
1421
+ const selector = {
1422
+ recordId: keyBuilder$3(luvio, config),
1423
+ node: adapterFragment$1(luvio, config),
1424
+ variables: {},
1425
+ };
1426
+ const cacheSnapshot = storeLookup(selector, {
1427
+ config,
1428
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1429
+ });
1430
+ return cacheSnapshot;
1431
+ }
1432
+ const getGenerationRequestAdapterFactory = (luvio) => function ServicePlan__getGenerationRequest(untrustedConfig, requestContext) {
1433
+ const config = validateAdapterConfig$1(untrustedConfig, getGenerationRequest_ConfigPropertyNames);
1434
+ // Invalid or incomplete config
1435
+ if (config === null) {
1436
+ return null;
1437
+ }
1438
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1439
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1440
+ };
1441
+
1442
+ function validate$2(obj, path = 'ServicePlanStepDetailsRepresentation') {
1443
+ const v_error = (() => {
1444
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1445
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1446
+ }
1447
+ const obj_executionStatus = obj.executionStatus;
1448
+ const path_executionStatus = path + '.executionStatus';
1449
+ if (typeof obj_executionStatus !== 'string') {
1450
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
1451
+ }
1452
+ const obj_groupName = obj.groupName;
1453
+ const path_groupName = path + '.groupName';
1454
+ let obj_groupName_union0 = null;
1455
+ const obj_groupName_union0_error = (() => {
1456
+ if (typeof obj_groupName !== 'string') {
1457
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
1458
+ }
1459
+ })();
1460
+ if (obj_groupName_union0_error != null) {
1461
+ obj_groupName_union0 = obj_groupName_union0_error.message;
1462
+ }
1463
+ let obj_groupName_union1 = null;
1464
+ const obj_groupName_union1_error = (() => {
1465
+ if (obj_groupName !== null) {
1466
+ return new TypeError('Expected "null" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
1467
+ }
1468
+ })();
1469
+ if (obj_groupName_union1_error != null) {
1470
+ obj_groupName_union1 = obj_groupName_union1_error.message;
1471
+ }
1472
+ if (obj_groupName_union0 && obj_groupName_union1) {
1473
+ let message = 'Object doesn\'t match union (at "' + path_groupName + '")';
1474
+ message += '\n' + obj_groupName_union0.split('\n').map((line) => '\t' + line).join('\n');
1475
+ message += '\n' + obj_groupName_union1.split('\n').map((line) => '\t' + line).join('\n');
1476
+ return new TypeError(message);
1477
+ }
1478
+ const obj_order = obj.order;
1479
+ const path_order = path + '.order';
1480
+ if (typeof obj_order !== 'number' || (typeof obj_order === 'number' && Math.floor(obj_order) !== obj_order)) {
1481
+ return new TypeError('Expected "integer" but received "' + typeof obj_order + '" (at "' + path_order + '")');
1482
+ }
1483
+ const obj_stepId = obj.stepId;
1484
+ const path_stepId = path + '.stepId';
1485
+ if (typeof obj_stepId !== 'string') {
1486
+ return new TypeError('Expected "string" but received "' + typeof obj_stepId + '" (at "' + path_stepId + '")');
1487
+ }
1488
+ const obj_stepName = obj.stepName;
1489
+ const path_stepName = path + '.stepName';
1490
+ if (typeof obj_stepName !== 'string') {
1491
+ return new TypeError('Expected "string" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
1492
+ }
1493
+ })();
1494
+ return v_error === undefined ? null : v_error;
1495
+ }
1496
+
1497
+ const VERSION$1 = "b4f5b09aa7f657ce0b31e25aa7b50b1c";
1498
+ function validate$1(obj, path = 'ServicePlanDetailsRepresentation') {
1499
+ const v_error = (() => {
1500
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1501
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1502
+ }
1503
+ const obj_clientFeatureId = obj.clientFeatureId;
1504
+ const path_clientFeatureId = path + '.clientFeatureId';
1505
+ let obj_clientFeatureId_union0 = null;
1506
+ const obj_clientFeatureId_union0_error = (() => {
1507
+ if (typeof obj_clientFeatureId !== 'string') {
1508
+ return new TypeError('Expected "string" but received "' + typeof obj_clientFeatureId + '" (at "' + path_clientFeatureId + '")');
1509
+ }
1510
+ })();
1511
+ if (obj_clientFeatureId_union0_error != null) {
1512
+ obj_clientFeatureId_union0 = obj_clientFeatureId_union0_error.message;
1513
+ }
1514
+ let obj_clientFeatureId_union1 = null;
1515
+ const obj_clientFeatureId_union1_error = (() => {
1516
+ if (obj_clientFeatureId !== null) {
1517
+ return new TypeError('Expected "null" but received "' + typeof obj_clientFeatureId + '" (at "' + path_clientFeatureId + '")');
1518
+ }
1519
+ })();
1520
+ if (obj_clientFeatureId_union1_error != null) {
1521
+ obj_clientFeatureId_union1 = obj_clientFeatureId_union1_error.message;
1522
+ }
1523
+ if (obj_clientFeatureId_union0 && obj_clientFeatureId_union1) {
1524
+ let message = 'Object doesn\'t match union (at "' + path_clientFeatureId + '")';
1525
+ message += '\n' + obj_clientFeatureId_union0.split('\n').map((line) => '\t' + line).join('\n');
1526
+ message += '\n' + obj_clientFeatureId_union1.split('\n').map((line) => '\t' + line).join('\n');
1527
+ return new TypeError(message);
1528
+ }
1529
+ const obj_createdDate = obj.createdDate;
1530
+ const path_createdDate = path + '.createdDate';
1531
+ let obj_createdDate_union0 = null;
1532
+ const obj_createdDate_union0_error = (() => {
1533
+ if (typeof obj_createdDate !== 'string') {
1534
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1535
+ }
1536
+ })();
1537
+ if (obj_createdDate_union0_error != null) {
1538
+ obj_createdDate_union0 = obj_createdDate_union0_error.message;
1539
+ }
1540
+ let obj_createdDate_union1 = null;
1541
+ const obj_createdDate_union1_error = (() => {
1542
+ if (obj_createdDate !== null) {
1543
+ return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1544
+ }
1545
+ })();
1546
+ if (obj_createdDate_union1_error != null) {
1547
+ obj_createdDate_union1 = obj_createdDate_union1_error.message;
1548
+ }
1549
+ if (obj_createdDate_union0 && obj_createdDate_union1) {
1550
+ let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
1551
+ message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
1552
+ message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
1553
+ return new TypeError(message);
1554
+ }
1555
+ const obj_executionStatus = obj.executionStatus;
1556
+ const path_executionStatus = path + '.executionStatus';
1557
+ let obj_executionStatus_union0 = null;
1558
+ const obj_executionStatus_union0_error = (() => {
1559
+ if (typeof obj_executionStatus !== 'string') {
1560
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
1561
+ }
1562
+ })();
1563
+ if (obj_executionStatus_union0_error != null) {
1564
+ obj_executionStatus_union0 = obj_executionStatus_union0_error.message;
1565
+ }
1566
+ let obj_executionStatus_union1 = null;
1567
+ const obj_executionStatus_union1_error = (() => {
1568
+ if (obj_executionStatus !== null) {
1569
+ return new TypeError('Expected "null" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
1570
+ }
1571
+ })();
1572
+ if (obj_executionStatus_union1_error != null) {
1573
+ obj_executionStatus_union1 = obj_executionStatus_union1_error.message;
1574
+ }
1575
+ if (obj_executionStatus_union0 && obj_executionStatus_union1) {
1576
+ let message = 'Object doesn\'t match union (at "' + path_executionStatus + '")';
1577
+ message += '\n' + obj_executionStatus_union0.split('\n').map((line) => '\t' + line).join('\n');
1578
+ message += '\n' + obj_executionStatus_union1.split('\n').map((line) => '\t' + line).join('\n');
1579
+ return new TypeError(message);
1580
+ }
1581
+ const obj_feedbackId = obj.feedbackId;
1582
+ const path_feedbackId = path + '.feedbackId';
1583
+ let obj_feedbackId_union0 = null;
1584
+ const obj_feedbackId_union0_error = (() => {
1585
+ if (typeof obj_feedbackId !== 'string') {
1586
+ return new TypeError('Expected "string" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
1587
+ }
1588
+ })();
1589
+ if (obj_feedbackId_union0_error != null) {
1590
+ obj_feedbackId_union0 = obj_feedbackId_union0_error.message;
1591
+ }
1592
+ let obj_feedbackId_union1 = null;
1593
+ const obj_feedbackId_union1_error = (() => {
1594
+ if (obj_feedbackId !== null) {
1595
+ return new TypeError('Expected "null" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
1596
+ }
1597
+ })();
1598
+ if (obj_feedbackId_union1_error != null) {
1599
+ obj_feedbackId_union1 = obj_feedbackId_union1_error.message;
1600
+ }
1601
+ if (obj_feedbackId_union0 && obj_feedbackId_union1) {
1602
+ let message = 'Object doesn\'t match union (at "' + path_feedbackId + '")';
1603
+ message += '\n' + obj_feedbackId_union0.split('\n').map((line) => '\t' + line).join('\n');
1604
+ message += '\n' + obj_feedbackId_union1.split('\n').map((line) => '\t' + line).join('\n');
1605
+ return new TypeError(message);
1606
+ }
1607
+ const obj_planId = obj.planId;
1608
+ const path_planId = path + '.planId';
1609
+ let obj_planId_union0 = null;
1610
+ const obj_planId_union0_error = (() => {
1611
+ if (typeof obj_planId !== 'string') {
1612
+ return new TypeError('Expected "string" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
1613
+ }
1614
+ })();
1615
+ if (obj_planId_union0_error != null) {
1616
+ obj_planId_union0 = obj_planId_union0_error.message;
1617
+ }
1618
+ let obj_planId_union1 = null;
1619
+ const obj_planId_union1_error = (() => {
1620
+ if (obj_planId !== null) {
1621
+ return new TypeError('Expected "null" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
1622
+ }
1623
+ })();
1624
+ if (obj_planId_union1_error != null) {
1625
+ obj_planId_union1 = obj_planId_union1_error.message;
1626
+ }
1627
+ if (obj_planId_union0 && obj_planId_union1) {
1628
+ let message = 'Object doesn\'t match union (at "' + path_planId + '")';
1629
+ message += '\n' + obj_planId_union0.split('\n').map((line) => '\t' + line).join('\n');
1630
+ message += '\n' + obj_planId_union1.split('\n').map((line) => '\t' + line).join('\n');
1631
+ return new TypeError(message);
1632
+ }
1633
+ const obj_servicePlanSteps = obj.servicePlanSteps;
1634
+ const path_servicePlanSteps = path + '.servicePlanSteps';
1635
+ if (!ArrayIsArray(obj_servicePlanSteps)) {
1636
+ return new TypeError('Expected "array" but received "' + typeof obj_servicePlanSteps + '" (at "' + path_servicePlanSteps + '")');
1637
+ }
1638
+ for (let i = 0; i < obj_servicePlanSteps.length; i++) {
1639
+ const obj_servicePlanSteps_item = obj_servicePlanSteps[i];
1640
+ const path_servicePlanSteps_item = path_servicePlanSteps + '[' + i + ']';
1641
+ const referencepath_servicePlanSteps_itemValidationError = validate$2(obj_servicePlanSteps_item, path_servicePlanSteps_item);
1642
+ if (referencepath_servicePlanSteps_itemValidationError !== null) {
1643
+ let message = 'Object doesn\'t match ServicePlanStepDetailsRepresentation (at "' + path_servicePlanSteps_item + '")\n';
1644
+ message += referencepath_servicePlanSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1645
+ return new TypeError(message);
1646
+ }
1647
+ }
1648
+ const obj_topic = obj.topic;
1649
+ const path_topic = path + '.topic';
1650
+ let obj_topic_union0 = null;
1651
+ const obj_topic_union0_error = (() => {
1652
+ if (typeof obj_topic !== 'string') {
1653
+ return new TypeError('Expected "string" but received "' + typeof obj_topic + '" (at "' + path_topic + '")');
1654
+ }
1655
+ })();
1656
+ if (obj_topic_union0_error != null) {
1657
+ obj_topic_union0 = obj_topic_union0_error.message;
1658
+ }
1659
+ let obj_topic_union1 = null;
1660
+ const obj_topic_union1_error = (() => {
1661
+ if (obj_topic !== null) {
1662
+ return new TypeError('Expected "null" but received "' + typeof obj_topic + '" (at "' + path_topic + '")');
1663
+ }
1664
+ })();
1665
+ if (obj_topic_union1_error != null) {
1666
+ obj_topic_union1 = obj_topic_union1_error.message;
1667
+ }
1668
+ if (obj_topic_union0 && obj_topic_union1) {
1669
+ let message = 'Object doesn\'t match union (at "' + path_topic + '")';
1670
+ message += '\n' + obj_topic_union0.split('\n').map((line) => '\t' + line).join('\n');
1671
+ message += '\n' + obj_topic_union1.split('\n').map((line) => '\t' + line).join('\n');
1672
+ return new TypeError(message);
1673
+ }
1674
+ })();
1675
+ return v_error === undefined ? null : v_error;
1676
+ }
1677
+ const RepresentationType$1 = 'ServicePlanDetailsRepresentation';
1678
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1679
+ return input;
1680
+ }
1681
+ const select$2 = function ServicePlanDetailsRepresentationSelect() {
1682
+ return {
1683
+ kind: 'Fragment',
1684
+ version: VERSION$1,
1685
+ private: [],
1686
+ opaque: true
1687
+ };
1688
+ };
1689
+ function equals$1(existing, incoming) {
1690
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1691
+ return false;
1692
+ }
1693
+ return true;
1694
+ }
1695
+ const ingest$1 = function ServicePlanDetailsRepresentationIngest(input, path, luvio, store, timestamp) {
1696
+ if (process.env.NODE_ENV !== 'production') {
1697
+ const validateError = validate$1(input);
1698
+ if (validateError !== null) {
1699
+ throw validateError;
1700
+ }
1701
+ }
1702
+ const key = path.fullPath;
1703
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
1704
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "ServicePlan", VERSION$1, RepresentationType$1, equals$1);
1705
+ return createLink(key);
1706
+ };
1707
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1708
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1709
+ const rootKey = fullPathFactory();
1710
+ rootKeySet.set(rootKey, {
1711
+ namespace: keyPrefix,
1712
+ representationName: RepresentationType$1,
1713
+ mergeable: false
1714
+ });
1715
+ }
1716
+
1717
+ const TTL = 1000;
1718
+ const VERSION = "2dd60cd6c267351cb563fcc04cb5cb56";
1719
+ function validate(obj, path = 'ServicePlanDetailsOutputRepresentation') {
1720
+ const v_error = (() => {
1721
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1722
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1723
+ }
1724
+ const obj_plan = obj.plan;
1725
+ const path_plan = path + '.plan';
1726
+ if (typeof obj_plan !== 'object') {
1727
+ return new TypeError('Expected "object" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
1728
+ }
1729
+ const obj_planRequestId = obj.planRequestId;
1730
+ const path_planRequestId = path + '.planRequestId';
1731
+ if (typeof obj_planRequestId !== 'string') {
1732
+ return new TypeError('Expected "string" but received "' + typeof obj_planRequestId + '" (at "' + path_planRequestId + '")');
1733
+ }
1734
+ const obj_reason = obj.reason;
1735
+ const path_reason = path + '.reason';
1736
+ if (typeof obj_reason !== 'string') {
1737
+ return new TypeError('Expected "string" but received "' + typeof obj_reason + '" (at "' + path_reason + '")');
1738
+ }
1739
+ const obj_reasonDetails = obj.reasonDetails;
1740
+ const path_reasonDetails = path + '.reasonDetails';
1741
+ let obj_reasonDetails_union0 = null;
1742
+ const obj_reasonDetails_union0_error = (() => {
1743
+ if (typeof obj_reasonDetails !== 'string') {
1744
+ return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1745
+ }
1746
+ })();
1747
+ if (obj_reasonDetails_union0_error != null) {
1748
+ obj_reasonDetails_union0 = obj_reasonDetails_union0_error.message;
1749
+ }
1750
+ let obj_reasonDetails_union1 = null;
1751
+ const obj_reasonDetails_union1_error = (() => {
1752
+ if (obj_reasonDetails !== null) {
1753
+ return new TypeError('Expected "null" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1754
+ }
1755
+ })();
1756
+ if (obj_reasonDetails_union1_error != null) {
1757
+ obj_reasonDetails_union1 = obj_reasonDetails_union1_error.message;
1758
+ }
1759
+ if (obj_reasonDetails_union0 && obj_reasonDetails_union1) {
1760
+ let message = 'Object doesn\'t match union (at "' + path_reasonDetails + '")';
1761
+ message += '\n' + obj_reasonDetails_union0.split('\n').map((line) => '\t' + line).join('\n');
1762
+ message += '\n' + obj_reasonDetails_union1.split('\n').map((line) => '\t' + line).join('\n');
1763
+ return new TypeError(message);
1764
+ }
1765
+ const obj_status = obj.status;
1766
+ const path_status = path + '.status';
1767
+ if (typeof obj_status !== 'string') {
1768
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1769
+ }
1770
+ })();
1771
+ return v_error === undefined ? null : v_error;
1772
+ }
1773
+ const RepresentationType = 'ServicePlanDetailsOutputRepresentation';
1774
+ function keyBuilder$2(luvio, config) {
1775
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
1776
+ }
1777
+ function keyBuilderFromType(luvio, object) {
1778
+ const keyParams = {
1779
+ id: object.planRequestId
1780
+ };
1781
+ return keyBuilder$2(luvio, keyParams);
1782
+ }
1783
+ function normalize(input, existing, path, luvio, store, timestamp) {
1784
+ const input_plan = input.plan;
1785
+ const input_plan_id = path.fullPath + '__plan';
1786
+ input.plan = ingest$1(input_plan, {
1787
+ fullPath: input_plan_id,
1788
+ propertyName: 'plan',
1789
+ parent: {
1790
+ data: input,
1791
+ key: path.fullPath,
1792
+ existing: existing,
1793
+ },
1794
+ ttl: path.ttl
1795
+ }, luvio, store, timestamp);
1796
+ return input;
1797
+ }
1798
+ const select$1 = function ServicePlanDetailsOutputRepresentationSelect() {
1799
+ return {
1800
+ kind: 'Fragment',
1801
+ version: VERSION,
1802
+ private: [],
1803
+ selections: [
1804
+ {
1805
+ name: 'plan',
1806
+ kind: 'Link',
1807
+ fragment: select$2()
1808
+ },
1809
+ {
1810
+ name: 'planRequestId',
1811
+ kind: 'Scalar'
1812
+ },
1813
+ {
1814
+ name: 'reason',
1815
+ kind: 'Scalar'
1816
+ },
1817
+ {
1818
+ name: 'reasonDetails',
1819
+ kind: 'Scalar'
1820
+ },
1821
+ {
1822
+ name: 'status',
1823
+ kind: 'Scalar'
1824
+ }
1825
+ ]
1826
+ };
1827
+ };
1828
+ function equals(existing, incoming) {
1829
+ const existing_planRequestId = existing.planRequestId;
1830
+ const incoming_planRequestId = incoming.planRequestId;
1831
+ if (!(existing_planRequestId === incoming_planRequestId)) {
1832
+ return false;
1833
+ }
1834
+ const existing_reason = existing.reason;
1835
+ const incoming_reason = incoming.reason;
1836
+ if (!(existing_reason === incoming_reason)) {
1837
+ return false;
1838
+ }
1839
+ const existing_status = existing.status;
1840
+ const incoming_status = incoming.status;
1841
+ if (!(existing_status === incoming_status)) {
1842
+ return false;
1843
+ }
1844
+ const existing_plan = existing.plan;
1845
+ const incoming_plan = incoming.plan;
1846
+ if (!(existing_plan.__ref === incoming_plan.__ref)) {
1847
+ return false;
1848
+ }
1849
+ const existing_reasonDetails = existing.reasonDetails;
1850
+ const incoming_reasonDetails = incoming.reasonDetails;
1851
+ if (!(existing_reasonDetails === incoming_reasonDetails)) {
1852
+ return false;
1853
+ }
1854
+ return true;
1855
+ }
1856
+ const ingest = function ServicePlanDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1857
+ if (process.env.NODE_ENV !== 'production') {
1858
+ const validateError = validate(input);
1859
+ if (validateError !== null) {
1860
+ throw validateError;
1861
+ }
1862
+ }
1863
+ const key = keyBuilderFromType(luvio, input);
1864
+ const ttlToUse = TTL;
1865
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "ServicePlan", VERSION, RepresentationType, equals);
1866
+ return createLink(key);
1867
+ };
1868
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1869
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1870
+ const rootKey = keyBuilderFromType(luvio, input);
1871
+ rootKeySet.set(rootKey, {
1872
+ namespace: keyPrefix,
1873
+ representationName: RepresentationType,
1874
+ mergeable: false
1875
+ });
1876
+ getTypeCacheKeys$1(rootKeySet, luvio, input.plan, () => rootKey + "__" + "plan");
1877
+ }
1878
+
1879
+ function select(luvio, params) {
1880
+ return select$1();
1881
+ }
1882
+ function keyBuilder$1(luvio, params) {
1883
+ return keyBuilder$2(luvio, {
1884
+ id: params.urlParams.recordId
1885
+ });
1886
+ }
1887
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1888
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1889
+ }
1890
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1891
+ const { body } = response;
1892
+ const key = keyBuilder$1(luvio, resourceParams);
1893
+ luvio.storeIngest(key, ingest, body);
1894
+ const snapshot = luvio.storeLookup({
1895
+ recordId: key,
1896
+ node: select(),
1897
+ variables: {},
1898
+ }, snapshotRefresh);
1899
+ if (process.env.NODE_ENV !== 'production') {
1900
+ if (snapshot.state !== 'Fulfilled') {
1901
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1902
+ }
1903
+ }
1904
+ deepFreeze(snapshot.data);
1905
+ return snapshot;
1906
+ }
1907
+ function ingestError(luvio, params, error, snapshotRefresh) {
1908
+ const key = keyBuilder$1(luvio, params);
1909
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1910
+ const storeMetadataParams = {
1911
+ ttl: TTL,
1912
+ namespace: keyPrefix,
1913
+ version: VERSION,
1914
+ representationName: RepresentationType
1915
+ };
1916
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1917
+ return errorSnapshot;
1918
+ }
1919
+ function createResourceRequest(config) {
1920
+ const headers = {};
1921
+ return {
1922
+ baseUri: '/services/data/v62.0',
1923
+ basePath: '/connect/service-plan/servicePlanDetails/' + config.urlParams.recordId + '',
1924
+ method: 'get',
1925
+ body: null,
1926
+ urlParams: config.urlParams,
1927
+ queryParams: {},
1928
+ headers,
1929
+ priority: 'normal',
1930
+ };
1931
+ }
1932
+ function createResourceRequestFromRepresentation(representation) {
1933
+ const config = {
1934
+ urlParams: {},
1935
+ };
1936
+ config.urlParams.recordId = representation.planRequestId;
1937
+ return createResourceRequest(config);
1938
+ }
1939
+
1940
+ const adapterName = 'getServicePlan';
1941
+ const getServicePlan_ConfigPropertyMetadata = [
1942
+ generateParamConfigMetadata('recordId', true, 0 /* UrlParameter */, 0 /* String */),
1943
+ ];
1944
+ const getServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getServicePlan_ConfigPropertyMetadata);
1945
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(getServicePlan_ConfigPropertyMetadata);
1946
+ function keyBuilder(luvio, config) {
1947
+ const resourceParams = createResourceParams(config);
1948
+ return keyBuilder$1(luvio, resourceParams);
1949
+ }
1950
+ function typeCheckConfig(untrustedConfig) {
1951
+ const config = {};
1952
+ typeCheckConfig$4(untrustedConfig, config, getServicePlan_ConfigPropertyMetadata);
1953
+ return config;
1954
+ }
1955
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1956
+ if (!untrustedIsObject(untrustedConfig)) {
1957
+ return null;
1958
+ }
1959
+ if (process.env.NODE_ENV !== 'production') {
1960
+ validateConfig(untrustedConfig, configPropertyNames);
1961
+ }
1962
+ const config = typeCheckConfig(untrustedConfig);
1963
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1964
+ return null;
1965
+ }
1966
+ return config;
1967
+ }
1968
+ function adapterFragment(luvio, config) {
1969
+ createResourceParams(config);
1970
+ return select();
1971
+ }
1972
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1973
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1974
+ config,
1975
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1976
+ });
1977
+ return luvio.storeBroadcast().then(() => snapshot);
1978
+ }
1979
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1980
+ const snapshot = ingestError(luvio, resourceParams, response, {
1981
+ config,
1982
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1983
+ });
1984
+ return luvio.storeBroadcast().then(() => snapshot);
1985
+ }
1986
+ function buildNetworkSnapshot(luvio, config, options) {
1987
+ const resourceParams = createResourceParams(config);
1988
+ const request = createResourceRequest(resourceParams);
1989
+ return luvio.dispatchResourceRequest(request, options)
1990
+ .then((response) => {
1991
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1992
+ const cache = new StoreKeyMap();
1993
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1994
+ return cache;
1995
+ });
1996
+ }, (response) => {
1997
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1998
+ });
1999
+ }
2000
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2001
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2002
+ }
2003
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2004
+ const { luvio, config } = context;
2005
+ const selector = {
2006
+ recordId: keyBuilder(luvio, config),
2007
+ node: adapterFragment(luvio, config),
2008
+ variables: {},
2009
+ };
2010
+ const cacheSnapshot = storeLookup(selector, {
2011
+ config,
2012
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2013
+ });
2014
+ return cacheSnapshot;
2015
+ }
2016
+ const getServicePlanAdapterFactory = (luvio) => function ServicePlan__getServicePlan(untrustedConfig, requestContext) {
2017
+ const config = validateAdapterConfig(untrustedConfig, getServicePlan_ConfigPropertyNames);
2018
+ // Invalid or incomplete config
2019
+ if (config === null) {
2020
+ return null;
2021
+ }
2022
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2023
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2024
+ };
2025
+ const notifyChangeFactory = (luvio, options) => {
2026
+ return function getConnectServicePlanServicePlanDetailsByRecordIdNotifyChange(configs) {
2027
+ const keys = configs.map(c => keyBuilder$2(luvio, c));
2028
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
2029
+ for (let i = 0, len = entries.length; i < len; i++) {
2030
+ const { key, record: val } = entries[i];
2031
+ const refreshRequest = createResourceRequestFromRepresentation(val);
2032
+ luvio.dispatchResourceRequest(refreshRequest, options)
2033
+ .then((response) => {
2034
+ return luvio.handleSuccessResponse(() => {
2035
+ const { body } = response;
2036
+ luvio.storeIngest(key, ingest, body);
2037
+ return luvio.storeBroadcast();
2038
+ }, () => {
2039
+ const cache = new StoreKeyMap();
2040
+ getTypeCacheKeys(cache, luvio, response.body);
2041
+ return cache;
2042
+ });
2043
+ }, (error) => {
2044
+ return luvio.handleErrorResponse(() => {
2045
+ const errorSnapshot = luvio.errorSnapshot(error);
2046
+ luvio.storeIngestError(key, errorSnapshot, {
2047
+ ttl: TTL,
2048
+ namespace: keyPrefix,
2049
+ version: VERSION,
2050
+ representationName: RepresentationType
2051
+ });
2052
+ return luvio.storeBroadcast().then(() => errorSnapshot);
2053
+ });
2054
+ });
2055
+ }
2056
+ });
2057
+ };
2058
+ };
2059
+
2060
+ let executeServicePlan;
2061
+ let generateServicePlan;
2062
+ let getGenerationRequest;
2063
+ let getServicePlan;
2064
+ let getServicePlanNotifyChange;
2065
+ // Imperative GET Adapters
2066
+ let getGenerationRequest_imperative;
2067
+ let getServicePlan_imperative;
2068
+ const getGenerationRequestMetadata = {
2069
+ apiFamily: 'ServicePlan',
2070
+ name: 'getGenerationRequest',
2071
+ ttl: 1000,
2072
+ };
2073
+ const getServicePlanMetadata = { apiFamily: 'ServicePlan', name: 'getServicePlan', ttl: 1000 };
1262
2074
  // Notify Update Available
1263
2075
  function bindExportsTo(luvio) {
1264
2076
  // LDS Adapters
2077
+ const getGenerationRequest_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getGenerationRequest', getGenerationRequestAdapterFactory), getGenerationRequestMetadata);
2078
+ const getServicePlan_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getServicePlan', getServicePlanAdapterFactory), getServicePlanMetadata);
1265
2079
  function unwrapSnapshotData(factory) {
1266
2080
  const adapter = factory(luvio);
1267
2081
  return (config) => adapter(config).then((snapshot) => snapshot.data);
1268
2082
  }
1269
2083
  return {
1270
2084
  executeServicePlan: unwrapSnapshotData(executeServicePlanAdapterFactory),
1271
- generateSync: unwrapSnapshotData(generateSyncAdapterFactory),
2085
+ generateServicePlan: unwrapSnapshotData(generateServicePlanAdapterFactory),
2086
+ getGenerationRequest: createWireAdapterConstructor(luvio, getGenerationRequest_ldsAdapter, getGenerationRequestMetadata),
2087
+ getServicePlan: createWireAdapterConstructor(luvio, getServicePlan_ldsAdapter, getServicePlanMetadata),
2088
+ getServicePlanNotifyChange: createLDSAdapter(luvio, 'getServicePlanNotifyChange', notifyChangeFactory),
1272
2089
  // Imperative GET Adapters
2090
+ getGenerationRequest_imperative: createImperativeAdapter(luvio, getGenerationRequest_ldsAdapter, getGenerationRequestMetadata),
2091
+ getServicePlan_imperative: createImperativeAdapter(luvio, getServicePlan_ldsAdapter, getServicePlanMetadata),
1273
2092
  // Notify Update Availables
1274
2093
  };
1275
2094
  }
1276
2095
  withDefaultLuvio((luvio) => {
1277
- ({ executeServicePlan, generateSync } = bindExportsTo(luvio));
2096
+ ({
2097
+ executeServicePlan,
2098
+ generateServicePlan,
2099
+ getGenerationRequest,
2100
+ getServicePlan,
2101
+ getServicePlanNotifyChange,
2102
+ getGenerationRequest_imperative,
2103
+ getServicePlan_imperative,
2104
+ } = bindExportsTo(luvio));
1278
2105
  });
1279
2106
 
1280
- export { executeServicePlan, generateSync };
1281
- // version: 1.308.0-dev4-f0bdc19646
2107
+ export { executeServicePlan, generateServicePlan, getGenerationRequest, getGenerationRequest_imperative, getServicePlan, getServicePlanNotifyChange, getServicePlan_imperative };
2108
+ // version: 1.308.0-dev6-76d7a63e29