@salesforce/lds-adapters-service-serviceplan 1.308.0 → 1.309.0-dev11

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 (33) hide show
  1. package/dist/es/es2018/service-serviceplan.js +1502 -328
  2. package/dist/es/es2018/types/src/generated/adapters/executeServicePlan.d.ts +4 -6
  3. package/dist/es/es2018/types/src/generated/adapters/generateServicePlan.d.ts +21 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getGenerationRequest.d.ts +27 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getServicePlan.d.ts +28 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +5 -1
  7. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +10 -2
  8. package/dist/es/es2018/types/src/generated/resources/{getConnectServicePlanExecuteByGeneratedPlanId.d.ts → getConnectServicePlanExecuteByPlanOrStepId.d.ts} +1 -1
  9. package/dist/es/es2018/types/src/generated/resources/getConnectServicePlanGenerationRequestsByRequestId.d.ts +15 -0
  10. package/dist/es/es2018/types/src/generated/resources/getConnectServicePlanServicePlanDetailsByRecordId.d.ts +16 -0
  11. package/dist/es/es2018/types/src/generated/resources/{postConnectServicePlanGenerateSyncByRecordId.d.ts → postConnectServicePlanGenerationRequests.d.ts} +7 -6
  12. package/dist/es/es2018/types/src/generated/resources/{putConnectServicePlanExecuteByGeneratedPlanId.d.ts → putConnectServicePlanExecuteByPlanOrStepId.d.ts} +2 -4
  13. package/dist/es/es2018/types/src/generated/types/ServicePlanDataInputRepresentation.d.ts +28 -0
  14. package/dist/es/es2018/types/src/generated/types/ServicePlanDataOutputRepresentation.d.ts +28 -0
  15. package/dist/es/es2018/types/src/generated/types/ServicePlanDetailsOutputRepresentation.d.ts +60 -0
  16. package/dist/es/es2018/types/src/generated/types/ServicePlanDetailsRepresentation.d.ts +47 -0
  17. package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionInputRepresentation.d.ts +4 -10
  18. package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionOutputRepresentation.d.ts +11 -16
  19. package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionSummaryRepresentation.d.ts +2 -11
  20. package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationInputParamRepresentation.d.ts +5 -5
  21. package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationOutputRepresentation.d.ts +73 -0
  22. package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationSessionInformationOutputRepresentation.d.ts +13 -19
  23. package/dist/es/es2018/types/src/generated/types/ServicePlanOutputRepresentation.d.ts +27 -20
  24. package/dist/es/es2018/types/src/generated/types/ServicePlanStepDetailsRepresentation.d.ts +40 -0
  25. package/dist/es/es2018/types/src/generated/types/ServicePlanStepExecutionStatusRepresentation.d.ts +31 -0
  26. package/dist/es/es2018/types/src/generated/types/ServicePlanStepRepresentation.d.ts +14 -18
  27. package/package.json +3 -3
  28. package/sfdc/index.js +1583 -334
  29. package/src/raml/api.raml +238 -97
  30. package/src/raml/luvio.raml +39 -7
  31. package/dist/es/es2018/types/src/generated/adapters/generateSync.d.ts +0 -20
  32. package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationSyncOutputRepresentation.d.ts +0 -56
  33. package/dist/es/es2018/types/src/generated/types/ServicePlanStepAttributeRepresentation.d.ts +0 -31
@@ -4,10 +4,10 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys, create: ObjectCreate } = Object;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
11
  const { isArray: ArrayIsArray$1 } = Array;
12
12
  /**
13
13
  * Validates an adapter config is well-formed.
@@ -31,7 +31,7 @@ function validateConfig(config, adapter, oneOf) {
31
31
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
32
  }
33
33
  const supported = required.concat(optional);
34
- if (ObjectKeys(config).some(key => !supported.includes(key))) {
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
35
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
36
  }
37
37
  }
@@ -41,6 +41,13 @@ function untrustedIsObject(untrusted) {
41
41
  function areRequiredParametersPresent(config, configPropertyNames) {
42
42
  return configPropertyNames.parameters.required.every(req => req in config);
43
43
  }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
44
51
  function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
45
52
  return {
46
53
  name,
@@ -64,6 +71,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
64
71
  }
65
72
  const keyPrefix = 'ServicePlan';
66
73
 
74
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
67
75
  const { isArray: ArrayIsArray } = Array;
68
76
  const { stringify: JSONStringify } = JSON;
69
77
  function equalsArray(a, b, equalsItem) {
@@ -85,105 +93,130 @@ function createLink(ref) {
85
93
  };
86
94
  }
87
95
 
88
- const VERSION$4 = "49ecad43516b5e32603856ae2fd27e4c";
89
- function validate$5(obj, path = 'ServicePlanStepExecutionSummaryRepresentation') {
96
+ const VERSION$5 = "de8249c0171ece44729fbb33b422a074";
97
+ function validate$8(obj, path = 'ServicePlanStepExecutionStatusRepresentation') {
90
98
  const v_error = (() => {
91
99
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
92
100
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
93
101
  }
94
- const obj_message = obj.message;
95
- const path_message = path + '.message';
96
- if (typeof obj_message !== 'string') {
97
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
102
+ const obj_executionStatus = obj.executionStatus;
103
+ const path_executionStatus = path + '.executionStatus';
104
+ if (typeof obj_executionStatus !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
98
106
  }
99
- const obj_status = obj.status;
100
- const path_status = path + '.status';
101
- if (typeof obj_status !== 'string') {
102
- return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
107
+ const obj_stepId = obj.stepId;
108
+ const path_stepId = path + '.stepId';
109
+ let obj_stepId_union0 = null;
110
+ const obj_stepId_union0_error = (() => {
111
+ if (typeof obj_stepId !== 'string') {
112
+ return new TypeError('Expected "string" but received "' + typeof obj_stepId + '" (at "' + path_stepId + '")');
113
+ }
114
+ })();
115
+ if (obj_stepId_union0_error != null) {
116
+ obj_stepId_union0 = obj_stepId_union0_error.message;
117
+ }
118
+ let obj_stepId_union1 = null;
119
+ const obj_stepId_union1_error = (() => {
120
+ if (obj_stepId !== null) {
121
+ return new TypeError('Expected "null" but received "' + typeof obj_stepId + '" (at "' + path_stepId + '")');
122
+ }
123
+ })();
124
+ if (obj_stepId_union1_error != null) {
125
+ obj_stepId_union1 = obj_stepId_union1_error.message;
126
+ }
127
+ if (obj_stepId_union0 && obj_stepId_union1) {
128
+ let message = 'Object doesn\'t match union (at "' + path_stepId + '")';
129
+ message += '\n' + obj_stepId_union0.split('\n').map((line) => '\t' + line).join('\n');
130
+ message += '\n' + obj_stepId_union1.split('\n').map((line) => '\t' + line).join('\n');
131
+ return new TypeError(message);
103
132
  }
104
133
  })();
105
134
  return v_error === undefined ? null : v_error;
106
135
  }
107
- const RepresentationType$4 = 'ServicePlanStepExecutionSummaryRepresentation';
108
- function normalize$4(input, existing, path, luvio, store, timestamp) {
136
+ const RepresentationType$5 = 'ServicePlanStepExecutionStatusRepresentation';
137
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
109
138
  return input;
110
139
  }
111
- const select$6 = function ServicePlanStepExecutionSummaryRepresentationSelect() {
140
+ const select$9 = function ServicePlanStepExecutionStatusRepresentationSelect() {
112
141
  return {
113
142
  kind: 'Fragment',
114
- version: VERSION$4,
143
+ version: VERSION$5,
115
144
  private: [],
116
145
  opaque: true
117
146
  };
118
147
  };
119
- function equals$4(existing, incoming) {
148
+ function equals$5(existing, incoming) {
120
149
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
121
150
  return false;
122
151
  }
123
152
  return true;
124
153
  }
125
- const ingest$4 = function ServicePlanStepExecutionSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
154
+ const ingest$5 = function ServicePlanStepExecutionStatusRepresentationIngest(input, path, luvio, store, timestamp) {
126
155
  if (process.env.NODE_ENV !== 'production') {
127
- const validateError = validate$5(input);
156
+ const validateError = validate$8(input);
128
157
  if (validateError !== null) {
129
158
  throw validateError;
130
159
  }
131
160
  }
132
161
  const key = path.fullPath;
133
162
  const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
134
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "ServicePlan", VERSION$4, RepresentationType$4, equals$4);
163
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "ServicePlan", VERSION$5, RepresentationType$5, equals$5);
135
164
  return createLink(key);
136
165
  };
137
- function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
166
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
138
167
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
139
168
  const rootKey = fullPathFactory();
140
169
  rootKeySet.set(rootKey, {
141
170
  namespace: keyPrefix,
142
- representationName: RepresentationType$4,
171
+ representationName: RepresentationType$5,
143
172
  mergeable: false
144
173
  });
145
174
  }
146
175
 
147
- const VERSION$3 = "a662e9bd461c05a065cae3077b4084a7";
148
- function validate$4(obj, path = 'ServicePlanExecutionSummaryRepresentation') {
176
+ const VERSION$4 = "f3a6de28bf56634adca757ba07accf43";
177
+ function validate$7(obj, path = 'ServicePlanExecutionOutputRepresentation') {
149
178
  const v_error = (() => {
150
179
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
151
180
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
152
181
  }
153
- const obj_executedDate = obj.executedDate;
154
- const path_executedDate = path + '.executedDate';
155
- if (typeof obj_executedDate !== 'string') {
156
- return new TypeError('Expected "string" but received "' + typeof obj_executedDate + '" (at "' + path_executedDate + '")');
182
+ const obj_executionStatus = obj.executionStatus;
183
+ const path_executionStatus = path + '.executionStatus';
184
+ if (typeof obj_executionStatus !== 'string') {
185
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
157
186
  }
158
- const obj_status = obj.status;
159
- const path_status = path + '.status';
160
- if (typeof obj_status !== 'string') {
161
- return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
162
- }
163
- const obj_steps = obj.steps;
164
- const path_steps = path + '.steps';
165
- if (!ArrayIsArray(obj_steps)) {
166
- return new TypeError('Expected "array" but received "' + typeof obj_steps + '" (at "' + path_steps + '")');
187
+ const obj_planSteps = obj.planSteps;
188
+ const path_planSteps = path + '.planSteps';
189
+ if (!ArrayIsArray(obj_planSteps)) {
190
+ return new TypeError('Expected "array" but received "' + typeof obj_planSteps + '" (at "' + path_planSteps + '")');
167
191
  }
168
- for (let i = 0; i < obj_steps.length; i++) {
169
- const obj_steps_item = obj_steps[i];
170
- const path_steps_item = path_steps + '[' + i + ']';
171
- if (typeof obj_steps_item !== 'object') {
172
- return new TypeError('Expected "object" but received "' + typeof obj_steps_item + '" (at "' + path_steps_item + '")');
192
+ for (let i = 0; i < obj_planSteps.length; i++) {
193
+ const obj_planSteps_item = obj_planSteps[i];
194
+ const path_planSteps_item = path_planSteps + '[' + i + ']';
195
+ if (typeof obj_planSteps_item !== 'object') {
196
+ return new TypeError('Expected "object" but received "' + typeof obj_planSteps_item + '" (at "' + path_planSteps_item + '")');
173
197
  }
174
198
  }
175
199
  })();
176
200
  return v_error === undefined ? null : v_error;
177
201
  }
178
- const RepresentationType$3 = 'ServicePlanExecutionSummaryRepresentation';
179
- function normalize$3(input, existing, path, luvio, store, timestamp) {
180
- const input_steps = input.steps;
181
- const input_steps_id = path.fullPath + '__steps';
182
- for (let i = 0; i < input_steps.length; i++) {
183
- const input_steps_item = input_steps[i];
184
- let input_steps_item_id = input_steps_id + '__' + i;
185
- input_steps[i] = ingest$4(input_steps_item, {
186
- fullPath: input_steps_item_id,
202
+ const RepresentationType$4 = 'ServicePlanExecutionOutputRepresentation';
203
+ function keyBuilder$6(luvio, config) {
204
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.id;
205
+ }
206
+ function keyBuilderFromType$2(luvio, object) {
207
+ const keyParams = {
208
+ id: object.executionStatus
209
+ };
210
+ return keyBuilder$6(luvio, keyParams);
211
+ }
212
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
213
+ const input_planSteps = input.planSteps;
214
+ const input_planSteps_id = path.fullPath + '__planSteps';
215
+ for (let i = 0; i < input_planSteps.length; i++) {
216
+ const input_planSteps_item = input_planSteps[i];
217
+ let input_planSteps_item_id = input_planSteps_id + '__' + i;
218
+ input_planSteps[i] = ingest$5(input_planSteps_item, {
219
+ fullPath: input_planSteps_item_id,
187
220
  propertyName: i,
188
221
  parent: {
189
222
  data: input,
@@ -195,53 +228,624 @@ function normalize$3(input, existing, path, luvio, store, timestamp) {
195
228
  }
196
229
  return input;
197
230
  }
198
- const select$5 = function ServicePlanExecutionSummaryRepresentationSelect() {
231
+ const select$8 = function ServicePlanExecutionOutputRepresentationSelect() {
199
232
  return {
200
233
  kind: 'Fragment',
201
- version: VERSION$3,
234
+ version: VERSION$4,
202
235
  private: [],
203
236
  selections: [
204
237
  {
205
- name: 'executedDate',
206
- kind: 'Scalar'
207
- },
208
- {
209
- name: 'status',
238
+ name: 'executionStatus',
210
239
  kind: 'Scalar'
211
240
  },
212
241
  {
213
- name: 'steps',
242
+ name: 'planSteps',
214
243
  kind: 'Link',
215
244
  plural: true,
216
- fragment: select$6()
245
+ fragment: select$9()
217
246
  }
218
247
  ]
219
248
  };
220
249
  };
221
- function equals$3(existing, incoming) {
222
- const existing_executedDate = existing.executedDate;
223
- const incoming_executedDate = incoming.executedDate;
224
- if (!(existing_executedDate === incoming_executedDate)) {
250
+ function equals$4(existing, incoming) {
251
+ const existing_executionStatus = existing.executionStatus;
252
+ const incoming_executionStatus = incoming.executionStatus;
253
+ if (!(existing_executionStatus === incoming_executionStatus)) {
225
254
  return false;
226
255
  }
227
- const existing_status = existing.status;
228
- const incoming_status = incoming.status;
229
- if (!(existing_status === incoming_status)) {
256
+ const existing_planSteps = existing.planSteps;
257
+ const incoming_planSteps = incoming.planSteps;
258
+ const equals_planSteps_items = equalsArray(existing_planSteps, incoming_planSteps, (existing_planSteps_item, incoming_planSteps_item) => {
259
+ if (!(existing_planSteps_item.__ref === incoming_planSteps_item.__ref)) {
260
+ return false;
261
+ }
262
+ });
263
+ if (equals_planSteps_items === false) {
230
264
  return false;
231
265
  }
232
- const existing_steps = existing.steps;
233
- const incoming_steps = incoming.steps;
234
- const equals_steps_items = equalsArray(existing_steps, incoming_steps, (existing_steps_item, incoming_steps_item) => {
235
- if (!(existing_steps_item.__ref === incoming_steps_item.__ref)) {
236
- return false;
266
+ return true;
267
+ }
268
+ const ingest$4 = function ServicePlanExecutionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
269
+ if (process.env.NODE_ENV !== 'production') {
270
+ const validateError = validate$7(input);
271
+ if (validateError !== null) {
272
+ throw validateError;
237
273
  }
274
+ }
275
+ const key = keyBuilderFromType$2(luvio, input);
276
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
277
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "ServicePlan", VERSION$4, RepresentationType$4, equals$4);
278
+ return createLink(key);
279
+ };
280
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
281
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
282
+ const rootKey = keyBuilderFromType$2(luvio, input);
283
+ rootKeySet.set(rootKey, {
284
+ namespace: keyPrefix,
285
+ representationName: RepresentationType$4,
286
+ mergeable: false
238
287
  });
239
- if (equals_steps_items === false) {
288
+ const input_planSteps_length = input.planSteps.length;
289
+ for (let i = 0; i < input_planSteps_length; i++) {
290
+ getTypeCacheKeys$5(rootKeySet, luvio, input.planSteps[i], () => '');
291
+ }
292
+ }
293
+
294
+ function select$7(luvio, params) {
295
+ return select$8();
296
+ }
297
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
298
+ getTypeCacheKeys$4(storeKeyMap, luvio, response);
299
+ }
300
+ function ingestSuccess$3(luvio, resourceParams, response) {
301
+ const { body } = response;
302
+ const key = keyBuilderFromType$2(luvio, body);
303
+ luvio.storeIngest(key, ingest$4, body);
304
+ const snapshot = luvio.storeLookup({
305
+ recordId: key,
306
+ node: select$7(),
307
+ variables: {},
308
+ });
309
+ if (process.env.NODE_ENV !== 'production') {
310
+ if (snapshot.state !== 'Fulfilled') {
311
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
312
+ }
313
+ }
314
+ deepFreeze(snapshot.data);
315
+ return snapshot;
316
+ }
317
+ function createResourceRequest$3(config) {
318
+ const headers = {};
319
+ return {
320
+ baseUri: '/services/data/v62.0',
321
+ basePath: '/connect/service-plan/execute/' + config.urlParams.planOrStepId + '',
322
+ method: 'put',
323
+ body: config.body,
324
+ urlParams: config.urlParams,
325
+ queryParams: {},
326
+ headers,
327
+ priority: 'normal',
328
+ };
329
+ }
330
+
331
+ const adapterName$3 = 'executeServicePlan';
332
+ const executeServicePlan_ConfigPropertyMetadata = [
333
+ generateParamConfigMetadata('planOrStepId', true, 0 /* UrlParameter */, 0 /* String */),
334
+ generateParamConfigMetadata('action', true, 2 /* Body */, 0 /* String */),
335
+ ];
336
+ const executeServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, executeServicePlan_ConfigPropertyMetadata);
337
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(executeServicePlan_ConfigPropertyMetadata);
338
+ function typeCheckConfig$3(untrustedConfig) {
339
+ const config = {};
340
+ typeCheckConfig$4(untrustedConfig, config, executeServicePlan_ConfigPropertyMetadata);
341
+ return config;
342
+ }
343
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
344
+ if (!untrustedIsObject(untrustedConfig)) {
345
+ return null;
346
+ }
347
+ if (process.env.NODE_ENV !== 'production') {
348
+ validateConfig(untrustedConfig, configPropertyNames);
349
+ }
350
+ const config = typeCheckConfig$3(untrustedConfig);
351
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
352
+ return null;
353
+ }
354
+ return config;
355
+ }
356
+ function buildNetworkSnapshot$3(luvio, config, options) {
357
+ const resourceParams = createResourceParams$3(config);
358
+ const request = createResourceRequest$3(resourceParams);
359
+ return luvio.dispatchResourceRequest(request, options)
360
+ .then((response) => {
361
+ return luvio.handleSuccessResponse(() => {
362
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
363
+ return luvio.storeBroadcast().then(() => snapshot);
364
+ }, () => {
365
+ const cache = new StoreKeyMap();
366
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
367
+ return cache;
368
+ });
369
+ }, (response) => {
370
+ deepFreeze(response);
371
+ throw response;
372
+ });
373
+ }
374
+ const executeServicePlanAdapterFactory = (luvio) => {
375
+ return function executeServicePlan(untrustedConfig) {
376
+ const config = validateAdapterConfig$3(untrustedConfig, executeServicePlan_ConfigPropertyNames);
377
+ // Invalid or incomplete config
378
+ if (config === null) {
379
+ throw new Error('Invalid config for "executeServicePlan"');
380
+ }
381
+ return buildNetworkSnapshot$3(luvio, config);
382
+ };
383
+ };
384
+
385
+ function validate$6(obj, path = 'ServicePlanGenerationSessionInformationOutputRepresentation') {
386
+ const v_error = (() => {
387
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
388
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
389
+ }
390
+ const obj_clientFeatureKey = obj.clientFeatureKey;
391
+ const path_clientFeatureKey = path + '.clientFeatureKey';
392
+ let obj_clientFeatureKey_union0 = null;
393
+ const obj_clientFeatureKey_union0_error = (() => {
394
+ if (typeof obj_clientFeatureKey !== 'string') {
395
+ return new TypeError('Expected "string" but received "' + typeof obj_clientFeatureKey + '" (at "' + path_clientFeatureKey + '")');
396
+ }
397
+ })();
398
+ if (obj_clientFeatureKey_union0_error != null) {
399
+ obj_clientFeatureKey_union0 = obj_clientFeatureKey_union0_error.message;
400
+ }
401
+ let obj_clientFeatureKey_union1 = null;
402
+ const obj_clientFeatureKey_union1_error = (() => {
403
+ if (obj_clientFeatureKey !== null) {
404
+ return new TypeError('Expected "null" but received "' + typeof obj_clientFeatureKey + '" (at "' + path_clientFeatureKey + '")');
405
+ }
406
+ })();
407
+ if (obj_clientFeatureKey_union1_error != null) {
408
+ obj_clientFeatureKey_union1 = obj_clientFeatureKey_union1_error.message;
409
+ }
410
+ if (obj_clientFeatureKey_union0 && obj_clientFeatureKey_union1) {
411
+ let message = 'Object doesn\'t match union (at "' + path_clientFeatureKey + '")';
412
+ message += '\n' + obj_clientFeatureKey_union0.split('\n').map((line) => '\t' + line).join('\n');
413
+ message += '\n' + obj_clientFeatureKey_union1.split('\n').map((line) => '\t' + line).join('\n');
414
+ return new TypeError(message);
415
+ }
416
+ const obj_feedbackKey = obj.feedbackKey;
417
+ const path_feedbackKey = path + '.feedbackKey';
418
+ let obj_feedbackKey_union0 = null;
419
+ const obj_feedbackKey_union0_error = (() => {
420
+ if (typeof obj_feedbackKey !== 'string') {
421
+ return new TypeError('Expected "string" but received "' + typeof obj_feedbackKey + '" (at "' + path_feedbackKey + '")');
422
+ }
423
+ })();
424
+ if (obj_feedbackKey_union0_error != null) {
425
+ obj_feedbackKey_union0 = obj_feedbackKey_union0_error.message;
426
+ }
427
+ let obj_feedbackKey_union1 = null;
428
+ const obj_feedbackKey_union1_error = (() => {
429
+ if (obj_feedbackKey !== null) {
430
+ return new TypeError('Expected "null" but received "' + typeof obj_feedbackKey + '" (at "' + path_feedbackKey + '")');
431
+ }
432
+ })();
433
+ if (obj_feedbackKey_union1_error != null) {
434
+ obj_feedbackKey_union1 = obj_feedbackKey_union1_error.message;
435
+ }
436
+ if (obj_feedbackKey_union0 && obj_feedbackKey_union1) {
437
+ let message = 'Object doesn\'t match union (at "' + path_feedbackKey + '")';
438
+ message += '\n' + obj_feedbackKey_union0.split('\n').map((line) => '\t' + line).join('\n');
439
+ message += '\n' + obj_feedbackKey_union1.split('\n').map((line) => '\t' + line).join('\n');
440
+ return new TypeError(message);
441
+ }
442
+ const obj_planKey = obj.planKey;
443
+ const path_planKey = path + '.planKey';
444
+ let obj_planKey_union0 = null;
445
+ const obj_planKey_union0_error = (() => {
446
+ if (typeof obj_planKey !== 'string') {
447
+ return new TypeError('Expected "string" but received "' + typeof obj_planKey + '" (at "' + path_planKey + '")');
448
+ }
449
+ })();
450
+ if (obj_planKey_union0_error != null) {
451
+ obj_planKey_union0 = obj_planKey_union0_error.message;
452
+ }
453
+ let obj_planKey_union1 = null;
454
+ const obj_planKey_union1_error = (() => {
455
+ if (obj_planKey !== null) {
456
+ return new TypeError('Expected "null" but received "' + typeof obj_planKey + '" (at "' + path_planKey + '")');
457
+ }
458
+ })();
459
+ if (obj_planKey_union1_error != null) {
460
+ obj_planKey_union1 = obj_planKey_union1_error.message;
461
+ }
462
+ if (obj_planKey_union0 && obj_planKey_union1) {
463
+ let message = 'Object doesn\'t match union (at "' + path_planKey + '")';
464
+ message += '\n' + obj_planKey_union0.split('\n').map((line) => '\t' + line).join('\n');
465
+ message += '\n' + obj_planKey_union1.split('\n').map((line) => '\t' + line).join('\n');
466
+ return new TypeError(message);
467
+ }
468
+ const obj_sessionKey = obj.sessionKey;
469
+ const path_sessionKey = path + '.sessionKey';
470
+ let obj_sessionKey_union0 = null;
471
+ const obj_sessionKey_union0_error = (() => {
472
+ if (typeof obj_sessionKey !== 'string') {
473
+ return new TypeError('Expected "string" but received "' + typeof obj_sessionKey + '" (at "' + path_sessionKey + '")');
474
+ }
475
+ })();
476
+ if (obj_sessionKey_union0_error != null) {
477
+ obj_sessionKey_union0 = obj_sessionKey_union0_error.message;
478
+ }
479
+ let obj_sessionKey_union1 = null;
480
+ const obj_sessionKey_union1_error = (() => {
481
+ if (obj_sessionKey !== null) {
482
+ return new TypeError('Expected "null" but received "' + typeof obj_sessionKey + '" (at "' + path_sessionKey + '")');
483
+ }
484
+ })();
485
+ if (obj_sessionKey_union1_error != null) {
486
+ obj_sessionKey_union1 = obj_sessionKey_union1_error.message;
487
+ }
488
+ if (obj_sessionKey_union0 && obj_sessionKey_union1) {
489
+ let message = 'Object doesn\'t match union (at "' + path_sessionKey + '")';
490
+ message += '\n' + obj_sessionKey_union0.split('\n').map((line) => '\t' + line).join('\n');
491
+ message += '\n' + obj_sessionKey_union1.split('\n').map((line) => '\t' + line).join('\n');
492
+ return new TypeError(message);
493
+ }
494
+ })();
495
+ return v_error === undefined ? null : v_error;
496
+ }
497
+
498
+ function validate$5(obj, path = 'ServicePlanStepRepresentation') {
499
+ const v_error = (() => {
500
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
501
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
502
+ }
503
+ const obj_groupName = obj.groupName;
504
+ const path_groupName = path + '.groupName';
505
+ let obj_groupName_union0 = null;
506
+ const obj_groupName_union0_error = (() => {
507
+ if (typeof obj_groupName !== 'string') {
508
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
509
+ }
510
+ })();
511
+ if (obj_groupName_union0_error != null) {
512
+ obj_groupName_union0 = obj_groupName_union0_error.message;
513
+ }
514
+ let obj_groupName_union1 = null;
515
+ const obj_groupName_union1_error = (() => {
516
+ if (obj_groupName !== null) {
517
+ return new TypeError('Expected "null" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
518
+ }
519
+ })();
520
+ if (obj_groupName_union1_error != null) {
521
+ obj_groupName_union1 = obj_groupName_union1_error.message;
522
+ }
523
+ if (obj_groupName_union0 && obj_groupName_union1) {
524
+ let message = 'Object doesn\'t match union (at "' + path_groupName + '")';
525
+ message += '\n' + obj_groupName_union0.split('\n').map((line) => '\t' + line).join('\n');
526
+ message += '\n' + obj_groupName_union1.split('\n').map((line) => '\t' + line).join('\n');
527
+ return new TypeError(message);
528
+ }
529
+ const obj_id = obj.id;
530
+ const path_id = path + '.id';
531
+ if (typeof obj_id !== 'string') {
532
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
533
+ }
534
+ const obj_name = obj.name;
535
+ const path_name = path + '.name';
536
+ let obj_name_union0 = null;
537
+ const obj_name_union0_error = (() => {
538
+ if (typeof obj_name !== 'string') {
539
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
540
+ }
541
+ })();
542
+ if (obj_name_union0_error != null) {
543
+ obj_name_union0 = obj_name_union0_error.message;
544
+ }
545
+ let obj_name_union1 = null;
546
+ const obj_name_union1_error = (() => {
547
+ if (obj_name !== null) {
548
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
549
+ }
550
+ })();
551
+ if (obj_name_union1_error != null) {
552
+ obj_name_union1 = obj_name_union1_error.message;
553
+ }
554
+ if (obj_name_union0 && obj_name_union1) {
555
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
556
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
557
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
558
+ return new TypeError(message);
559
+ }
560
+ const obj_order = obj.order;
561
+ const path_order = path + '.order';
562
+ if (typeof obj_order !== 'number' || (typeof obj_order === 'number' && Math.floor(obj_order) !== obj_order)) {
563
+ return new TypeError('Expected "integer" but received "' + typeof obj_order + '" (at "' + path_order + '")');
564
+ }
565
+ })();
566
+ return v_error === undefined ? null : v_error;
567
+ }
568
+
569
+ const VERSION$3 = "4c0fefe9caa169c4221be369e384ee56";
570
+ function validate$4(obj, path = 'ServicePlanOutputRepresentation') {
571
+ const v_error = (() => {
572
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
573
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
574
+ }
575
+ const obj_copilotSessionInfo = obj.copilotSessionInfo;
576
+ const path_copilotSessionInfo = path + '.copilotSessionInfo';
577
+ let obj_copilotSessionInfo_union0 = null;
578
+ const obj_copilotSessionInfo_union0_error = (() => {
579
+ const referencepath_copilotSessionInfoValidationError = validate$6(obj_copilotSessionInfo, path_copilotSessionInfo);
580
+ if (referencepath_copilotSessionInfoValidationError !== null) {
581
+ let message = 'Object doesn\'t match ServicePlanGenerationSessionInformationOutputRepresentation (at "' + path_copilotSessionInfo + '")\n';
582
+ message += referencepath_copilotSessionInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
583
+ return new TypeError(message);
584
+ }
585
+ })();
586
+ if (obj_copilotSessionInfo_union0_error != null) {
587
+ obj_copilotSessionInfo_union0 = obj_copilotSessionInfo_union0_error.message;
588
+ }
589
+ let obj_copilotSessionInfo_union1 = null;
590
+ const obj_copilotSessionInfo_union1_error = (() => {
591
+ if (obj_copilotSessionInfo !== null) {
592
+ return new TypeError('Expected "null" but received "' + typeof obj_copilotSessionInfo + '" (at "' + path_copilotSessionInfo + '")');
593
+ }
594
+ })();
595
+ if (obj_copilotSessionInfo_union1_error != null) {
596
+ obj_copilotSessionInfo_union1 = obj_copilotSessionInfo_union1_error.message;
597
+ }
598
+ if (obj_copilotSessionInfo_union0 && obj_copilotSessionInfo_union1) {
599
+ let message = 'Object doesn\'t match union (at "' + path_copilotSessionInfo + '")';
600
+ message += '\n' + obj_copilotSessionInfo_union0.split('\n').map((line) => '\t' + line).join('\n');
601
+ message += '\n' + obj_copilotSessionInfo_union1.split('\n').map((line) => '\t' + line).join('\n');
602
+ return new TypeError(message);
603
+ }
604
+ const obj_createdDate = obj.createdDate;
605
+ const path_createdDate = path + '.createdDate';
606
+ let obj_createdDate_union0 = null;
607
+ const obj_createdDate_union0_error = (() => {
608
+ if (typeof obj_createdDate !== 'string') {
609
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
610
+ }
611
+ })();
612
+ if (obj_createdDate_union0_error != null) {
613
+ obj_createdDate_union0 = obj_createdDate_union0_error.message;
614
+ }
615
+ let obj_createdDate_union1 = null;
616
+ const obj_createdDate_union1_error = (() => {
617
+ if (obj_createdDate !== null) {
618
+ return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
619
+ }
620
+ })();
621
+ if (obj_createdDate_union1_error != null) {
622
+ obj_createdDate_union1 = obj_createdDate_union1_error.message;
623
+ }
624
+ if (obj_createdDate_union0 && obj_createdDate_union1) {
625
+ let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
626
+ message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
627
+ message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
628
+ return new TypeError(message);
629
+ }
630
+ const obj_id = obj.id;
631
+ const path_id = path + '.id';
632
+ let obj_id_union0 = null;
633
+ const obj_id_union0_error = (() => {
634
+ if (typeof obj_id !== 'string') {
635
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
636
+ }
637
+ })();
638
+ if (obj_id_union0_error != null) {
639
+ obj_id_union0 = obj_id_union0_error.message;
640
+ }
641
+ let obj_id_union1 = null;
642
+ const obj_id_union1_error = (() => {
643
+ if (obj_id !== null) {
644
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
645
+ }
646
+ })();
647
+ if (obj_id_union1_error != null) {
648
+ obj_id_union1 = obj_id_union1_error.message;
649
+ }
650
+ if (obj_id_union0 && obj_id_union1) {
651
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
652
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
653
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
654
+ return new TypeError(message);
655
+ }
656
+ const obj_intent = obj.intent;
657
+ const path_intent = path + '.intent';
658
+ let obj_intent_union0 = null;
659
+ const obj_intent_union0_error = (() => {
660
+ if (typeof obj_intent !== 'string') {
661
+ return new TypeError('Expected "string" but received "' + typeof obj_intent + '" (at "' + path_intent + '")');
662
+ }
663
+ })();
664
+ if (obj_intent_union0_error != null) {
665
+ obj_intent_union0 = obj_intent_union0_error.message;
666
+ }
667
+ let obj_intent_union1 = null;
668
+ const obj_intent_union1_error = (() => {
669
+ if (obj_intent !== null) {
670
+ return new TypeError('Expected "null" but received "' + typeof obj_intent + '" (at "' + path_intent + '")');
671
+ }
672
+ })();
673
+ if (obj_intent_union1_error != null) {
674
+ obj_intent_union1 = obj_intent_union1_error.message;
675
+ }
676
+ if (obj_intent_union0 && obj_intent_union1) {
677
+ let message = 'Object doesn\'t match union (at "' + path_intent + '")';
678
+ message += '\n' + obj_intent_union0.split('\n').map((line) => '\t' + line).join('\n');
679
+ message += '\n' + obj_intent_union1.split('\n').map((line) => '\t' + line).join('\n');
680
+ return new TypeError(message);
681
+ }
682
+ const obj_plan = obj.plan;
683
+ const path_plan = path + '.plan';
684
+ let obj_plan_union0 = null;
685
+ const obj_plan_union0_error = (() => {
686
+ if (typeof obj_plan !== 'string') {
687
+ return new TypeError('Expected "string" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
688
+ }
689
+ })();
690
+ if (obj_plan_union0_error != null) {
691
+ obj_plan_union0 = obj_plan_union0_error.message;
692
+ }
693
+ let obj_plan_union1 = null;
694
+ const obj_plan_union1_error = (() => {
695
+ if (obj_plan !== null) {
696
+ return new TypeError('Expected "null" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
697
+ }
698
+ })();
699
+ if (obj_plan_union1_error != null) {
700
+ obj_plan_union1 = obj_plan_union1_error.message;
701
+ }
702
+ if (obj_plan_union0 && obj_plan_union1) {
703
+ let message = 'Object doesn\'t match union (at "' + path_plan + '")';
704
+ message += '\n' + obj_plan_union0.split('\n').map((line) => '\t' + line).join('\n');
705
+ message += '\n' + obj_plan_union1.split('\n').map((line) => '\t' + line).join('\n');
706
+ return new TypeError(message);
707
+ }
708
+ const obj_steps = obj.steps;
709
+ const path_steps = path + '.steps';
710
+ if (!ArrayIsArray(obj_steps)) {
711
+ return new TypeError('Expected "array" but received "' + typeof obj_steps + '" (at "' + path_steps + '")');
712
+ }
713
+ for (let i = 0; i < obj_steps.length; i++) {
714
+ const obj_steps_item = obj_steps[i];
715
+ const path_steps_item = path_steps + '[' + i + ']';
716
+ const referencepath_steps_itemValidationError = validate$5(obj_steps_item, path_steps_item);
717
+ if (referencepath_steps_itemValidationError !== null) {
718
+ let message = 'Object doesn\'t match ServicePlanStepRepresentation (at "' + path_steps_item + '")\n';
719
+ message += referencepath_steps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
720
+ return new TypeError(message);
721
+ }
722
+ }
723
+ const obj_topicDescription = obj.topicDescription;
724
+ const path_topicDescription = path + '.topicDescription';
725
+ let obj_topicDescription_union0 = null;
726
+ const obj_topicDescription_union0_error = (() => {
727
+ if (typeof obj_topicDescription !== 'string') {
728
+ return new TypeError('Expected "string" but received "' + typeof obj_topicDescription + '" (at "' + path_topicDescription + '")');
729
+ }
730
+ })();
731
+ if (obj_topicDescription_union0_error != null) {
732
+ obj_topicDescription_union0 = obj_topicDescription_union0_error.message;
733
+ }
734
+ let obj_topicDescription_union1 = null;
735
+ const obj_topicDescription_union1_error = (() => {
736
+ if (obj_topicDescription !== null) {
737
+ return new TypeError('Expected "null" but received "' + typeof obj_topicDescription + '" (at "' + path_topicDescription + '")');
738
+ }
739
+ })();
740
+ if (obj_topicDescription_union1_error != null) {
741
+ obj_topicDescription_union1 = obj_topicDescription_union1_error.message;
742
+ }
743
+ if (obj_topicDescription_union0 && obj_topicDescription_union1) {
744
+ let message = 'Object doesn\'t match union (at "' + path_topicDescription + '")';
745
+ message += '\n' + obj_topicDescription_union0.split('\n').map((line) => '\t' + line).join('\n');
746
+ message += '\n' + obj_topicDescription_union1.split('\n').map((line) => '\t' + line).join('\n');
747
+ return new TypeError(message);
748
+ }
749
+ const obj_topicId = obj.topicId;
750
+ const path_topicId = path + '.topicId';
751
+ let obj_topicId_union0 = null;
752
+ const obj_topicId_union0_error = (() => {
753
+ if (typeof obj_topicId !== 'string') {
754
+ return new TypeError('Expected "string" but received "' + typeof obj_topicId + '" (at "' + path_topicId + '")');
755
+ }
756
+ })();
757
+ if (obj_topicId_union0_error != null) {
758
+ obj_topicId_union0 = obj_topicId_union0_error.message;
759
+ }
760
+ let obj_topicId_union1 = null;
761
+ const obj_topicId_union1_error = (() => {
762
+ if (obj_topicId !== null) {
763
+ return new TypeError('Expected "null" but received "' + typeof obj_topicId + '" (at "' + path_topicId + '")');
764
+ }
765
+ })();
766
+ if (obj_topicId_union1_error != null) {
767
+ obj_topicId_union1 = obj_topicId_union1_error.message;
768
+ }
769
+ if (obj_topicId_union0 && obj_topicId_union1) {
770
+ let message = 'Object doesn\'t match union (at "' + path_topicId + '")';
771
+ message += '\n' + obj_topicId_union0.split('\n').map((line) => '\t' + line).join('\n');
772
+ message += '\n' + obj_topicId_union1.split('\n').map((line) => '\t' + line).join('\n');
773
+ return new TypeError(message);
774
+ }
775
+ const obj_topicName = obj.topicName;
776
+ const path_topicName = path + '.topicName';
777
+ let obj_topicName_union0 = null;
778
+ const obj_topicName_union0_error = (() => {
779
+ if (typeof obj_topicName !== 'string') {
780
+ return new TypeError('Expected "string" but received "' + typeof obj_topicName + '" (at "' + path_topicName + '")');
781
+ }
782
+ })();
783
+ if (obj_topicName_union0_error != null) {
784
+ obj_topicName_union0 = obj_topicName_union0_error.message;
785
+ }
786
+ let obj_topicName_union1 = null;
787
+ const obj_topicName_union1_error = (() => {
788
+ if (obj_topicName !== null) {
789
+ return new TypeError('Expected "null" but received "' + typeof obj_topicName + '" (at "' + path_topicName + '")');
790
+ }
791
+ })();
792
+ if (obj_topicName_union1_error != null) {
793
+ obj_topicName_union1 = obj_topicName_union1_error.message;
794
+ }
795
+ if (obj_topicName_union0 && obj_topicName_union1) {
796
+ let message = 'Object doesn\'t match union (at "' + path_topicName + '")';
797
+ message += '\n' + obj_topicName_union0.split('\n').map((line) => '\t' + line).join('\n');
798
+ message += '\n' + obj_topicName_union1.split('\n').map((line) => '\t' + line).join('\n');
799
+ return new TypeError(message);
800
+ }
801
+ const obj_type = obj.type;
802
+ const path_type = path + '.type';
803
+ let obj_type_union0 = null;
804
+ const obj_type_union0_error = (() => {
805
+ if (typeof obj_type !== 'string') {
806
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
807
+ }
808
+ })();
809
+ if (obj_type_union0_error != null) {
810
+ obj_type_union0 = obj_type_union0_error.message;
811
+ }
812
+ let obj_type_union1 = null;
813
+ const obj_type_union1_error = (() => {
814
+ if (obj_type !== null) {
815
+ return new TypeError('Expected "null" but received "' + typeof obj_type + '" (at "' + path_type + '")');
816
+ }
817
+ })();
818
+ if (obj_type_union1_error != null) {
819
+ obj_type_union1 = obj_type_union1_error.message;
820
+ }
821
+ if (obj_type_union0 && obj_type_union1) {
822
+ let message = 'Object doesn\'t match union (at "' + path_type + '")';
823
+ message += '\n' + obj_type_union0.split('\n').map((line) => '\t' + line).join('\n');
824
+ message += '\n' + obj_type_union1.split('\n').map((line) => '\t' + line).join('\n');
825
+ return new TypeError(message);
826
+ }
827
+ })();
828
+ return v_error === undefined ? null : v_error;
829
+ }
830
+ const RepresentationType$3 = 'ServicePlanOutputRepresentation';
831
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
832
+ return input;
833
+ }
834
+ const select$6 = function ServicePlanOutputRepresentationSelect() {
835
+ return {
836
+ kind: 'Fragment',
837
+ version: VERSION$3,
838
+ private: [],
839
+ opaque: true
840
+ };
841
+ };
842
+ function equals$3(existing, incoming) {
843
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
240
844
  return false;
241
845
  }
242
846
  return true;
243
847
  }
244
- const ingest$3 = function ServicePlanExecutionSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
848
+ const ingest$3 = function ServicePlanOutputRepresentationIngest(input, path, luvio, store, timestamp) {
245
849
  if (process.env.NODE_ENV !== 'production') {
246
850
  const validateError = validate$4(input);
247
851
  if (validateError !== null) {
@@ -261,153 +865,465 @@ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
261
865
  representationName: RepresentationType$3,
262
866
  mergeable: false
263
867
  });
264
- const input_steps_length = input.steps.length;
265
- for (let i = 0; i < input_steps_length; i++) {
266
- getTypeCacheKeys$4(rootKeySet, luvio, input.steps[i], () => '');
267
- }
268
868
  }
269
869
 
270
- const VERSION$2 = "7fa20e4b8a4c0391c7b39e1465f0b813";
271
- function validate$3(obj, path = 'ServicePlanExecutionOutputRepresentation') {
870
+ const TTL$1 = 1000;
871
+ const VERSION$2 = "1b54ee684d826acba0725f11c75ee33b";
872
+ function validate$3(obj, path = 'ServicePlanGenerationOutputRepresentation') {
272
873
  const v_error = (() => {
273
874
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
274
875
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
275
876
  }
877
+ const obj_copilotId = obj.copilotId;
878
+ const path_copilotId = path + '.copilotId';
879
+ let obj_copilotId_union0 = null;
880
+ const obj_copilotId_union0_error = (() => {
881
+ if (typeof obj_copilotId !== 'string') {
882
+ return new TypeError('Expected "string" but received "' + typeof obj_copilotId + '" (at "' + path_copilotId + '")');
883
+ }
884
+ })();
885
+ if (obj_copilotId_union0_error != null) {
886
+ obj_copilotId_union0 = obj_copilotId_union0_error.message;
887
+ }
888
+ let obj_copilotId_union1 = null;
889
+ const obj_copilotId_union1_error = (() => {
890
+ if (obj_copilotId !== null) {
891
+ return new TypeError('Expected "null" but received "' + typeof obj_copilotId + '" (at "' + path_copilotId + '")');
892
+ }
893
+ })();
894
+ if (obj_copilotId_union1_error != null) {
895
+ obj_copilotId_union1 = obj_copilotId_union1_error.message;
896
+ }
897
+ if (obj_copilotId_union0 && obj_copilotId_union1) {
898
+ let message = 'Object doesn\'t match union (at "' + path_copilotId + '")';
899
+ message += '\n' + obj_copilotId_union0.split('\n').map((line) => '\t' + line).join('\n');
900
+ message += '\n' + obj_copilotId_union1.split('\n').map((line) => '\t' + line).join('\n');
901
+ return new TypeError(message);
902
+ }
903
+ const obj_copilotName = obj.copilotName;
904
+ const path_copilotName = path + '.copilotName';
905
+ let obj_copilotName_union0 = null;
906
+ const obj_copilotName_union0_error = (() => {
907
+ if (typeof obj_copilotName !== 'string') {
908
+ return new TypeError('Expected "string" but received "' + typeof obj_copilotName + '" (at "' + path_copilotName + '")');
909
+ }
910
+ })();
911
+ if (obj_copilotName_union0_error != null) {
912
+ obj_copilotName_union0 = obj_copilotName_union0_error.message;
913
+ }
914
+ let obj_copilotName_union1 = null;
915
+ const obj_copilotName_union1_error = (() => {
916
+ if (obj_copilotName !== null) {
917
+ return new TypeError('Expected "null" but received "' + typeof obj_copilotName + '" (at "' + path_copilotName + '")');
918
+ }
919
+ })();
920
+ if (obj_copilotName_union1_error != null) {
921
+ obj_copilotName_union1 = obj_copilotName_union1_error.message;
922
+ }
923
+ if (obj_copilotName_union0 && obj_copilotName_union1) {
924
+ let message = 'Object doesn\'t match union (at "' + path_copilotName + '")';
925
+ message += '\n' + obj_copilotName_union0.split('\n').map((line) => '\t' + line).join('\n');
926
+ message += '\n' + obj_copilotName_union1.split('\n').map((line) => '\t' + line).join('\n');
927
+ return new TypeError(message);
928
+ }
929
+ const obj_errorMessage = obj.errorMessage;
930
+ const path_errorMessage = path + '.errorMessage';
931
+ let obj_errorMessage_union0 = null;
932
+ const obj_errorMessage_union0_error = (() => {
933
+ if (typeof obj_errorMessage !== 'string') {
934
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
935
+ }
936
+ })();
937
+ if (obj_errorMessage_union0_error != null) {
938
+ obj_errorMessage_union0 = obj_errorMessage_union0_error.message;
939
+ }
940
+ let obj_errorMessage_union1 = null;
941
+ const obj_errorMessage_union1_error = (() => {
942
+ if (obj_errorMessage !== null) {
943
+ return new TypeError('Expected "null" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
944
+ }
945
+ })();
946
+ if (obj_errorMessage_union1_error != null) {
947
+ obj_errorMessage_union1 = obj_errorMessage_union1_error.message;
948
+ }
949
+ if (obj_errorMessage_union0 && obj_errorMessage_union1) {
950
+ let message = 'Object doesn\'t match union (at "' + path_errorMessage + '")';
951
+ message += '\n' + obj_errorMessage_union0.split('\n').map((line) => '\t' + line).join('\n');
952
+ message += '\n' + obj_errorMessage_union1.split('\n').map((line) => '\t' + line).join('\n');
953
+ return new TypeError(message);
954
+ }
955
+ const obj_id = obj.id;
956
+ const path_id = path + '.id';
957
+ let obj_id_union0 = null;
958
+ const obj_id_union0_error = (() => {
959
+ if (typeof obj_id !== 'string') {
960
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
961
+ }
962
+ })();
963
+ if (obj_id_union0_error != null) {
964
+ obj_id_union0 = obj_id_union0_error.message;
965
+ }
966
+ let obj_id_union1 = null;
967
+ const obj_id_union1_error = (() => {
968
+ if (obj_id !== null) {
969
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
970
+ }
971
+ })();
972
+ if (obj_id_union1_error != null) {
973
+ obj_id_union1 = obj_id_union1_error.message;
974
+ }
975
+ if (obj_id_union0 && obj_id_union1) {
976
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
977
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
978
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
979
+ return new TypeError(message);
980
+ }
981
+ const obj_plan = obj.plan;
982
+ const path_plan = path + '.plan';
983
+ let obj_plan_union0 = null;
984
+ const obj_plan_union0_error = (() => {
985
+ if (typeof obj_plan !== 'object') {
986
+ return new TypeError('Expected "object" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
987
+ }
988
+ })();
989
+ if (obj_plan_union0_error != null) {
990
+ obj_plan_union0 = obj_plan_union0_error.message;
991
+ }
992
+ let obj_plan_union1 = null;
993
+ const obj_plan_union1_error = (() => {
994
+ if (obj_plan !== null) {
995
+ return new TypeError('Expected "null" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
996
+ }
997
+ })();
998
+ if (obj_plan_union1_error != null) {
999
+ obj_plan_union1 = obj_plan_union1_error.message;
1000
+ }
1001
+ if (obj_plan_union0 && obj_plan_union1) {
1002
+ let message = 'Object doesn\'t match union (at "' + path_plan + '")';
1003
+ message += '\n' + obj_plan_union0.split('\n').map((line) => '\t' + line).join('\n');
1004
+ message += '\n' + obj_plan_union1.split('\n').map((line) => '\t' + line).join('\n');
1005
+ return new TypeError(message);
1006
+ }
276
1007
  const obj_reason = obj.reason;
277
1008
  const path_reason = path + '.reason';
278
1009
  if (typeof obj_reason !== 'string') {
279
1010
  return new TypeError('Expected "string" but received "' + typeof obj_reason + '" (at "' + path_reason + '")');
280
1011
  }
281
- const obj_reasonDetails = obj.reasonDetails;
282
- const path_reasonDetails = path + '.reasonDetails';
283
- if (typeof obj_reasonDetails !== 'string') {
284
- return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
285
- }
286
- const obj_servicePlan = obj.servicePlan;
287
- const path_servicePlan = path + '.servicePlan';
288
- if (typeof obj_servicePlan !== 'object') {
289
- return new TypeError('Expected "object" but received "' + typeof obj_servicePlan + '" (at "' + path_servicePlan + '")');
1012
+ const obj_recordId = obj.recordId;
1013
+ const path_recordId = path + '.recordId';
1014
+ if (typeof obj_recordId !== 'string') {
1015
+ return new TypeError('Expected "string" but received "' + typeof obj_recordId + '" (at "' + path_recordId + '")');
290
1016
  }
291
1017
  const obj_status = obj.status;
292
1018
  const path_status = path + '.status';
293
1019
  if (typeof obj_status !== 'string') {
294
1020
  return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
295
1021
  }
1022
+ const obj_type = obj.type;
1023
+ const path_type = path + '.type';
1024
+ if (typeof obj_type !== 'string') {
1025
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1026
+ }
296
1027
  })();
297
1028
  return v_error === undefined ? null : v_error;
298
1029
  }
299
- const RepresentationType$2 = 'ServicePlanExecutionOutputRepresentation';
300
- function keyBuilder$1(luvio, config) {
301
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
1030
+ const RepresentationType$2 = 'ServicePlanGenerationOutputRepresentation';
1031
+ function keyBuilder$5(luvio, config) {
1032
+ return keyPrefix + '::' + RepresentationType$2 + ':' + (config.id === null ? '' : config.id);
302
1033
  }
303
1034
  function keyBuilderFromType$1(luvio, object) {
304
1035
  const keyParams = {
305
- id: object.reason
1036
+ id: object.id
306
1037
  };
307
- return keyBuilder$1(luvio, keyParams);
1038
+ return keyBuilder$5(luvio, keyParams);
308
1039
  }
309
1040
  function normalize$2(input, existing, path, luvio, store, timestamp) {
310
- const input_servicePlan = input.servicePlan;
311
- const input_servicePlan_id = path.fullPath + '__servicePlan';
312
- input.servicePlan = ingest$3(input_servicePlan, {
313
- fullPath: input_servicePlan_id,
314
- propertyName: 'servicePlan',
315
- parent: {
316
- data: input,
317
- key: path.fullPath,
318
- existing: existing,
319
- },
320
- ttl: path.ttl
321
- }, luvio, store, timestamp);
1041
+ const input_plan = input.plan;
1042
+ const input_plan_id = path.fullPath + '__plan';
1043
+ if (input_plan !== null && typeof input_plan === 'object') {
1044
+ input.plan = ingest$3(input_plan, {
1045
+ fullPath: input_plan_id,
1046
+ propertyName: 'plan',
1047
+ parent: {
1048
+ data: input,
1049
+ key: path.fullPath,
1050
+ existing: existing,
1051
+ },
1052
+ ttl: path.ttl
1053
+ }, luvio, store, timestamp);
1054
+ }
322
1055
  return input;
323
1056
  }
324
- const select$4 = function ServicePlanExecutionOutputRepresentationSelect() {
1057
+ const select$5 = function ServicePlanGenerationOutputRepresentationSelect() {
325
1058
  return {
326
1059
  kind: 'Fragment',
327
1060
  version: VERSION$2,
328
1061
  private: [],
329
1062
  selections: [
330
1063
  {
331
- name: 'reason',
1064
+ name: 'copilotId',
332
1065
  kind: 'Scalar'
333
1066
  },
334
1067
  {
335
- name: 'reasonDetails',
1068
+ name: 'copilotName',
336
1069
  kind: 'Scalar'
337
1070
  },
338
1071
  {
339
- name: 'servicePlan',
1072
+ name: 'errorMessage',
1073
+ kind: 'Scalar'
1074
+ },
1075
+ {
1076
+ name: 'id',
1077
+ kind: 'Scalar'
1078
+ },
1079
+ {
1080
+ name: 'plan',
340
1081
  kind: 'Link',
341
- fragment: select$5()
1082
+ nullable: true,
1083
+ fragment: select$6()
1084
+ },
1085
+ {
1086
+ name: 'reason',
1087
+ kind: 'Scalar'
1088
+ },
1089
+ {
1090
+ name: 'recordId',
1091
+ kind: 'Scalar'
342
1092
  },
343
1093
  {
344
1094
  name: 'status',
345
1095
  kind: 'Scalar'
1096
+ },
1097
+ {
1098
+ name: 'type',
1099
+ kind: 'Scalar'
346
1100
  }
347
1101
  ]
348
1102
  };
349
- };
350
- function equals$2(existing, incoming) {
351
- const existing_reason = existing.reason;
352
- const incoming_reason = incoming.reason;
353
- if (!(existing_reason === incoming_reason)) {
354
- return false;
1103
+ };
1104
+ function equals$2(existing, incoming) {
1105
+ const existing_reason = existing.reason;
1106
+ const incoming_reason = incoming.reason;
1107
+ if (!(existing_reason === incoming_reason)) {
1108
+ return false;
1109
+ }
1110
+ const existing_recordId = existing.recordId;
1111
+ const incoming_recordId = incoming.recordId;
1112
+ if (!(existing_recordId === incoming_recordId)) {
1113
+ return false;
1114
+ }
1115
+ const existing_status = existing.status;
1116
+ const incoming_status = incoming.status;
1117
+ if (!(existing_status === incoming_status)) {
1118
+ return false;
1119
+ }
1120
+ const existing_type = existing.type;
1121
+ const incoming_type = incoming.type;
1122
+ if (!(existing_type === incoming_type)) {
1123
+ return false;
1124
+ }
1125
+ const existing_copilotId = existing.copilotId;
1126
+ const incoming_copilotId = incoming.copilotId;
1127
+ if (!(existing_copilotId === incoming_copilotId)) {
1128
+ return false;
1129
+ }
1130
+ const existing_copilotName = existing.copilotName;
1131
+ const incoming_copilotName = incoming.copilotName;
1132
+ if (!(existing_copilotName === incoming_copilotName)) {
1133
+ return false;
1134
+ }
1135
+ const existing_errorMessage = existing.errorMessage;
1136
+ const incoming_errorMessage = incoming.errorMessage;
1137
+ if (!(existing_errorMessage === incoming_errorMessage)) {
1138
+ return false;
1139
+ }
1140
+ const existing_id = existing.id;
1141
+ const incoming_id = incoming.id;
1142
+ if (!(existing_id === incoming_id)) {
1143
+ return false;
1144
+ }
1145
+ const existing_plan = existing.plan;
1146
+ const incoming_plan = incoming.plan;
1147
+ if (!(existing_plan === incoming_plan
1148
+ || (existing_plan != null &&
1149
+ incoming_plan != null &&
1150
+ existing_plan.__ref != null &&
1151
+ incoming_plan.__ref != null &&
1152
+ existing_plan.__ref === incoming_plan.__ref))) {
1153
+ return false;
1154
+ }
1155
+ return true;
1156
+ }
1157
+ const ingest$2 = function ServicePlanGenerationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1158
+ if (process.env.NODE_ENV !== 'production') {
1159
+ const validateError = validate$3(input);
1160
+ if (validateError !== null) {
1161
+ throw validateError;
1162
+ }
1163
+ }
1164
+ const key = keyBuilderFromType$1(luvio, input);
1165
+ const ttlToUse = TTL$1;
1166
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "ServicePlan", VERSION$2, RepresentationType$2, equals$2);
1167
+ return createLink(key);
1168
+ };
1169
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1170
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1171
+ const rootKey = keyBuilderFromType$1(luvio, input);
1172
+ rootKeySet.set(rootKey, {
1173
+ namespace: keyPrefix,
1174
+ representationName: RepresentationType$2,
1175
+ mergeable: false
1176
+ });
1177
+ if (input.plan !== null && typeof input.plan === 'object') {
1178
+ getTypeCacheKeys$3(rootKeySet, luvio, input.plan, () => rootKey + "__" + "plan");
1179
+ }
1180
+ }
1181
+ const notifyUpdateAvailableFactory$1 = (luvio) => {
1182
+ return function notifyServicePlanGenerationUpdateAvailable(configs) {
1183
+ if (process.env.NODE_ENV !== 'production') {
1184
+ const requiredKeyParams = ['id'];
1185
+ configs.forEach(config => {
1186
+ if (false === requiredKeyParams.every(req => req in config)) {
1187
+ throw new Error(`one of the configs did not contain all required parameters: ${JSONStringify(ObjectKeys(config))}`);
1188
+ }
1189
+ });
1190
+ }
1191
+ const keys = configs.map(c => keyBuilder$5(luvio, c));
1192
+ return luvio.notifyStoreUpdateAvailable(keys);
1193
+ };
1194
+ };
1195
+
1196
+ function select$4(luvio, params) {
1197
+ return select$5();
1198
+ }
1199
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1200
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1201
+ }
1202
+ function ingestSuccess$2(luvio, resourceParams, response) {
1203
+ const { body } = response;
1204
+ const key = keyBuilderFromType$1(luvio, body);
1205
+ luvio.storeIngest(key, ingest$2, body);
1206
+ const snapshot = luvio.storeLookup({
1207
+ recordId: key,
1208
+ node: select$4(),
1209
+ variables: {},
1210
+ });
1211
+ if (process.env.NODE_ENV !== 'production') {
1212
+ if (snapshot.state !== 'Fulfilled') {
1213
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1214
+ }
1215
+ }
1216
+ deepFreeze(snapshot.data);
1217
+ return snapshot;
1218
+ }
1219
+ function createResourceRequest$2(config) {
1220
+ const headers = {};
1221
+ return {
1222
+ baseUri: '/services/data/v62.0',
1223
+ basePath: '/connect/service-plan/generationRequests',
1224
+ method: 'post',
1225
+ body: config.body,
1226
+ urlParams: {},
1227
+ queryParams: config.queryParams,
1228
+ headers,
1229
+ priority: 'normal',
1230
+ };
1231
+ }
1232
+
1233
+ const adapterName$2 = 'generateServicePlan';
1234
+ const generateServicePlan_ConfigPropertyMetadata = [
1235
+ generateParamConfigMetadata('processingMode', false, 1 /* QueryParameter */, 0 /* String */),
1236
+ generateParamConfigMetadata('recordId', false, 1 /* QueryParameter */, 0 /* String */),
1237
+ generateParamConfigMetadata('additionalContext', true, 2 /* Body */, 4 /* Unsupported */),
1238
+ generateParamConfigMetadata('generationMode', true, 2 /* Body */, 0 /* String */),
1239
+ generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
1240
+ ];
1241
+ const generateServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateServicePlan_ConfigPropertyMetadata);
1242
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(generateServicePlan_ConfigPropertyMetadata);
1243
+ function typeCheckConfig$2(untrustedConfig) {
1244
+ const config = {};
1245
+ typeCheckConfig$4(untrustedConfig, config, generateServicePlan_ConfigPropertyMetadata);
1246
+ const untrustedConfig_additionalContext = untrustedConfig.additionalContext;
1247
+ if (untrustedIsObject(untrustedConfig_additionalContext)) {
1248
+ const untrustedConfig_additionalContext_object = {};
1249
+ const untrustedConfig_additionalContext_keys = Object.keys(untrustedConfig_additionalContext);
1250
+ for (let i = 0, arrayLength = untrustedConfig_additionalContext_keys.length; i < arrayLength; i++) {
1251
+ const key = untrustedConfig_additionalContext_keys[i];
1252
+ const untrustedConfig_additionalContext_prop = untrustedConfig_additionalContext[key];
1253
+ if (typeof untrustedConfig_additionalContext_prop === 'string') {
1254
+ if (untrustedConfig_additionalContext_object !== undefined) {
1255
+ untrustedConfig_additionalContext_object[key] = untrustedConfig_additionalContext_prop;
1256
+ }
1257
+ }
1258
+ }
1259
+ if (untrustedConfig_additionalContext_object !== undefined && Object.keys(untrustedConfig_additionalContext_object).length >= 0) {
1260
+ config.additionalContext = untrustedConfig_additionalContext_object;
1261
+ }
355
1262
  }
356
- const existing_reasonDetails = existing.reasonDetails;
357
- const incoming_reasonDetails = incoming.reasonDetails;
358
- if (!(existing_reasonDetails === incoming_reasonDetails)) {
359
- return false;
1263
+ return config;
1264
+ }
1265
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1266
+ if (!untrustedIsObject(untrustedConfig)) {
1267
+ return null;
360
1268
  }
361
- const existing_status = existing.status;
362
- const incoming_status = incoming.status;
363
- if (!(existing_status === incoming_status)) {
364
- return false;
1269
+ if (process.env.NODE_ENV !== 'production') {
1270
+ validateConfig(untrustedConfig, configPropertyNames);
365
1271
  }
366
- const existing_servicePlan = existing.servicePlan;
367
- const incoming_servicePlan = incoming.servicePlan;
368
- if (!(existing_servicePlan.__ref === incoming_servicePlan.__ref)) {
369
- return false;
1272
+ const config = typeCheckConfig$2(untrustedConfig);
1273
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1274
+ return null;
370
1275
  }
371
- return true;
1276
+ return config;
372
1277
  }
373
- const ingest$2 = function ServicePlanExecutionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
374
- if (process.env.NODE_ENV !== 'production') {
375
- const validateError = validate$3(input);
376
- if (validateError !== null) {
377
- throw validateError;
378
- }
379
- }
380
- const key = keyBuilderFromType$1(luvio, input);
381
- const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
382
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "ServicePlan", VERSION$2, RepresentationType$2, equals$2);
383
- return createLink(key);
384
- };
385
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
386
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
387
- const rootKey = keyBuilderFromType$1(luvio, input);
388
- rootKeySet.set(rootKey, {
389
- namespace: keyPrefix,
390
- representationName: RepresentationType$2,
391
- mergeable: false
1278
+ function buildNetworkSnapshot$2(luvio, config, options) {
1279
+ const resourceParams = createResourceParams$2(config);
1280
+ const request = createResourceRequest$2(resourceParams);
1281
+ return luvio.dispatchResourceRequest(request, options)
1282
+ .then((response) => {
1283
+ return luvio.handleSuccessResponse(() => {
1284
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1285
+ return luvio.storeBroadcast().then(() => snapshot);
1286
+ }, () => {
1287
+ const cache = new StoreKeyMap();
1288
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1289
+ return cache;
1290
+ });
1291
+ }, (response) => {
1292
+ deepFreeze(response);
1293
+ throw response;
392
1294
  });
393
- getTypeCacheKeys$3(rootKeySet, luvio, input.servicePlan, () => rootKey + "__" + "servicePlan");
394
1295
  }
1296
+ const generateServicePlanAdapterFactory = (luvio) => {
1297
+ return function generateServicePlan(untrustedConfig) {
1298
+ const config = validateAdapterConfig$2(untrustedConfig, generateServicePlan_ConfigPropertyNames);
1299
+ // Invalid or incomplete config
1300
+ if (config === null) {
1301
+ throw new Error('Invalid config for "generateServicePlan"');
1302
+ }
1303
+ return buildNetworkSnapshot$2(luvio, config);
1304
+ };
1305
+ };
395
1306
 
396
1307
  function select$3(luvio, params) {
397
- return select$4();
1308
+ return select$5();
1309
+ }
1310
+ function keyBuilder$4(luvio, params) {
1311
+ return keyBuilder$5(luvio, {
1312
+ id: params.urlParams.requestId
1313
+ });
398
1314
  }
399
1315
  function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
400
1316
  getTypeCacheKeys$2(storeKeyMap, luvio, response);
401
1317
  }
402
- function ingestSuccess$1(luvio, resourceParams, response) {
1318
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
403
1319
  const { body } = response;
404
- const key = keyBuilderFromType$1(luvio, body);
1320
+ const key = keyBuilder$4(luvio, resourceParams);
405
1321
  luvio.storeIngest(key, ingest$2, body);
406
1322
  const snapshot = luvio.storeLookup({
407
1323
  recordId: key,
408
1324
  node: select$3(),
409
1325
  variables: {},
410
- });
1326
+ }, snapshotRefresh);
411
1327
  if (process.env.NODE_ENV !== 'production') {
412
1328
  if (snapshot.state !== 'Fulfilled') {
413
1329
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -416,13 +1332,25 @@ function ingestSuccess$1(luvio, resourceParams, response) {
416
1332
  deepFreeze(snapshot.data);
417
1333
  return snapshot;
418
1334
  }
1335
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1336
+ const key = keyBuilder$4(luvio, params);
1337
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1338
+ const storeMetadataParams = {
1339
+ ttl: TTL$1,
1340
+ namespace: keyPrefix,
1341
+ version: VERSION$2,
1342
+ representationName: RepresentationType$2
1343
+ };
1344
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1345
+ return errorSnapshot;
1346
+ }
419
1347
  function createResourceRequest$1(config) {
420
1348
  const headers = {};
421
1349
  return {
422
1350
  baseUri: '/services/data/v62.0',
423
- basePath: '/connect/service-plan/execute/' + config.urlParams.generatedPlanId + '',
424
- method: 'put',
425
- body: config.body,
1351
+ basePath: '/connect/service-plan/generationRequests/' + config.urlParams.requestId + '',
1352
+ method: 'get',
1353
+ body: null,
426
1354
  urlParams: config.urlParams,
427
1355
  queryParams: {},
428
1356
  headers,
@@ -430,18 +1358,19 @@ function createResourceRequest$1(config) {
430
1358
  };
431
1359
  }
432
1360
 
433
- const adapterName$1 = 'executeServicePlan';
434
- const executeServicePlan_ConfigPropertyMetadata = [
435
- generateParamConfigMetadata('generatedPlanId', true, 0 /* UrlParameter */, 0 /* String */),
436
- generateParamConfigMetadata('intent', true, 2 /* Body */, 0 /* String */),
437
- generateParamConfigMetadata('planId', true, 2 /* Body */, 0 /* String */),
438
- generateParamConfigMetadata('sessionId', true, 2 /* Body */, 0 /* String */),
1361
+ const adapterName$1 = 'getGenerationRequest';
1362
+ const getGenerationRequest_ConfigPropertyMetadata = [
1363
+ generateParamConfigMetadata('requestId', true, 0 /* UrlParameter */, 0 /* String */),
439
1364
  ];
440
- const executeServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, executeServicePlan_ConfigPropertyMetadata);
441
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(executeServicePlan_ConfigPropertyMetadata);
1365
+ const getGenerationRequest_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getGenerationRequest_ConfigPropertyMetadata);
1366
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getGenerationRequest_ConfigPropertyMetadata);
1367
+ function keyBuilder$3(luvio, config) {
1368
+ const resourceParams = createResourceParams$1(config);
1369
+ return keyBuilder$4(luvio, resourceParams);
1370
+ }
442
1371
  function typeCheckConfig$1(untrustedConfig) {
443
1372
  const config = {};
444
- typeCheckConfig$2(untrustedConfig, config, executeServicePlan_ConfigPropertyMetadata);
1373
+ typeCheckConfig$4(untrustedConfig, config, getGenerationRequest_ConfigPropertyMetadata);
445
1374
  return config;
446
1375
  }
447
1376
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -457,138 +1386,304 @@ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
457
1386
  }
458
1387
  return config;
459
1388
  }
1389
+ function adapterFragment$1(luvio, config) {
1390
+ createResourceParams$1(config);
1391
+ return select$3();
1392
+ }
1393
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1394
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1395
+ config,
1396
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1397
+ });
1398
+ return luvio.storeBroadcast().then(() => snapshot);
1399
+ }
1400
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1401
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1402
+ config,
1403
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1404
+ });
1405
+ return luvio.storeBroadcast().then(() => snapshot);
1406
+ }
460
1407
  function buildNetworkSnapshot$1(luvio, config, options) {
461
1408
  const resourceParams = createResourceParams$1(config);
462
1409
  const request = createResourceRequest$1(resourceParams);
463
1410
  return luvio.dispatchResourceRequest(request, options)
464
1411
  .then((response) => {
465
- return luvio.handleSuccessResponse(() => {
466
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
467
- return luvio.storeBroadcast().then(() => snapshot);
468
- }, () => {
1412
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
469
1413
  const cache = new StoreKeyMap();
470
1414
  getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
471
1415
  return cache;
472
1416
  });
473
1417
  }, (response) => {
474
- deepFreeze(response);
475
- throw response;
1418
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
476
1419
  });
477
1420
  }
478
- const executeServicePlanAdapterFactory = (luvio) => {
479
- return function executeServicePlan(untrustedConfig) {
480
- const config = validateAdapterConfig$1(untrustedConfig, executeServicePlan_ConfigPropertyNames);
481
- // Invalid or incomplete config
482
- if (config === null) {
483
- throw new Error('Invalid config for "executeServicePlan"');
484
- }
485
- return buildNetworkSnapshot$1(luvio, config);
1421
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1422
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1423
+ }
1424
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1425
+ const { luvio, config } = context;
1426
+ const selector = {
1427
+ recordId: keyBuilder$3(luvio, config),
1428
+ node: adapterFragment$1(luvio, config),
1429
+ variables: {},
486
1430
  };
1431
+ const cacheSnapshot = storeLookup(selector, {
1432
+ config,
1433
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1434
+ });
1435
+ return cacheSnapshot;
1436
+ }
1437
+ const getGenerationRequestAdapterFactory = (luvio) => function ServicePlan__getGenerationRequest(untrustedConfig, requestContext) {
1438
+ const config = validateAdapterConfig$1(untrustedConfig, getGenerationRequest_ConfigPropertyNames);
1439
+ // Invalid or incomplete config
1440
+ if (config === null) {
1441
+ return null;
1442
+ }
1443
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1444
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
487
1445
  };
488
1446
 
489
- function validate$2(obj, path = 'ServicePlanGenerationSessionInformationOutputRepresentation') {
1447
+ function validate$2(obj, path = 'ServicePlanStepDetailsRepresentation') {
490
1448
  const v_error = (() => {
491
1449
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
492
1450
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
493
1451
  }
494
- const obj_botId = obj.botId;
495
- const path_botId = path + '.botId';
496
- if (typeof obj_botId !== 'string') {
497
- return new TypeError('Expected "string" but received "' + typeof obj_botId + '" (at "' + path_botId + '")');
1452
+ const obj_executionStatus = obj.executionStatus;
1453
+ const path_executionStatus = path + '.executionStatus';
1454
+ if (typeof obj_executionStatus !== 'string') {
1455
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
498
1456
  }
499
- const obj_botVersionId = obj.botVersionId;
500
- const path_botVersionId = path + '.botVersionId';
501
- if (typeof obj_botVersionId !== 'string') {
502
- return new TypeError('Expected "string" but received "' + typeof obj_botVersionId + '" (at "' + path_botVersionId + '")');
1457
+ const obj_groupName = obj.groupName;
1458
+ const path_groupName = path + '.groupName';
1459
+ let obj_groupName_union0 = null;
1460
+ const obj_groupName_union0_error = (() => {
1461
+ if (typeof obj_groupName !== 'string') {
1462
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
1463
+ }
1464
+ })();
1465
+ if (obj_groupName_union0_error != null) {
1466
+ obj_groupName_union0 = obj_groupName_union0_error.message;
503
1467
  }
504
- const obj_clientFeatureId = obj.clientFeatureId;
505
- const path_clientFeatureId = path + '.clientFeatureId';
506
- if (typeof obj_clientFeatureId !== 'string') {
507
- return new TypeError('Expected "string" but received "' + typeof obj_clientFeatureId + '" (at "' + path_clientFeatureId + '")');
1468
+ let obj_groupName_union1 = null;
1469
+ const obj_groupName_union1_error = (() => {
1470
+ if (obj_groupName !== null) {
1471
+ return new TypeError('Expected "null" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
1472
+ }
1473
+ })();
1474
+ if (obj_groupName_union1_error != null) {
1475
+ obj_groupName_union1 = obj_groupName_union1_error.message;
508
1476
  }
509
- const obj_generationsId = obj.generationsId;
510
- const path_generationsId = path + '.generationsId';
511
- if (typeof obj_generationsId !== 'string') {
512
- return new TypeError('Expected "string" but received "' + typeof obj_generationsId + '" (at "' + path_generationsId + '")');
1477
+ if (obj_groupName_union0 && obj_groupName_union1) {
1478
+ let message = 'Object doesn\'t match union (at "' + path_groupName + '")';
1479
+ message += '\n' + obj_groupName_union0.split('\n').map((line) => '\t' + line).join('\n');
1480
+ message += '\n' + obj_groupName_union1.split('\n').map((line) => '\t' + line).join('\n');
1481
+ return new TypeError(message);
513
1482
  }
514
- const obj_planId = obj.planId;
515
- const path_planId = path + '.planId';
516
- if (typeof obj_planId !== 'string') {
517
- return new TypeError('Expected "string" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
1483
+ const obj_order = obj.order;
1484
+ const path_order = path + '.order';
1485
+ if (typeof obj_order !== 'number' || (typeof obj_order === 'number' && Math.floor(obj_order) !== obj_order)) {
1486
+ return new TypeError('Expected "integer" but received "' + typeof obj_order + '" (at "' + path_order + '")');
1487
+ }
1488
+ const obj_stepId = obj.stepId;
1489
+ const path_stepId = path + '.stepId';
1490
+ if (typeof obj_stepId !== 'string') {
1491
+ return new TypeError('Expected "string" but received "' + typeof obj_stepId + '" (at "' + path_stepId + '")');
518
1492
  }
519
- const obj_sessionId = obj.sessionId;
520
- const path_sessionId = path + '.sessionId';
521
- if (typeof obj_sessionId !== 'string') {
522
- return new TypeError('Expected "string" but received "' + typeof obj_sessionId + '" (at "' + path_sessionId + '")');
1493
+ const obj_stepName = obj.stepName;
1494
+ const path_stepName = path + '.stepName';
1495
+ if (typeof obj_stepName !== 'string') {
1496
+ return new TypeError('Expected "string" but received "' + typeof obj_stepName + '" (at "' + path_stepName + '")');
523
1497
  }
524
1498
  })();
525
1499
  return v_error === undefined ? null : v_error;
526
1500
  }
527
1501
 
528
- const VERSION$1 = "62b4abcd5c780a0219ce54573c8187b5";
529
- function validate$1(obj, path = 'ServicePlanOutputRepresentation') {
1502
+ const VERSION$1 = "b4f5b09aa7f657ce0b31e25aa7b50b1c";
1503
+ function validate$1(obj, path = 'ServicePlanDetailsRepresentation') {
530
1504
  const v_error = (() => {
531
1505
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
532
1506
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
533
1507
  }
534
- const obj_copilot = obj.copilot;
535
- const path_copilot = path + '.copilot';
536
- if (typeof obj_copilot !== 'string') {
537
- return new TypeError('Expected "string" but received "' + typeof obj_copilot + '" (at "' + path_copilot + '")');
1508
+ const obj_clientFeatureId = obj.clientFeatureId;
1509
+ const path_clientFeatureId = path + '.clientFeatureId';
1510
+ let obj_clientFeatureId_union0 = null;
1511
+ const obj_clientFeatureId_union0_error = (() => {
1512
+ if (typeof obj_clientFeatureId !== 'string') {
1513
+ return new TypeError('Expected "string" but received "' + typeof obj_clientFeatureId + '" (at "' + path_clientFeatureId + '")');
1514
+ }
1515
+ })();
1516
+ if (obj_clientFeatureId_union0_error != null) {
1517
+ obj_clientFeatureId_union0 = obj_clientFeatureId_union0_error.message;
1518
+ }
1519
+ let obj_clientFeatureId_union1 = null;
1520
+ const obj_clientFeatureId_union1_error = (() => {
1521
+ if (obj_clientFeatureId !== null) {
1522
+ return new TypeError('Expected "null" but received "' + typeof obj_clientFeatureId + '" (at "' + path_clientFeatureId + '")');
1523
+ }
1524
+ })();
1525
+ if (obj_clientFeatureId_union1_error != null) {
1526
+ obj_clientFeatureId_union1 = obj_clientFeatureId_union1_error.message;
1527
+ }
1528
+ if (obj_clientFeatureId_union0 && obj_clientFeatureId_union1) {
1529
+ let message = 'Object doesn\'t match union (at "' + path_clientFeatureId + '")';
1530
+ message += '\n' + obj_clientFeatureId_union0.split('\n').map((line) => '\t' + line).join('\n');
1531
+ message += '\n' + obj_clientFeatureId_union1.split('\n').map((line) => '\t' + line).join('\n');
1532
+ return new TypeError(message);
538
1533
  }
539
1534
  const obj_createdDate = obj.createdDate;
540
1535
  const path_createdDate = path + '.createdDate';
541
- if (typeof obj_createdDate !== 'string') {
542
- return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
543
- }
544
- const obj_generatedPlanId = obj.generatedPlanId;
545
- const path_generatedPlanId = path + '.generatedPlanId';
546
- if (typeof obj_generatedPlanId !== 'string') {
547
- return new TypeError('Expected "string" but received "' + typeof obj_generatedPlanId + '" (at "' + path_generatedPlanId + '")');
548
- }
549
- const obj_rawPlan = obj.rawPlan;
550
- const path_rawPlan = path + '.rawPlan';
551
- if (typeof obj_rawPlan !== 'string') {
552
- return new TypeError('Expected "string" but received "' + typeof obj_rawPlan + '" (at "' + path_rawPlan + '")');
553
- }
554
- const obj_sessionInformation = obj.sessionInformation;
555
- const path_sessionInformation = path + '.sessionInformation';
556
- const referencepath_sessionInformationValidationError = validate$2(obj_sessionInformation, path_sessionInformation);
557
- if (referencepath_sessionInformationValidationError !== null) {
558
- let message = 'Object doesn\'t match ServicePlanGenerationSessionInformationOutputRepresentation (at "' + path_sessionInformation + '")\n';
559
- message += referencepath_sessionInformationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1536
+ let obj_createdDate_union0 = null;
1537
+ const obj_createdDate_union0_error = (() => {
1538
+ if (typeof obj_createdDate !== 'string') {
1539
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1540
+ }
1541
+ })();
1542
+ if (obj_createdDate_union0_error != null) {
1543
+ obj_createdDate_union0 = obj_createdDate_union0_error.message;
1544
+ }
1545
+ let obj_createdDate_union1 = null;
1546
+ const obj_createdDate_union1_error = (() => {
1547
+ if (obj_createdDate !== null) {
1548
+ return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
1549
+ }
1550
+ })();
1551
+ if (obj_createdDate_union1_error != null) {
1552
+ obj_createdDate_union1 = obj_createdDate_union1_error.message;
1553
+ }
1554
+ if (obj_createdDate_union0 && obj_createdDate_union1) {
1555
+ let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
1556
+ message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
1557
+ message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
560
1558
  return new TypeError(message);
561
1559
  }
562
- const obj_steps = obj.steps;
563
- const path_steps = path + '.steps';
564
- if (!ArrayIsArray(obj_steps)) {
565
- return new TypeError('Expected "array" but received "' + typeof obj_steps + '" (at "' + path_steps + '")');
1560
+ const obj_executionStatus = obj.executionStatus;
1561
+ const path_executionStatus = path + '.executionStatus';
1562
+ let obj_executionStatus_union0 = null;
1563
+ const obj_executionStatus_union0_error = (() => {
1564
+ if (typeof obj_executionStatus !== 'string') {
1565
+ return new TypeError('Expected "string" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
1566
+ }
1567
+ })();
1568
+ if (obj_executionStatus_union0_error != null) {
1569
+ obj_executionStatus_union0 = obj_executionStatus_union0_error.message;
566
1570
  }
567
- for (let i = 0; i < obj_steps.length; i++) {
568
- const obj_steps_item = obj_steps[i];
569
- const path_steps_item = path_steps + '[' + i + ']';
570
- if (typeof obj_steps_item !== 'object' || ArrayIsArray(obj_steps_item) || obj_steps_item === null) {
571
- return new TypeError('Expected "object" but received "' + typeof obj_steps_item + '" (at "' + path_steps_item + '")');
1571
+ let obj_executionStatus_union1 = null;
1572
+ const obj_executionStatus_union1_error = (() => {
1573
+ if (obj_executionStatus !== null) {
1574
+ return new TypeError('Expected "null" but received "' + typeof obj_executionStatus + '" (at "' + path_executionStatus + '")');
1575
+ }
1576
+ })();
1577
+ if (obj_executionStatus_union1_error != null) {
1578
+ obj_executionStatus_union1 = obj_executionStatus_union1_error.message;
1579
+ }
1580
+ if (obj_executionStatus_union0 && obj_executionStatus_union1) {
1581
+ let message = 'Object doesn\'t match union (at "' + path_executionStatus + '")';
1582
+ message += '\n' + obj_executionStatus_union0.split('\n').map((line) => '\t' + line).join('\n');
1583
+ message += '\n' + obj_executionStatus_union1.split('\n').map((line) => '\t' + line).join('\n');
1584
+ return new TypeError(message);
1585
+ }
1586
+ const obj_feedbackId = obj.feedbackId;
1587
+ const path_feedbackId = path + '.feedbackId';
1588
+ let obj_feedbackId_union0 = null;
1589
+ const obj_feedbackId_union0_error = (() => {
1590
+ if (typeof obj_feedbackId !== 'string') {
1591
+ return new TypeError('Expected "string" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
1592
+ }
1593
+ })();
1594
+ if (obj_feedbackId_union0_error != null) {
1595
+ obj_feedbackId_union0 = obj_feedbackId_union0_error.message;
1596
+ }
1597
+ let obj_feedbackId_union1 = null;
1598
+ const obj_feedbackId_union1_error = (() => {
1599
+ if (obj_feedbackId !== null) {
1600
+ return new TypeError('Expected "null" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
1601
+ }
1602
+ })();
1603
+ if (obj_feedbackId_union1_error != null) {
1604
+ obj_feedbackId_union1 = obj_feedbackId_union1_error.message;
1605
+ }
1606
+ if (obj_feedbackId_union0 && obj_feedbackId_union1) {
1607
+ let message = 'Object doesn\'t match union (at "' + path_feedbackId + '")';
1608
+ message += '\n' + obj_feedbackId_union0.split('\n').map((line) => '\t' + line).join('\n');
1609
+ message += '\n' + obj_feedbackId_union1.split('\n').map((line) => '\t' + line).join('\n');
1610
+ return new TypeError(message);
1611
+ }
1612
+ const obj_planId = obj.planId;
1613
+ const path_planId = path + '.planId';
1614
+ let obj_planId_union0 = null;
1615
+ const obj_planId_union0_error = (() => {
1616
+ if (typeof obj_planId !== 'string') {
1617
+ return new TypeError('Expected "string" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
1618
+ }
1619
+ })();
1620
+ if (obj_planId_union0_error != null) {
1621
+ obj_planId_union0 = obj_planId_union0_error.message;
1622
+ }
1623
+ let obj_planId_union1 = null;
1624
+ const obj_planId_union1_error = (() => {
1625
+ if (obj_planId !== null) {
1626
+ return new TypeError('Expected "null" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
1627
+ }
1628
+ })();
1629
+ if (obj_planId_union1_error != null) {
1630
+ obj_planId_union1 = obj_planId_union1_error.message;
1631
+ }
1632
+ if (obj_planId_union0 && obj_planId_union1) {
1633
+ let message = 'Object doesn\'t match union (at "' + path_planId + '")';
1634
+ message += '\n' + obj_planId_union0.split('\n').map((line) => '\t' + line).join('\n');
1635
+ message += '\n' + obj_planId_union1.split('\n').map((line) => '\t' + line).join('\n');
1636
+ return new TypeError(message);
1637
+ }
1638
+ const obj_servicePlanSteps = obj.servicePlanSteps;
1639
+ const path_servicePlanSteps = path + '.servicePlanSteps';
1640
+ if (!ArrayIsArray(obj_servicePlanSteps)) {
1641
+ return new TypeError('Expected "array" but received "' + typeof obj_servicePlanSteps + '" (at "' + path_servicePlanSteps + '")');
1642
+ }
1643
+ for (let i = 0; i < obj_servicePlanSteps.length; i++) {
1644
+ const obj_servicePlanSteps_item = obj_servicePlanSteps[i];
1645
+ const path_servicePlanSteps_item = path_servicePlanSteps + '[' + i + ']';
1646
+ const referencepath_servicePlanSteps_itemValidationError = validate$2(obj_servicePlanSteps_item, path_servicePlanSteps_item);
1647
+ if (referencepath_servicePlanSteps_itemValidationError !== null) {
1648
+ let message = 'Object doesn\'t match ServicePlanStepDetailsRepresentation (at "' + path_servicePlanSteps_item + '")\n';
1649
+ message += referencepath_servicePlanSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1650
+ return new TypeError(message);
572
1651
  }
573
1652
  }
574
1653
  const obj_topic = obj.topic;
575
1654
  const path_topic = path + '.topic';
576
- if (typeof obj_topic !== 'string') {
577
- return new TypeError('Expected "string" but received "' + typeof obj_topic + '" (at "' + path_topic + '")');
1655
+ let obj_topic_union0 = null;
1656
+ const obj_topic_union0_error = (() => {
1657
+ if (typeof obj_topic !== 'string') {
1658
+ return new TypeError('Expected "string" but received "' + typeof obj_topic + '" (at "' + path_topic + '")');
1659
+ }
1660
+ })();
1661
+ if (obj_topic_union0_error != null) {
1662
+ obj_topic_union0 = obj_topic_union0_error.message;
578
1663
  }
579
- const obj_topicDescription = obj.topicDescription;
580
- const path_topicDescription = path + '.topicDescription';
581
- if (typeof obj_topicDescription !== 'string') {
582
- return new TypeError('Expected "string" but received "' + typeof obj_topicDescription + '" (at "' + path_topicDescription + '")');
1664
+ let obj_topic_union1 = null;
1665
+ const obj_topic_union1_error = (() => {
1666
+ if (obj_topic !== null) {
1667
+ return new TypeError('Expected "null" but received "' + typeof obj_topic + '" (at "' + path_topic + '")');
1668
+ }
1669
+ })();
1670
+ if (obj_topic_union1_error != null) {
1671
+ obj_topic_union1 = obj_topic_union1_error.message;
1672
+ }
1673
+ if (obj_topic_union0 && obj_topic_union1) {
1674
+ let message = 'Object doesn\'t match union (at "' + path_topic + '")';
1675
+ message += '\n' + obj_topic_union0.split('\n').map((line) => '\t' + line).join('\n');
1676
+ message += '\n' + obj_topic_union1.split('\n').map((line) => '\t' + line).join('\n');
1677
+ return new TypeError(message);
583
1678
  }
584
1679
  })();
585
1680
  return v_error === undefined ? null : v_error;
586
1681
  }
587
- const RepresentationType$1 = 'ServicePlanOutputRepresentation';
1682
+ const RepresentationType$1 = 'ServicePlanDetailsRepresentation';
588
1683
  function normalize$1(input, existing, path, luvio, store, timestamp) {
589
1684
  return input;
590
1685
  }
591
- const select$2 = function ServicePlanOutputRepresentationSelect() {
1686
+ const select$2 = function ServicePlanDetailsRepresentationSelect() {
592
1687
  return {
593
1688
  kind: 'Fragment',
594
1689
  version: VERSION$1,
@@ -602,7 +1697,7 @@ function equals$1(existing, incoming) {
602
1697
  }
603
1698
  return true;
604
1699
  }
605
- const ingest$1 = function ServicePlanOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1700
+ const ingest$1 = function ServicePlanDetailsRepresentationIngest(input, path, luvio, store, timestamp) {
606
1701
  if (process.env.NODE_ENV !== 'production') {
607
1702
  const validateError = validate$1(input);
608
1703
  if (validateError !== null) {
@@ -625,12 +1720,22 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
625
1720
  }
626
1721
 
627
1722
  const TTL = 1000;
628
- const VERSION = "1abaf86bec8ec96b264ca95686a8d77f";
629
- function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
1723
+ const VERSION = "2dd60cd6c267351cb563fcc04cb5cb56";
1724
+ function validate(obj, path = 'ServicePlanDetailsOutputRepresentation') {
630
1725
  const v_error = (() => {
631
1726
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
632
1727
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
633
1728
  }
1729
+ const obj_plan = obj.plan;
1730
+ const path_plan = path + '.plan';
1731
+ if (typeof obj_plan !== 'object') {
1732
+ return new TypeError('Expected "object" but received "' + typeof obj_plan + '" (at "' + path_plan + '")');
1733
+ }
1734
+ const obj_planRequestId = obj.planRequestId;
1735
+ const path_planRequestId = path + '.planRequestId';
1736
+ if (typeof obj_planRequestId !== 'string') {
1737
+ return new TypeError('Expected "string" but received "' + typeof obj_planRequestId + '" (at "' + path_planRequestId + '")');
1738
+ }
634
1739
  const obj_reason = obj.reason;
635
1740
  const path_reason = path + '.reason';
636
1741
  if (typeof obj_reason !== 'string') {
@@ -638,13 +1743,29 @@ function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
638
1743
  }
639
1744
  const obj_reasonDetails = obj.reasonDetails;
640
1745
  const path_reasonDetails = path + '.reasonDetails';
641
- if (typeof obj_reasonDetails !== 'string') {
642
- return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1746
+ let obj_reasonDetails_union0 = null;
1747
+ const obj_reasonDetails_union0_error = (() => {
1748
+ if (typeof obj_reasonDetails !== 'string') {
1749
+ return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1750
+ }
1751
+ })();
1752
+ if (obj_reasonDetails_union0_error != null) {
1753
+ obj_reasonDetails_union0 = obj_reasonDetails_union0_error.message;
1754
+ }
1755
+ let obj_reasonDetails_union1 = null;
1756
+ const obj_reasonDetails_union1_error = (() => {
1757
+ if (obj_reasonDetails !== null) {
1758
+ return new TypeError('Expected "null" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
1759
+ }
1760
+ })();
1761
+ if (obj_reasonDetails_union1_error != null) {
1762
+ obj_reasonDetails_union1 = obj_reasonDetails_union1_error.message;
643
1763
  }
644
- const obj_servicePlan = obj.servicePlan;
645
- const path_servicePlan = path + '.servicePlan';
646
- if (typeof obj_servicePlan !== 'object') {
647
- return new TypeError('Expected "object" but received "' + typeof obj_servicePlan + '" (at "' + path_servicePlan + '")');
1764
+ if (obj_reasonDetails_union0 && obj_reasonDetails_union1) {
1765
+ let message = 'Object doesn\'t match union (at "' + path_reasonDetails + '")';
1766
+ message += '\n' + obj_reasonDetails_union0.split('\n').map((line) => '\t' + line).join('\n');
1767
+ message += '\n' + obj_reasonDetails_union1.split('\n').map((line) => '\t' + line).join('\n');
1768
+ return new TypeError(message);
648
1769
  }
649
1770
  const obj_status = obj.status;
650
1771
  const path_status = path + '.status';
@@ -654,22 +1775,22 @@ function validate(obj, path = 'ServicePlanGenerationSyncOutputRepresentation') {
654
1775
  })();
655
1776
  return v_error === undefined ? null : v_error;
656
1777
  }
657
- const RepresentationType = 'ServicePlanGenerationSyncOutputRepresentation';
658
- function keyBuilder(luvio, config) {
1778
+ const RepresentationType = 'ServicePlanDetailsOutputRepresentation';
1779
+ function keyBuilder$2(luvio, config) {
659
1780
  return keyPrefix + '::' + RepresentationType + ':' + config.id;
660
1781
  }
661
1782
  function keyBuilderFromType(luvio, object) {
662
1783
  const keyParams = {
663
- id: object.reason
1784
+ id: object.planRequestId
664
1785
  };
665
- return keyBuilder(luvio, keyParams);
1786
+ return keyBuilder$2(luvio, keyParams);
666
1787
  }
667
1788
  function normalize(input, existing, path, luvio, store, timestamp) {
668
- const input_servicePlan = input.servicePlan;
669
- const input_servicePlan_id = path.fullPath + '__servicePlan';
670
- input.servicePlan = ingest$1(input_servicePlan, {
671
- fullPath: input_servicePlan_id,
672
- propertyName: 'servicePlan',
1789
+ const input_plan = input.plan;
1790
+ const input_plan_id = path.fullPath + '__plan';
1791
+ input.plan = ingest$1(input_plan, {
1792
+ fullPath: input_plan_id,
1793
+ propertyName: 'plan',
673
1794
  parent: {
674
1795
  data: input,
675
1796
  key: path.fullPath,
@@ -679,24 +1800,28 @@ function normalize(input, existing, path, luvio, store, timestamp) {
679
1800
  }, luvio, store, timestamp);
680
1801
  return input;
681
1802
  }
682
- const select$1 = function ServicePlanGenerationSyncOutputRepresentationSelect() {
1803
+ const select$1 = function ServicePlanDetailsOutputRepresentationSelect() {
683
1804
  return {
684
1805
  kind: 'Fragment',
685
1806
  version: VERSION,
686
1807
  private: [],
687
1808
  selections: [
688
1809
  {
689
- name: 'reason',
1810
+ name: 'plan',
1811
+ kind: 'Link',
1812
+ fragment: select$2()
1813
+ },
1814
+ {
1815
+ name: 'planRequestId',
690
1816
  kind: 'Scalar'
691
1817
  },
692
1818
  {
693
- name: 'reasonDetails',
1819
+ name: 'reason',
694
1820
  kind: 'Scalar'
695
1821
  },
696
1822
  {
697
- name: 'servicePlan',
698
- kind: 'Link',
699
- fragment: select$2()
1823
+ name: 'reasonDetails',
1824
+ kind: 'Scalar'
700
1825
  },
701
1826
  {
702
1827
  name: 'status',
@@ -706,29 +1831,34 @@ const select$1 = function ServicePlanGenerationSyncOutputRepresentationSelect()
706
1831
  };
707
1832
  };
708
1833
  function equals(existing, incoming) {
1834
+ const existing_planRequestId = existing.planRequestId;
1835
+ const incoming_planRequestId = incoming.planRequestId;
1836
+ if (!(existing_planRequestId === incoming_planRequestId)) {
1837
+ return false;
1838
+ }
709
1839
  const existing_reason = existing.reason;
710
1840
  const incoming_reason = incoming.reason;
711
1841
  if (!(existing_reason === incoming_reason)) {
712
1842
  return false;
713
1843
  }
714
- const existing_reasonDetails = existing.reasonDetails;
715
- const incoming_reasonDetails = incoming.reasonDetails;
716
- if (!(existing_reasonDetails === incoming_reasonDetails)) {
717
- return false;
718
- }
719
1844
  const existing_status = existing.status;
720
1845
  const incoming_status = incoming.status;
721
1846
  if (!(existing_status === incoming_status)) {
722
1847
  return false;
723
1848
  }
724
- const existing_servicePlan = existing.servicePlan;
725
- const incoming_servicePlan = incoming.servicePlan;
726
- if (!(existing_servicePlan.__ref === incoming_servicePlan.__ref)) {
1849
+ const existing_plan = existing.plan;
1850
+ const incoming_plan = incoming.plan;
1851
+ if (!(existing_plan.__ref === incoming_plan.__ref)) {
1852
+ return false;
1853
+ }
1854
+ const existing_reasonDetails = existing.reasonDetails;
1855
+ const incoming_reasonDetails = incoming.reasonDetails;
1856
+ if (!(existing_reasonDetails === incoming_reasonDetails)) {
727
1857
  return false;
728
1858
  }
729
1859
  return true;
730
1860
  }
731
- const ingest = function ServicePlanGenerationSyncOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1861
+ const ingest = function ServicePlanDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
732
1862
  if (process.env.NODE_ENV !== 'production') {
733
1863
  const validateError = validate(input);
734
1864
  if (validateError !== null) {
@@ -748,24 +1878,43 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
748
1878
  representationName: RepresentationType,
749
1879
  mergeable: false
750
1880
  });
751
- getTypeCacheKeys$1(rootKeySet, luvio, input.servicePlan, () => rootKey + "__" + "servicePlan");
1881
+ getTypeCacheKeys$1(rootKeySet, luvio, input.plan, () => rootKey + "__" + "plan");
752
1882
  }
1883
+ const notifyUpdateAvailableFactory = (luvio) => {
1884
+ return function notifyServicePlanDetailsUpdateAvailable(configs) {
1885
+ if (process.env.NODE_ENV !== 'production') {
1886
+ const requiredKeyParams = ['id'];
1887
+ configs.forEach(config => {
1888
+ if (false === requiredKeyParams.every(req => req in config)) {
1889
+ throw new Error(`one of the configs did not contain all required parameters: ${JSONStringify(ObjectKeys(config))}`);
1890
+ }
1891
+ });
1892
+ }
1893
+ const keys = configs.map(c => keyBuilder$2(luvio, c));
1894
+ return luvio.notifyStoreUpdateAvailable(keys);
1895
+ };
1896
+ };
753
1897
 
754
1898
  function select(luvio, params) {
755
1899
  return select$1();
756
1900
  }
1901
+ function keyBuilder$1(luvio, params) {
1902
+ return keyBuilder$2(luvio, {
1903
+ id: params.urlParams.recordId
1904
+ });
1905
+ }
757
1906
  function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
758
1907
  getTypeCacheKeys(storeKeyMap, luvio, response);
759
1908
  }
760
- function ingestSuccess(luvio, resourceParams, response) {
1909
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
761
1910
  const { body } = response;
762
- const key = keyBuilderFromType(luvio, body);
1911
+ const key = keyBuilder$1(luvio, resourceParams);
763
1912
  luvio.storeIngest(key, ingest, body);
764
1913
  const snapshot = luvio.storeLookup({
765
1914
  recordId: key,
766
1915
  node: select(),
767
1916
  variables: {},
768
- });
1917
+ }, snapshotRefresh);
769
1918
  if (process.env.NODE_ENV !== 'production') {
770
1919
  if (snapshot.state !== 'Fulfilled') {
771
1920
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -774,13 +1923,25 @@ function ingestSuccess(luvio, resourceParams, response) {
774
1923
  deepFreeze(snapshot.data);
775
1924
  return snapshot;
776
1925
  }
1926
+ function ingestError(luvio, params, error, snapshotRefresh) {
1927
+ const key = keyBuilder$1(luvio, params);
1928
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1929
+ const storeMetadataParams = {
1930
+ ttl: TTL,
1931
+ namespace: keyPrefix,
1932
+ version: VERSION,
1933
+ representationName: RepresentationType
1934
+ };
1935
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1936
+ return errorSnapshot;
1937
+ }
777
1938
  function createResourceRequest(config) {
778
1939
  const headers = {};
779
1940
  return {
780
1941
  baseUri: '/services/data/v62.0',
781
- basePath: '/connect/service-plan/generateSync/' + config.urlParams.recordId + '',
782
- method: 'post',
783
- body: config.body,
1942
+ basePath: '/connect/service-plan/servicePlanDetails/' + config.urlParams.recordId + '',
1943
+ method: 'get',
1944
+ body: null,
784
1945
  urlParams: config.urlParams,
785
1946
  queryParams: {},
786
1947
  headers,
@@ -788,35 +1949,19 @@ function createResourceRequest(config) {
788
1949
  };
789
1950
  }
790
1951
 
791
- const adapterName = 'generateSync';
792
- const generateSync_ConfigPropertyMetadata = [
1952
+ const adapterName = 'getServicePlan';
1953
+ const getServicePlan_ConfigPropertyMetadata = [
793
1954
  generateParamConfigMetadata('recordId', true, 0 /* UrlParameter */, 0 /* String */),
794
- generateParamConfigMetadata('additionalContext', true, 2 /* Body */, 4 /* Unsupported */),
795
- generateParamConfigMetadata('mode', true, 2 /* Body */, 0 /* String */),
796
- generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
797
1955
  ];
798
- const generateSync_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, generateSync_ConfigPropertyMetadata);
799
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(generateSync_ConfigPropertyMetadata);
1956
+ const getServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getServicePlan_ConfigPropertyMetadata);
1957
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(getServicePlan_ConfigPropertyMetadata);
1958
+ function keyBuilder(luvio, config) {
1959
+ const resourceParams = createResourceParams(config);
1960
+ return keyBuilder$1(luvio, resourceParams);
1961
+ }
800
1962
  function typeCheckConfig(untrustedConfig) {
801
1963
  const config = {};
802
- typeCheckConfig$2(untrustedConfig, config, generateSync_ConfigPropertyMetadata);
803
- const untrustedConfig_additionalContext = untrustedConfig.additionalContext;
804
- if (untrustedIsObject(untrustedConfig_additionalContext)) {
805
- const untrustedConfig_additionalContext_object = {};
806
- const untrustedConfig_additionalContext_keys = Object.keys(untrustedConfig_additionalContext);
807
- for (let i = 0, arrayLength = untrustedConfig_additionalContext_keys.length; i < arrayLength; i++) {
808
- const key = untrustedConfig_additionalContext_keys[i];
809
- const untrustedConfig_additionalContext_prop = untrustedConfig_additionalContext[key];
810
- if (typeof untrustedConfig_additionalContext_prop === 'string') {
811
- if (untrustedConfig_additionalContext_object !== undefined) {
812
- untrustedConfig_additionalContext_object[key] = untrustedConfig_additionalContext_prop;
813
- }
814
- }
815
- }
816
- if (untrustedConfig_additionalContext_object !== undefined && Object.keys(untrustedConfig_additionalContext_object).length >= 0) {
817
- config.additionalContext = untrustedConfig_additionalContext_object;
818
- }
819
- }
1964
+ typeCheckConfig$4(untrustedConfig, config, getServicePlan_ConfigPropertyMetadata);
820
1965
  return config;
821
1966
  }
822
1967
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -832,33 +1977,62 @@ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
832
1977
  }
833
1978
  return config;
834
1979
  }
1980
+ function adapterFragment(luvio, config) {
1981
+ createResourceParams(config);
1982
+ return select();
1983
+ }
1984
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1985
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1986
+ config,
1987
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1988
+ });
1989
+ return luvio.storeBroadcast().then(() => snapshot);
1990
+ }
1991
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1992
+ const snapshot = ingestError(luvio, resourceParams, response, {
1993
+ config,
1994
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1995
+ });
1996
+ return luvio.storeBroadcast().then(() => snapshot);
1997
+ }
835
1998
  function buildNetworkSnapshot(luvio, config, options) {
836
1999
  const resourceParams = createResourceParams(config);
837
2000
  const request = createResourceRequest(resourceParams);
838
2001
  return luvio.dispatchResourceRequest(request, options)
839
2002
  .then((response) => {
840
- return luvio.handleSuccessResponse(() => {
841
- const snapshot = ingestSuccess(luvio, resourceParams, response);
842
- return luvio.storeBroadcast().then(() => snapshot);
843
- }, () => {
2003
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
844
2004
  const cache = new StoreKeyMap();
845
2005
  getResponseCacheKeys(cache, luvio, resourceParams, response.body);
846
2006
  return cache;
847
2007
  });
848
2008
  }, (response) => {
849
- deepFreeze(response);
850
- throw response;
2009
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
851
2010
  });
852
2011
  }
853
- const generateSyncAdapterFactory = (luvio) => {
854
- return function generateSync(untrustedConfig) {
855
- const config = validateAdapterConfig(untrustedConfig, generateSync_ConfigPropertyNames);
856
- // Invalid or incomplete config
857
- if (config === null) {
858
- throw new Error('Invalid config for "generateSync"');
859
- }
860
- return buildNetworkSnapshot(luvio, config);
2012
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2013
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2014
+ }
2015
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2016
+ const { luvio, config } = context;
2017
+ const selector = {
2018
+ recordId: keyBuilder(luvio, config),
2019
+ node: adapterFragment(luvio, config),
2020
+ variables: {},
861
2021
  };
2022
+ const cacheSnapshot = storeLookup(selector, {
2023
+ config,
2024
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2025
+ });
2026
+ return cacheSnapshot;
2027
+ }
2028
+ const getServicePlanAdapterFactory = (luvio) => function ServicePlan__getServicePlan(untrustedConfig, requestContext) {
2029
+ const config = validateAdapterConfig(untrustedConfig, getServicePlan_ConfigPropertyNames);
2030
+ // Invalid or incomplete config
2031
+ if (config === null) {
2032
+ return null;
2033
+ }
2034
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2035
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
862
2036
  };
863
2037
 
864
- export { executeServicePlanAdapterFactory, generateSyncAdapterFactory };
2038
+ export { executeServicePlanAdapterFactory, generateServicePlanAdapterFactory, getGenerationRequestAdapterFactory, getServicePlanAdapterFactory, notifyUpdateAvailableFactory as notifyServicePlanDetailsUpdateAvailableFactory, notifyUpdateAvailableFactory$1 as notifyServicePlanGenerationUpdateAvailableFactory };