@salesforce/lds-adapters-platform-interaction-orchestrator 0.1.0-dev1

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 (21) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-interaction-orchestrator.js +1548 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getOrchestrationInstance.d.ts +27 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getOrchestrationInstanceCollection.d.ts +28 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -0
  8. package/dist/es/es2018/types/src/generated/resources/getConnectInteractionOrchestrationInstanceDetail.d.ts +15 -0
  9. package/dist/es/es2018/types/src/generated/resources/getConnectInteractionOrchestrationInstances.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationInstanceCollectionRepresentation.d.ts +30 -0
  11. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationInstanceRepresentation.d.ts +48 -0
  12. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationStageInstanceRepresentation.d.ts +44 -0
  13. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationStepInstanceRepresentation.d.ts +62 -0
  14. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationWorkAssignmentRepresentation.d.ts +25 -0
  15. package/dist/es/es2018/types/src/generated/types/FlowOrchestrationWorkItemRepresentation.d.ts +61 -0
  16. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  17. package/package.json +72 -0
  18. package/sfdc/index.d.ts +1 -0
  19. package/sfdc/index.js +1598 -0
  20. package/src/raml/api.raml +244 -0
  21. package/src/raml/luvio.raml +29 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,1598 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /*
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'InteractionOrchestrator';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ function equalsArray(a, b, equalsItem) {
86
+ const aLength = a.length;
87
+ const bLength = b.length;
88
+ if (aLength !== bLength) {
89
+ return false;
90
+ }
91
+ for (let i = 0; i < aLength; i++) {
92
+ if (equalsItem(a[i], b[i]) === false) {
93
+ return false;
94
+ }
95
+ }
96
+ return true;
97
+ }
98
+ function createLink(ref) {
99
+ return {
100
+ __ref: serializeStructuredKey(ref),
101
+ };
102
+ }
103
+
104
+ const VERSION$4 = "b69d8daaed2eb1f7100d21944f59f208";
105
+ function validate$4(obj, path = 'FlowOrchestrationWorkItemRepresentation') {
106
+ const v_error = (() => {
107
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
108
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
109
+ }
110
+ const obj_assigneeId = obj.assigneeId;
111
+ const path_assigneeId = path + '.assigneeId';
112
+ if (typeof obj_assigneeId !== 'string') {
113
+ return new TypeError('Expected "string" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
114
+ }
115
+ const obj_createdDate = obj.createdDate;
116
+ const path_createdDate = path + '.createdDate';
117
+ if (typeof obj_createdDate !== 'string') {
118
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
119
+ }
120
+ const obj_description = obj.description;
121
+ const path_description = path + '.description';
122
+ let obj_description_union0 = null;
123
+ const obj_description_union0_error = (() => {
124
+ if (typeof obj_description !== 'string') {
125
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
126
+ }
127
+ })();
128
+ if (obj_description_union0_error != null) {
129
+ obj_description_union0 = obj_description_union0_error.message;
130
+ }
131
+ let obj_description_union1 = null;
132
+ const obj_description_union1_error = (() => {
133
+ if (obj_description !== null) {
134
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
135
+ }
136
+ })();
137
+ if (obj_description_union1_error != null) {
138
+ obj_description_union1 = obj_description_union1_error.message;
139
+ }
140
+ if (obj_description_union0 && obj_description_union1) {
141
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
142
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
143
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
144
+ return new TypeError(message);
145
+ }
146
+ const obj_flowType = obj.flowType;
147
+ const path_flowType = path + '.flowType';
148
+ let obj_flowType_union0 = null;
149
+ const obj_flowType_union0_error = (() => {
150
+ if (typeof obj_flowType !== 'string') {
151
+ return new TypeError('Expected "string" but received "' + typeof obj_flowType + '" (at "' + path_flowType + '")');
152
+ }
153
+ })();
154
+ if (obj_flowType_union0_error != null) {
155
+ obj_flowType_union0 = obj_flowType_union0_error.message;
156
+ }
157
+ let obj_flowType_union1 = null;
158
+ const obj_flowType_union1_error = (() => {
159
+ if (obj_flowType !== null) {
160
+ return new TypeError('Expected "null" but received "' + typeof obj_flowType + '" (at "' + path_flowType + '")');
161
+ }
162
+ })();
163
+ if (obj_flowType_union1_error != null) {
164
+ obj_flowType_union1 = obj_flowType_union1_error.message;
165
+ }
166
+ if (obj_flowType_union0 && obj_flowType_union1) {
167
+ let message = 'Object doesn\'t match union (at "' + path_flowType + '")';
168
+ message += '\n' + obj_flowType_union0.split('\n').map((line) => '\t' + line).join('\n');
169
+ message += '\n' + obj_flowType_union1.split('\n').map((line) => '\t' + line).join('\n');
170
+ return new TypeError(message);
171
+ }
172
+ const obj_id = obj.id;
173
+ const path_id = path + '.id';
174
+ if (typeof obj_id !== 'string') {
175
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
176
+ }
177
+ const obj_label = obj.label;
178
+ const path_label = path + '.label';
179
+ let obj_label_union0 = null;
180
+ const obj_label_union0_error = (() => {
181
+ if (typeof obj_label !== 'string') {
182
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
183
+ }
184
+ })();
185
+ if (obj_label_union0_error != null) {
186
+ obj_label_union0 = obj_label_union0_error.message;
187
+ }
188
+ let obj_label_union1 = null;
189
+ const obj_label_union1_error = (() => {
190
+ if (obj_label !== null) {
191
+ return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
192
+ }
193
+ })();
194
+ if (obj_label_union1_error != null) {
195
+ obj_label_union1 = obj_label_union1_error.message;
196
+ }
197
+ if (obj_label_union0 && obj_label_union1) {
198
+ let message = 'Object doesn\'t match union (at "' + path_label + '")';
199
+ message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
200
+ message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
201
+ return new TypeError(message);
202
+ }
203
+ const obj_lastModifiedDate = obj.lastModifiedDate;
204
+ const path_lastModifiedDate = path + '.lastModifiedDate';
205
+ if (typeof obj_lastModifiedDate !== 'string') {
206
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
207
+ }
208
+ const obj_relatedRecordId = obj.relatedRecordId;
209
+ const path_relatedRecordId = path + '.relatedRecordId';
210
+ let obj_relatedRecordId_union0 = null;
211
+ const obj_relatedRecordId_union0_error = (() => {
212
+ if (typeof obj_relatedRecordId !== 'string') {
213
+ return new TypeError('Expected "string" but received "' + typeof obj_relatedRecordId + '" (at "' + path_relatedRecordId + '")');
214
+ }
215
+ })();
216
+ if (obj_relatedRecordId_union0_error != null) {
217
+ obj_relatedRecordId_union0 = obj_relatedRecordId_union0_error.message;
218
+ }
219
+ let obj_relatedRecordId_union1 = null;
220
+ const obj_relatedRecordId_union1_error = (() => {
221
+ if (obj_relatedRecordId !== null) {
222
+ return new TypeError('Expected "null" but received "' + typeof obj_relatedRecordId + '" (at "' + path_relatedRecordId + '")');
223
+ }
224
+ })();
225
+ if (obj_relatedRecordId_union1_error != null) {
226
+ obj_relatedRecordId_union1 = obj_relatedRecordId_union1_error.message;
227
+ }
228
+ if (obj_relatedRecordId_union0 && obj_relatedRecordId_union1) {
229
+ let message = 'Object doesn\'t match union (at "' + path_relatedRecordId + '")';
230
+ message += '\n' + obj_relatedRecordId_union0.split('\n').map((line) => '\t' + line).join('\n');
231
+ message += '\n' + obj_relatedRecordId_union1.split('\n').map((line) => '\t' + line).join('\n');
232
+ return new TypeError(message);
233
+ }
234
+ const obj_screenFlowDeveloperName = obj.screenFlowDeveloperName;
235
+ const path_screenFlowDeveloperName = path + '.screenFlowDeveloperName';
236
+ if (typeof obj_screenFlowDeveloperName !== 'string') {
237
+ return new TypeError('Expected "string" but received "' + typeof obj_screenFlowDeveloperName + '" (at "' + path_screenFlowDeveloperName + '")');
238
+ }
239
+ const obj_screenFlowId = obj.screenFlowId;
240
+ const path_screenFlowId = path + '.screenFlowId';
241
+ if (typeof obj_screenFlowId !== 'string') {
242
+ return new TypeError('Expected "string" but received "' + typeof obj_screenFlowId + '" (at "' + path_screenFlowId + '")');
243
+ }
244
+ const obj_screenFlowInputs = obj.screenFlowInputs;
245
+ const path_screenFlowInputs = path + '.screenFlowInputs';
246
+ if (typeof obj_screenFlowInputs !== 'string') {
247
+ return new TypeError('Expected "string" but received "' + typeof obj_screenFlowInputs + '" (at "' + path_screenFlowInputs + '")');
248
+ }
249
+ const obj_status = obj.status;
250
+ const path_status = path + '.status';
251
+ if (typeof obj_status !== 'string') {
252
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
253
+ }
254
+ })();
255
+ return v_error === undefined ? null : v_error;
256
+ }
257
+ const select$6 = function FlowOrchestrationWorkItemRepresentationSelect() {
258
+ return {
259
+ kind: 'Fragment',
260
+ version: VERSION$4,
261
+ private: [],
262
+ selections: [
263
+ {
264
+ name: 'assigneeId',
265
+ kind: 'Scalar'
266
+ },
267
+ {
268
+ name: 'createdDate',
269
+ kind: 'Scalar'
270
+ },
271
+ {
272
+ name: 'description',
273
+ kind: 'Scalar'
274
+ },
275
+ {
276
+ name: 'flowType',
277
+ kind: 'Scalar'
278
+ },
279
+ {
280
+ name: 'id',
281
+ kind: 'Scalar'
282
+ },
283
+ {
284
+ name: 'label',
285
+ kind: 'Scalar'
286
+ },
287
+ {
288
+ name: 'lastModifiedDate',
289
+ kind: 'Scalar'
290
+ },
291
+ {
292
+ name: 'relatedRecordId',
293
+ kind: 'Scalar'
294
+ },
295
+ {
296
+ name: 'screenFlowDeveloperName',
297
+ kind: 'Scalar'
298
+ },
299
+ {
300
+ name: 'screenFlowId',
301
+ kind: 'Scalar'
302
+ },
303
+ {
304
+ name: 'screenFlowInputs',
305
+ kind: 'Scalar'
306
+ },
307
+ {
308
+ name: 'status',
309
+ kind: 'Scalar'
310
+ }
311
+ ]
312
+ };
313
+ };
314
+ function equals$4(existing, incoming) {
315
+ const existing_assigneeId = existing.assigneeId;
316
+ const incoming_assigneeId = incoming.assigneeId;
317
+ if (!(existing_assigneeId === incoming_assigneeId)) {
318
+ return false;
319
+ }
320
+ const existing_createdDate = existing.createdDate;
321
+ const incoming_createdDate = incoming.createdDate;
322
+ if (!(existing_createdDate === incoming_createdDate)) {
323
+ return false;
324
+ }
325
+ const existing_id = existing.id;
326
+ const incoming_id = incoming.id;
327
+ if (!(existing_id === incoming_id)) {
328
+ return false;
329
+ }
330
+ const existing_lastModifiedDate = existing.lastModifiedDate;
331
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
332
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
333
+ return false;
334
+ }
335
+ const existing_screenFlowDeveloperName = existing.screenFlowDeveloperName;
336
+ const incoming_screenFlowDeveloperName = incoming.screenFlowDeveloperName;
337
+ if (!(existing_screenFlowDeveloperName === incoming_screenFlowDeveloperName)) {
338
+ return false;
339
+ }
340
+ const existing_screenFlowId = existing.screenFlowId;
341
+ const incoming_screenFlowId = incoming.screenFlowId;
342
+ if (!(existing_screenFlowId === incoming_screenFlowId)) {
343
+ return false;
344
+ }
345
+ const existing_screenFlowInputs = existing.screenFlowInputs;
346
+ const incoming_screenFlowInputs = incoming.screenFlowInputs;
347
+ if (!(existing_screenFlowInputs === incoming_screenFlowInputs)) {
348
+ return false;
349
+ }
350
+ const existing_status = existing.status;
351
+ const incoming_status = incoming.status;
352
+ if (!(existing_status === incoming_status)) {
353
+ return false;
354
+ }
355
+ const existing_description = existing.description;
356
+ const incoming_description = incoming.description;
357
+ if (!(existing_description === incoming_description)) {
358
+ return false;
359
+ }
360
+ const existing_flowType = existing.flowType;
361
+ const incoming_flowType = incoming.flowType;
362
+ if (!(existing_flowType === incoming_flowType)) {
363
+ return false;
364
+ }
365
+ const existing_label = existing.label;
366
+ const incoming_label = incoming.label;
367
+ if (!(existing_label === incoming_label)) {
368
+ return false;
369
+ }
370
+ const existing_relatedRecordId = existing.relatedRecordId;
371
+ const incoming_relatedRecordId = incoming.relatedRecordId;
372
+ if (!(existing_relatedRecordId === incoming_relatedRecordId)) {
373
+ return false;
374
+ }
375
+ return true;
376
+ }
377
+
378
+ const VERSION$3 = "6d8faa2a100e935ff20990303f8da309";
379
+ function validate$3(obj, path = 'FlowOrchestrationStepInstanceRepresentation') {
380
+ const v_error = (() => {
381
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
382
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
383
+ }
384
+ const obj_assignedTo = obj.assignedTo;
385
+ const path_assignedTo = path + '.assignedTo';
386
+ let obj_assignedTo_union0 = null;
387
+ const obj_assignedTo_union0_error = (() => {
388
+ if (typeof obj_assignedTo !== 'string') {
389
+ return new TypeError('Expected "string" but received "' + typeof obj_assignedTo + '" (at "' + path_assignedTo + '")');
390
+ }
391
+ })();
392
+ if (obj_assignedTo_union0_error != null) {
393
+ obj_assignedTo_union0 = obj_assignedTo_union0_error.message;
394
+ }
395
+ let obj_assignedTo_union1 = null;
396
+ const obj_assignedTo_union1_error = (() => {
397
+ if (obj_assignedTo !== null) {
398
+ return new TypeError('Expected "null" but received "' + typeof obj_assignedTo + '" (at "' + path_assignedTo + '")');
399
+ }
400
+ })();
401
+ if (obj_assignedTo_union1_error != null) {
402
+ obj_assignedTo_union1 = obj_assignedTo_union1_error.message;
403
+ }
404
+ if (obj_assignedTo_union0 && obj_assignedTo_union1) {
405
+ let message = 'Object doesn\'t match union (at "' + path_assignedTo + '")';
406
+ message += '\n' + obj_assignedTo_union0.split('\n').map((line) => '\t' + line).join('\n');
407
+ message += '\n' + obj_assignedTo_union1.split('\n').map((line) => '\t' + line).join('\n');
408
+ return new TypeError(message);
409
+ }
410
+ const obj_assigneeType = obj.assigneeType;
411
+ const path_assigneeType = path + '.assigneeType';
412
+ let obj_assigneeType_union0 = null;
413
+ const obj_assigneeType_union0_error = (() => {
414
+ if (typeof obj_assigneeType !== 'string') {
415
+ return new TypeError('Expected "string" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
416
+ }
417
+ })();
418
+ if (obj_assigneeType_union0_error != null) {
419
+ obj_assigneeType_union0 = obj_assigneeType_union0_error.message;
420
+ }
421
+ let obj_assigneeType_union1 = null;
422
+ const obj_assigneeType_union1_error = (() => {
423
+ if (obj_assigneeType !== null) {
424
+ return new TypeError('Expected "null" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
425
+ }
426
+ })();
427
+ if (obj_assigneeType_union1_error != null) {
428
+ obj_assigneeType_union1 = obj_assigneeType_union1_error.message;
429
+ }
430
+ if (obj_assigneeType_union0 && obj_assigneeType_union1) {
431
+ let message = 'Object doesn\'t match union (at "' + path_assigneeType + '")';
432
+ message += '\n' + obj_assigneeType_union0.split('\n').map((line) => '\t' + line).join('\n');
433
+ message += '\n' + obj_assigneeType_union1.split('\n').map((line) => '\t' + line).join('\n');
434
+ return new TypeError(message);
435
+ }
436
+ const obj_comments = obj.comments;
437
+ const path_comments = path + '.comments';
438
+ let obj_comments_union0 = null;
439
+ const obj_comments_union0_error = (() => {
440
+ if (typeof obj_comments !== 'string') {
441
+ return new TypeError('Expected "string" but received "' + typeof obj_comments + '" (at "' + path_comments + '")');
442
+ }
443
+ })();
444
+ if (obj_comments_union0_error != null) {
445
+ obj_comments_union0 = obj_comments_union0_error.message;
446
+ }
447
+ let obj_comments_union1 = null;
448
+ const obj_comments_union1_error = (() => {
449
+ if (obj_comments !== null) {
450
+ return new TypeError('Expected "null" but received "' + typeof obj_comments + '" (at "' + path_comments + '")');
451
+ }
452
+ })();
453
+ if (obj_comments_union1_error != null) {
454
+ obj_comments_union1 = obj_comments_union1_error.message;
455
+ }
456
+ if (obj_comments_union0 && obj_comments_union1) {
457
+ let message = 'Object doesn\'t match union (at "' + path_comments + '")';
458
+ message += '\n' + obj_comments_union0.split('\n').map((line) => '\t' + line).join('\n');
459
+ message += '\n' + obj_comments_union1.split('\n').map((line) => '\t' + line).join('\n');
460
+ return new TypeError(message);
461
+ }
462
+ const obj_completedBy = obj.completedBy;
463
+ const path_completedBy = path + '.completedBy';
464
+ let obj_completedBy_union0 = null;
465
+ const obj_completedBy_union0_error = (() => {
466
+ if (typeof obj_completedBy !== 'string') {
467
+ return new TypeError('Expected "string" but received "' + typeof obj_completedBy + '" (at "' + path_completedBy + '")');
468
+ }
469
+ })();
470
+ if (obj_completedBy_union0_error != null) {
471
+ obj_completedBy_union0 = obj_completedBy_union0_error.message;
472
+ }
473
+ let obj_completedBy_union1 = null;
474
+ const obj_completedBy_union1_error = (() => {
475
+ if (obj_completedBy !== null) {
476
+ return new TypeError('Expected "null" but received "' + typeof obj_completedBy + '" (at "' + path_completedBy + '")');
477
+ }
478
+ })();
479
+ if (obj_completedBy_union1_error != null) {
480
+ obj_completedBy_union1 = obj_completedBy_union1_error.message;
481
+ }
482
+ if (obj_completedBy_union0 && obj_completedBy_union1) {
483
+ let message = 'Object doesn\'t match union (at "' + path_completedBy + '")';
484
+ message += '\n' + obj_completedBy_union0.split('\n').map((line) => '\t' + line).join('\n');
485
+ message += '\n' + obj_completedBy_union1.split('\n').map((line) => '\t' + line).join('\n');
486
+ return new TypeError(message);
487
+ }
488
+ const obj_completionTime = obj.completionTime;
489
+ const path_completionTime = path + '.completionTime';
490
+ let obj_completionTime_union0 = null;
491
+ const obj_completionTime_union0_error = (() => {
492
+ if (typeof obj_completionTime !== 'string') {
493
+ return new TypeError('Expected "string" but received "' + typeof obj_completionTime + '" (at "' + path_completionTime + '")');
494
+ }
495
+ })();
496
+ if (obj_completionTime_union0_error != null) {
497
+ obj_completionTime_union0 = obj_completionTime_union0_error.message;
498
+ }
499
+ let obj_completionTime_union1 = null;
500
+ const obj_completionTime_union1_error = (() => {
501
+ if (obj_completionTime !== null) {
502
+ return new TypeError('Expected "null" but received "' + typeof obj_completionTime + '" (at "' + path_completionTime + '")');
503
+ }
504
+ })();
505
+ if (obj_completionTime_union1_error != null) {
506
+ obj_completionTime_union1 = obj_completionTime_union1_error.message;
507
+ }
508
+ if (obj_completionTime_union0 && obj_completionTime_union1) {
509
+ let message = 'Object doesn\'t match union (at "' + path_completionTime + '")';
510
+ message += '\n' + obj_completionTime_union0.split('\n').map((line) => '\t' + line).join('\n');
511
+ message += '\n' + obj_completionTime_union1.split('\n').map((line) => '\t' + line).join('\n');
512
+ return new TypeError(message);
513
+ }
514
+ const obj_description = obj.description;
515
+ const path_description = path + '.description';
516
+ let obj_description_union0 = null;
517
+ const obj_description_union0_error = (() => {
518
+ if (typeof obj_description !== 'string') {
519
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
520
+ }
521
+ })();
522
+ if (obj_description_union0_error != null) {
523
+ obj_description_union0 = obj_description_union0_error.message;
524
+ }
525
+ let obj_description_union1 = null;
526
+ const obj_description_union1_error = (() => {
527
+ if (obj_description !== null) {
528
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
529
+ }
530
+ })();
531
+ if (obj_description_union1_error != null) {
532
+ obj_description_union1 = obj_description_union1_error.message;
533
+ }
534
+ if (obj_description_union0 && obj_description_union1) {
535
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
536
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
537
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
538
+ return new TypeError(message);
539
+ }
540
+ const obj_id = obj.id;
541
+ const path_id = path + '.id';
542
+ if (typeof obj_id !== 'string') {
543
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
544
+ }
545
+ const obj_label = obj.label;
546
+ const path_label = path + '.label';
547
+ let obj_label_union0 = null;
548
+ const obj_label_union0_error = (() => {
549
+ if (typeof obj_label !== 'string') {
550
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
551
+ }
552
+ })();
553
+ if (obj_label_union0_error != null) {
554
+ obj_label_union0 = obj_label_union0_error.message;
555
+ }
556
+ let obj_label_union1 = null;
557
+ const obj_label_union1_error = (() => {
558
+ if (obj_label !== null) {
559
+ return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
560
+ }
561
+ })();
562
+ if (obj_label_union1_error != null) {
563
+ obj_label_union1 = obj_label_union1_error.message;
564
+ }
565
+ if (obj_label_union0 && obj_label_union1) {
566
+ let message = 'Object doesn\'t match union (at "' + path_label + '")';
567
+ message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
568
+ message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
569
+ return new TypeError(message);
570
+ }
571
+ const obj_name = obj.name;
572
+ const path_name = path + '.name';
573
+ let obj_name_union0 = null;
574
+ const obj_name_union0_error = (() => {
575
+ if (typeof obj_name !== 'string') {
576
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
577
+ }
578
+ })();
579
+ if (obj_name_union0_error != null) {
580
+ obj_name_union0 = obj_name_union0_error.message;
581
+ }
582
+ let obj_name_union1 = null;
583
+ const obj_name_union1_error = (() => {
584
+ if (obj_name !== null) {
585
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
586
+ }
587
+ })();
588
+ if (obj_name_union1_error != null) {
589
+ obj_name_union1 = obj_name_union1_error.message;
590
+ }
591
+ if (obj_name_union0 && obj_name_union1) {
592
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
593
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
594
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
595
+ return new TypeError(message);
596
+ }
597
+ const obj_status = obj.status;
598
+ const path_status = path + '.status';
599
+ if (typeof obj_status !== 'string') {
600
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
601
+ }
602
+ const obj_stepType = obj.stepType;
603
+ const path_stepType = path + '.stepType';
604
+ if (typeof obj_stepType !== 'string') {
605
+ return new TypeError('Expected "string" but received "' + typeof obj_stepType + '" (at "' + path_stepType + '")');
606
+ }
607
+ const obj_workItems = obj.workItems;
608
+ const path_workItems = path + '.workItems';
609
+ if (!ArrayIsArray(obj_workItems)) {
610
+ return new TypeError('Expected "array" but received "' + typeof obj_workItems + '" (at "' + path_workItems + '")');
611
+ }
612
+ for (let i = 0; i < obj_workItems.length; i++) {
613
+ const obj_workItems_item = obj_workItems[i];
614
+ const path_workItems_item = path_workItems + '[' + i + ']';
615
+ const referencepath_workItems_itemValidationError = validate$4(obj_workItems_item, path_workItems_item);
616
+ if (referencepath_workItems_itemValidationError !== null) {
617
+ let message = 'Object doesn\'t match FlowOrchestrationWorkItemRepresentation (at "' + path_workItems_item + '")\n';
618
+ message += referencepath_workItems_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
619
+ return new TypeError(message);
620
+ }
621
+ }
622
+ })();
623
+ return v_error === undefined ? null : v_error;
624
+ }
625
+ const select$5 = function FlowOrchestrationStepInstanceRepresentationSelect() {
626
+ const { selections: FlowOrchestrationWorkItemRepresentation__selections, opaque: FlowOrchestrationWorkItemRepresentation__opaque, } = select$6();
627
+ return {
628
+ kind: 'Fragment',
629
+ version: VERSION$3,
630
+ private: [],
631
+ selections: [
632
+ {
633
+ name: 'assignedTo',
634
+ kind: 'Scalar'
635
+ },
636
+ {
637
+ name: 'assigneeType',
638
+ kind: 'Scalar'
639
+ },
640
+ {
641
+ name: 'comments',
642
+ kind: 'Scalar'
643
+ },
644
+ {
645
+ name: 'completedBy',
646
+ kind: 'Scalar'
647
+ },
648
+ {
649
+ name: 'completionTime',
650
+ kind: 'Scalar'
651
+ },
652
+ {
653
+ name: 'description',
654
+ kind: 'Scalar'
655
+ },
656
+ {
657
+ name: 'id',
658
+ kind: 'Scalar'
659
+ },
660
+ {
661
+ name: 'label',
662
+ kind: 'Scalar'
663
+ },
664
+ {
665
+ name: 'name',
666
+ kind: 'Scalar'
667
+ },
668
+ {
669
+ name: 'status',
670
+ kind: 'Scalar'
671
+ },
672
+ {
673
+ name: 'stepType',
674
+ kind: 'Scalar'
675
+ },
676
+ {
677
+ name: 'workItems',
678
+ kind: 'Object',
679
+ plural: true,
680
+ selections: FlowOrchestrationWorkItemRepresentation__selections
681
+ }
682
+ ]
683
+ };
684
+ };
685
+ function equals$3(existing, incoming) {
686
+ const existing_id = existing.id;
687
+ const incoming_id = incoming.id;
688
+ if (!(existing_id === incoming_id)) {
689
+ return false;
690
+ }
691
+ const existing_status = existing.status;
692
+ const incoming_status = incoming.status;
693
+ if (!(existing_status === incoming_status)) {
694
+ return false;
695
+ }
696
+ const existing_stepType = existing.stepType;
697
+ const incoming_stepType = incoming.stepType;
698
+ if (!(existing_stepType === incoming_stepType)) {
699
+ return false;
700
+ }
701
+ const existing_assignedTo = existing.assignedTo;
702
+ const incoming_assignedTo = incoming.assignedTo;
703
+ if (!(existing_assignedTo === incoming_assignedTo)) {
704
+ return false;
705
+ }
706
+ const existing_assigneeType = existing.assigneeType;
707
+ const incoming_assigneeType = incoming.assigneeType;
708
+ if (!(existing_assigneeType === incoming_assigneeType)) {
709
+ return false;
710
+ }
711
+ const existing_comments = existing.comments;
712
+ const incoming_comments = incoming.comments;
713
+ if (!(existing_comments === incoming_comments)) {
714
+ return false;
715
+ }
716
+ const existing_completedBy = existing.completedBy;
717
+ const incoming_completedBy = incoming.completedBy;
718
+ if (!(existing_completedBy === incoming_completedBy)) {
719
+ return false;
720
+ }
721
+ const existing_completionTime = existing.completionTime;
722
+ const incoming_completionTime = incoming.completionTime;
723
+ if (!(existing_completionTime === incoming_completionTime)) {
724
+ return false;
725
+ }
726
+ const existing_description = existing.description;
727
+ const incoming_description = incoming.description;
728
+ if (!(existing_description === incoming_description)) {
729
+ return false;
730
+ }
731
+ const existing_label = existing.label;
732
+ const incoming_label = incoming.label;
733
+ if (!(existing_label === incoming_label)) {
734
+ return false;
735
+ }
736
+ const existing_name = existing.name;
737
+ const incoming_name = incoming.name;
738
+ if (!(existing_name === incoming_name)) {
739
+ return false;
740
+ }
741
+ const existing_workItems = existing.workItems;
742
+ const incoming_workItems = incoming.workItems;
743
+ const equals_workItems_items = equalsArray(existing_workItems, incoming_workItems, (existing_workItems_item, incoming_workItems_item) => {
744
+ if (!(equals$4(existing_workItems_item, incoming_workItems_item))) {
745
+ return false;
746
+ }
747
+ });
748
+ if (equals_workItems_items === false) {
749
+ return false;
750
+ }
751
+ return true;
752
+ }
753
+
754
+ const VERSION$2 = "34c2ae0baf31e5cef069324398009d09";
755
+ function validate$2(obj, path = 'FlowOrchestrationStageInstanceRepresentation') {
756
+ const v_error = (() => {
757
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
758
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
759
+ }
760
+ const obj_completionTime = obj.completionTime;
761
+ const path_completionTime = path + '.completionTime';
762
+ let obj_completionTime_union0 = null;
763
+ const obj_completionTime_union0_error = (() => {
764
+ if (typeof obj_completionTime !== 'string') {
765
+ return new TypeError('Expected "string" but received "' + typeof obj_completionTime + '" (at "' + path_completionTime + '")');
766
+ }
767
+ })();
768
+ if (obj_completionTime_union0_error != null) {
769
+ obj_completionTime_union0 = obj_completionTime_union0_error.message;
770
+ }
771
+ let obj_completionTime_union1 = null;
772
+ const obj_completionTime_union1_error = (() => {
773
+ if (obj_completionTime !== null) {
774
+ return new TypeError('Expected "null" but received "' + typeof obj_completionTime + '" (at "' + path_completionTime + '")');
775
+ }
776
+ })();
777
+ if (obj_completionTime_union1_error != null) {
778
+ obj_completionTime_union1 = obj_completionTime_union1_error.message;
779
+ }
780
+ if (obj_completionTime_union0 && obj_completionTime_union1) {
781
+ let message = 'Object doesn\'t match union (at "' + path_completionTime + '")';
782
+ message += '\n' + obj_completionTime_union0.split('\n').map((line) => '\t' + line).join('\n');
783
+ message += '\n' + obj_completionTime_union1.split('\n').map((line) => '\t' + line).join('\n');
784
+ return new TypeError(message);
785
+ }
786
+ const obj_id = obj.id;
787
+ const path_id = path + '.id';
788
+ if (typeof obj_id !== 'string') {
789
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
790
+ }
791
+ const obj_label = obj.label;
792
+ const path_label = path + '.label';
793
+ let obj_label_union0 = null;
794
+ const obj_label_union0_error = (() => {
795
+ if (typeof obj_label !== 'string') {
796
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
797
+ }
798
+ })();
799
+ if (obj_label_union0_error != null) {
800
+ obj_label_union0 = obj_label_union0_error.message;
801
+ }
802
+ let obj_label_union1 = null;
803
+ const obj_label_union1_error = (() => {
804
+ if (obj_label !== null) {
805
+ return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
806
+ }
807
+ })();
808
+ if (obj_label_union1_error != null) {
809
+ obj_label_union1 = obj_label_union1_error.message;
810
+ }
811
+ if (obj_label_union0 && obj_label_union1) {
812
+ let message = 'Object doesn\'t match union (at "' + path_label + '")';
813
+ message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
814
+ message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
815
+ return new TypeError(message);
816
+ }
817
+ const obj_name = obj.name;
818
+ const path_name = path + '.name';
819
+ let obj_name_union0 = null;
820
+ const obj_name_union0_error = (() => {
821
+ if (typeof obj_name !== 'string') {
822
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
823
+ }
824
+ })();
825
+ if (obj_name_union0_error != null) {
826
+ obj_name_union0 = obj_name_union0_error.message;
827
+ }
828
+ let obj_name_union1 = null;
829
+ const obj_name_union1_error = (() => {
830
+ if (obj_name !== null) {
831
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
832
+ }
833
+ })();
834
+ if (obj_name_union1_error != null) {
835
+ obj_name_union1 = obj_name_union1_error.message;
836
+ }
837
+ if (obj_name_union0 && obj_name_union1) {
838
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
839
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
840
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
841
+ return new TypeError(message);
842
+ }
843
+ const obj_status = obj.status;
844
+ const path_status = path + '.status';
845
+ if (typeof obj_status !== 'string') {
846
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
847
+ }
848
+ const obj_stepInstances = obj.stepInstances;
849
+ const path_stepInstances = path + '.stepInstances';
850
+ if (!ArrayIsArray(obj_stepInstances)) {
851
+ return new TypeError('Expected "array" but received "' + typeof obj_stepInstances + '" (at "' + path_stepInstances + '")');
852
+ }
853
+ for (let i = 0; i < obj_stepInstances.length; i++) {
854
+ const obj_stepInstances_item = obj_stepInstances[i];
855
+ const path_stepInstances_item = path_stepInstances + '[' + i + ']';
856
+ const referencepath_stepInstances_itemValidationError = validate$3(obj_stepInstances_item, path_stepInstances_item);
857
+ if (referencepath_stepInstances_itemValidationError !== null) {
858
+ let message = 'Object doesn\'t match FlowOrchestrationStepInstanceRepresentation (at "' + path_stepInstances_item + '")\n';
859
+ message += referencepath_stepInstances_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
860
+ return new TypeError(message);
861
+ }
862
+ }
863
+ })();
864
+ return v_error === undefined ? null : v_error;
865
+ }
866
+ const select$4 = function FlowOrchestrationStageInstanceRepresentationSelect() {
867
+ const { selections: FlowOrchestrationStepInstanceRepresentation__selections, opaque: FlowOrchestrationStepInstanceRepresentation__opaque, } = select$5();
868
+ return {
869
+ kind: 'Fragment',
870
+ version: VERSION$2,
871
+ private: [],
872
+ selections: [
873
+ {
874
+ name: 'completionTime',
875
+ kind: 'Scalar'
876
+ },
877
+ {
878
+ name: 'id',
879
+ kind: 'Scalar'
880
+ },
881
+ {
882
+ name: 'label',
883
+ kind: 'Scalar'
884
+ },
885
+ {
886
+ name: 'name',
887
+ kind: 'Scalar'
888
+ },
889
+ {
890
+ name: 'status',
891
+ kind: 'Scalar'
892
+ },
893
+ {
894
+ name: 'stepInstances',
895
+ kind: 'Object',
896
+ plural: true,
897
+ selections: FlowOrchestrationStepInstanceRepresentation__selections
898
+ }
899
+ ]
900
+ };
901
+ };
902
+ function equals$2(existing, incoming) {
903
+ const existing_id = existing.id;
904
+ const incoming_id = incoming.id;
905
+ if (!(existing_id === incoming_id)) {
906
+ return false;
907
+ }
908
+ const existing_status = existing.status;
909
+ const incoming_status = incoming.status;
910
+ if (!(existing_status === incoming_status)) {
911
+ return false;
912
+ }
913
+ const existing_completionTime = existing.completionTime;
914
+ const incoming_completionTime = incoming.completionTime;
915
+ if (!(existing_completionTime === incoming_completionTime)) {
916
+ return false;
917
+ }
918
+ const existing_label = existing.label;
919
+ const incoming_label = incoming.label;
920
+ if (!(existing_label === incoming_label)) {
921
+ return false;
922
+ }
923
+ const existing_name = existing.name;
924
+ const incoming_name = incoming.name;
925
+ if (!(existing_name === incoming_name)) {
926
+ return false;
927
+ }
928
+ const existing_stepInstances = existing.stepInstances;
929
+ const incoming_stepInstances = incoming.stepInstances;
930
+ const equals_stepInstances_items = equalsArray(existing_stepInstances, incoming_stepInstances, (existing_stepInstances_item, incoming_stepInstances_item) => {
931
+ if (!(equals$3(existing_stepInstances_item, incoming_stepInstances_item))) {
932
+ return false;
933
+ }
934
+ });
935
+ if (equals_stepInstances_items === false) {
936
+ return false;
937
+ }
938
+ return true;
939
+ }
940
+
941
+ const TTL$1 = 100;
942
+ const VERSION$1 = "5cd09fe6e4e088f4787a6cf1b9ab7a2a";
943
+ function validate$1(obj, path = 'FlowOrchestrationInstanceRepresentation') {
944
+ const v_error = (() => {
945
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
946
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
947
+ }
948
+ const obj_flowDefinitionDeveloperName = obj.flowDefinitionDeveloperName;
949
+ const path_flowDefinitionDeveloperName = path + '.flowDefinitionDeveloperName';
950
+ let obj_flowDefinitionDeveloperName_union0 = null;
951
+ const obj_flowDefinitionDeveloperName_union0_error = (() => {
952
+ if (typeof obj_flowDefinitionDeveloperName !== 'string') {
953
+ return new TypeError('Expected "string" but received "' + typeof obj_flowDefinitionDeveloperName + '" (at "' + path_flowDefinitionDeveloperName + '")');
954
+ }
955
+ })();
956
+ if (obj_flowDefinitionDeveloperName_union0_error != null) {
957
+ obj_flowDefinitionDeveloperName_union0 = obj_flowDefinitionDeveloperName_union0_error.message;
958
+ }
959
+ let obj_flowDefinitionDeveloperName_union1 = null;
960
+ const obj_flowDefinitionDeveloperName_union1_error = (() => {
961
+ if (obj_flowDefinitionDeveloperName !== null) {
962
+ return new TypeError('Expected "null" but received "' + typeof obj_flowDefinitionDeveloperName + '" (at "' + path_flowDefinitionDeveloperName + '")');
963
+ }
964
+ })();
965
+ if (obj_flowDefinitionDeveloperName_union1_error != null) {
966
+ obj_flowDefinitionDeveloperName_union1 = obj_flowDefinitionDeveloperName_union1_error.message;
967
+ }
968
+ if (obj_flowDefinitionDeveloperName_union0 && obj_flowDefinitionDeveloperName_union1) {
969
+ let message = 'Object doesn\'t match union (at "' + path_flowDefinitionDeveloperName + '")';
970
+ message += '\n' + obj_flowDefinitionDeveloperName_union0.split('\n').map((line) => '\t' + line).join('\n');
971
+ message += '\n' + obj_flowDefinitionDeveloperName_union1.split('\n').map((line) => '\t' + line).join('\n');
972
+ return new TypeError(message);
973
+ }
974
+ const obj_flowDefinitionId = obj.flowDefinitionId;
975
+ const path_flowDefinitionId = path + '.flowDefinitionId';
976
+ let obj_flowDefinitionId_union0 = null;
977
+ const obj_flowDefinitionId_union0_error = (() => {
978
+ if (typeof obj_flowDefinitionId !== 'string') {
979
+ return new TypeError('Expected "string" but received "' + typeof obj_flowDefinitionId + '" (at "' + path_flowDefinitionId + '")');
980
+ }
981
+ })();
982
+ if (obj_flowDefinitionId_union0_error != null) {
983
+ obj_flowDefinitionId_union0 = obj_flowDefinitionId_union0_error.message;
984
+ }
985
+ let obj_flowDefinitionId_union1 = null;
986
+ const obj_flowDefinitionId_union1_error = (() => {
987
+ if (obj_flowDefinitionId !== null) {
988
+ return new TypeError('Expected "null" but received "' + typeof obj_flowDefinitionId + '" (at "' + path_flowDefinitionId + '")');
989
+ }
990
+ })();
991
+ if (obj_flowDefinitionId_union1_error != null) {
992
+ obj_flowDefinitionId_union1 = obj_flowDefinitionId_union1_error.message;
993
+ }
994
+ if (obj_flowDefinitionId_union0 && obj_flowDefinitionId_union1) {
995
+ let message = 'Object doesn\'t match union (at "' + path_flowDefinitionId + '")';
996
+ message += '\n' + obj_flowDefinitionId_union0.split('\n').map((line) => '\t' + line).join('\n');
997
+ message += '\n' + obj_flowDefinitionId_union1.split('\n').map((line) => '\t' + line).join('\n');
998
+ return new TypeError(message);
999
+ }
1000
+ const obj_flowDefinitionName = obj.flowDefinitionName;
1001
+ const path_flowDefinitionName = path + '.flowDefinitionName';
1002
+ let obj_flowDefinitionName_union0 = null;
1003
+ const obj_flowDefinitionName_union0_error = (() => {
1004
+ if (typeof obj_flowDefinitionName !== 'string') {
1005
+ return new TypeError('Expected "string" but received "' + typeof obj_flowDefinitionName + '" (at "' + path_flowDefinitionName + '")');
1006
+ }
1007
+ })();
1008
+ if (obj_flowDefinitionName_union0_error != null) {
1009
+ obj_flowDefinitionName_union0 = obj_flowDefinitionName_union0_error.message;
1010
+ }
1011
+ let obj_flowDefinitionName_union1 = null;
1012
+ const obj_flowDefinitionName_union1_error = (() => {
1013
+ if (obj_flowDefinitionName !== null) {
1014
+ return new TypeError('Expected "null" but received "' + typeof obj_flowDefinitionName + '" (at "' + path_flowDefinitionName + '")');
1015
+ }
1016
+ })();
1017
+ if (obj_flowDefinitionName_union1_error != null) {
1018
+ obj_flowDefinitionName_union1 = obj_flowDefinitionName_union1_error.message;
1019
+ }
1020
+ if (obj_flowDefinitionName_union0 && obj_flowDefinitionName_union1) {
1021
+ let message = 'Object doesn\'t match union (at "' + path_flowDefinitionName + '")';
1022
+ message += '\n' + obj_flowDefinitionName_union0.split('\n').map((line) => '\t' + line).join('\n');
1023
+ message += '\n' + obj_flowDefinitionName_union1.split('\n').map((line) => '\t' + line).join('\n');
1024
+ return new TypeError(message);
1025
+ }
1026
+ const obj_id = obj.id;
1027
+ const path_id = path + '.id';
1028
+ if (typeof obj_id !== 'string') {
1029
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1030
+ }
1031
+ const obj_interviewId = obj.interviewId;
1032
+ const path_interviewId = path + '.interviewId';
1033
+ let obj_interviewId_union0 = null;
1034
+ const obj_interviewId_union0_error = (() => {
1035
+ if (typeof obj_interviewId !== 'string') {
1036
+ return new TypeError('Expected "string" but received "' + typeof obj_interviewId + '" (at "' + path_interviewId + '")');
1037
+ }
1038
+ })();
1039
+ if (obj_interviewId_union0_error != null) {
1040
+ obj_interviewId_union0 = obj_interviewId_union0_error.message;
1041
+ }
1042
+ let obj_interviewId_union1 = null;
1043
+ const obj_interviewId_union1_error = (() => {
1044
+ if (obj_interviewId !== null) {
1045
+ return new TypeError('Expected "null" but received "' + typeof obj_interviewId + '" (at "' + path_interviewId + '")');
1046
+ }
1047
+ })();
1048
+ if (obj_interviewId_union1_error != null) {
1049
+ obj_interviewId_union1 = obj_interviewId_union1_error.message;
1050
+ }
1051
+ if (obj_interviewId_union0 && obj_interviewId_union1) {
1052
+ let message = 'Object doesn\'t match union (at "' + path_interviewId + '")';
1053
+ message += '\n' + obj_interviewId_union0.split('\n').map((line) => '\t' + line).join('\n');
1054
+ message += '\n' + obj_interviewId_union1.split('\n').map((line) => '\t' + line).join('\n');
1055
+ return new TypeError(message);
1056
+ }
1057
+ const obj_stageInstances = obj.stageInstances;
1058
+ const path_stageInstances = path + '.stageInstances';
1059
+ if (!ArrayIsArray(obj_stageInstances)) {
1060
+ return new TypeError('Expected "array" but received "' + typeof obj_stageInstances + '" (at "' + path_stageInstances + '")');
1061
+ }
1062
+ for (let i = 0; i < obj_stageInstances.length; i++) {
1063
+ const obj_stageInstances_item = obj_stageInstances[i];
1064
+ const path_stageInstances_item = path_stageInstances + '[' + i + ']';
1065
+ const referencepath_stageInstances_itemValidationError = validate$2(obj_stageInstances_item, path_stageInstances_item);
1066
+ if (referencepath_stageInstances_itemValidationError !== null) {
1067
+ let message = 'Object doesn\'t match FlowOrchestrationStageInstanceRepresentation (at "' + path_stageInstances_item + '")\n';
1068
+ message += referencepath_stageInstances_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1069
+ return new TypeError(message);
1070
+ }
1071
+ }
1072
+ const obj_status = obj.status;
1073
+ const path_status = path + '.status';
1074
+ if (typeof obj_status !== 'string') {
1075
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1076
+ }
1077
+ })();
1078
+ return v_error === undefined ? null : v_error;
1079
+ }
1080
+ const RepresentationType$1 = 'FlowOrchestrationInstanceRepresentation';
1081
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1082
+ return input;
1083
+ }
1084
+ const select$3 = function FlowOrchestrationInstanceRepresentationSelect() {
1085
+ const { selections: FlowOrchestrationStageInstanceRepresentation__selections, opaque: FlowOrchestrationStageInstanceRepresentation__opaque, } = select$4();
1086
+ return {
1087
+ kind: 'Fragment',
1088
+ version: VERSION$1,
1089
+ private: [],
1090
+ selections: [
1091
+ {
1092
+ name: 'flowDefinitionDeveloperName',
1093
+ kind: 'Scalar'
1094
+ },
1095
+ {
1096
+ name: 'flowDefinitionId',
1097
+ kind: 'Scalar'
1098
+ },
1099
+ {
1100
+ name: 'flowDefinitionName',
1101
+ kind: 'Scalar'
1102
+ },
1103
+ {
1104
+ name: 'id',
1105
+ kind: 'Scalar'
1106
+ },
1107
+ {
1108
+ name: 'interviewId',
1109
+ kind: 'Scalar'
1110
+ },
1111
+ {
1112
+ name: 'stageInstances',
1113
+ kind: 'Object',
1114
+ plural: true,
1115
+ selections: FlowOrchestrationStageInstanceRepresentation__selections
1116
+ },
1117
+ {
1118
+ name: 'status',
1119
+ kind: 'Scalar'
1120
+ }
1121
+ ]
1122
+ };
1123
+ };
1124
+ function equals$1(existing, incoming) {
1125
+ const existing_id = existing.id;
1126
+ const incoming_id = incoming.id;
1127
+ if (!(existing_id === incoming_id)) {
1128
+ return false;
1129
+ }
1130
+ const existing_status = existing.status;
1131
+ const incoming_status = incoming.status;
1132
+ if (!(existing_status === incoming_status)) {
1133
+ return false;
1134
+ }
1135
+ const existing_flowDefinitionDeveloperName = existing.flowDefinitionDeveloperName;
1136
+ const incoming_flowDefinitionDeveloperName = incoming.flowDefinitionDeveloperName;
1137
+ if (!(existing_flowDefinitionDeveloperName === incoming_flowDefinitionDeveloperName)) {
1138
+ return false;
1139
+ }
1140
+ const existing_flowDefinitionId = existing.flowDefinitionId;
1141
+ const incoming_flowDefinitionId = incoming.flowDefinitionId;
1142
+ if (!(existing_flowDefinitionId === incoming_flowDefinitionId)) {
1143
+ return false;
1144
+ }
1145
+ const existing_flowDefinitionName = existing.flowDefinitionName;
1146
+ const incoming_flowDefinitionName = incoming.flowDefinitionName;
1147
+ if (!(existing_flowDefinitionName === incoming_flowDefinitionName)) {
1148
+ return false;
1149
+ }
1150
+ const existing_interviewId = existing.interviewId;
1151
+ const incoming_interviewId = incoming.interviewId;
1152
+ if (!(existing_interviewId === incoming_interviewId)) {
1153
+ return false;
1154
+ }
1155
+ const existing_stageInstances = existing.stageInstances;
1156
+ const incoming_stageInstances = incoming.stageInstances;
1157
+ const equals_stageInstances_items = equalsArray(existing_stageInstances, incoming_stageInstances, (existing_stageInstances_item, incoming_stageInstances_item) => {
1158
+ if (!(equals$2(existing_stageInstances_item, incoming_stageInstances_item))) {
1159
+ return false;
1160
+ }
1161
+ });
1162
+ if (equals_stageInstances_items === false) {
1163
+ return false;
1164
+ }
1165
+ return true;
1166
+ }
1167
+ const ingest$1 = function FlowOrchestrationInstanceRepresentationIngest(input, path, luvio, store, timestamp) {
1168
+ if (process.env.NODE_ENV !== 'production') {
1169
+ const validateError = validate$1(input);
1170
+ if (validateError !== null) {
1171
+ throw validateError;
1172
+ }
1173
+ }
1174
+ const key = path.fullPath;
1175
+ const ttlToUse = TTL$1;
1176
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "InteractionOrchestrator", VERSION$1, RepresentationType$1, equals$1);
1177
+ return createLink(key);
1178
+ };
1179
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1180
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1181
+ const rootKey = fullPathFactory();
1182
+ rootKeySet.set(rootKey, {
1183
+ namespace: keyPrefix,
1184
+ representationName: RepresentationType$1,
1185
+ mergeable: false
1186
+ });
1187
+ }
1188
+
1189
+ function select$2(luvio, params) {
1190
+ return select$3();
1191
+ }
1192
+ function keyBuilder$3(luvio, params) {
1193
+ return keyPrefix + '::FlowOrchestrationInstanceRepresentation:(' + 'instanceId:' + params.queryParams.instanceId + ')';
1194
+ }
1195
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1196
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
1197
+ }
1198
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1199
+ const { body } = response;
1200
+ const key = keyBuilder$3(luvio, resourceParams);
1201
+ luvio.storeIngest(key, ingest$1, body);
1202
+ const snapshot = luvio.storeLookup({
1203
+ recordId: key,
1204
+ node: select$2(),
1205
+ variables: {},
1206
+ }, snapshotRefresh);
1207
+ if (process.env.NODE_ENV !== 'production') {
1208
+ if (snapshot.state !== 'Fulfilled') {
1209
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1210
+ }
1211
+ }
1212
+ deepFreeze(snapshot.data);
1213
+ return snapshot;
1214
+ }
1215
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1216
+ const key = keyBuilder$3(luvio, params);
1217
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1218
+ const storeMetadataParams = {
1219
+ ttl: TTL$1,
1220
+ namespace: keyPrefix,
1221
+ version: VERSION$1,
1222
+ representationName: RepresentationType$1
1223
+ };
1224
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1225
+ return errorSnapshot;
1226
+ }
1227
+ function createResourceRequest$1(config) {
1228
+ const headers = {};
1229
+ return {
1230
+ baseUri: '/services/data/v66.0',
1231
+ basePath: '/connect/interaction/orchestration/instance/detail',
1232
+ method: 'get',
1233
+ body: null,
1234
+ urlParams: {},
1235
+ queryParams: config.queryParams,
1236
+ headers,
1237
+ priority: 'normal',
1238
+ };
1239
+ }
1240
+
1241
+ const adapterName$1 = 'getOrchestrationInstance';
1242
+ const oneOfConfigPropertiesIdentifier$1 = [
1243
+ 'instanceId'
1244
+ ];
1245
+ const getOrchestrationInstance_ConfigPropertyMetadata = [
1246
+ generateParamConfigMetadata('instanceId', false, 1 /* QueryParameter */, 0 /* String */),
1247
+ ];
1248
+ const getOrchestrationInstance_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getOrchestrationInstance_ConfigPropertyMetadata);
1249
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getOrchestrationInstance_ConfigPropertyMetadata);
1250
+ function keyBuilder$2(luvio, config) {
1251
+ const resourceParams = createResourceParams$1(config);
1252
+ return keyBuilder$3(luvio, resourceParams);
1253
+ }
1254
+ function typeCheckConfig$1(untrustedConfig) {
1255
+ const config = {};
1256
+ typeCheckConfig$2(untrustedConfig, config, getOrchestrationInstance_ConfigPropertyMetadata);
1257
+ return config;
1258
+ }
1259
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1260
+ if (!untrustedIsObject(untrustedConfig)) {
1261
+ return null;
1262
+ }
1263
+ if (process.env.NODE_ENV !== 'production') {
1264
+ validateConfig(untrustedConfig, configPropertyNames, oneOfConfigPropertiesIdentifier$1);
1265
+ }
1266
+ const config = typeCheckConfig$1(untrustedConfig);
1267
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1268
+ return null;
1269
+ }
1270
+ if (config.instanceId === undefined) {
1271
+ return null;
1272
+ }
1273
+ return config;
1274
+ }
1275
+ function adapterFragment$1(luvio, config) {
1276
+ createResourceParams$1(config);
1277
+ return select$2();
1278
+ }
1279
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1280
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1281
+ config,
1282
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1283
+ });
1284
+ return luvio.storeBroadcast().then(() => snapshot);
1285
+ }
1286
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1287
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1288
+ config,
1289
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1290
+ });
1291
+ return luvio.storeBroadcast().then(() => snapshot);
1292
+ }
1293
+ function buildNetworkSnapshot$1(luvio, config, options) {
1294
+ const resourceParams = createResourceParams$1(config);
1295
+ const request = createResourceRequest$1(resourceParams);
1296
+ return luvio.dispatchResourceRequest(request, options)
1297
+ .then((response) => {
1298
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
1299
+ const cache = new StoreKeyMap();
1300
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1301
+ return cache;
1302
+ });
1303
+ }, (response) => {
1304
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1305
+ });
1306
+ }
1307
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1308
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1309
+ }
1310
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1311
+ const { luvio, config } = context;
1312
+ const selector = {
1313
+ recordId: keyBuilder$2(luvio, config),
1314
+ node: adapterFragment$1(luvio, config),
1315
+ variables: {},
1316
+ };
1317
+ const cacheSnapshot = storeLookup(selector, {
1318
+ config,
1319
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1320
+ });
1321
+ return cacheSnapshot;
1322
+ }
1323
+ const getOrchestrationInstanceAdapterFactory = (luvio) => function InteractionOrchestrator__getOrchestrationInstance(untrustedConfig, requestContext) {
1324
+ const config = validateAdapterConfig$1(untrustedConfig, getOrchestrationInstance_ConfigPropertyNames);
1325
+ // Invalid or incomplete config
1326
+ if (config === null) {
1327
+ return null;
1328
+ }
1329
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1330
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1331
+ };
1332
+
1333
+ const TTL = 100;
1334
+ const VERSION = "ff1028f6e4a6a9aeed322135fdf518b5";
1335
+ function validate(obj, path = 'FlowOrchestrationInstanceCollectionRepresentation') {
1336
+ const v_error = (() => {
1337
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1338
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1339
+ }
1340
+ const obj_instances = obj.instances;
1341
+ const path_instances = path + '.instances';
1342
+ if (!ArrayIsArray(obj_instances)) {
1343
+ return new TypeError('Expected "array" but received "' + typeof obj_instances + '" (at "' + path_instances + '")');
1344
+ }
1345
+ for (let i = 0; i < obj_instances.length; i++) {
1346
+ const obj_instances_item = obj_instances[i];
1347
+ const path_instances_item = path_instances + '[' + i + ']';
1348
+ const referencepath_instances_itemValidationError = validate$1(obj_instances_item, path_instances_item);
1349
+ if (referencepath_instances_itemValidationError !== null) {
1350
+ let message = 'Object doesn\'t match FlowOrchestrationInstanceRepresentation (at "' + path_instances_item + '")\n';
1351
+ message += referencepath_instances_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1352
+ return new TypeError(message);
1353
+ }
1354
+ }
1355
+ })();
1356
+ return v_error === undefined ? null : v_error;
1357
+ }
1358
+ const RepresentationType = 'FlowOrchestrationInstanceCollectionRepresentation';
1359
+ function normalize(input, existing, path, luvio, store, timestamp) {
1360
+ return input;
1361
+ }
1362
+ const select$1 = function FlowOrchestrationInstanceCollectionRepresentationSelect() {
1363
+ const { selections: FlowOrchestrationInstanceRepresentation__selections, opaque: FlowOrchestrationInstanceRepresentation__opaque, } = select$3();
1364
+ return {
1365
+ kind: 'Fragment',
1366
+ version: VERSION,
1367
+ private: [],
1368
+ selections: [
1369
+ {
1370
+ name: 'instances',
1371
+ kind: 'Object',
1372
+ plural: true,
1373
+ selections: FlowOrchestrationInstanceRepresentation__selections
1374
+ }
1375
+ ]
1376
+ };
1377
+ };
1378
+ function equals(existing, incoming) {
1379
+ const existing_instances = existing.instances;
1380
+ const incoming_instances = incoming.instances;
1381
+ const equals_instances_items = equalsArray(existing_instances, incoming_instances, (existing_instances_item, incoming_instances_item) => {
1382
+ if (!(equals$1(existing_instances_item, incoming_instances_item))) {
1383
+ return false;
1384
+ }
1385
+ });
1386
+ if (equals_instances_items === false) {
1387
+ return false;
1388
+ }
1389
+ return true;
1390
+ }
1391
+ const ingest = function FlowOrchestrationInstanceCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
1392
+ if (process.env.NODE_ENV !== 'production') {
1393
+ const validateError = validate(input);
1394
+ if (validateError !== null) {
1395
+ throw validateError;
1396
+ }
1397
+ }
1398
+ const key = path.fullPath;
1399
+ const ttlToUse = TTL;
1400
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "InteractionOrchestrator", VERSION, RepresentationType, equals);
1401
+ return createLink(key);
1402
+ };
1403
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1404
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1405
+ const rootKey = fullPathFactory();
1406
+ rootKeySet.set(rootKey, {
1407
+ namespace: keyPrefix,
1408
+ representationName: RepresentationType,
1409
+ mergeable: false
1410
+ });
1411
+ }
1412
+
1413
+ function select(luvio, params) {
1414
+ return select$1();
1415
+ }
1416
+ function keyBuilder$1(luvio, params) {
1417
+ return keyPrefix + '::FlowOrchestrationInstanceCollectionRepresentation:(' + 'contextRecordId:' + params.queryParams.contextRecordId + ',' + 'relatedRecordId:' + params.queryParams.relatedRecordId + ')';
1418
+ }
1419
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1420
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
1421
+ }
1422
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1423
+ const { body } = response;
1424
+ const key = keyBuilder$1(luvio, resourceParams);
1425
+ luvio.storeIngest(key, ingest, body);
1426
+ const snapshot = luvio.storeLookup({
1427
+ recordId: key,
1428
+ node: select(),
1429
+ variables: {},
1430
+ }, snapshotRefresh);
1431
+ if (process.env.NODE_ENV !== 'production') {
1432
+ if (snapshot.state !== 'Fulfilled') {
1433
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1434
+ }
1435
+ }
1436
+ deepFreeze(snapshot.data);
1437
+ return snapshot;
1438
+ }
1439
+ function ingestError(luvio, params, error, snapshotRefresh) {
1440
+ const key = keyBuilder$1(luvio, params);
1441
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1442
+ const storeMetadataParams = {
1443
+ ttl: TTL,
1444
+ namespace: keyPrefix,
1445
+ version: VERSION,
1446
+ representationName: RepresentationType
1447
+ };
1448
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1449
+ return errorSnapshot;
1450
+ }
1451
+ function createResourceRequest(config) {
1452
+ const headers = {};
1453
+ return {
1454
+ baseUri: '/services/data/v66.0',
1455
+ basePath: '/connect/interaction/orchestration/instances',
1456
+ method: 'get',
1457
+ body: null,
1458
+ urlParams: {},
1459
+ queryParams: config.queryParams,
1460
+ headers,
1461
+ priority: 'normal',
1462
+ };
1463
+ }
1464
+
1465
+ const adapterName = 'getOrchestrationInstanceCollection';
1466
+ const oneOfConfigPropertiesIdentifier = [
1467
+ 'relatedRecordId'
1468
+ ];
1469
+ const getOrchestrationInstanceCollection_ConfigPropertyMetadata = [
1470
+ generateParamConfigMetadata('contextRecordId', false, 1 /* QueryParameter */, 0 /* String */),
1471
+ generateParamConfigMetadata('relatedRecordId', false, 1 /* QueryParameter */, 0 /* String */),
1472
+ ];
1473
+ const getOrchestrationInstanceCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getOrchestrationInstanceCollection_ConfigPropertyMetadata);
1474
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(getOrchestrationInstanceCollection_ConfigPropertyMetadata);
1475
+ function keyBuilder(luvio, config) {
1476
+ const resourceParams = createResourceParams(config);
1477
+ return keyBuilder$1(luvio, resourceParams);
1478
+ }
1479
+ function typeCheckConfig(untrustedConfig) {
1480
+ const config = {};
1481
+ typeCheckConfig$2(untrustedConfig, config, getOrchestrationInstanceCollection_ConfigPropertyMetadata);
1482
+ return config;
1483
+ }
1484
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1485
+ if (!untrustedIsObject(untrustedConfig)) {
1486
+ return null;
1487
+ }
1488
+ if (process.env.NODE_ENV !== 'production') {
1489
+ validateConfig(untrustedConfig, configPropertyNames, oneOfConfigPropertiesIdentifier);
1490
+ }
1491
+ const config = typeCheckConfig(untrustedConfig);
1492
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1493
+ return null;
1494
+ }
1495
+ if (config.relatedRecordId === undefined) {
1496
+ return null;
1497
+ }
1498
+ return config;
1499
+ }
1500
+ function adapterFragment(luvio, config) {
1501
+ createResourceParams(config);
1502
+ return select();
1503
+ }
1504
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1505
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1506
+ config,
1507
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1508
+ });
1509
+ return luvio.storeBroadcast().then(() => snapshot);
1510
+ }
1511
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1512
+ const snapshot = ingestError(luvio, resourceParams, response, {
1513
+ config,
1514
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1515
+ });
1516
+ return luvio.storeBroadcast().then(() => snapshot);
1517
+ }
1518
+ function buildNetworkSnapshot(luvio, config, options) {
1519
+ const resourceParams = createResourceParams(config);
1520
+ const request = createResourceRequest(resourceParams);
1521
+ return luvio.dispatchResourceRequest(request, options)
1522
+ .then((response) => {
1523
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1524
+ const cache = new StoreKeyMap();
1525
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1526
+ return cache;
1527
+ });
1528
+ }, (response) => {
1529
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1530
+ });
1531
+ }
1532
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1533
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
1534
+ }
1535
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1536
+ const { luvio, config } = context;
1537
+ const selector = {
1538
+ recordId: keyBuilder(luvio, config),
1539
+ node: adapterFragment(luvio, config),
1540
+ variables: {},
1541
+ };
1542
+ const cacheSnapshot = storeLookup(selector, {
1543
+ config,
1544
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1545
+ });
1546
+ return cacheSnapshot;
1547
+ }
1548
+ const getOrchestrationInstanceCollectionAdapterFactory = (luvio) => function InteractionOrchestrator__getOrchestrationInstanceCollection(untrustedConfig, requestContext) {
1549
+ const config = validateAdapterConfig(untrustedConfig, getOrchestrationInstanceCollection_ConfigPropertyNames);
1550
+ // Invalid or incomplete config
1551
+ if (config === null) {
1552
+ return null;
1553
+ }
1554
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1555
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1556
+ };
1557
+
1558
+ let getOrchestrationInstance;
1559
+ let getOrchestrationInstanceCollection;
1560
+ // Imperative GET Adapters
1561
+ let getOrchestrationInstance_imperative;
1562
+ let getOrchestrationInstanceCollection_imperative;
1563
+ // Adapter Metadata
1564
+ const getOrchestrationInstanceMetadata = {
1565
+ apiFamily: 'InteractionOrchestrator',
1566
+ name: 'getOrchestrationInstance',
1567
+ ttl: 100,
1568
+ };
1569
+ const getOrchestrationInstanceCollectionMetadata = {
1570
+ apiFamily: 'InteractionOrchestrator',
1571
+ name: 'getOrchestrationInstanceCollection',
1572
+ ttl: 100,
1573
+ };
1574
+ // Notify Update Available
1575
+ function bindExportsTo(luvio) {
1576
+ // LDS Adapters
1577
+ const getOrchestrationInstance_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOrchestrationInstance', getOrchestrationInstanceAdapterFactory), getOrchestrationInstanceMetadata);
1578
+ const getOrchestrationInstanceCollection_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOrchestrationInstanceCollection', getOrchestrationInstanceCollectionAdapterFactory), getOrchestrationInstanceCollectionMetadata);
1579
+ return {
1580
+ getOrchestrationInstance: createWireAdapterConstructor(luvio, getOrchestrationInstance_ldsAdapter, getOrchestrationInstanceMetadata),
1581
+ getOrchestrationInstanceCollection: createWireAdapterConstructor(luvio, getOrchestrationInstanceCollection_ldsAdapter, getOrchestrationInstanceCollectionMetadata),
1582
+ // Imperative GET Adapters
1583
+ getOrchestrationInstance_imperative: createImperativeAdapter(luvio, getOrchestrationInstance_ldsAdapter, getOrchestrationInstanceMetadata),
1584
+ getOrchestrationInstanceCollection_imperative: createImperativeAdapter(luvio, getOrchestrationInstanceCollection_ldsAdapter, getOrchestrationInstanceCollectionMetadata),
1585
+ // Notify Update Availables
1586
+ };
1587
+ }
1588
+ withDefaultLuvio((luvio) => {
1589
+ ({
1590
+ getOrchestrationInstance,
1591
+ getOrchestrationInstanceCollection,
1592
+ getOrchestrationInstance_imperative,
1593
+ getOrchestrationInstanceCollection_imperative,
1594
+ } = bindExportsTo(luvio));
1595
+ });
1596
+
1597
+ export { getOrchestrationInstance, getOrchestrationInstanceCollection, getOrchestrationInstanceCollection_imperative, getOrchestrationInstance_imperative };
1598
+ // version: 0.1.0-dev1-c978a7b010