@salesforce/lds-adapters-platform-data-seed 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 (59) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-data-seed.js +3388 -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/generateData.d.ts +26 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getAuthCallbackStatus.d.ts +19 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getDataSeedRequestStatus.d.ts +19 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getDataSeedStatus.d.ts +30 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getDownloadPreSignedUrl.d.ts +20 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getOrgEntities.d.ts +20 -0
  10. package/dist/es/es2018/types/src/generated/adapters/getOrgEntitiesDetails.d.ts +21 -0
  11. package/dist/es/es2018/types/src/generated/adapters/getSalesforceOrgDetails.d.ts +18 -0
  12. package/dist/es/es2018/types/src/generated/adapters/getUploadPreSignedUrl.d.ts +19 -0
  13. package/dist/es/es2018/types/src/generated/adapters/loadDataToTargetOrg.d.ts +22 -0
  14. package/dist/es/es2018/types/src/generated/adapters/migrateData.d.ts +26 -0
  15. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +11 -0
  16. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +13 -0
  17. package/dist/es/es2018/types/src/generated/resources/getPlatformDataSeedV1DataSeedRequest.d.ts +18 -0
  18. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedAuthCallbackStatusByCallback_id.d.ts +18 -0
  19. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedFetchSalesforceEntities.d.ts +19 -0
  20. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedFetchSalesforceObjectMetadata.d.ts +20 -0
  21. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedGenerate.d.ts +25 -0
  22. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedGeneratePresignedDownloadUrlByRequest_idAndFile_type.d.ts +19 -0
  23. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedGeneratePresignedUploadUrl.d.ts +18 -0
  24. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedLoadByDataseed_request_id.d.ts +23 -0
  25. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedMigrate.d.ts +25 -0
  26. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedOrgDetails.d.ts +15 -0
  27. package/dist/es/es2018/types/src/generated/resources/postPlatformDataSeedV1DataSeedRequestByRequest_id.d.ts +18 -0
  28. package/dist/es/es2018/types/src/generated/types/AuthCallbackStatusRepresentation.d.ts +53 -0
  29. package/dist/es/es2018/types/src/generated/types/DataSeedRequestObjectRepresentation.d.ts +64 -0
  30. package/dist/es/es2018/types/src/generated/types/DataSeedRequestStatusOutputRepresentation.d.ts +41 -0
  31. package/dist/es/es2018/types/src/generated/types/DataSeedStatusErrorRepresentation.d.ts +28 -0
  32. package/dist/es/es2018/types/src/generated/types/DataSeedStatusOutputRepresentation.d.ts +32 -0
  33. package/dist/es/es2018/types/src/generated/types/EntitiesDetailsInputRepresentation.d.ts +34 -0
  34. package/dist/es/es2018/types/src/generated/types/EntitiesDetailsOutputRepresentation.d.ts +42 -0
  35. package/dist/es/es2018/types/src/generated/types/EntitiesOutputRepresentation.d.ts +42 -0
  36. package/dist/es/es2018/types/src/generated/types/EntityDetailsChildResponseObject.d.ts +37 -0
  37. package/dist/es/es2018/types/src/generated/types/EntityDetailsFieldsResponseObject.d.ts +38 -0
  38. package/dist/es/es2018/types/src/generated/types/EntityDetailsParentResponseObject.d.ts +37 -0
  39. package/dist/es/es2018/types/src/generated/types/EntityDetailsResponseObject.d.ts +58 -0
  40. package/dist/es/es2018/types/src/generated/types/EntityResponseObject.d.ts +34 -0
  41. package/dist/es/es2018/types/src/generated/types/LoadDataInputRepresentation.d.ts +34 -0
  42. package/dist/es/es2018/types/src/generated/types/MigrateDataInputRepresentation.d.ts +49 -0
  43. package/dist/es/es2018/types/src/generated/types/MigrateDataOutputRepresentation.d.ts +44 -0
  44. package/dist/es/es2018/types/src/generated/types/OrgDetailsErrorRepresentation.d.ts +31 -0
  45. package/dist/es/es2018/types/src/generated/types/OrgDetailsObjectRepresentation.d.ts +37 -0
  46. package/dist/es/es2018/types/src/generated/types/OrgDetailsRepresentation.d.ts +41 -0
  47. package/dist/es/es2018/types/src/generated/types/OrgEntitiesInputRepresentation.d.ts +31 -0
  48. package/dist/es/es2018/types/src/generated/types/PicklistValueObject.d.ts +40 -0
  49. package/dist/es/es2018/types/src/generated/types/PreSignedDownloadUrlResultRepresentation.d.ts +41 -0
  50. package/dist/es/es2018/types/src/generated/types/PreSignedUrlBadErrorRepresentation.d.ts +28 -0
  51. package/dist/es/es2018/types/src/generated/types/PreSignedUrlInputRepresentation.d.ts +28 -0
  52. package/dist/es/es2018/types/src/generated/types/PreSignedUrlResultRepresentation.d.ts +41 -0
  53. package/dist/es/es2018/types/src/generated/types/PreSignedUrlServerErrorRepresentation.d.ts +31 -0
  54. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  55. package/package.json +66 -0
  56. package/sfdc/index.d.ts +1 -0
  57. package/sfdc/index.js +3455 -0
  58. package/src/raml/api.raml +898 -0
  59. package/src/raml/luvio.raml +84 -0
@@ -0,0 +1,3388 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$b, StoreKeyMap, createResourceParams as createResourceParams$b } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
59
+ };
60
+ }
61
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
62
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
63
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
64
+ return {
65
+ displayName,
66
+ parameters: {
67
+ required,
68
+ optional,
69
+ }
70
+ };
71
+ }
72
+ const keyPrefix = 'data-seed';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ function equalsArray(a, b, equalsItem) {
76
+ const aLength = a.length;
77
+ const bLength = b.length;
78
+ if (aLength !== bLength) {
79
+ return false;
80
+ }
81
+ for (let i = 0; i < aLength; i++) {
82
+ if (equalsItem(a[i], b[i]) === false) {
83
+ return false;
84
+ }
85
+ }
86
+ return true;
87
+ }
88
+ function createLink(ref) {
89
+ return {
90
+ __ref: serializeStructuredKey(ref),
91
+ };
92
+ }
93
+
94
+ const VERSION$g = "c99b6467d047bac3cc770bcf35963899";
95
+ function validate$g(obj, path = 'DataSeedRequestObjectRepresentation') {
96
+ const v_error = (() => {
97
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
98
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
99
+ }
100
+ const obj_created_by = obj.created_by;
101
+ const path_created_by = path + '.created_by';
102
+ if (typeof obj_created_by !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_created_by + '" (at "' + path_created_by + '")');
104
+ }
105
+ const obj_description = obj.description;
106
+ const path_description = path + '.description';
107
+ if (typeof obj_description !== 'string') {
108
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
109
+ }
110
+ const obj_execution_end_time = obj.execution_end_time;
111
+ const path_execution_end_time = path + '.execution_end_time';
112
+ if (typeof obj_execution_end_time !== 'string') {
113
+ return new TypeError('Expected "string" but received "' + typeof obj_execution_end_time + '" (at "' + path_execution_end_time + '")');
114
+ }
115
+ const obj_execution_start_time = obj.execution_start_time;
116
+ const path_execution_start_time = path + '.execution_start_time';
117
+ if (typeof obj_execution_start_time !== 'string') {
118
+ return new TypeError('Expected "string" but received "' + typeof obj_execution_start_time + '" (at "' + path_execution_start_time + '")');
119
+ }
120
+ const obj_job_type = obj.job_type;
121
+ const path_job_type = path + '.job_type';
122
+ if (typeof obj_job_type !== 'string') {
123
+ return new TypeError('Expected "string" but received "' + typeof obj_job_type + '" (at "' + path_job_type + '")');
124
+ }
125
+ const obj_log_text = obj.log_text;
126
+ const path_log_text = path + '.log_text';
127
+ if (typeof obj_log_text !== 'string') {
128
+ return new TypeError('Expected "string" but received "' + typeof obj_log_text + '" (at "' + path_log_text + '")');
129
+ }
130
+ const obj_name = obj.name;
131
+ const path_name = path + '.name';
132
+ if (typeof obj_name !== 'string') {
133
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
134
+ }
135
+ const obj_organization_id = obj.organization_id;
136
+ const path_organization_id = path + '.organization_id';
137
+ if (typeof obj_organization_id !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_organization_id + '" (at "' + path_organization_id + '")');
139
+ }
140
+ const obj_request_id = obj.request_id;
141
+ const path_request_id = path + '.request_id';
142
+ if (typeof obj_request_id !== 'string') {
143
+ return new TypeError('Expected "string" but received "' + typeof obj_request_id + '" (at "' + path_request_id + '")');
144
+ }
145
+ const obj_source_organization_id = obj.source_organization_id;
146
+ const path_source_organization_id = path + '.source_organization_id';
147
+ if (typeof obj_source_organization_id !== 'string') {
148
+ return new TypeError('Expected "string" but received "' + typeof obj_source_organization_id + '" (at "' + path_source_organization_id + '")');
149
+ }
150
+ const obj_status = obj.status;
151
+ const path_status = path + '.status';
152
+ if (typeof obj_status !== 'string') {
153
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
154
+ }
155
+ const obj_step = obj.step;
156
+ const path_step = path + '.step';
157
+ if (typeof obj_step !== 'string') {
158
+ return new TypeError('Expected "string" but received "' + typeof obj_step + '" (at "' + path_step + '")');
159
+ }
160
+ const obj_target_organization_id = obj.target_organization_id;
161
+ const path_target_organization_id = path + '.target_organization_id';
162
+ if (typeof obj_target_organization_id !== 'string') {
163
+ return new TypeError('Expected "string" but received "' + typeof obj_target_organization_id + '" (at "' + path_target_organization_id + '")');
164
+ }
165
+ })();
166
+ return v_error === undefined ? null : v_error;
167
+ }
168
+ const select$r = function DataSeedRequestObjectRepresentationSelect() {
169
+ return {
170
+ kind: 'Fragment',
171
+ version: VERSION$g,
172
+ private: [],
173
+ selections: [
174
+ {
175
+ name: 'created_by',
176
+ kind: 'Scalar'
177
+ },
178
+ {
179
+ name: 'description',
180
+ kind: 'Scalar'
181
+ },
182
+ {
183
+ name: 'execution_end_time',
184
+ kind: 'Scalar'
185
+ },
186
+ {
187
+ name: 'execution_start_time',
188
+ kind: 'Scalar'
189
+ },
190
+ {
191
+ name: 'job_type',
192
+ kind: 'Scalar'
193
+ },
194
+ {
195
+ name: 'log_text',
196
+ kind: 'Scalar'
197
+ },
198
+ {
199
+ name: 'name',
200
+ kind: 'Scalar'
201
+ },
202
+ {
203
+ name: 'organization_id',
204
+ kind: 'Scalar'
205
+ },
206
+ {
207
+ name: 'request_id',
208
+ kind: 'Scalar'
209
+ },
210
+ {
211
+ name: 'source_organization_id',
212
+ kind: 'Scalar'
213
+ },
214
+ {
215
+ name: 'status',
216
+ kind: 'Scalar'
217
+ },
218
+ {
219
+ name: 'step',
220
+ kind: 'Scalar'
221
+ },
222
+ {
223
+ name: 'target_organization_id',
224
+ kind: 'Scalar'
225
+ }
226
+ ]
227
+ };
228
+ };
229
+ function equals$g(existing, incoming) {
230
+ const existing_created_by = existing.created_by;
231
+ const incoming_created_by = incoming.created_by;
232
+ if (!(existing_created_by === incoming_created_by)) {
233
+ return false;
234
+ }
235
+ const existing_description = existing.description;
236
+ const incoming_description = incoming.description;
237
+ if (!(existing_description === incoming_description)) {
238
+ return false;
239
+ }
240
+ const existing_execution_end_time = existing.execution_end_time;
241
+ const incoming_execution_end_time = incoming.execution_end_time;
242
+ if (!(existing_execution_end_time === incoming_execution_end_time)) {
243
+ return false;
244
+ }
245
+ const existing_execution_start_time = existing.execution_start_time;
246
+ const incoming_execution_start_time = incoming.execution_start_time;
247
+ if (!(existing_execution_start_time === incoming_execution_start_time)) {
248
+ return false;
249
+ }
250
+ const existing_job_type = existing.job_type;
251
+ const incoming_job_type = incoming.job_type;
252
+ if (!(existing_job_type === incoming_job_type)) {
253
+ return false;
254
+ }
255
+ const existing_log_text = existing.log_text;
256
+ const incoming_log_text = incoming.log_text;
257
+ if (!(existing_log_text === incoming_log_text)) {
258
+ return false;
259
+ }
260
+ const existing_name = existing.name;
261
+ const incoming_name = incoming.name;
262
+ if (!(existing_name === incoming_name)) {
263
+ return false;
264
+ }
265
+ const existing_organization_id = existing.organization_id;
266
+ const incoming_organization_id = incoming.organization_id;
267
+ if (!(existing_organization_id === incoming_organization_id)) {
268
+ return false;
269
+ }
270
+ const existing_request_id = existing.request_id;
271
+ const incoming_request_id = incoming.request_id;
272
+ if (!(existing_request_id === incoming_request_id)) {
273
+ return false;
274
+ }
275
+ const existing_source_organization_id = existing.source_organization_id;
276
+ const incoming_source_organization_id = incoming.source_organization_id;
277
+ if (!(existing_source_organization_id === incoming_source_organization_id)) {
278
+ return false;
279
+ }
280
+ const existing_status = existing.status;
281
+ const incoming_status = incoming.status;
282
+ if (!(existing_status === incoming_status)) {
283
+ return false;
284
+ }
285
+ const existing_step = existing.step;
286
+ const incoming_step = incoming.step;
287
+ if (!(existing_step === incoming_step)) {
288
+ return false;
289
+ }
290
+ const existing_target_organization_id = existing.target_organization_id;
291
+ const incoming_target_organization_id = incoming.target_organization_id;
292
+ if (!(existing_target_organization_id === incoming_target_organization_id)) {
293
+ return false;
294
+ }
295
+ return true;
296
+ }
297
+
298
+ const VERSION$f = "732685344ea5e037b5b3da3c38ad04eb";
299
+ function validate$f(obj, path = 'DataSeedStatusOutputRepresentation') {
300
+ const v_error = (() => {
301
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
302
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
303
+ }
304
+ const obj_correlation_id = obj.correlation_id;
305
+ const path_correlation_id = path + '.correlation_id';
306
+ if (typeof obj_correlation_id !== 'string') {
307
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
308
+ }
309
+ const obj_data = obj.data;
310
+ const path_data = path + '.data';
311
+ if (!ArrayIsArray(obj_data)) {
312
+ return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
313
+ }
314
+ for (let i = 0; i < obj_data.length; i++) {
315
+ const obj_data_item = obj_data[i];
316
+ const path_data_item = path_data + '[' + i + ']';
317
+ const referencepath_data_itemValidationError = validate$g(obj_data_item, path_data_item);
318
+ if (referencepath_data_itemValidationError !== null) {
319
+ let message = 'Object doesn\'t match DataSeedRequestObjectRepresentation (at "' + path_data_item + '")\n';
320
+ message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
321
+ return new TypeError(message);
322
+ }
323
+ }
324
+ })();
325
+ return v_error === undefined ? null : v_error;
326
+ }
327
+ const RepresentationType$8 = 'DataSeedStatusOutputRepresentation';
328
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
329
+ return input;
330
+ }
331
+ const select$q = function DataSeedStatusOutputRepresentationSelect() {
332
+ const { selections: DataSeedRequestObjectRepresentation__selections, opaque: DataSeedRequestObjectRepresentation__opaque, } = select$r();
333
+ return {
334
+ kind: 'Fragment',
335
+ version: VERSION$f,
336
+ private: [],
337
+ selections: [
338
+ {
339
+ name: 'correlation_id',
340
+ kind: 'Scalar'
341
+ },
342
+ {
343
+ name: 'data',
344
+ kind: 'Object',
345
+ plural: true,
346
+ selections: DataSeedRequestObjectRepresentation__selections
347
+ }
348
+ ]
349
+ };
350
+ };
351
+ function equals$f(existing, incoming) {
352
+ const existing_correlation_id = existing.correlation_id;
353
+ const incoming_correlation_id = incoming.correlation_id;
354
+ if (!(existing_correlation_id === incoming_correlation_id)) {
355
+ return false;
356
+ }
357
+ const existing_data = existing.data;
358
+ const incoming_data = incoming.data;
359
+ const equals_data_items = equalsArray(existing_data, incoming_data, (existing_data_item, incoming_data_item) => {
360
+ if (!(equals$g(existing_data_item, incoming_data_item))) {
361
+ return false;
362
+ }
363
+ });
364
+ if (equals_data_items === false) {
365
+ return false;
366
+ }
367
+ return true;
368
+ }
369
+ const ingest$8 = function DataSeedStatusOutputRepresentationIngest(input, path, luvio, store, timestamp) {
370
+ if (process.env.NODE_ENV !== 'production') {
371
+ const validateError = validate$f(input);
372
+ if (validateError !== null) {
373
+ throw validateError;
374
+ }
375
+ }
376
+ const key = path.fullPath;
377
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 30000;
378
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "data-seed", VERSION$f, RepresentationType$8, equals$f);
379
+ return createLink(key);
380
+ };
381
+ function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
382
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
383
+ const rootKey = fullPathFactory();
384
+ rootKeySet.set(rootKey, {
385
+ namespace: keyPrefix,
386
+ representationName: RepresentationType$8,
387
+ mergeable: false
388
+ });
389
+ }
390
+
391
+ function select$p(luvio, params) {
392
+ return select$q();
393
+ }
394
+ function keyBuilder$9(luvio, params) {
395
+ return keyPrefix + '::DataSeedStatusOutputRepresentation:(' + 'xClientTraceId:' + params.headers.xClientTraceId + ',' + 'xSalesforceRegion:' + params.headers.xSalesforceRegion + ',' + 'orgUrl:' + params.headers.orgUrl + ',' + 'accessToken:' + params.headers.accessToken + ')';
396
+ }
397
+ function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
398
+ getTypeCacheKeys$8(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
399
+ }
400
+ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
401
+ const { body } = response;
402
+ const key = keyBuilder$9(luvio, resourceParams);
403
+ luvio.storeIngest(key, ingest$8, body);
404
+ const snapshot = luvio.storeLookup({
405
+ recordId: key,
406
+ node: select$p(),
407
+ variables: {},
408
+ }, snapshotRefresh);
409
+ if (process.env.NODE_ENV !== 'production') {
410
+ if (snapshot.state !== 'Fulfilled') {
411
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
412
+ }
413
+ }
414
+ deepFreeze(snapshot.data);
415
+ return snapshot;
416
+ }
417
+ function ingestError(luvio, params, error, snapshotRefresh) {
418
+ const key = keyBuilder$9(luvio, params);
419
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
420
+ luvio.storeIngestError(key, errorSnapshot);
421
+ return errorSnapshot;
422
+ }
423
+ function createResourceRequest$a(config) {
424
+ const headers = {};
425
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
426
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
427
+ headers['Org-Url'] = config.headers.orgUrl;
428
+ headers['Access-Token'] = config.headers.accessToken;
429
+ return {
430
+ baseUri: 'api.salesforce.com',
431
+ basePath: '/platform/data-seed/v1/data-seed-request',
432
+ method: 'get',
433
+ body: null,
434
+ urlParams: {},
435
+ queryParams: {},
436
+ headers,
437
+ priority: 'normal',
438
+ };
439
+ }
440
+
441
+ const adapterName$a = 'getDataSeedStatus';
442
+ const getDataSeedStatus_ConfigPropertyMetadata = [
443
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
444
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
445
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
446
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
447
+ ];
448
+ const getDataSeedStatus_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, getDataSeedStatus_ConfigPropertyMetadata);
449
+ const createResourceParams$a = /*#__PURE__*/ createResourceParams$b(getDataSeedStatus_ConfigPropertyMetadata);
450
+ function keyBuilder$8(luvio, config) {
451
+ const resourceParams = createResourceParams$a(config);
452
+ return keyBuilder$9(luvio, resourceParams);
453
+ }
454
+ function typeCheckConfig$a(untrustedConfig) {
455
+ const config = {};
456
+ typeCheckConfig$b(untrustedConfig, config, getDataSeedStatus_ConfigPropertyMetadata);
457
+ return config;
458
+ }
459
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
460
+ if (!untrustedIsObject(untrustedConfig)) {
461
+ return null;
462
+ }
463
+ if (process.env.NODE_ENV !== 'production') {
464
+ validateConfig(untrustedConfig, configPropertyNames);
465
+ }
466
+ const config = typeCheckConfig$a(untrustedConfig);
467
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
468
+ return null;
469
+ }
470
+ return config;
471
+ }
472
+ function adapterFragment(luvio, config) {
473
+ createResourceParams$a(config);
474
+ return select$p();
475
+ }
476
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
477
+ const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
478
+ config,
479
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
480
+ });
481
+ return luvio.storeBroadcast().then(() => snapshot);
482
+ }
483
+ function onFetchResponseError(luvio, config, resourceParams, response) {
484
+ const snapshot = ingestError(luvio, resourceParams, response, {
485
+ config,
486
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
487
+ });
488
+ return luvio.storeBroadcast().then(() => snapshot);
489
+ }
490
+ function buildNetworkSnapshot$a(luvio, config, options) {
491
+ const resourceParams = createResourceParams$a(config);
492
+ const request = createResourceRequest$a(resourceParams);
493
+ return luvio.dispatchResourceRequest(request, options)
494
+ .then((response) => {
495
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
496
+ const cache = new StoreKeyMap();
497
+ getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
498
+ return cache;
499
+ });
500
+ }, (response) => {
501
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
502
+ });
503
+ }
504
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
505
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$a, undefined, false);
506
+ }
507
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
508
+ const { luvio, config } = context;
509
+ const selector = {
510
+ recordId: keyBuilder$8(luvio, config),
511
+ node: adapterFragment(luvio, config),
512
+ variables: {},
513
+ };
514
+ const cacheSnapshot = storeLookup(selector, {
515
+ config,
516
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
517
+ });
518
+ return cacheSnapshot;
519
+ }
520
+ const getDataSeedStatusAdapterFactory = (luvio) => function dataSeed__getDataSeedStatus(untrustedConfig, requestContext) {
521
+ const config = validateAdapterConfig$a(untrustedConfig, getDataSeedStatus_ConfigPropertyNames);
522
+ // Invalid or incomplete config
523
+ if (config === null) {
524
+ return null;
525
+ }
526
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
527
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
528
+ };
529
+
530
+ const TTL$7 = 200;
531
+ const VERSION$e = "7fb1a6b558a60e18929e558f8d902ab3";
532
+ function validate$e(obj, path = 'DataSeedRequestStatusOutputRepresentation') {
533
+ const v_error = (() => {
534
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
535
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
536
+ }
537
+ const obj_correlation_id = obj.correlation_id;
538
+ const path_correlation_id = path + '.correlation_id';
539
+ if (typeof obj_correlation_id !== 'string') {
540
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
541
+ }
542
+ const obj_data = obj.data;
543
+ const path_data = path + '.data';
544
+ const referencepath_dataValidationError = validate$g(obj_data, path_data);
545
+ if (referencepath_dataValidationError !== null) {
546
+ let message = 'Object doesn\'t match DataSeedRequestObjectRepresentation (at "' + path_data + '")\n';
547
+ message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
548
+ return new TypeError(message);
549
+ }
550
+ })();
551
+ return v_error === undefined ? null : v_error;
552
+ }
553
+ const RepresentationType$7 = 'DataSeedRequestStatusOutputRepresentation';
554
+ function keyBuilder$7(luvio, config) {
555
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.correlation_id;
556
+ }
557
+ function keyBuilderFromType$7(luvio, object) {
558
+ const keyParams = {
559
+ correlation_id: object.correlation_id
560
+ };
561
+ return keyBuilder$7(luvio, keyParams);
562
+ }
563
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
564
+ return input;
565
+ }
566
+ const select$o = function DataSeedRequestStatusOutputRepresentationSelect() {
567
+ const { selections: DataSeedRequestObjectRepresentation__selections, opaque: DataSeedRequestObjectRepresentation__opaque, } = select$r();
568
+ return {
569
+ kind: 'Fragment',
570
+ version: VERSION$e,
571
+ private: [],
572
+ selections: [
573
+ {
574
+ name: 'correlation_id',
575
+ kind: 'Scalar'
576
+ },
577
+ {
578
+ name: 'data',
579
+ kind: 'Object',
580
+ selections: DataSeedRequestObjectRepresentation__selections
581
+ }
582
+ ]
583
+ };
584
+ };
585
+ function equals$e(existing, incoming) {
586
+ const existing_correlation_id = existing.correlation_id;
587
+ const incoming_correlation_id = incoming.correlation_id;
588
+ if (!(existing_correlation_id === incoming_correlation_id)) {
589
+ return false;
590
+ }
591
+ const existing_data = existing.data;
592
+ const incoming_data = incoming.data;
593
+ if (!(equals$g(existing_data, incoming_data))) {
594
+ return false;
595
+ }
596
+ return true;
597
+ }
598
+ const ingest$7 = function DataSeedRequestStatusOutputRepresentationIngest(input, path, luvio, store, timestamp) {
599
+ if (process.env.NODE_ENV !== 'production') {
600
+ const validateError = validate$e(input);
601
+ if (validateError !== null) {
602
+ throw validateError;
603
+ }
604
+ }
605
+ const key = keyBuilderFromType$7(luvio, input);
606
+ const ttlToUse = TTL$7;
607
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "data-seed", VERSION$e, RepresentationType$7, equals$e);
608
+ return createLink(key);
609
+ };
610
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
611
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
612
+ const rootKey = keyBuilderFromType$7(luvio, input);
613
+ rootKeySet.set(rootKey, {
614
+ namespace: keyPrefix,
615
+ representationName: RepresentationType$7,
616
+ mergeable: false
617
+ });
618
+ }
619
+
620
+ function select$n(luvio, params) {
621
+ return select$o();
622
+ }
623
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
624
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
625
+ }
626
+ function ingestSuccess$9(luvio, resourceParams, response) {
627
+ const { body } = response;
628
+ const key = keyBuilderFromType$7(luvio, body);
629
+ luvio.storeIngest(key, ingest$7, body);
630
+ const snapshot = luvio.storeLookup({
631
+ recordId: key,
632
+ node: select$n(),
633
+ variables: {},
634
+ });
635
+ if (process.env.NODE_ENV !== 'production') {
636
+ if (snapshot.state !== 'Fulfilled') {
637
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
638
+ }
639
+ }
640
+ deepFreeze(snapshot.data);
641
+ return snapshot;
642
+ }
643
+ function createResourceRequest$9(config) {
644
+ const headers = {};
645
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
646
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
647
+ headers['Org-Url'] = config.headers.orgUrl;
648
+ headers['Access-Token'] = config.headers.accessToken;
649
+ return {
650
+ baseUri: 'api.salesforce.com',
651
+ basePath: '/platform/data-seed/v1/data-seed-request/' + config.urlParams.request_id + '',
652
+ method: 'post',
653
+ body: null,
654
+ urlParams: config.urlParams,
655
+ queryParams: {},
656
+ headers,
657
+ priority: 'normal',
658
+ };
659
+ }
660
+
661
+ const adapterName$9 = 'getDataSeedRequestStatus';
662
+ const getDataSeedRequestStatus_ConfigPropertyMetadata = [
663
+ generateParamConfigMetadata('request_id', true, 0 /* UrlParameter */, 0 /* String */),
664
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
665
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
666
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
667
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
668
+ ];
669
+ const getDataSeedRequestStatus_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getDataSeedRequestStatus_ConfigPropertyMetadata);
670
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$b(getDataSeedRequestStatus_ConfigPropertyMetadata);
671
+ function typeCheckConfig$9(untrustedConfig) {
672
+ const config = {};
673
+ typeCheckConfig$b(untrustedConfig, config, getDataSeedRequestStatus_ConfigPropertyMetadata);
674
+ return config;
675
+ }
676
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
677
+ if (!untrustedIsObject(untrustedConfig)) {
678
+ return null;
679
+ }
680
+ if (process.env.NODE_ENV !== 'production') {
681
+ validateConfig(untrustedConfig, configPropertyNames);
682
+ }
683
+ const config = typeCheckConfig$9(untrustedConfig);
684
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
685
+ return null;
686
+ }
687
+ return config;
688
+ }
689
+ function buildNetworkSnapshot$9(luvio, config, options) {
690
+ const resourceParams = createResourceParams$9(config);
691
+ const request = createResourceRequest$9(resourceParams);
692
+ return luvio.dispatchResourceRequest(request, options)
693
+ .then((response) => {
694
+ return luvio.handleSuccessResponse(() => {
695
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response);
696
+ return luvio.storeBroadcast().then(() => snapshot);
697
+ }, () => {
698
+ const cache = new StoreKeyMap();
699
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
700
+ return cache;
701
+ });
702
+ }, (response) => {
703
+ deepFreeze(response);
704
+ throw response;
705
+ });
706
+ }
707
+ const getDataSeedRequestStatusAdapterFactory = (luvio) => {
708
+ return function getDataSeedRequestStatus(untrustedConfig) {
709
+ const config = validateAdapterConfig$9(untrustedConfig, getDataSeedRequestStatus_ConfigPropertyNames);
710
+ // Invalid or incomplete config
711
+ if (config === null) {
712
+ throw new Error('Invalid config for "getDataSeedRequestStatus"');
713
+ }
714
+ return buildNetworkSnapshot$9(luvio, config);
715
+ };
716
+ };
717
+
718
+ const TTL$6 = 300000;
719
+ const VERSION$d = "578e9dba5d8078135d4027313a51d7dc";
720
+ function validate$d(obj, path = 'PreSignedUrlResultRepresentation') {
721
+ const v_error = (() => {
722
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
723
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
724
+ }
725
+ const obj_s3_unique_id = obj.s3_unique_id;
726
+ const path_s3_unique_id = path + '.s3_unique_id';
727
+ if (typeof obj_s3_unique_id !== 'string') {
728
+ return new TypeError('Expected "string" but received "' + typeof obj_s3_unique_id + '" (at "' + path_s3_unique_id + '")');
729
+ }
730
+ const obj_url = obj.url;
731
+ const path_url = path + '.url';
732
+ if (typeof obj_url !== 'string') {
733
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
734
+ }
735
+ })();
736
+ return v_error === undefined ? null : v_error;
737
+ }
738
+ const RepresentationType$6 = 'PreSignedUrlResultRepresentation';
739
+ function keyBuilder$6(luvio, config) {
740
+ return keyPrefix + '::' + RepresentationType$6 + ':' + config.s3_unique_id;
741
+ }
742
+ function keyBuilderFromType$6(luvio, object) {
743
+ const keyParams = {
744
+ s3_unique_id: object.s3_unique_id
745
+ };
746
+ return keyBuilder$6(luvio, keyParams);
747
+ }
748
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
749
+ return input;
750
+ }
751
+ const select$m = function PreSignedUrlResultRepresentationSelect() {
752
+ return {
753
+ kind: 'Fragment',
754
+ version: VERSION$d,
755
+ private: [],
756
+ selections: [
757
+ {
758
+ name: 's3_unique_id',
759
+ kind: 'Scalar'
760
+ },
761
+ {
762
+ name: 'url',
763
+ kind: 'Scalar'
764
+ }
765
+ ]
766
+ };
767
+ };
768
+ function equals$d(existing, incoming) {
769
+ const existing_s3_unique_id = existing.s3_unique_id;
770
+ const incoming_s3_unique_id = incoming.s3_unique_id;
771
+ if (!(existing_s3_unique_id === incoming_s3_unique_id)) {
772
+ return false;
773
+ }
774
+ const existing_url = existing.url;
775
+ const incoming_url = incoming.url;
776
+ if (!(existing_url === incoming_url)) {
777
+ return false;
778
+ }
779
+ return true;
780
+ }
781
+ const ingest$6 = function PreSignedUrlResultRepresentationIngest(input, path, luvio, store, timestamp) {
782
+ if (process.env.NODE_ENV !== 'production') {
783
+ const validateError = validate$d(input);
784
+ if (validateError !== null) {
785
+ throw validateError;
786
+ }
787
+ }
788
+ const key = keyBuilderFromType$6(luvio, input);
789
+ const ttlToUse = TTL$6;
790
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "data-seed", VERSION$d, RepresentationType$6, equals$d);
791
+ return createLink(key);
792
+ };
793
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
794
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
795
+ const rootKey = keyBuilderFromType$6(luvio, input);
796
+ rootKeySet.set(rootKey, {
797
+ namespace: keyPrefix,
798
+ representationName: RepresentationType$6,
799
+ mergeable: false
800
+ });
801
+ }
802
+
803
+ function select$l(luvio, params) {
804
+ return select$m();
805
+ }
806
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
807
+ getTypeCacheKeys$6(storeKeyMap, luvio, response);
808
+ }
809
+ function ingestSuccess$8(luvio, resourceParams, response) {
810
+ const { body } = response;
811
+ const key = keyBuilderFromType$6(luvio, body);
812
+ luvio.storeIngest(key, ingest$6, body);
813
+ const snapshot = luvio.storeLookup({
814
+ recordId: key,
815
+ node: select$l(),
816
+ variables: {},
817
+ });
818
+ if (process.env.NODE_ENV !== 'production') {
819
+ if (snapshot.state !== 'Fulfilled') {
820
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
821
+ }
822
+ }
823
+ deepFreeze(snapshot.data);
824
+ return snapshot;
825
+ }
826
+ function createResourceRequest$8(config) {
827
+ const headers = {};
828
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
829
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
830
+ headers['Org-Url'] = config.headers.orgUrl;
831
+ headers['Access-Token'] = config.headers.accessToken;
832
+ return {
833
+ baseUri: 'api.salesforce.com',
834
+ basePath: '/platform/data-seed/v1/data-seed-generate-presigned-upload-url',
835
+ method: 'post',
836
+ body: config.body,
837
+ urlParams: {},
838
+ queryParams: {},
839
+ headers,
840
+ priority: 'normal',
841
+ };
842
+ }
843
+
844
+ const adapterName$8 = 'getUploadPreSignedUrl';
845
+ const getUploadPreSignedUrl_ConfigPropertyMetadata = [
846
+ generateParamConfigMetadata('file_name', true, 2 /* Body */, 0 /* String */),
847
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
848
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
849
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
850
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
851
+ ];
852
+ const getUploadPreSignedUrl_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getUploadPreSignedUrl_ConfigPropertyMetadata);
853
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$b(getUploadPreSignedUrl_ConfigPropertyMetadata);
854
+ function typeCheckConfig$8(untrustedConfig) {
855
+ const config = {};
856
+ typeCheckConfig$b(untrustedConfig, config, getUploadPreSignedUrl_ConfigPropertyMetadata);
857
+ return config;
858
+ }
859
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
860
+ if (!untrustedIsObject(untrustedConfig)) {
861
+ return null;
862
+ }
863
+ if (process.env.NODE_ENV !== 'production') {
864
+ validateConfig(untrustedConfig, configPropertyNames);
865
+ }
866
+ const config = typeCheckConfig$8(untrustedConfig);
867
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
868
+ return null;
869
+ }
870
+ return config;
871
+ }
872
+ function buildNetworkSnapshot$8(luvio, config, options) {
873
+ const resourceParams = createResourceParams$8(config);
874
+ const request = createResourceRequest$8(resourceParams);
875
+ return luvio.dispatchResourceRequest(request, options)
876
+ .then((response) => {
877
+ return luvio.handleSuccessResponse(() => {
878
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
879
+ return luvio.storeBroadcast().then(() => snapshot);
880
+ }, () => {
881
+ const cache = new StoreKeyMap();
882
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
883
+ return cache;
884
+ });
885
+ }, (response) => {
886
+ deepFreeze(response);
887
+ throw response;
888
+ });
889
+ }
890
+ const getUploadPreSignedUrlAdapterFactory = (luvio) => {
891
+ return function getUploadPreSignedUrl(untrustedConfig) {
892
+ const config = validateAdapterConfig$8(untrustedConfig, getUploadPreSignedUrl_ConfigPropertyNames);
893
+ // Invalid or incomplete config
894
+ if (config === null) {
895
+ throw new Error('Invalid config for "getUploadPreSignedUrl"');
896
+ }
897
+ return buildNetworkSnapshot$8(luvio, config);
898
+ };
899
+ };
900
+
901
+ const TTL$5 = 200;
902
+ const VERSION$c = "fb30035fb4e1163f7b85f84bc6799870";
903
+ function validate$c(obj, path = 'PreSignedDownloadUrlResultRepresentation') {
904
+ const v_error = (() => {
905
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
906
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
907
+ }
908
+ const obj_correlation_id = obj.correlation_id;
909
+ const path_correlation_id = path + '.correlation_id';
910
+ if (typeof obj_correlation_id !== 'string') {
911
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
912
+ }
913
+ const obj_url = obj.url;
914
+ const path_url = path + '.url';
915
+ if (typeof obj_url !== 'string') {
916
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
917
+ }
918
+ })();
919
+ return v_error === undefined ? null : v_error;
920
+ }
921
+ const RepresentationType$5 = 'PreSignedDownloadUrlResultRepresentation';
922
+ function keyBuilder$5(luvio, config) {
923
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.correlation_id;
924
+ }
925
+ function keyBuilderFromType$5(luvio, object) {
926
+ const keyParams = {
927
+ correlation_id: object.correlation_id
928
+ };
929
+ return keyBuilder$5(luvio, keyParams);
930
+ }
931
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
932
+ return input;
933
+ }
934
+ const select$k = function PreSignedDownloadUrlResultRepresentationSelect() {
935
+ return {
936
+ kind: 'Fragment',
937
+ version: VERSION$c,
938
+ private: [],
939
+ selections: [
940
+ {
941
+ name: 'correlation_id',
942
+ kind: 'Scalar'
943
+ },
944
+ {
945
+ name: 'url',
946
+ kind: 'Scalar'
947
+ }
948
+ ]
949
+ };
950
+ };
951
+ function equals$c(existing, incoming) {
952
+ const existing_correlation_id = existing.correlation_id;
953
+ const incoming_correlation_id = incoming.correlation_id;
954
+ if (!(existing_correlation_id === incoming_correlation_id)) {
955
+ return false;
956
+ }
957
+ const existing_url = existing.url;
958
+ const incoming_url = incoming.url;
959
+ if (!(existing_url === incoming_url)) {
960
+ return false;
961
+ }
962
+ return true;
963
+ }
964
+ const ingest$5 = function PreSignedDownloadUrlResultRepresentationIngest(input, path, luvio, store, timestamp) {
965
+ if (process.env.NODE_ENV !== 'production') {
966
+ const validateError = validate$c(input);
967
+ if (validateError !== null) {
968
+ throw validateError;
969
+ }
970
+ }
971
+ const key = keyBuilderFromType$5(luvio, input);
972
+ const ttlToUse = TTL$5;
973
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "data-seed", VERSION$c, RepresentationType$5, equals$c);
974
+ return createLink(key);
975
+ };
976
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
977
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
978
+ const rootKey = keyBuilderFromType$5(luvio, input);
979
+ rootKeySet.set(rootKey, {
980
+ namespace: keyPrefix,
981
+ representationName: RepresentationType$5,
982
+ mergeable: false
983
+ });
984
+ }
985
+
986
+ function select$j(luvio, params) {
987
+ return select$k();
988
+ }
989
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
990
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
991
+ }
992
+ function ingestSuccess$7(luvio, resourceParams, response) {
993
+ const { body } = response;
994
+ const key = keyBuilderFromType$5(luvio, body);
995
+ luvio.storeIngest(key, ingest$5, body);
996
+ const snapshot = luvio.storeLookup({
997
+ recordId: key,
998
+ node: select$j(),
999
+ variables: {},
1000
+ });
1001
+ if (process.env.NODE_ENV !== 'production') {
1002
+ if (snapshot.state !== 'Fulfilled') {
1003
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1004
+ }
1005
+ }
1006
+ deepFreeze(snapshot.data);
1007
+ return snapshot;
1008
+ }
1009
+ function createResourceRequest$7(config) {
1010
+ const headers = {};
1011
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
1012
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
1013
+ headers['Org-Url'] = config.headers.orgUrl;
1014
+ headers['Access-Token'] = config.headers.accessToken;
1015
+ return {
1016
+ baseUri: 'api.salesforce.com',
1017
+ basePath: '/platform/data-seed/v1/data-seed-generate-presigned-download-url/' + config.urlParams.file_type + '/' + config.urlParams.request_id + '',
1018
+ method: 'post',
1019
+ body: null,
1020
+ urlParams: config.urlParams,
1021
+ queryParams: {},
1022
+ headers,
1023
+ priority: 'normal',
1024
+ };
1025
+ }
1026
+
1027
+ const adapterName$7 = 'getDownloadPreSignedUrl';
1028
+ const getDownloadPreSignedUrl_ConfigPropertyMetadata = [
1029
+ generateParamConfigMetadata('request_id', true, 0 /* UrlParameter */, 0 /* String */),
1030
+ generateParamConfigMetadata('file_type', true, 0 /* UrlParameter */, 0 /* String */),
1031
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
1032
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
1033
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
1034
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
1035
+ ];
1036
+ const getDownloadPreSignedUrl_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getDownloadPreSignedUrl_ConfigPropertyMetadata);
1037
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$b(getDownloadPreSignedUrl_ConfigPropertyMetadata);
1038
+ function typeCheckConfig$7(untrustedConfig) {
1039
+ const config = {};
1040
+ typeCheckConfig$b(untrustedConfig, config, getDownloadPreSignedUrl_ConfigPropertyMetadata);
1041
+ return config;
1042
+ }
1043
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1044
+ if (!untrustedIsObject(untrustedConfig)) {
1045
+ return null;
1046
+ }
1047
+ if (process.env.NODE_ENV !== 'production') {
1048
+ validateConfig(untrustedConfig, configPropertyNames);
1049
+ }
1050
+ const config = typeCheckConfig$7(untrustedConfig);
1051
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1052
+ return null;
1053
+ }
1054
+ return config;
1055
+ }
1056
+ function buildNetworkSnapshot$7(luvio, config, options) {
1057
+ const resourceParams = createResourceParams$7(config);
1058
+ const request = createResourceRequest$7(resourceParams);
1059
+ return luvio.dispatchResourceRequest(request, options)
1060
+ .then((response) => {
1061
+ return luvio.handleSuccessResponse(() => {
1062
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response);
1063
+ return luvio.storeBroadcast().then(() => snapshot);
1064
+ }, () => {
1065
+ const cache = new StoreKeyMap();
1066
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
1067
+ return cache;
1068
+ });
1069
+ }, (response) => {
1070
+ deepFreeze(response);
1071
+ throw response;
1072
+ });
1073
+ }
1074
+ const getDownloadPreSignedUrlAdapterFactory = (luvio) => {
1075
+ return function getDownloadPreSignedUrl(untrustedConfig) {
1076
+ const config = validateAdapterConfig$7(untrustedConfig, getDownloadPreSignedUrl_ConfigPropertyNames);
1077
+ // Invalid or incomplete config
1078
+ if (config === null) {
1079
+ throw new Error('Invalid config for "getDownloadPreSignedUrl"');
1080
+ }
1081
+ return buildNetworkSnapshot$7(luvio, config);
1082
+ };
1083
+ };
1084
+
1085
+ const VERSION$b = "d05acb56ab5bac9800fbedd0ee17a85b";
1086
+ function validate$b(obj, path = 'EntityResponseObject') {
1087
+ const v_error = (() => {
1088
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1089
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1090
+ }
1091
+ const obj_objectAPIName = obj.objectAPIName;
1092
+ const path_objectAPIName = path + '.objectAPIName';
1093
+ if (typeof obj_objectAPIName !== 'string') {
1094
+ return new TypeError('Expected "string" but received "' + typeof obj_objectAPIName + '" (at "' + path_objectAPIName + '")');
1095
+ }
1096
+ const obj_objectName = obj.objectName;
1097
+ const path_objectName = path + '.objectName';
1098
+ if (typeof obj_objectName !== 'string') {
1099
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
1100
+ }
1101
+ const obj_type = obj.type;
1102
+ const path_type = path + '.type';
1103
+ if (typeof obj_type !== 'string') {
1104
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1105
+ }
1106
+ })();
1107
+ return v_error === undefined ? null : v_error;
1108
+ }
1109
+ const select$i = function EntityResponseObjectSelect() {
1110
+ return {
1111
+ kind: 'Fragment',
1112
+ version: VERSION$b,
1113
+ private: [],
1114
+ selections: [
1115
+ {
1116
+ name: 'objectAPIName',
1117
+ kind: 'Scalar'
1118
+ },
1119
+ {
1120
+ name: 'objectName',
1121
+ kind: 'Scalar'
1122
+ },
1123
+ {
1124
+ name: 'type',
1125
+ kind: 'Scalar'
1126
+ }
1127
+ ]
1128
+ };
1129
+ };
1130
+ function equals$b(existing, incoming) {
1131
+ const existing_objectAPIName = existing.objectAPIName;
1132
+ const incoming_objectAPIName = incoming.objectAPIName;
1133
+ if (!(existing_objectAPIName === incoming_objectAPIName)) {
1134
+ return false;
1135
+ }
1136
+ const existing_objectName = existing.objectName;
1137
+ const incoming_objectName = incoming.objectName;
1138
+ if (!(existing_objectName === incoming_objectName)) {
1139
+ return false;
1140
+ }
1141
+ const existing_type = existing.type;
1142
+ const incoming_type = incoming.type;
1143
+ if (!(existing_type === incoming_type)) {
1144
+ return false;
1145
+ }
1146
+ return true;
1147
+ }
1148
+
1149
+ const TTL$4 = 1000;
1150
+ const VERSION$a = "d6223d7170b81572755f7276496527ee";
1151
+ function validate$a(obj, path = 'EntitiesOutputRepresentation') {
1152
+ const v_error = (() => {
1153
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1154
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1155
+ }
1156
+ const obj_correlation_id = obj.correlation_id;
1157
+ const path_correlation_id = path + '.correlation_id';
1158
+ if (typeof obj_correlation_id !== 'string') {
1159
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
1160
+ }
1161
+ const obj_entities = obj.entities;
1162
+ const path_entities = path + '.entities';
1163
+ if (!ArrayIsArray(obj_entities)) {
1164
+ return new TypeError('Expected "array" but received "' + typeof obj_entities + '" (at "' + path_entities + '")');
1165
+ }
1166
+ for (let i = 0; i < obj_entities.length; i++) {
1167
+ const obj_entities_item = obj_entities[i];
1168
+ const path_entities_item = path_entities + '[' + i + ']';
1169
+ const referencepath_entities_itemValidationError = validate$b(obj_entities_item, path_entities_item);
1170
+ if (referencepath_entities_itemValidationError !== null) {
1171
+ let message = 'Object doesn\'t match EntityResponseObject (at "' + path_entities_item + '")\n';
1172
+ message += referencepath_entities_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1173
+ return new TypeError(message);
1174
+ }
1175
+ }
1176
+ })();
1177
+ return v_error === undefined ? null : v_error;
1178
+ }
1179
+ const RepresentationType$4 = 'EntitiesOutputRepresentation';
1180
+ function keyBuilder$4(luvio, config) {
1181
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.correlation_id;
1182
+ }
1183
+ function keyBuilderFromType$4(luvio, object) {
1184
+ const keyParams = {
1185
+ correlation_id: object.correlation_id
1186
+ };
1187
+ return keyBuilder$4(luvio, keyParams);
1188
+ }
1189
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
1190
+ return input;
1191
+ }
1192
+ const select$h = function EntitiesOutputRepresentationSelect() {
1193
+ const { selections: EntityResponseObject__selections, opaque: EntityResponseObject__opaque, } = select$i();
1194
+ return {
1195
+ kind: 'Fragment',
1196
+ version: VERSION$a,
1197
+ private: [],
1198
+ selections: [
1199
+ {
1200
+ name: 'correlation_id',
1201
+ kind: 'Scalar'
1202
+ },
1203
+ {
1204
+ name: 'entities',
1205
+ kind: 'Object',
1206
+ plural: true,
1207
+ selections: EntityResponseObject__selections
1208
+ }
1209
+ ]
1210
+ };
1211
+ };
1212
+ function equals$a(existing, incoming) {
1213
+ const existing_correlation_id = existing.correlation_id;
1214
+ const incoming_correlation_id = incoming.correlation_id;
1215
+ if (!(existing_correlation_id === incoming_correlation_id)) {
1216
+ return false;
1217
+ }
1218
+ const existing_entities = existing.entities;
1219
+ const incoming_entities = incoming.entities;
1220
+ const equals_entities_items = equalsArray(existing_entities, incoming_entities, (existing_entities_item, incoming_entities_item) => {
1221
+ if (!(equals$b(existing_entities_item, incoming_entities_item))) {
1222
+ return false;
1223
+ }
1224
+ });
1225
+ if (equals_entities_items === false) {
1226
+ return false;
1227
+ }
1228
+ return true;
1229
+ }
1230
+ const ingest$4 = function EntitiesOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1231
+ if (process.env.NODE_ENV !== 'production') {
1232
+ const validateError = validate$a(input);
1233
+ if (validateError !== null) {
1234
+ throw validateError;
1235
+ }
1236
+ }
1237
+ const key = keyBuilderFromType$4(luvio, input);
1238
+ const ttlToUse = TTL$4;
1239
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "data-seed", VERSION$a, RepresentationType$4, equals$a);
1240
+ return createLink(key);
1241
+ };
1242
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
1243
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1244
+ const rootKey = keyBuilderFromType$4(luvio, input);
1245
+ rootKeySet.set(rootKey, {
1246
+ namespace: keyPrefix,
1247
+ representationName: RepresentationType$4,
1248
+ mergeable: false
1249
+ });
1250
+ }
1251
+
1252
+ function select$g(luvio, params) {
1253
+ return select$h();
1254
+ }
1255
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
1256
+ getTypeCacheKeys$4(storeKeyMap, luvio, response);
1257
+ }
1258
+ function ingestSuccess$6(luvio, resourceParams, response) {
1259
+ const { body } = response;
1260
+ const key = keyBuilderFromType$4(luvio, body);
1261
+ luvio.storeIngest(key, ingest$4, body);
1262
+ const snapshot = luvio.storeLookup({
1263
+ recordId: key,
1264
+ node: select$g(),
1265
+ variables: {},
1266
+ });
1267
+ if (process.env.NODE_ENV !== 'production') {
1268
+ if (snapshot.state !== 'Fulfilled') {
1269
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1270
+ }
1271
+ }
1272
+ deepFreeze(snapshot.data);
1273
+ return snapshot;
1274
+ }
1275
+ function createResourceRequest$6(config) {
1276
+ const headers = {};
1277
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
1278
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
1279
+ headers['Org-Url'] = config.headers.orgUrl;
1280
+ headers['Access-Token'] = config.headers.accessToken;
1281
+ return {
1282
+ baseUri: 'api.salesforce.com',
1283
+ basePath: '/platform/data-seed/v1/data-seed-fetch-salesforce-entities',
1284
+ method: 'post',
1285
+ body: config.body,
1286
+ urlParams: {},
1287
+ queryParams: {},
1288
+ headers,
1289
+ priority: 'normal',
1290
+ };
1291
+ }
1292
+
1293
+ const adapterName$6 = 'getOrgEntities';
1294
+ const getOrgEntities_ConfigPropertyMetadata = [
1295
+ generateParamConfigMetadata('source_instance_url', true, 2 /* Body */, 0 /* String */),
1296
+ generateParamConfigMetadata('source_access_token', true, 2 /* Body */, 0 /* String */),
1297
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
1298
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
1299
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
1300
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
1301
+ ];
1302
+ const getOrgEntities_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getOrgEntities_ConfigPropertyMetadata);
1303
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$b(getOrgEntities_ConfigPropertyMetadata);
1304
+ function typeCheckConfig$6(untrustedConfig) {
1305
+ const config = {};
1306
+ typeCheckConfig$b(untrustedConfig, config, getOrgEntities_ConfigPropertyMetadata);
1307
+ return config;
1308
+ }
1309
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
1310
+ if (!untrustedIsObject(untrustedConfig)) {
1311
+ return null;
1312
+ }
1313
+ if (process.env.NODE_ENV !== 'production') {
1314
+ validateConfig(untrustedConfig, configPropertyNames);
1315
+ }
1316
+ const config = typeCheckConfig$6(untrustedConfig);
1317
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1318
+ return null;
1319
+ }
1320
+ return config;
1321
+ }
1322
+ function buildNetworkSnapshot$6(luvio, config, options) {
1323
+ const resourceParams = createResourceParams$6(config);
1324
+ const request = createResourceRequest$6(resourceParams);
1325
+ return luvio.dispatchResourceRequest(request, options)
1326
+ .then((response) => {
1327
+ return luvio.handleSuccessResponse(() => {
1328
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
1329
+ return luvio.storeBroadcast().then(() => snapshot);
1330
+ }, () => {
1331
+ const cache = new StoreKeyMap();
1332
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
1333
+ return cache;
1334
+ });
1335
+ }, (response) => {
1336
+ deepFreeze(response);
1337
+ throw response;
1338
+ });
1339
+ }
1340
+ const getOrgEntitiesAdapterFactory = (luvio) => {
1341
+ return function getOrgEntities(untrustedConfig) {
1342
+ const config = validateAdapterConfig$6(untrustedConfig, getOrgEntities_ConfigPropertyNames);
1343
+ // Invalid or incomplete config
1344
+ if (config === null) {
1345
+ throw new Error('Invalid config for "getOrgEntities"');
1346
+ }
1347
+ return buildNetworkSnapshot$6(luvio, config);
1348
+ };
1349
+ };
1350
+
1351
+ const TTL$3 = 200;
1352
+ const VERSION$9 = "c30968fc6807765eaa0ac390bf21f4b6";
1353
+ function validate$9(obj, path = 'MigrateDataOutputRepresentation') {
1354
+ const v_error = (() => {
1355
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1356
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1357
+ }
1358
+ const obj_correlation_id = obj.correlation_id;
1359
+ const path_correlation_id = path + '.correlation_id';
1360
+ if (typeof obj_correlation_id !== 'string') {
1361
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
1362
+ }
1363
+ const obj_request_id = obj.request_id;
1364
+ const path_request_id = path + '.request_id';
1365
+ if (typeof obj_request_id !== 'string') {
1366
+ return new TypeError('Expected "string" but received "' + typeof obj_request_id + '" (at "' + path_request_id + '")');
1367
+ }
1368
+ const obj_response = obj.response;
1369
+ const path_response = path + '.response';
1370
+ if (typeof obj_response !== 'string') {
1371
+ return new TypeError('Expected "string" but received "' + typeof obj_response + '" (at "' + path_response + '")');
1372
+ }
1373
+ })();
1374
+ return v_error === undefined ? null : v_error;
1375
+ }
1376
+ const RepresentationType$3 = 'MigrateDataOutputRepresentation';
1377
+ function keyBuilder$3(luvio, config) {
1378
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.request_id;
1379
+ }
1380
+ function keyBuilderFromType$3(luvio, object) {
1381
+ const keyParams = {
1382
+ request_id: object.request_id
1383
+ };
1384
+ return keyBuilder$3(luvio, keyParams);
1385
+ }
1386
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
1387
+ return input;
1388
+ }
1389
+ const select$f = function MigrateDataOutputRepresentationSelect() {
1390
+ return {
1391
+ kind: 'Fragment',
1392
+ version: VERSION$9,
1393
+ private: [],
1394
+ selections: [
1395
+ {
1396
+ name: 'correlation_id',
1397
+ kind: 'Scalar'
1398
+ },
1399
+ {
1400
+ name: 'request_id',
1401
+ kind: 'Scalar'
1402
+ },
1403
+ {
1404
+ name: 'response',
1405
+ kind: 'Scalar'
1406
+ }
1407
+ ]
1408
+ };
1409
+ };
1410
+ function equals$9(existing, incoming) {
1411
+ const existing_correlation_id = existing.correlation_id;
1412
+ const incoming_correlation_id = incoming.correlation_id;
1413
+ if (!(existing_correlation_id === incoming_correlation_id)) {
1414
+ return false;
1415
+ }
1416
+ const existing_request_id = existing.request_id;
1417
+ const incoming_request_id = incoming.request_id;
1418
+ if (!(existing_request_id === incoming_request_id)) {
1419
+ return false;
1420
+ }
1421
+ const existing_response = existing.response;
1422
+ const incoming_response = incoming.response;
1423
+ if (!(existing_response === incoming_response)) {
1424
+ return false;
1425
+ }
1426
+ return true;
1427
+ }
1428
+ const ingest$3 = function MigrateDataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1429
+ if (process.env.NODE_ENV !== 'production') {
1430
+ const validateError = validate$9(input);
1431
+ if (validateError !== null) {
1432
+ throw validateError;
1433
+ }
1434
+ }
1435
+ const key = keyBuilderFromType$3(luvio, input);
1436
+ const ttlToUse = TTL$3;
1437
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "data-seed", VERSION$9, RepresentationType$3, equals$9);
1438
+ return createLink(key);
1439
+ };
1440
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1441
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1442
+ const rootKey = keyBuilderFromType$3(luvio, input);
1443
+ rootKeySet.set(rootKey, {
1444
+ namespace: keyPrefix,
1445
+ representationName: RepresentationType$3,
1446
+ mergeable: false
1447
+ });
1448
+ }
1449
+
1450
+ function select$e(luvio, params) {
1451
+ return select$f();
1452
+ }
1453
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
1454
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1455
+ }
1456
+ function ingestSuccess$5(luvio, resourceParams, response) {
1457
+ const { body } = response;
1458
+ const key = keyBuilderFromType$3(luvio, body);
1459
+ luvio.storeIngest(key, ingest$3, body);
1460
+ const snapshot = luvio.storeLookup({
1461
+ recordId: key,
1462
+ node: select$e(),
1463
+ variables: {},
1464
+ });
1465
+ if (process.env.NODE_ENV !== 'production') {
1466
+ if (snapshot.state !== 'Fulfilled') {
1467
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1468
+ }
1469
+ }
1470
+ deepFreeze(snapshot.data);
1471
+ return snapshot;
1472
+ }
1473
+ function createResourceRequest$5(config) {
1474
+ const headers = {};
1475
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
1476
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
1477
+ headers['Org-Url'] = config.headers.orgUrl;
1478
+ headers['Access-Token'] = config.headers.accessToken;
1479
+ return {
1480
+ baseUri: 'api.salesforce.com',
1481
+ basePath: '/platform/data-seed/v1/data-seed-migrate',
1482
+ method: 'post',
1483
+ body: config.body,
1484
+ urlParams: {},
1485
+ queryParams: {},
1486
+ headers,
1487
+ priority: 'normal',
1488
+ };
1489
+ }
1490
+
1491
+ const adapterName$5 = 'migrateData';
1492
+ const migrateData_ConfigPropertyMetadata = [
1493
+ generateParamConfigMetadata('source_instance_url', true, 2 /* Body */, 0 /* String */),
1494
+ generateParamConfigMetadata('source_access_token', true, 2 /* Body */, 0 /* String */),
1495
+ generateParamConfigMetadata('target_instance_url', true, 2 /* Body */, 0 /* String */),
1496
+ generateParamConfigMetadata('target_access_token', true, 2 /* Body */, 0 /* String */),
1497
+ generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
1498
+ generateParamConfigMetadata('desc', true, 2 /* Body */, 0 /* String */),
1499
+ generateParamConfigMetadata('config', true, 2 /* Body */, 0 /* String */),
1500
+ generateParamConfigMetadata('mode', true, 2 /* Body */, 0 /* String */),
1501
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
1502
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
1503
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
1504
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
1505
+ ];
1506
+ const migrateData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, migrateData_ConfigPropertyMetadata);
1507
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$b(migrateData_ConfigPropertyMetadata);
1508
+ function typeCheckConfig$5(untrustedConfig) {
1509
+ const config = {};
1510
+ typeCheckConfig$b(untrustedConfig, config, migrateData_ConfigPropertyMetadata);
1511
+ return config;
1512
+ }
1513
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1514
+ if (!untrustedIsObject(untrustedConfig)) {
1515
+ return null;
1516
+ }
1517
+ if (process.env.NODE_ENV !== 'production') {
1518
+ validateConfig(untrustedConfig, configPropertyNames);
1519
+ }
1520
+ const config = typeCheckConfig$5(untrustedConfig);
1521
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1522
+ return null;
1523
+ }
1524
+ return config;
1525
+ }
1526
+ function buildNetworkSnapshot$5(luvio, config, options) {
1527
+ const resourceParams = createResourceParams$5(config);
1528
+ const request = createResourceRequest$5(resourceParams);
1529
+ return luvio.dispatchResourceRequest(request, options)
1530
+ .then((response) => {
1531
+ return luvio.handleSuccessResponse(() => {
1532
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
1533
+ return luvio.storeBroadcast().then(() => snapshot);
1534
+ }, () => {
1535
+ const cache = new StoreKeyMap();
1536
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
1537
+ return cache;
1538
+ });
1539
+ }, (response) => {
1540
+ deepFreeze(response);
1541
+ throw response;
1542
+ });
1543
+ }
1544
+ const migrateDataAdapterFactory = (luvio) => {
1545
+ return function migrateData(untrustedConfig) {
1546
+ const config = validateAdapterConfig$5(untrustedConfig, migrateData_ConfigPropertyNames);
1547
+ // Invalid or incomplete config
1548
+ if (config === null) {
1549
+ throw new Error('Invalid config for "migrateData"');
1550
+ }
1551
+ return buildNetworkSnapshot$5(luvio, config);
1552
+ };
1553
+ };
1554
+
1555
+ function select$d(luvio, params) {
1556
+ return select$f();
1557
+ }
1558
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1559
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1560
+ }
1561
+ function ingestSuccess$4(luvio, resourceParams, response) {
1562
+ const { body } = response;
1563
+ const key = keyBuilderFromType$3(luvio, body);
1564
+ luvio.storeIngest(key, ingest$3, body);
1565
+ const snapshot = luvio.storeLookup({
1566
+ recordId: key,
1567
+ node: select$d(),
1568
+ variables: {},
1569
+ });
1570
+ if (process.env.NODE_ENV !== 'production') {
1571
+ if (snapshot.state !== 'Fulfilled') {
1572
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1573
+ }
1574
+ }
1575
+ deepFreeze(snapshot.data);
1576
+ return snapshot;
1577
+ }
1578
+ function createResourceRequest$4(config) {
1579
+ const headers = {};
1580
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
1581
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
1582
+ headers['Org-Url'] = config.headers.orgUrl;
1583
+ headers['Access-Token'] = config.headers.accessToken;
1584
+ return {
1585
+ baseUri: 'api.salesforce.com',
1586
+ basePath: '/platform/data-seed/v1/data-seed-load/' + config.urlParams.dataseed_request_id + '',
1587
+ method: 'post',
1588
+ body: config.body,
1589
+ urlParams: config.urlParams,
1590
+ queryParams: {},
1591
+ headers,
1592
+ priority: 'normal',
1593
+ };
1594
+ }
1595
+
1596
+ const adapterName$4 = 'loadDataToTargetOrg';
1597
+ const loadDataToTargetOrg_ConfigPropertyMetadata = [
1598
+ generateParamConfigMetadata('dataseed_request_id', true, 0 /* UrlParameter */, 0 /* String */),
1599
+ generateParamConfigMetadata('target_instance_url', true, 2 /* Body */, 0 /* String */),
1600
+ generateParamConfigMetadata('target_access_token', true, 2 /* Body */, 0 /* String */),
1601
+ generateParamConfigMetadata('operation_type', false, 2 /* Body */, 0 /* String */),
1602
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
1603
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
1604
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
1605
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
1606
+ ];
1607
+ const loadDataToTargetOrg_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, loadDataToTargetOrg_ConfigPropertyMetadata);
1608
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$b(loadDataToTargetOrg_ConfigPropertyMetadata);
1609
+ function typeCheckConfig$4(untrustedConfig) {
1610
+ const config = {};
1611
+ typeCheckConfig$b(untrustedConfig, config, loadDataToTargetOrg_ConfigPropertyMetadata);
1612
+ return config;
1613
+ }
1614
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1615
+ if (!untrustedIsObject(untrustedConfig)) {
1616
+ return null;
1617
+ }
1618
+ if (process.env.NODE_ENV !== 'production') {
1619
+ validateConfig(untrustedConfig, configPropertyNames);
1620
+ }
1621
+ const config = typeCheckConfig$4(untrustedConfig);
1622
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1623
+ return null;
1624
+ }
1625
+ return config;
1626
+ }
1627
+ function buildNetworkSnapshot$4(luvio, config, options) {
1628
+ const resourceParams = createResourceParams$4(config);
1629
+ const request = createResourceRequest$4(resourceParams);
1630
+ return luvio.dispatchResourceRequest(request, options)
1631
+ .then((response) => {
1632
+ return luvio.handleSuccessResponse(() => {
1633
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
1634
+ return luvio.storeBroadcast().then(() => snapshot);
1635
+ }, () => {
1636
+ const cache = new StoreKeyMap();
1637
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1638
+ return cache;
1639
+ });
1640
+ }, (response) => {
1641
+ deepFreeze(response);
1642
+ throw response;
1643
+ });
1644
+ }
1645
+ const loadDataToTargetOrgAdapterFactory = (luvio) => {
1646
+ return function loadDataToTargetOrg(untrustedConfig) {
1647
+ const config = validateAdapterConfig$4(untrustedConfig, loadDataToTargetOrg_ConfigPropertyNames);
1648
+ // Invalid or incomplete config
1649
+ if (config === null) {
1650
+ throw new Error('Invalid config for "loadDataToTargetOrg"');
1651
+ }
1652
+ return buildNetworkSnapshot$4(luvio, config);
1653
+ };
1654
+ };
1655
+
1656
+ const TTL$2 = 200;
1657
+ const VERSION$8 = "6dd0d28fef32df67c362e907a7004fd4";
1658
+ function validate$8(obj, path = 'AuthCallbackStatusRepresentation') {
1659
+ const v_error = (() => {
1660
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1661
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1662
+ }
1663
+ const obj_access_token = obj.access_token;
1664
+ const path_access_token = path + '.access_token';
1665
+ if (typeof obj_access_token !== 'string') {
1666
+ return new TypeError('Expected "string" but received "' + typeof obj_access_token + '" (at "' + path_access_token + '")');
1667
+ }
1668
+ const obj_auth_code = obj.auth_code;
1669
+ const path_auth_code = path + '.auth_code';
1670
+ if (typeof obj_auth_code !== 'string') {
1671
+ return new TypeError('Expected "string" but received "' + typeof obj_auth_code + '" (at "' + path_auth_code + '")');
1672
+ }
1673
+ const obj_callback_id = obj.callback_id;
1674
+ const path_callback_id = path + '.callback_id';
1675
+ if (typeof obj_callback_id !== 'string') {
1676
+ return new TypeError('Expected "string" but received "' + typeof obj_callback_id + '" (at "' + path_callback_id + '")');
1677
+ }
1678
+ const obj_correlation_id = obj.correlation_id;
1679
+ const path_correlation_id = path + '.correlation_id';
1680
+ if (typeof obj_correlation_id !== 'string') {
1681
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
1682
+ }
1683
+ const obj_org_url = obj.org_url;
1684
+ const path_org_url = path + '.org_url';
1685
+ if (typeof obj_org_url !== 'string') {
1686
+ return new TypeError('Expected "string" but received "' + typeof obj_org_url + '" (at "' + path_org_url + '")');
1687
+ }
1688
+ const obj_organization_id = obj.organization_id;
1689
+ const path_organization_id = path + '.organization_id';
1690
+ if (typeof obj_organization_id !== 'string') {
1691
+ return new TypeError('Expected "string" but received "' + typeof obj_organization_id + '" (at "' + path_organization_id + '")');
1692
+ }
1693
+ })();
1694
+ return v_error === undefined ? null : v_error;
1695
+ }
1696
+ const RepresentationType$2 = 'AuthCallbackStatusRepresentation';
1697
+ function keyBuilder$2(luvio, config) {
1698
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.correlation_id;
1699
+ }
1700
+ function keyBuilderFromType$2(luvio, object) {
1701
+ const keyParams = {
1702
+ correlation_id: object.correlation_id
1703
+ };
1704
+ return keyBuilder$2(luvio, keyParams);
1705
+ }
1706
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1707
+ return input;
1708
+ }
1709
+ const select$c = function AuthCallbackStatusRepresentationSelect() {
1710
+ return {
1711
+ kind: 'Fragment',
1712
+ version: VERSION$8,
1713
+ private: [],
1714
+ selections: [
1715
+ {
1716
+ name: 'access_token',
1717
+ kind: 'Scalar'
1718
+ },
1719
+ {
1720
+ name: 'auth_code',
1721
+ kind: 'Scalar'
1722
+ },
1723
+ {
1724
+ name: 'callback_id',
1725
+ kind: 'Scalar'
1726
+ },
1727
+ {
1728
+ name: 'correlation_id',
1729
+ kind: 'Scalar'
1730
+ },
1731
+ {
1732
+ name: 'org_url',
1733
+ kind: 'Scalar'
1734
+ },
1735
+ {
1736
+ name: 'organization_id',
1737
+ kind: 'Scalar'
1738
+ }
1739
+ ]
1740
+ };
1741
+ };
1742
+ function equals$8(existing, incoming) {
1743
+ const existing_access_token = existing.access_token;
1744
+ const incoming_access_token = incoming.access_token;
1745
+ if (!(existing_access_token === incoming_access_token)) {
1746
+ return false;
1747
+ }
1748
+ const existing_auth_code = existing.auth_code;
1749
+ const incoming_auth_code = incoming.auth_code;
1750
+ if (!(existing_auth_code === incoming_auth_code)) {
1751
+ return false;
1752
+ }
1753
+ const existing_callback_id = existing.callback_id;
1754
+ const incoming_callback_id = incoming.callback_id;
1755
+ if (!(existing_callback_id === incoming_callback_id)) {
1756
+ return false;
1757
+ }
1758
+ const existing_correlation_id = existing.correlation_id;
1759
+ const incoming_correlation_id = incoming.correlation_id;
1760
+ if (!(existing_correlation_id === incoming_correlation_id)) {
1761
+ return false;
1762
+ }
1763
+ const existing_org_url = existing.org_url;
1764
+ const incoming_org_url = incoming.org_url;
1765
+ if (!(existing_org_url === incoming_org_url)) {
1766
+ return false;
1767
+ }
1768
+ const existing_organization_id = existing.organization_id;
1769
+ const incoming_organization_id = incoming.organization_id;
1770
+ if (!(existing_organization_id === incoming_organization_id)) {
1771
+ return false;
1772
+ }
1773
+ return true;
1774
+ }
1775
+ const ingest$2 = function AuthCallbackStatusRepresentationIngest(input, path, luvio, store, timestamp) {
1776
+ if (process.env.NODE_ENV !== 'production') {
1777
+ const validateError = validate$8(input);
1778
+ if (validateError !== null) {
1779
+ throw validateError;
1780
+ }
1781
+ }
1782
+ const key = keyBuilderFromType$2(luvio, input);
1783
+ const ttlToUse = TTL$2;
1784
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "data-seed", VERSION$8, RepresentationType$2, equals$8);
1785
+ return createLink(key);
1786
+ };
1787
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1788
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1789
+ const rootKey = keyBuilderFromType$2(luvio, input);
1790
+ rootKeySet.set(rootKey, {
1791
+ namespace: keyPrefix,
1792
+ representationName: RepresentationType$2,
1793
+ mergeable: false
1794
+ });
1795
+ }
1796
+
1797
+ function select$b(luvio, params) {
1798
+ return select$c();
1799
+ }
1800
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1801
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1802
+ }
1803
+ function ingestSuccess$3(luvio, resourceParams, response) {
1804
+ const { body } = response;
1805
+ const key = keyBuilderFromType$2(luvio, body);
1806
+ luvio.storeIngest(key, ingest$2, body);
1807
+ const snapshot = luvio.storeLookup({
1808
+ recordId: key,
1809
+ node: select$b(),
1810
+ variables: {},
1811
+ });
1812
+ if (process.env.NODE_ENV !== 'production') {
1813
+ if (snapshot.state !== 'Fulfilled') {
1814
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1815
+ }
1816
+ }
1817
+ deepFreeze(snapshot.data);
1818
+ return snapshot;
1819
+ }
1820
+ function createResourceRequest$3(config) {
1821
+ const headers = {};
1822
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
1823
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
1824
+ headers['Org-Url'] = config.headers.orgUrl;
1825
+ headers['Access-Token'] = config.headers.accessToken;
1826
+ return {
1827
+ baseUri: 'api.salesforce.com',
1828
+ basePath: '/platform/data-seed/v1/data-seed-auth-callback-status/' + config.urlParams.callback_id + '',
1829
+ method: 'post',
1830
+ body: null,
1831
+ urlParams: config.urlParams,
1832
+ queryParams: {},
1833
+ headers,
1834
+ priority: 'normal',
1835
+ };
1836
+ }
1837
+
1838
+ const adapterName$3 = 'getAuthCallbackStatus';
1839
+ const getAuthCallbackStatus_ConfigPropertyMetadata = [
1840
+ generateParamConfigMetadata('callback_id', true, 0 /* UrlParameter */, 0 /* String */),
1841
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
1842
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
1843
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
1844
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
1845
+ ];
1846
+ const getAuthCallbackStatus_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getAuthCallbackStatus_ConfigPropertyMetadata);
1847
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$b(getAuthCallbackStatus_ConfigPropertyMetadata);
1848
+ function typeCheckConfig$3(untrustedConfig) {
1849
+ const config = {};
1850
+ typeCheckConfig$b(untrustedConfig, config, getAuthCallbackStatus_ConfigPropertyMetadata);
1851
+ return config;
1852
+ }
1853
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1854
+ if (!untrustedIsObject(untrustedConfig)) {
1855
+ return null;
1856
+ }
1857
+ if (process.env.NODE_ENV !== 'production') {
1858
+ validateConfig(untrustedConfig, configPropertyNames);
1859
+ }
1860
+ const config = typeCheckConfig$3(untrustedConfig);
1861
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1862
+ return null;
1863
+ }
1864
+ return config;
1865
+ }
1866
+ function buildNetworkSnapshot$3(luvio, config, options) {
1867
+ const resourceParams = createResourceParams$3(config);
1868
+ const request = createResourceRequest$3(resourceParams);
1869
+ return luvio.dispatchResourceRequest(request, options)
1870
+ .then((response) => {
1871
+ return luvio.handleSuccessResponse(() => {
1872
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1873
+ return luvio.storeBroadcast().then(() => snapshot);
1874
+ }, () => {
1875
+ const cache = new StoreKeyMap();
1876
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1877
+ return cache;
1878
+ });
1879
+ }, (response) => {
1880
+ deepFreeze(response);
1881
+ throw response;
1882
+ });
1883
+ }
1884
+ const getAuthCallbackStatusAdapterFactory = (luvio) => {
1885
+ return function getAuthCallbackStatus(untrustedConfig) {
1886
+ const config = validateAdapterConfig$3(untrustedConfig, getAuthCallbackStatus_ConfigPropertyNames);
1887
+ // Invalid or incomplete config
1888
+ if (config === null) {
1889
+ throw new Error('Invalid config for "getAuthCallbackStatus"');
1890
+ }
1891
+ return buildNetworkSnapshot$3(luvio, config);
1892
+ };
1893
+ };
1894
+
1895
+ const VERSION$7 = "6c7162c1ac0af13e0958aba84495c152";
1896
+ function validate$7(obj, path = 'EntityDetailsChildResponseObject') {
1897
+ const v_error = (() => {
1898
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1899
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1900
+ }
1901
+ if (obj.childObjectLabel !== undefined) {
1902
+ const obj_childObjectLabel = obj.childObjectLabel;
1903
+ const path_childObjectLabel = path + '.childObjectLabel';
1904
+ if (typeof obj_childObjectLabel !== 'string') {
1905
+ return new TypeError('Expected "string" but received "' + typeof obj_childObjectLabel + '" (at "' + path_childObjectLabel + '")');
1906
+ }
1907
+ }
1908
+ if (obj.childObjectName !== undefined) {
1909
+ const obj_childObjectName = obj.childObjectName;
1910
+ const path_childObjectName = path + '.childObjectName';
1911
+ if (typeof obj_childObjectName !== 'string') {
1912
+ return new TypeError('Expected "string" but received "' + typeof obj_childObjectName + '" (at "' + path_childObjectName + '")');
1913
+ }
1914
+ }
1915
+ if (obj.childObjectRelationshipField !== undefined) {
1916
+ const obj_childObjectRelationshipField = obj.childObjectRelationshipField;
1917
+ const path_childObjectRelationshipField = path + '.childObjectRelationshipField';
1918
+ if (typeof obj_childObjectRelationshipField !== 'string') {
1919
+ return new TypeError('Expected "string" but received "' + typeof obj_childObjectRelationshipField + '" (at "' + path_childObjectRelationshipField + '")');
1920
+ }
1921
+ }
1922
+ if (obj.childObjectType !== undefined) {
1923
+ const obj_childObjectType = obj.childObjectType;
1924
+ const path_childObjectType = path + '.childObjectType';
1925
+ if (typeof obj_childObjectType !== 'string') {
1926
+ return new TypeError('Expected "string" but received "' + typeof obj_childObjectType + '" (at "' + path_childObjectType + '")');
1927
+ }
1928
+ }
1929
+ })();
1930
+ return v_error === undefined ? null : v_error;
1931
+ }
1932
+ const select$a = function EntityDetailsChildResponseObjectSelect() {
1933
+ return {
1934
+ kind: 'Fragment',
1935
+ version: VERSION$7,
1936
+ private: [],
1937
+ selections: [
1938
+ {
1939
+ name: 'childObjectLabel',
1940
+ kind: 'Scalar',
1941
+ required: false
1942
+ },
1943
+ {
1944
+ name: 'childObjectName',
1945
+ kind: 'Scalar',
1946
+ required: false
1947
+ },
1948
+ {
1949
+ name: 'childObjectRelationshipField',
1950
+ kind: 'Scalar',
1951
+ required: false
1952
+ },
1953
+ {
1954
+ name: 'childObjectType',
1955
+ kind: 'Scalar',
1956
+ required: false
1957
+ }
1958
+ ]
1959
+ };
1960
+ };
1961
+ function equals$7(existing, incoming) {
1962
+ const existing_childObjectLabel = existing.childObjectLabel;
1963
+ const incoming_childObjectLabel = incoming.childObjectLabel;
1964
+ // if at least one of these optionals is defined
1965
+ if (existing_childObjectLabel !== undefined || incoming_childObjectLabel !== undefined) {
1966
+ // if one of these is not defined we know the other is defined and therefore
1967
+ // not equal
1968
+ if (existing_childObjectLabel === undefined || incoming_childObjectLabel === undefined) {
1969
+ return false;
1970
+ }
1971
+ if (!(existing_childObjectLabel === incoming_childObjectLabel)) {
1972
+ return false;
1973
+ }
1974
+ }
1975
+ const existing_childObjectName = existing.childObjectName;
1976
+ const incoming_childObjectName = incoming.childObjectName;
1977
+ // if at least one of these optionals is defined
1978
+ if (existing_childObjectName !== undefined || incoming_childObjectName !== undefined) {
1979
+ // if one of these is not defined we know the other is defined and therefore
1980
+ // not equal
1981
+ if (existing_childObjectName === undefined || incoming_childObjectName === undefined) {
1982
+ return false;
1983
+ }
1984
+ if (!(existing_childObjectName === incoming_childObjectName)) {
1985
+ return false;
1986
+ }
1987
+ }
1988
+ const existing_childObjectRelationshipField = existing.childObjectRelationshipField;
1989
+ const incoming_childObjectRelationshipField = incoming.childObjectRelationshipField;
1990
+ // if at least one of these optionals is defined
1991
+ if (existing_childObjectRelationshipField !== undefined || incoming_childObjectRelationshipField !== undefined) {
1992
+ // if one of these is not defined we know the other is defined and therefore
1993
+ // not equal
1994
+ if (existing_childObjectRelationshipField === undefined || incoming_childObjectRelationshipField === undefined) {
1995
+ return false;
1996
+ }
1997
+ if (!(existing_childObjectRelationshipField === incoming_childObjectRelationshipField)) {
1998
+ return false;
1999
+ }
2000
+ }
2001
+ const existing_childObjectType = existing.childObjectType;
2002
+ const incoming_childObjectType = incoming.childObjectType;
2003
+ // if at least one of these optionals is defined
2004
+ if (existing_childObjectType !== undefined || incoming_childObjectType !== undefined) {
2005
+ // if one of these is not defined we know the other is defined and therefore
2006
+ // not equal
2007
+ if (existing_childObjectType === undefined || incoming_childObjectType === undefined) {
2008
+ return false;
2009
+ }
2010
+ if (!(existing_childObjectType === incoming_childObjectType)) {
2011
+ return false;
2012
+ }
2013
+ }
2014
+ return true;
2015
+ }
2016
+
2017
+ const VERSION$6 = "5b5a2be5ae5b9604c6e5fb7d904e3275";
2018
+ function validate$6(obj, path = 'PicklistValueObject') {
2019
+ const v_error = (() => {
2020
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2021
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2022
+ }
2023
+ if (obj.active !== undefined) {
2024
+ const obj_active = obj.active;
2025
+ const path_active = path + '.active';
2026
+ if (typeof obj_active !== 'boolean') {
2027
+ return new TypeError('Expected "boolean" but received "' + typeof obj_active + '" (at "' + path_active + '")');
2028
+ }
2029
+ }
2030
+ if (obj.defaultValue !== undefined) {
2031
+ const obj_defaultValue = obj.defaultValue;
2032
+ const path_defaultValue = path + '.defaultValue';
2033
+ if (typeof obj_defaultValue !== 'boolean') {
2034
+ return new TypeError('Expected "boolean" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
2035
+ }
2036
+ }
2037
+ if (obj.label !== undefined) {
2038
+ const obj_label = obj.label;
2039
+ const path_label = path + '.label';
2040
+ let obj_label_union0 = null;
2041
+ const obj_label_union0_error = (() => {
2042
+ if (typeof obj_label !== 'string') {
2043
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2044
+ }
2045
+ })();
2046
+ if (obj_label_union0_error != null) {
2047
+ obj_label_union0 = obj_label_union0_error.message;
2048
+ }
2049
+ let obj_label_union1 = null;
2050
+ const obj_label_union1_error = (() => {
2051
+ if (obj_label !== null) {
2052
+ return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2053
+ }
2054
+ })();
2055
+ if (obj_label_union1_error != null) {
2056
+ obj_label_union1 = obj_label_union1_error.message;
2057
+ }
2058
+ if (obj_label_union0 && obj_label_union1) {
2059
+ let message = 'Object doesn\'t match union (at "' + path_label + '")';
2060
+ message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
2061
+ message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
2062
+ return new TypeError(message);
2063
+ }
2064
+ }
2065
+ if (obj.validFor !== undefined) {
2066
+ const obj_validFor = obj.validFor;
2067
+ const path_validFor = path + '.validFor';
2068
+ let obj_validFor_union0 = null;
2069
+ const obj_validFor_union0_error = (() => {
2070
+ if (typeof obj_validFor !== 'string') {
2071
+ return new TypeError('Expected "string" but received "' + typeof obj_validFor + '" (at "' + path_validFor + '")');
2072
+ }
2073
+ })();
2074
+ if (obj_validFor_union0_error != null) {
2075
+ obj_validFor_union0 = obj_validFor_union0_error.message;
2076
+ }
2077
+ let obj_validFor_union1 = null;
2078
+ const obj_validFor_union1_error = (() => {
2079
+ if (obj_validFor !== null) {
2080
+ return new TypeError('Expected "null" but received "' + typeof obj_validFor + '" (at "' + path_validFor + '")');
2081
+ }
2082
+ })();
2083
+ if (obj_validFor_union1_error != null) {
2084
+ obj_validFor_union1 = obj_validFor_union1_error.message;
2085
+ }
2086
+ if (obj_validFor_union0 && obj_validFor_union1) {
2087
+ let message = 'Object doesn\'t match union (at "' + path_validFor + '")';
2088
+ message += '\n' + obj_validFor_union0.split('\n').map((line) => '\t' + line).join('\n');
2089
+ message += '\n' + obj_validFor_union1.split('\n').map((line) => '\t' + line).join('\n');
2090
+ return new TypeError(message);
2091
+ }
2092
+ }
2093
+ if (obj.value !== undefined) {
2094
+ const obj_value = obj.value;
2095
+ const path_value = path + '.value';
2096
+ let obj_value_union0 = null;
2097
+ const obj_value_union0_error = (() => {
2098
+ if (typeof obj_value !== 'string') {
2099
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
2100
+ }
2101
+ })();
2102
+ if (obj_value_union0_error != null) {
2103
+ obj_value_union0 = obj_value_union0_error.message;
2104
+ }
2105
+ let obj_value_union1 = null;
2106
+ const obj_value_union1_error = (() => {
2107
+ if (obj_value !== null) {
2108
+ return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
2109
+ }
2110
+ })();
2111
+ if (obj_value_union1_error != null) {
2112
+ obj_value_union1 = obj_value_union1_error.message;
2113
+ }
2114
+ if (obj_value_union0 && obj_value_union1) {
2115
+ let message = 'Object doesn\'t match union (at "' + path_value + '")';
2116
+ message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
2117
+ message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
2118
+ return new TypeError(message);
2119
+ }
2120
+ }
2121
+ })();
2122
+ return v_error === undefined ? null : v_error;
2123
+ }
2124
+ const select$9 = function PicklistValueObjectSelect() {
2125
+ return {
2126
+ kind: 'Fragment',
2127
+ version: VERSION$6,
2128
+ private: [],
2129
+ selections: [
2130
+ {
2131
+ name: 'active',
2132
+ kind: 'Scalar',
2133
+ required: false
2134
+ },
2135
+ {
2136
+ name: 'defaultValue',
2137
+ kind: 'Scalar',
2138
+ required: false
2139
+ },
2140
+ {
2141
+ name: 'label',
2142
+ kind: 'Scalar',
2143
+ required: false
2144
+ },
2145
+ {
2146
+ name: 'validFor',
2147
+ kind: 'Scalar',
2148
+ required: false
2149
+ },
2150
+ {
2151
+ name: 'value',
2152
+ kind: 'Scalar',
2153
+ required: false
2154
+ }
2155
+ ]
2156
+ };
2157
+ };
2158
+ function equals$6(existing, incoming) {
2159
+ const existing_active = existing.active;
2160
+ const incoming_active = incoming.active;
2161
+ // if at least one of these optionals is defined
2162
+ if (existing_active !== undefined || incoming_active !== undefined) {
2163
+ // if one of these is not defined we know the other is defined and therefore
2164
+ // not equal
2165
+ if (existing_active === undefined || incoming_active === undefined) {
2166
+ return false;
2167
+ }
2168
+ if (!(existing_active === incoming_active)) {
2169
+ return false;
2170
+ }
2171
+ }
2172
+ const existing_defaultValue = existing.defaultValue;
2173
+ const incoming_defaultValue = incoming.defaultValue;
2174
+ // if at least one of these optionals is defined
2175
+ if (existing_defaultValue !== undefined || incoming_defaultValue !== undefined) {
2176
+ // if one of these is not defined we know the other is defined and therefore
2177
+ // not equal
2178
+ if (existing_defaultValue === undefined || incoming_defaultValue === undefined) {
2179
+ return false;
2180
+ }
2181
+ if (!(existing_defaultValue === incoming_defaultValue)) {
2182
+ return false;
2183
+ }
2184
+ }
2185
+ const existing_label = existing.label;
2186
+ const incoming_label = incoming.label;
2187
+ // if at least one of these optionals is defined
2188
+ if (existing_label !== undefined || incoming_label !== undefined) {
2189
+ // if one of these is not defined we know the other is defined and therefore
2190
+ // not equal
2191
+ if (existing_label === undefined || incoming_label === undefined) {
2192
+ return false;
2193
+ }
2194
+ if (!(existing_label === incoming_label)) {
2195
+ return false;
2196
+ }
2197
+ }
2198
+ const existing_validFor = existing.validFor;
2199
+ const incoming_validFor = incoming.validFor;
2200
+ // if at least one of these optionals is defined
2201
+ if (existing_validFor !== undefined || incoming_validFor !== undefined) {
2202
+ // if one of these is not defined we know the other is defined and therefore
2203
+ // not equal
2204
+ if (existing_validFor === undefined || incoming_validFor === undefined) {
2205
+ return false;
2206
+ }
2207
+ if (!(existing_validFor === incoming_validFor)) {
2208
+ return false;
2209
+ }
2210
+ }
2211
+ const existing_value = existing.value;
2212
+ const incoming_value = incoming.value;
2213
+ // if at least one of these optionals is defined
2214
+ if (existing_value !== undefined || incoming_value !== undefined) {
2215
+ // if one of these is not defined we know the other is defined and therefore
2216
+ // not equal
2217
+ if (existing_value === undefined || incoming_value === undefined) {
2218
+ return false;
2219
+ }
2220
+ if (!(existing_value === incoming_value)) {
2221
+ return false;
2222
+ }
2223
+ }
2224
+ return true;
2225
+ }
2226
+
2227
+ const VERSION$5 = "f2ffbd5716e4948a457fe4b976613f2c";
2228
+ function validate$5(obj, path = 'EntityDetailsFieldsResponseObject') {
2229
+ const v_error = (() => {
2230
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2231
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2232
+ }
2233
+ if (obj.dataType !== undefined) {
2234
+ const obj_dataType = obj.dataType;
2235
+ const path_dataType = path + '.dataType';
2236
+ if (typeof obj_dataType !== 'string') {
2237
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
2238
+ }
2239
+ }
2240
+ if (obj.fieldLabel !== undefined) {
2241
+ const obj_fieldLabel = obj.fieldLabel;
2242
+ const path_fieldLabel = path + '.fieldLabel';
2243
+ if (typeof obj_fieldLabel !== 'string') {
2244
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldLabel + '" (at "' + path_fieldLabel + '")');
2245
+ }
2246
+ }
2247
+ if (obj.fieldName !== undefined) {
2248
+ const obj_fieldName = obj.fieldName;
2249
+ const path_fieldName = path + '.fieldName';
2250
+ if (typeof obj_fieldName !== 'string') {
2251
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
2252
+ }
2253
+ }
2254
+ if (obj.picklistValues !== undefined) {
2255
+ const obj_picklistValues = obj.picklistValues;
2256
+ const path_picklistValues = path + '.picklistValues';
2257
+ if (!ArrayIsArray(obj_picklistValues)) {
2258
+ return new TypeError('Expected "array" but received "' + typeof obj_picklistValues + '" (at "' + path_picklistValues + '")');
2259
+ }
2260
+ for (let i = 0; i < obj_picklistValues.length; i++) {
2261
+ const obj_picklistValues_item = obj_picklistValues[i];
2262
+ const path_picklistValues_item = path_picklistValues + '[' + i + ']';
2263
+ const referencepath_picklistValues_itemValidationError = validate$6(obj_picklistValues_item, path_picklistValues_item);
2264
+ if (referencepath_picklistValues_itemValidationError !== null) {
2265
+ let message = 'Object doesn\'t match PicklistValueObject (at "' + path_picklistValues_item + '")\n';
2266
+ message += referencepath_picklistValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2267
+ return new TypeError(message);
2268
+ }
2269
+ }
2270
+ }
2271
+ })();
2272
+ return v_error === undefined ? null : v_error;
2273
+ }
2274
+ const select$8 = function EntityDetailsFieldsResponseObjectSelect() {
2275
+ const { selections: PicklistValueObject__selections, opaque: PicklistValueObject__opaque, } = select$9();
2276
+ return {
2277
+ kind: 'Fragment',
2278
+ version: VERSION$5,
2279
+ private: [],
2280
+ selections: [
2281
+ {
2282
+ name: 'dataType',
2283
+ kind: 'Scalar',
2284
+ required: false
2285
+ },
2286
+ {
2287
+ name: 'fieldLabel',
2288
+ kind: 'Scalar',
2289
+ required: false
2290
+ },
2291
+ {
2292
+ name: 'fieldName',
2293
+ kind: 'Scalar',
2294
+ required: false
2295
+ },
2296
+ {
2297
+ name: 'picklistValues',
2298
+ kind: 'Object',
2299
+ plural: true,
2300
+ selections: PicklistValueObject__selections,
2301
+ required: false
2302
+ }
2303
+ ]
2304
+ };
2305
+ };
2306
+ function equals$5(existing, incoming) {
2307
+ const existing_dataType = existing.dataType;
2308
+ const incoming_dataType = incoming.dataType;
2309
+ // if at least one of these optionals is defined
2310
+ if (existing_dataType !== undefined || incoming_dataType !== undefined) {
2311
+ // if one of these is not defined we know the other is defined and therefore
2312
+ // not equal
2313
+ if (existing_dataType === undefined || incoming_dataType === undefined) {
2314
+ return false;
2315
+ }
2316
+ if (!(existing_dataType === incoming_dataType)) {
2317
+ return false;
2318
+ }
2319
+ }
2320
+ const existing_fieldLabel = existing.fieldLabel;
2321
+ const incoming_fieldLabel = incoming.fieldLabel;
2322
+ // if at least one of these optionals is defined
2323
+ if (existing_fieldLabel !== undefined || incoming_fieldLabel !== undefined) {
2324
+ // if one of these is not defined we know the other is defined and therefore
2325
+ // not equal
2326
+ if (existing_fieldLabel === undefined || incoming_fieldLabel === undefined) {
2327
+ return false;
2328
+ }
2329
+ if (!(existing_fieldLabel === incoming_fieldLabel)) {
2330
+ return false;
2331
+ }
2332
+ }
2333
+ const existing_fieldName = existing.fieldName;
2334
+ const incoming_fieldName = incoming.fieldName;
2335
+ // if at least one of these optionals is defined
2336
+ if (existing_fieldName !== undefined || incoming_fieldName !== undefined) {
2337
+ // if one of these is not defined we know the other is defined and therefore
2338
+ // not equal
2339
+ if (existing_fieldName === undefined || incoming_fieldName === undefined) {
2340
+ return false;
2341
+ }
2342
+ if (!(existing_fieldName === incoming_fieldName)) {
2343
+ return false;
2344
+ }
2345
+ }
2346
+ const existing_picklistValues = existing.picklistValues;
2347
+ const incoming_picklistValues = incoming.picklistValues;
2348
+ // if at least one of these optionals is defined
2349
+ if (existing_picklistValues !== undefined || incoming_picklistValues !== undefined) {
2350
+ // if one of these is not defined we know the other is defined and therefore
2351
+ // not equal
2352
+ if (existing_picklistValues === undefined || incoming_picklistValues === undefined) {
2353
+ return false;
2354
+ }
2355
+ const equals_picklistValues_items = equalsArray(existing_picklistValues, incoming_picklistValues, (existing_picklistValues_item, incoming_picklistValues_item) => {
2356
+ if (!(equals$6(existing_picklistValues_item, incoming_picklistValues_item))) {
2357
+ return false;
2358
+ }
2359
+ });
2360
+ if (equals_picklistValues_items === false) {
2361
+ return false;
2362
+ }
2363
+ }
2364
+ return true;
2365
+ }
2366
+
2367
+ const VERSION$4 = "3dd8c4b72e4601c0424788df244ee841";
2368
+ function validate$4(obj, path = 'EntityDetailsParentResponseObject') {
2369
+ const v_error = (() => {
2370
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2371
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2372
+ }
2373
+ if (obj.parentObjectLabel !== undefined) {
2374
+ const obj_parentObjectLabel = obj.parentObjectLabel;
2375
+ const path_parentObjectLabel = path + '.parentObjectLabel';
2376
+ if (typeof obj_parentObjectLabel !== 'string') {
2377
+ return new TypeError('Expected "string" but received "' + typeof obj_parentObjectLabel + '" (at "' + path_parentObjectLabel + '")');
2378
+ }
2379
+ }
2380
+ if (obj.parentObjectName !== undefined) {
2381
+ const obj_parentObjectName = obj.parentObjectName;
2382
+ const path_parentObjectName = path + '.parentObjectName';
2383
+ if (typeof obj_parentObjectName !== 'string') {
2384
+ return new TypeError('Expected "string" but received "' + typeof obj_parentObjectName + '" (at "' + path_parentObjectName + '")');
2385
+ }
2386
+ }
2387
+ if (obj.parentObjectRelationshipField !== undefined) {
2388
+ const obj_parentObjectRelationshipField = obj.parentObjectRelationshipField;
2389
+ const path_parentObjectRelationshipField = path + '.parentObjectRelationshipField';
2390
+ if (typeof obj_parentObjectRelationshipField !== 'string') {
2391
+ return new TypeError('Expected "string" but received "' + typeof obj_parentObjectRelationshipField + '" (at "' + path_parentObjectRelationshipField + '")');
2392
+ }
2393
+ }
2394
+ if (obj.parentObjectType !== undefined) {
2395
+ const obj_parentObjectType = obj.parentObjectType;
2396
+ const path_parentObjectType = path + '.parentObjectType';
2397
+ if (typeof obj_parentObjectType !== 'string') {
2398
+ return new TypeError('Expected "string" but received "' + typeof obj_parentObjectType + '" (at "' + path_parentObjectType + '")');
2399
+ }
2400
+ }
2401
+ })();
2402
+ return v_error === undefined ? null : v_error;
2403
+ }
2404
+ const select$7 = function EntityDetailsParentResponseObjectSelect() {
2405
+ return {
2406
+ kind: 'Fragment',
2407
+ version: VERSION$4,
2408
+ private: [],
2409
+ selections: [
2410
+ {
2411
+ name: 'parentObjectLabel',
2412
+ kind: 'Scalar',
2413
+ required: false
2414
+ },
2415
+ {
2416
+ name: 'parentObjectName',
2417
+ kind: 'Scalar',
2418
+ required: false
2419
+ },
2420
+ {
2421
+ name: 'parentObjectRelationshipField',
2422
+ kind: 'Scalar',
2423
+ required: false
2424
+ },
2425
+ {
2426
+ name: 'parentObjectType',
2427
+ kind: 'Scalar',
2428
+ required: false
2429
+ }
2430
+ ]
2431
+ };
2432
+ };
2433
+ function equals$4(existing, incoming) {
2434
+ const existing_parentObjectLabel = existing.parentObjectLabel;
2435
+ const incoming_parentObjectLabel = incoming.parentObjectLabel;
2436
+ // if at least one of these optionals is defined
2437
+ if (existing_parentObjectLabel !== undefined || incoming_parentObjectLabel !== undefined) {
2438
+ // if one of these is not defined we know the other is defined and therefore
2439
+ // not equal
2440
+ if (existing_parentObjectLabel === undefined || incoming_parentObjectLabel === undefined) {
2441
+ return false;
2442
+ }
2443
+ if (!(existing_parentObjectLabel === incoming_parentObjectLabel)) {
2444
+ return false;
2445
+ }
2446
+ }
2447
+ const existing_parentObjectName = existing.parentObjectName;
2448
+ const incoming_parentObjectName = incoming.parentObjectName;
2449
+ // if at least one of these optionals is defined
2450
+ if (existing_parentObjectName !== undefined || incoming_parentObjectName !== undefined) {
2451
+ // if one of these is not defined we know the other is defined and therefore
2452
+ // not equal
2453
+ if (existing_parentObjectName === undefined || incoming_parentObjectName === undefined) {
2454
+ return false;
2455
+ }
2456
+ if (!(existing_parentObjectName === incoming_parentObjectName)) {
2457
+ return false;
2458
+ }
2459
+ }
2460
+ const existing_parentObjectRelationshipField = existing.parentObjectRelationshipField;
2461
+ const incoming_parentObjectRelationshipField = incoming.parentObjectRelationshipField;
2462
+ // if at least one of these optionals is defined
2463
+ if (existing_parentObjectRelationshipField !== undefined || incoming_parentObjectRelationshipField !== undefined) {
2464
+ // if one of these is not defined we know the other is defined and therefore
2465
+ // not equal
2466
+ if (existing_parentObjectRelationshipField === undefined || incoming_parentObjectRelationshipField === undefined) {
2467
+ return false;
2468
+ }
2469
+ if (!(existing_parentObjectRelationshipField === incoming_parentObjectRelationshipField)) {
2470
+ return false;
2471
+ }
2472
+ }
2473
+ const existing_parentObjectType = existing.parentObjectType;
2474
+ const incoming_parentObjectType = incoming.parentObjectType;
2475
+ // if at least one of these optionals is defined
2476
+ if (existing_parentObjectType !== undefined || incoming_parentObjectType !== undefined) {
2477
+ // if one of these is not defined we know the other is defined and therefore
2478
+ // not equal
2479
+ if (existing_parentObjectType === undefined || incoming_parentObjectType === undefined) {
2480
+ return false;
2481
+ }
2482
+ if (!(existing_parentObjectType === incoming_parentObjectType)) {
2483
+ return false;
2484
+ }
2485
+ }
2486
+ return true;
2487
+ }
2488
+
2489
+ const VERSION$3 = "4eaabf520fc0b3fac32a0883f2c0e055";
2490
+ function validate$3(obj, path = 'EntityDetailsResponseObject') {
2491
+ const v_error = (() => {
2492
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2493
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2494
+ }
2495
+ if (obj.childRelationships !== undefined) {
2496
+ const obj_childRelationships = obj.childRelationships;
2497
+ const path_childRelationships = path + '.childRelationships';
2498
+ if (!ArrayIsArray(obj_childRelationships)) {
2499
+ return new TypeError('Expected "array" but received "' + typeof obj_childRelationships + '" (at "' + path_childRelationships + '")');
2500
+ }
2501
+ for (let i = 0; i < obj_childRelationships.length; i++) {
2502
+ const obj_childRelationships_item = obj_childRelationships[i];
2503
+ const path_childRelationships_item = path_childRelationships + '[' + i + ']';
2504
+ const referencepath_childRelationships_itemValidationError = validate$7(obj_childRelationships_item, path_childRelationships_item);
2505
+ if (referencepath_childRelationships_itemValidationError !== null) {
2506
+ let message = 'Object doesn\'t match EntityDetailsChildResponseObject (at "' + path_childRelationships_item + '")\n';
2507
+ message += referencepath_childRelationships_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2508
+ return new TypeError(message);
2509
+ }
2510
+ }
2511
+ }
2512
+ if (obj.error !== undefined) {
2513
+ const obj_error = obj.error;
2514
+ const path_error = path + '.error';
2515
+ if (typeof obj_error !== 'string') {
2516
+ return new TypeError('Expected "string" but received "' + typeof obj_error + '" (at "' + path_error + '")');
2517
+ }
2518
+ }
2519
+ if (obj.fields !== undefined) {
2520
+ const obj_fields = obj.fields;
2521
+ const path_fields = path + '.fields';
2522
+ if (!ArrayIsArray(obj_fields)) {
2523
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
2524
+ }
2525
+ for (let i = 0; i < obj_fields.length; i++) {
2526
+ const obj_fields_item = obj_fields[i];
2527
+ const path_fields_item = path_fields + '[' + i + ']';
2528
+ const referencepath_fields_itemValidationError = validate$5(obj_fields_item, path_fields_item);
2529
+ if (referencepath_fields_itemValidationError !== null) {
2530
+ let message = 'Object doesn\'t match EntityDetailsFieldsResponseObject (at "' + path_fields_item + '")\n';
2531
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2532
+ return new TypeError(message);
2533
+ }
2534
+ }
2535
+ }
2536
+ if (obj.objectAPIName !== undefined) {
2537
+ const obj_objectAPIName = obj.objectAPIName;
2538
+ const path_objectAPIName = path + '.objectAPIName';
2539
+ if (typeof obj_objectAPIName !== 'string') {
2540
+ return new TypeError('Expected "string" but received "' + typeof obj_objectAPIName + '" (at "' + path_objectAPIName + '")');
2541
+ }
2542
+ }
2543
+ if (obj.objectIcon !== undefined) {
2544
+ const obj_objectIcon = obj.objectIcon;
2545
+ const path_objectIcon = path + '.objectIcon';
2546
+ if (typeof obj_objectIcon !== 'string') {
2547
+ return new TypeError('Expected "string" but received "' + typeof obj_objectIcon + '" (at "' + path_objectIcon + '")');
2548
+ }
2549
+ }
2550
+ if (obj.objectLabel !== undefined) {
2551
+ const obj_objectLabel = obj.objectLabel;
2552
+ const path_objectLabel = path + '.objectLabel';
2553
+ if (typeof obj_objectLabel !== 'string') {
2554
+ return new TypeError('Expected "string" but received "' + typeof obj_objectLabel + '" (at "' + path_objectLabel + '")');
2555
+ }
2556
+ }
2557
+ if (obj.objectName !== undefined) {
2558
+ const obj_objectName = obj.objectName;
2559
+ const path_objectName = path + '.objectName';
2560
+ if (typeof obj_objectName !== 'string') {
2561
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
2562
+ }
2563
+ }
2564
+ if (obj.parentRelationships !== undefined) {
2565
+ const obj_parentRelationships = obj.parentRelationships;
2566
+ const path_parentRelationships = path + '.parentRelationships';
2567
+ if (!ArrayIsArray(obj_parentRelationships)) {
2568
+ return new TypeError('Expected "array" but received "' + typeof obj_parentRelationships + '" (at "' + path_parentRelationships + '")');
2569
+ }
2570
+ for (let i = 0; i < obj_parentRelationships.length; i++) {
2571
+ const obj_parentRelationships_item = obj_parentRelationships[i];
2572
+ const path_parentRelationships_item = path_parentRelationships + '[' + i + ']';
2573
+ const referencepath_parentRelationships_itemValidationError = validate$4(obj_parentRelationships_item, path_parentRelationships_item);
2574
+ if (referencepath_parentRelationships_itemValidationError !== null) {
2575
+ let message = 'Object doesn\'t match EntityDetailsParentResponseObject (at "' + path_parentRelationships_item + '")\n';
2576
+ message += referencepath_parentRelationships_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2577
+ return new TypeError(message);
2578
+ }
2579
+ }
2580
+ }
2581
+ if (obj.recordCount !== undefined) {
2582
+ const obj_recordCount = obj.recordCount;
2583
+ const path_recordCount = path + '.recordCount';
2584
+ if (typeof obj_recordCount !== 'number') {
2585
+ return new TypeError('Expected "number" but received "' + typeof obj_recordCount + '" (at "' + path_recordCount + '")');
2586
+ }
2587
+ }
2588
+ if (obj.type !== undefined) {
2589
+ const obj_type = obj.type;
2590
+ const path_type = path + '.type';
2591
+ if (typeof obj_type !== 'string') {
2592
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2593
+ }
2594
+ }
2595
+ })();
2596
+ return v_error === undefined ? null : v_error;
2597
+ }
2598
+ const select$6 = function EntityDetailsResponseObjectSelect() {
2599
+ const { selections: EntityDetailsChildResponseObject__selections, opaque: EntityDetailsChildResponseObject__opaque, } = select$a();
2600
+ const { selections: EntityDetailsFieldsResponseObject__selections, opaque: EntityDetailsFieldsResponseObject__opaque, } = select$8();
2601
+ const { selections: EntityDetailsParentResponseObject__selections, opaque: EntityDetailsParentResponseObject__opaque, } = select$7();
2602
+ return {
2603
+ kind: 'Fragment',
2604
+ version: VERSION$3,
2605
+ private: [],
2606
+ selections: [
2607
+ {
2608
+ name: 'childRelationships',
2609
+ kind: 'Object',
2610
+ plural: true,
2611
+ selections: EntityDetailsChildResponseObject__selections,
2612
+ required: false
2613
+ },
2614
+ {
2615
+ name: 'error',
2616
+ kind: 'Scalar',
2617
+ required: false
2618
+ },
2619
+ {
2620
+ name: 'fields',
2621
+ kind: 'Object',
2622
+ plural: true,
2623
+ selections: EntityDetailsFieldsResponseObject__selections,
2624
+ required: false
2625
+ },
2626
+ {
2627
+ name: 'objectAPIName',
2628
+ kind: 'Scalar',
2629
+ required: false
2630
+ },
2631
+ {
2632
+ name: 'objectIcon',
2633
+ kind: 'Scalar',
2634
+ required: false
2635
+ },
2636
+ {
2637
+ name: 'objectLabel',
2638
+ kind: 'Scalar',
2639
+ required: false
2640
+ },
2641
+ {
2642
+ name: 'objectName',
2643
+ kind: 'Scalar',
2644
+ required: false
2645
+ },
2646
+ {
2647
+ name: 'parentRelationships',
2648
+ kind: 'Object',
2649
+ plural: true,
2650
+ selections: EntityDetailsParentResponseObject__selections,
2651
+ required: false
2652
+ },
2653
+ {
2654
+ name: 'recordCount',
2655
+ kind: 'Scalar',
2656
+ required: false
2657
+ },
2658
+ {
2659
+ name: 'type',
2660
+ kind: 'Scalar',
2661
+ required: false
2662
+ }
2663
+ ]
2664
+ };
2665
+ };
2666
+ function equals$3(existing, incoming) {
2667
+ const existing_recordCount = existing.recordCount;
2668
+ const incoming_recordCount = incoming.recordCount;
2669
+ // if at least one of these optionals is defined
2670
+ if (existing_recordCount !== undefined || incoming_recordCount !== undefined) {
2671
+ // if one of these is not defined we know the other is defined and therefore
2672
+ // not equal
2673
+ if (existing_recordCount === undefined || incoming_recordCount === undefined) {
2674
+ return false;
2675
+ }
2676
+ if (!(existing_recordCount === incoming_recordCount)) {
2677
+ return false;
2678
+ }
2679
+ }
2680
+ const existing_error = existing.error;
2681
+ const incoming_error = incoming.error;
2682
+ // if at least one of these optionals is defined
2683
+ if (existing_error !== undefined || incoming_error !== undefined) {
2684
+ // if one of these is not defined we know the other is defined and therefore
2685
+ // not equal
2686
+ if (existing_error === undefined || incoming_error === undefined) {
2687
+ return false;
2688
+ }
2689
+ if (!(existing_error === incoming_error)) {
2690
+ return false;
2691
+ }
2692
+ }
2693
+ const existing_objectAPIName = existing.objectAPIName;
2694
+ const incoming_objectAPIName = incoming.objectAPIName;
2695
+ // if at least one of these optionals is defined
2696
+ if (existing_objectAPIName !== undefined || incoming_objectAPIName !== undefined) {
2697
+ // if one of these is not defined we know the other is defined and therefore
2698
+ // not equal
2699
+ if (existing_objectAPIName === undefined || incoming_objectAPIName === undefined) {
2700
+ return false;
2701
+ }
2702
+ if (!(existing_objectAPIName === incoming_objectAPIName)) {
2703
+ return false;
2704
+ }
2705
+ }
2706
+ const existing_objectIcon = existing.objectIcon;
2707
+ const incoming_objectIcon = incoming.objectIcon;
2708
+ // if at least one of these optionals is defined
2709
+ if (existing_objectIcon !== undefined || incoming_objectIcon !== undefined) {
2710
+ // if one of these is not defined we know the other is defined and therefore
2711
+ // not equal
2712
+ if (existing_objectIcon === undefined || incoming_objectIcon === undefined) {
2713
+ return false;
2714
+ }
2715
+ if (!(existing_objectIcon === incoming_objectIcon)) {
2716
+ return false;
2717
+ }
2718
+ }
2719
+ const existing_objectLabel = existing.objectLabel;
2720
+ const incoming_objectLabel = incoming.objectLabel;
2721
+ // if at least one of these optionals is defined
2722
+ if (existing_objectLabel !== undefined || incoming_objectLabel !== undefined) {
2723
+ // if one of these is not defined we know the other is defined and therefore
2724
+ // not equal
2725
+ if (existing_objectLabel === undefined || incoming_objectLabel === undefined) {
2726
+ return false;
2727
+ }
2728
+ if (!(existing_objectLabel === incoming_objectLabel)) {
2729
+ return false;
2730
+ }
2731
+ }
2732
+ const existing_objectName = existing.objectName;
2733
+ const incoming_objectName = incoming.objectName;
2734
+ // if at least one of these optionals is defined
2735
+ if (existing_objectName !== undefined || incoming_objectName !== undefined) {
2736
+ // if one of these is not defined we know the other is defined and therefore
2737
+ // not equal
2738
+ if (existing_objectName === undefined || incoming_objectName === undefined) {
2739
+ return false;
2740
+ }
2741
+ if (!(existing_objectName === incoming_objectName)) {
2742
+ return false;
2743
+ }
2744
+ }
2745
+ const existing_type = existing.type;
2746
+ const incoming_type = incoming.type;
2747
+ // if at least one of these optionals is defined
2748
+ if (existing_type !== undefined || incoming_type !== undefined) {
2749
+ // if one of these is not defined we know the other is defined and therefore
2750
+ // not equal
2751
+ if (existing_type === undefined || incoming_type === undefined) {
2752
+ return false;
2753
+ }
2754
+ if (!(existing_type === incoming_type)) {
2755
+ return false;
2756
+ }
2757
+ }
2758
+ const existing_childRelationships = existing.childRelationships;
2759
+ const incoming_childRelationships = incoming.childRelationships;
2760
+ // if at least one of these optionals is defined
2761
+ if (existing_childRelationships !== undefined || incoming_childRelationships !== undefined) {
2762
+ // if one of these is not defined we know the other is defined and therefore
2763
+ // not equal
2764
+ if (existing_childRelationships === undefined || incoming_childRelationships === undefined) {
2765
+ return false;
2766
+ }
2767
+ const equals_childRelationships_items = equalsArray(existing_childRelationships, incoming_childRelationships, (existing_childRelationships_item, incoming_childRelationships_item) => {
2768
+ if (!(equals$7(existing_childRelationships_item, incoming_childRelationships_item))) {
2769
+ return false;
2770
+ }
2771
+ });
2772
+ if (equals_childRelationships_items === false) {
2773
+ return false;
2774
+ }
2775
+ }
2776
+ const existing_fields = existing.fields;
2777
+ const incoming_fields = incoming.fields;
2778
+ // if at least one of these optionals is defined
2779
+ if (existing_fields !== undefined || incoming_fields !== undefined) {
2780
+ // if one of these is not defined we know the other is defined and therefore
2781
+ // not equal
2782
+ if (existing_fields === undefined || incoming_fields === undefined) {
2783
+ return false;
2784
+ }
2785
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
2786
+ if (!(equals$5(existing_fields_item, incoming_fields_item))) {
2787
+ return false;
2788
+ }
2789
+ });
2790
+ if (equals_fields_items === false) {
2791
+ return false;
2792
+ }
2793
+ }
2794
+ const existing_parentRelationships = existing.parentRelationships;
2795
+ const incoming_parentRelationships = incoming.parentRelationships;
2796
+ // if at least one of these optionals is defined
2797
+ if (existing_parentRelationships !== undefined || incoming_parentRelationships !== undefined) {
2798
+ // if one of these is not defined we know the other is defined and therefore
2799
+ // not equal
2800
+ if (existing_parentRelationships === undefined || incoming_parentRelationships === undefined) {
2801
+ return false;
2802
+ }
2803
+ const equals_parentRelationships_items = equalsArray(existing_parentRelationships, incoming_parentRelationships, (existing_parentRelationships_item, incoming_parentRelationships_item) => {
2804
+ if (!(equals$4(existing_parentRelationships_item, incoming_parentRelationships_item))) {
2805
+ return false;
2806
+ }
2807
+ });
2808
+ if (equals_parentRelationships_items === false) {
2809
+ return false;
2810
+ }
2811
+ }
2812
+ return true;
2813
+ }
2814
+
2815
+ const TTL$1 = 200;
2816
+ const VERSION$2 = "cc4b04e3cbff7dbd4546fac85637cd5b";
2817
+ function validate$2(obj, path = 'EntitiesDetailsOutputRepresentation') {
2818
+ const v_error = (() => {
2819
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2820
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2821
+ }
2822
+ const obj_correlation_id = obj.correlation_id;
2823
+ const path_correlation_id = path + '.correlation_id';
2824
+ if (typeof obj_correlation_id !== 'string') {
2825
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
2826
+ }
2827
+ const obj_metadata = obj.metadata;
2828
+ const path_metadata = path + '.metadata';
2829
+ if (!ArrayIsArray(obj_metadata)) {
2830
+ return new TypeError('Expected "array" but received "' + typeof obj_metadata + '" (at "' + path_metadata + '")');
2831
+ }
2832
+ for (let i = 0; i < obj_metadata.length; i++) {
2833
+ const obj_metadata_item = obj_metadata[i];
2834
+ const path_metadata_item = path_metadata + '[' + i + ']';
2835
+ const referencepath_metadata_itemValidationError = validate$3(obj_metadata_item, path_metadata_item);
2836
+ if (referencepath_metadata_itemValidationError !== null) {
2837
+ let message = 'Object doesn\'t match EntityDetailsResponseObject (at "' + path_metadata_item + '")\n';
2838
+ message += referencepath_metadata_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2839
+ return new TypeError(message);
2840
+ }
2841
+ }
2842
+ })();
2843
+ return v_error === undefined ? null : v_error;
2844
+ }
2845
+ const RepresentationType$1 = 'EntitiesDetailsOutputRepresentation';
2846
+ function keyBuilder$1(luvio, config) {
2847
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.correlation_id;
2848
+ }
2849
+ function keyBuilderFromType$1(luvio, object) {
2850
+ const keyParams = {
2851
+ correlation_id: object.correlation_id
2852
+ };
2853
+ return keyBuilder$1(luvio, keyParams);
2854
+ }
2855
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
2856
+ return input;
2857
+ }
2858
+ const select$5 = function EntitiesDetailsOutputRepresentationSelect() {
2859
+ const { selections: EntityDetailsResponseObject__selections, opaque: EntityDetailsResponseObject__opaque, } = select$6();
2860
+ return {
2861
+ kind: 'Fragment',
2862
+ version: VERSION$2,
2863
+ private: [],
2864
+ selections: [
2865
+ {
2866
+ name: 'correlation_id',
2867
+ kind: 'Scalar'
2868
+ },
2869
+ {
2870
+ name: 'metadata',
2871
+ kind: 'Object',
2872
+ plural: true,
2873
+ selections: EntityDetailsResponseObject__selections
2874
+ }
2875
+ ]
2876
+ };
2877
+ };
2878
+ function equals$2(existing, incoming) {
2879
+ const existing_correlation_id = existing.correlation_id;
2880
+ const incoming_correlation_id = incoming.correlation_id;
2881
+ if (!(existing_correlation_id === incoming_correlation_id)) {
2882
+ return false;
2883
+ }
2884
+ const existing_metadata = existing.metadata;
2885
+ const incoming_metadata = incoming.metadata;
2886
+ const equals_metadata_items = equalsArray(existing_metadata, incoming_metadata, (existing_metadata_item, incoming_metadata_item) => {
2887
+ if (!(equals$3(existing_metadata_item, incoming_metadata_item))) {
2888
+ return false;
2889
+ }
2890
+ });
2891
+ if (equals_metadata_items === false) {
2892
+ return false;
2893
+ }
2894
+ return true;
2895
+ }
2896
+ const ingest$1 = function EntitiesDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2897
+ if (process.env.NODE_ENV !== 'production') {
2898
+ const validateError = validate$2(input);
2899
+ if (validateError !== null) {
2900
+ throw validateError;
2901
+ }
2902
+ }
2903
+ const key = keyBuilderFromType$1(luvio, input);
2904
+ const ttlToUse = TTL$1;
2905
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "data-seed", VERSION$2, RepresentationType$1, equals$2);
2906
+ return createLink(key);
2907
+ };
2908
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
2909
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2910
+ const rootKey = keyBuilderFromType$1(luvio, input);
2911
+ rootKeySet.set(rootKey, {
2912
+ namespace: keyPrefix,
2913
+ representationName: RepresentationType$1,
2914
+ mergeable: false
2915
+ });
2916
+ }
2917
+
2918
+ function select$4(luvio, params) {
2919
+ return select$5();
2920
+ }
2921
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2922
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
2923
+ }
2924
+ function ingestSuccess$2(luvio, resourceParams, response) {
2925
+ const { body } = response;
2926
+ const key = keyBuilderFromType$1(luvio, body);
2927
+ luvio.storeIngest(key, ingest$1, body);
2928
+ const snapshot = luvio.storeLookup({
2929
+ recordId: key,
2930
+ node: select$4(),
2931
+ variables: {},
2932
+ });
2933
+ if (process.env.NODE_ENV !== 'production') {
2934
+ if (snapshot.state !== 'Fulfilled') {
2935
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2936
+ }
2937
+ }
2938
+ deepFreeze(snapshot.data);
2939
+ return snapshot;
2940
+ }
2941
+ function createResourceRequest$2(config) {
2942
+ const headers = {};
2943
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
2944
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
2945
+ headers['Org-Url'] = config.headers.orgUrl;
2946
+ headers['Access-Token'] = config.headers.accessToken;
2947
+ return {
2948
+ baseUri: 'api.salesforce.com',
2949
+ basePath: '/platform/data-seed/v1/data-seed-fetch-salesforce-object-metadata',
2950
+ method: 'post',
2951
+ body: config.body,
2952
+ urlParams: {},
2953
+ queryParams: {},
2954
+ headers,
2955
+ priority: 'normal',
2956
+ };
2957
+ }
2958
+
2959
+ const adapterName$2 = 'getOrgEntitiesDetails';
2960
+ const getOrgEntitiesDetails_ConfigPropertyMetadata = [
2961
+ generateParamConfigMetadata('source_instance_url', true, 2 /* Body */, 0 /* String */),
2962
+ generateParamConfigMetadata('source_access_token', true, 2 /* Body */, 0 /* String */),
2963
+ generateParamConfigMetadata('object_names', true, 2 /* Body */, 0 /* String */, true),
2964
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
2965
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
2966
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
2967
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
2968
+ ];
2969
+ const getOrgEntitiesDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getOrgEntitiesDetails_ConfigPropertyMetadata);
2970
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$b(getOrgEntitiesDetails_ConfigPropertyMetadata);
2971
+ function typeCheckConfig$2(untrustedConfig) {
2972
+ const config = {};
2973
+ typeCheckConfig$b(untrustedConfig, config, getOrgEntitiesDetails_ConfigPropertyMetadata);
2974
+ return config;
2975
+ }
2976
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2977
+ if (!untrustedIsObject(untrustedConfig)) {
2978
+ return null;
2979
+ }
2980
+ if (process.env.NODE_ENV !== 'production') {
2981
+ validateConfig(untrustedConfig, configPropertyNames);
2982
+ }
2983
+ const config = typeCheckConfig$2(untrustedConfig);
2984
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2985
+ return null;
2986
+ }
2987
+ return config;
2988
+ }
2989
+ function buildNetworkSnapshot$2(luvio, config, options) {
2990
+ const resourceParams = createResourceParams$2(config);
2991
+ const request = createResourceRequest$2(resourceParams);
2992
+ return luvio.dispatchResourceRequest(request, options)
2993
+ .then((response) => {
2994
+ return luvio.handleSuccessResponse(() => {
2995
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
2996
+ return luvio.storeBroadcast().then(() => snapshot);
2997
+ }, () => {
2998
+ const cache = new StoreKeyMap();
2999
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
3000
+ return cache;
3001
+ });
3002
+ }, (response) => {
3003
+ deepFreeze(response);
3004
+ throw response;
3005
+ });
3006
+ }
3007
+ const getOrgEntitiesDetailsAdapterFactory = (luvio) => {
3008
+ return function getOrgEntitiesDetails(untrustedConfig) {
3009
+ const config = validateAdapterConfig$2(untrustedConfig, getOrgEntitiesDetails_ConfigPropertyNames);
3010
+ // Invalid or incomplete config
3011
+ if (config === null) {
3012
+ throw new Error('Invalid config for "getOrgEntitiesDetails"');
3013
+ }
3014
+ return buildNetworkSnapshot$2(luvio, config);
3015
+ };
3016
+ };
3017
+
3018
+ const VERSION$1 = "91bdd9d579d56d9865521dbe25c21894";
3019
+ function validate$1(obj, path = 'OrgDetailsObjectRepresentation') {
3020
+ const v_error = (() => {
3021
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3022
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3023
+ }
3024
+ const obj_is_sandbox = obj.is_sandbox;
3025
+ const path_is_sandbox = path + '.is_sandbox';
3026
+ if (typeof obj_is_sandbox !== 'boolean') {
3027
+ return new TypeError('Expected "boolean" but received "' + typeof obj_is_sandbox + '" (at "' + path_is_sandbox + '")');
3028
+ }
3029
+ const obj_org_id = obj.org_id;
3030
+ const path_org_id = path + '.org_id';
3031
+ if (typeof obj_org_id !== 'string') {
3032
+ return new TypeError('Expected "string" but received "' + typeof obj_org_id + '" (at "' + path_org_id + '")');
3033
+ }
3034
+ const obj_org_name = obj.org_name;
3035
+ const path_org_name = path + '.org_name';
3036
+ if (typeof obj_org_name !== 'string') {
3037
+ return new TypeError('Expected "string" but received "' + typeof obj_org_name + '" (at "' + path_org_name + '")');
3038
+ }
3039
+ const obj_organization_type = obj.organization_type;
3040
+ const path_organization_type = path + '.organization_type';
3041
+ if (typeof obj_organization_type !== 'string') {
3042
+ return new TypeError('Expected "string" but received "' + typeof obj_organization_type + '" (at "' + path_organization_type + '")');
3043
+ }
3044
+ })();
3045
+ return v_error === undefined ? null : v_error;
3046
+ }
3047
+ const select$3 = function OrgDetailsObjectRepresentationSelect() {
3048
+ return {
3049
+ kind: 'Fragment',
3050
+ version: VERSION$1,
3051
+ private: [],
3052
+ selections: [
3053
+ {
3054
+ name: 'is_sandbox',
3055
+ kind: 'Scalar'
3056
+ },
3057
+ {
3058
+ name: 'org_id',
3059
+ kind: 'Scalar'
3060
+ },
3061
+ {
3062
+ name: 'org_name',
3063
+ kind: 'Scalar'
3064
+ },
3065
+ {
3066
+ name: 'organization_type',
3067
+ kind: 'Scalar'
3068
+ }
3069
+ ]
3070
+ };
3071
+ };
3072
+ function equals$1(existing, incoming) {
3073
+ const existing_is_sandbox = existing.is_sandbox;
3074
+ const incoming_is_sandbox = incoming.is_sandbox;
3075
+ if (!(existing_is_sandbox === incoming_is_sandbox)) {
3076
+ return false;
3077
+ }
3078
+ const existing_org_id = existing.org_id;
3079
+ const incoming_org_id = incoming.org_id;
3080
+ if (!(existing_org_id === incoming_org_id)) {
3081
+ return false;
3082
+ }
3083
+ const existing_org_name = existing.org_name;
3084
+ const incoming_org_name = incoming.org_name;
3085
+ if (!(existing_org_name === incoming_org_name)) {
3086
+ return false;
3087
+ }
3088
+ const existing_organization_type = existing.organization_type;
3089
+ const incoming_organization_type = incoming.organization_type;
3090
+ if (!(existing_organization_type === incoming_organization_type)) {
3091
+ return false;
3092
+ }
3093
+ return true;
3094
+ }
3095
+
3096
+ const TTL = 200;
3097
+ const VERSION = "50d597a0f1636efc71ac02a6c9abc436";
3098
+ function validate(obj, path = 'OrgDetailsRepresentation') {
3099
+ const v_error = (() => {
3100
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3101
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3102
+ }
3103
+ const obj_correlation_id = obj.correlation_id;
3104
+ const path_correlation_id = path + '.correlation_id';
3105
+ if (typeof obj_correlation_id !== 'string') {
3106
+ return new TypeError('Expected "string" but received "' + typeof obj_correlation_id + '" (at "' + path_correlation_id + '")');
3107
+ }
3108
+ const obj_org_details = obj.org_details;
3109
+ const path_org_details = path + '.org_details';
3110
+ const referencepath_org_detailsValidationError = validate$1(obj_org_details, path_org_details);
3111
+ if (referencepath_org_detailsValidationError !== null) {
3112
+ let message = 'Object doesn\'t match OrgDetailsObjectRepresentation (at "' + path_org_details + '")\n';
3113
+ message += referencepath_org_detailsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3114
+ return new TypeError(message);
3115
+ }
3116
+ })();
3117
+ return v_error === undefined ? null : v_error;
3118
+ }
3119
+ const RepresentationType = 'OrgDetailsRepresentation';
3120
+ function keyBuilder(luvio, config) {
3121
+ return keyPrefix + '::' + RepresentationType + ':' + config.correlation_id;
3122
+ }
3123
+ function keyBuilderFromType(luvio, object) {
3124
+ const keyParams = {
3125
+ correlation_id: object.correlation_id
3126
+ };
3127
+ return keyBuilder(luvio, keyParams);
3128
+ }
3129
+ function normalize(input, existing, path, luvio, store, timestamp) {
3130
+ return input;
3131
+ }
3132
+ const select$2 = function OrgDetailsRepresentationSelect() {
3133
+ const { selections: OrgDetailsObjectRepresentation__selections, opaque: OrgDetailsObjectRepresentation__opaque, } = select$3();
3134
+ return {
3135
+ kind: 'Fragment',
3136
+ version: VERSION,
3137
+ private: [],
3138
+ selections: [
3139
+ {
3140
+ name: 'correlation_id',
3141
+ kind: 'Scalar'
3142
+ },
3143
+ {
3144
+ name: 'org_details',
3145
+ kind: 'Object',
3146
+ selections: OrgDetailsObjectRepresentation__selections
3147
+ }
3148
+ ]
3149
+ };
3150
+ };
3151
+ function equals(existing, incoming) {
3152
+ const existing_correlation_id = existing.correlation_id;
3153
+ const incoming_correlation_id = incoming.correlation_id;
3154
+ if (!(existing_correlation_id === incoming_correlation_id)) {
3155
+ return false;
3156
+ }
3157
+ const existing_org_details = existing.org_details;
3158
+ const incoming_org_details = incoming.org_details;
3159
+ if (!(equals$1(existing_org_details, incoming_org_details))) {
3160
+ return false;
3161
+ }
3162
+ return true;
3163
+ }
3164
+ const ingest = function OrgDetailsRepresentationIngest(input, path, luvio, store, timestamp) {
3165
+ if (process.env.NODE_ENV !== 'production') {
3166
+ const validateError = validate(input);
3167
+ if (validateError !== null) {
3168
+ throw validateError;
3169
+ }
3170
+ }
3171
+ const key = keyBuilderFromType(luvio, input);
3172
+ const ttlToUse = TTL;
3173
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "data-seed", VERSION, RepresentationType, equals);
3174
+ return createLink(key);
3175
+ };
3176
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
3177
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3178
+ const rootKey = keyBuilderFromType(luvio, input);
3179
+ rootKeySet.set(rootKey, {
3180
+ namespace: keyPrefix,
3181
+ representationName: RepresentationType,
3182
+ mergeable: false
3183
+ });
3184
+ }
3185
+
3186
+ function select$1(luvio, params) {
3187
+ return select$2();
3188
+ }
3189
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
3190
+ getTypeCacheKeys(storeKeyMap, luvio, response);
3191
+ }
3192
+ function ingestSuccess$1(luvio, resourceParams, response) {
3193
+ const { body } = response;
3194
+ const key = keyBuilderFromType(luvio, body);
3195
+ luvio.storeIngest(key, ingest, body);
3196
+ const snapshot = luvio.storeLookup({
3197
+ recordId: key,
3198
+ node: select$1(),
3199
+ variables: {},
3200
+ });
3201
+ if (process.env.NODE_ENV !== 'production') {
3202
+ if (snapshot.state !== 'Fulfilled') {
3203
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3204
+ }
3205
+ }
3206
+ deepFreeze(snapshot.data);
3207
+ return snapshot;
3208
+ }
3209
+ function createResourceRequest$1(config) {
3210
+ const headers = {};
3211
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
3212
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
3213
+ headers['Org-Url'] = config.headers.orgUrl;
3214
+ headers['Access-Token'] = config.headers.accessToken;
3215
+ return {
3216
+ baseUri: 'api.salesforce.com',
3217
+ basePath: '/platform/data-seed/v1/data-seed-org-details',
3218
+ method: 'post',
3219
+ body: null,
3220
+ urlParams: {},
3221
+ queryParams: {},
3222
+ headers,
3223
+ priority: 'normal',
3224
+ };
3225
+ }
3226
+
3227
+ const adapterName$1 = 'getSalesforceOrgDetails';
3228
+ const getSalesforceOrgDetails_ConfigPropertyMetadata = [
3229
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
3230
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
3231
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
3232
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
3233
+ ];
3234
+ const getSalesforceOrgDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getSalesforceOrgDetails_ConfigPropertyMetadata);
3235
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$b(getSalesforceOrgDetails_ConfigPropertyMetadata);
3236
+ function typeCheckConfig$1(untrustedConfig) {
3237
+ const config = {};
3238
+ typeCheckConfig$b(untrustedConfig, config, getSalesforceOrgDetails_ConfigPropertyMetadata);
3239
+ return config;
3240
+ }
3241
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
3242
+ if (!untrustedIsObject(untrustedConfig)) {
3243
+ return null;
3244
+ }
3245
+ if (process.env.NODE_ENV !== 'production') {
3246
+ validateConfig(untrustedConfig, configPropertyNames);
3247
+ }
3248
+ const config = typeCheckConfig$1(untrustedConfig);
3249
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3250
+ return null;
3251
+ }
3252
+ return config;
3253
+ }
3254
+ function buildNetworkSnapshot$1(luvio, config, options) {
3255
+ const resourceParams = createResourceParams$1(config);
3256
+ const request = createResourceRequest$1(resourceParams);
3257
+ return luvio.dispatchResourceRequest(request, options)
3258
+ .then((response) => {
3259
+ return luvio.handleSuccessResponse(() => {
3260
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
3261
+ return luvio.storeBroadcast().then(() => snapshot);
3262
+ }, () => {
3263
+ const cache = new StoreKeyMap();
3264
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
3265
+ return cache;
3266
+ });
3267
+ }, (response) => {
3268
+ deepFreeze(response);
3269
+ throw response;
3270
+ });
3271
+ }
3272
+ const getSalesforceOrgDetailsAdapterFactory = (luvio) => {
3273
+ return function getSalesforceOrgDetails(untrustedConfig) {
3274
+ const config = validateAdapterConfig$1(untrustedConfig, getSalesforceOrgDetails_ConfigPropertyNames);
3275
+ // Invalid or incomplete config
3276
+ if (config === null) {
3277
+ throw new Error('Invalid config for "getSalesforceOrgDetails"');
3278
+ }
3279
+ return buildNetworkSnapshot$1(luvio, config);
3280
+ };
3281
+ };
3282
+
3283
+ function select(luvio, params) {
3284
+ return select$f();
3285
+ }
3286
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
3287
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
3288
+ }
3289
+ function ingestSuccess(luvio, resourceParams, response) {
3290
+ const { body } = response;
3291
+ const key = keyBuilderFromType$3(luvio, body);
3292
+ luvio.storeIngest(key, ingest$3, body);
3293
+ const snapshot = luvio.storeLookup({
3294
+ recordId: key,
3295
+ node: select(),
3296
+ variables: {},
3297
+ });
3298
+ if (process.env.NODE_ENV !== 'production') {
3299
+ if (snapshot.state !== 'Fulfilled') {
3300
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3301
+ }
3302
+ }
3303
+ deepFreeze(snapshot.data);
3304
+ return snapshot;
3305
+ }
3306
+ function createResourceRequest(config) {
3307
+ const headers = {};
3308
+ headers['x-client-trace-id'] = config.headers.xClientTraceId;
3309
+ headers['x-salesforce-region'] = config.headers.xSalesforceRegion;
3310
+ headers['Org-Url'] = config.headers.orgUrl;
3311
+ headers['Access-Token'] = config.headers.accessToken;
3312
+ return {
3313
+ baseUri: 'api.salesforce.com',
3314
+ basePath: '/platform/data-seed/v1/data-seed-generate',
3315
+ method: 'post',
3316
+ body: config.body,
3317
+ urlParams: {},
3318
+ queryParams: {},
3319
+ headers,
3320
+ priority: 'normal',
3321
+ };
3322
+ }
3323
+
3324
+ const adapterName = 'generateData';
3325
+ const generateData_ConfigPropertyMetadata = [
3326
+ generateParamConfigMetadata('source_instance_url', true, 2 /* Body */, 0 /* String */),
3327
+ generateParamConfigMetadata('source_access_token', true, 2 /* Body */, 0 /* String */),
3328
+ generateParamConfigMetadata('target_instance_url', true, 2 /* Body */, 0 /* String */),
3329
+ generateParamConfigMetadata('target_access_token', true, 2 /* Body */, 0 /* String */),
3330
+ generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
3331
+ generateParamConfigMetadata('desc', true, 2 /* Body */, 0 /* String */),
3332
+ generateParamConfigMetadata('config', true, 2 /* Body */, 0 /* String */),
3333
+ generateParamConfigMetadata('mode', true, 2 /* Body */, 0 /* String */),
3334
+ generateParamConfigMetadata('xClientTraceId', true, 3 /* Header */, 0 /* String */),
3335
+ generateParamConfigMetadata('xSalesforceRegion', true, 3 /* Header */, 0 /* String */),
3336
+ generateParamConfigMetadata('orgUrl', true, 3 /* Header */, 0 /* String */),
3337
+ generateParamConfigMetadata('accessToken', true, 3 /* Header */, 0 /* String */),
3338
+ ];
3339
+ const generateData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, generateData_ConfigPropertyMetadata);
3340
+ const createResourceParams = /*#__PURE__*/ createResourceParams$b(generateData_ConfigPropertyMetadata);
3341
+ function typeCheckConfig(untrustedConfig) {
3342
+ const config = {};
3343
+ typeCheckConfig$b(untrustedConfig, config, generateData_ConfigPropertyMetadata);
3344
+ return config;
3345
+ }
3346
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
3347
+ if (!untrustedIsObject(untrustedConfig)) {
3348
+ return null;
3349
+ }
3350
+ if (process.env.NODE_ENV !== 'production') {
3351
+ validateConfig(untrustedConfig, configPropertyNames);
3352
+ }
3353
+ const config = typeCheckConfig(untrustedConfig);
3354
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3355
+ return null;
3356
+ }
3357
+ return config;
3358
+ }
3359
+ function buildNetworkSnapshot(luvio, config, options) {
3360
+ const resourceParams = createResourceParams(config);
3361
+ const request = createResourceRequest(resourceParams);
3362
+ return luvio.dispatchResourceRequest(request, options)
3363
+ .then((response) => {
3364
+ return luvio.handleSuccessResponse(() => {
3365
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
3366
+ return luvio.storeBroadcast().then(() => snapshot);
3367
+ }, () => {
3368
+ const cache = new StoreKeyMap();
3369
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
3370
+ return cache;
3371
+ });
3372
+ }, (response) => {
3373
+ deepFreeze(response);
3374
+ throw response;
3375
+ });
3376
+ }
3377
+ const generateDataAdapterFactory = (luvio) => {
3378
+ return function generateData(untrustedConfig) {
3379
+ const config = validateAdapterConfig(untrustedConfig, generateData_ConfigPropertyNames);
3380
+ // Invalid or incomplete config
3381
+ if (config === null) {
3382
+ throw new Error('Invalid config for "generateData"');
3383
+ }
3384
+ return buildNetworkSnapshot(luvio, config);
3385
+ };
3386
+ };
3387
+
3388
+ export { generateDataAdapterFactory, getAuthCallbackStatusAdapterFactory, getDataSeedRequestStatusAdapterFactory, getDataSeedStatusAdapterFactory, getDownloadPreSignedUrlAdapterFactory, getOrgEntitiesAdapterFactory, getOrgEntitiesDetailsAdapterFactory, getSalesforceOrgDetailsAdapterFactory, getUploadPreSignedUrlAdapterFactory, loadDataToTargetOrgAdapterFactory, migrateDataAdapterFactory };