@salesforce/lds-adapters-industries-filebased-dataimport 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 (55) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-filebased-dataimport.js +3827 -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/createFileBasedDataImport.d.ts +29 -0
  5. package/dist/es/es2018/types/src/generated/adapters/deleteFileBasedDataImport.d.ts +14 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getAllFields.d.ts +30 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getAllSobjects.d.ts +29 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getCsvAutoMap.d.ts +30 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getCsvPreviewData.d.ts +30 -0
  10. package/dist/es/es2018/types/src/generated/adapters/getDPEDefinitions.d.ts +26 -0
  11. package/dist/es/es2018/types/src/generated/adapters/getFileBasedDataImportById.d.ts +28 -0
  12. package/dist/es/es2018/types/src/generated/adapters/getFileBasedDataImports.d.ts +26 -0
  13. package/dist/es/es2018/types/src/generated/adapters/startAdvanceImport.d.ts +18 -0
  14. package/dist/es/es2018/types/src/generated/adapters/startSimpleImport.d.ts +18 -0
  15. package/dist/es/es2018/types/src/generated/adapters/updateFileBasedDataImport.d.ts +29 -0
  16. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +12 -0
  17. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +21 -0
  18. package/dist/es/es2018/types/src/generated/resources/deleteConnectIndustriesFileBasedDataImportsByFileBasedImportId.d.ts +12 -0
  19. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImports.d.ts +12 -0
  20. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsAutomap.d.ts +18 -0
  21. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsByFileBasedImportId.d.ts +16 -0
  22. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsDpeDefinitions.d.ts +12 -0
  23. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsEntities.d.ts +17 -0
  24. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsEntitiesFieldsByEntityApiName.d.ts +20 -0
  25. package/dist/es/es2018/types/src/generated/resources/getConnectIndustriesFileBasedDataImportsPreviewByFileBasedImportId.d.ts +20 -0
  26. package/dist/es/es2018/types/src/generated/resources/patchConnectIndustriesFileBasedDataImportsByFileBasedImportId.d.ts +28 -0
  27. package/dist/es/es2018/types/src/generated/resources/postConnectIndustriesFileBasedDataImports.d.ts +26 -0
  28. package/dist/es/es2018/types/src/generated/resources/postConnectIndustriesFileBasedDataImportsAdvanceImport.d.ts +15 -0
  29. package/dist/es/es2018/types/src/generated/resources/postConnectIndustriesFileBasedDataImportsSimpleImport.d.ts +15 -0
  30. package/dist/es/es2018/types/src/generated/types/CSVMappingsResultRepresentation.d.ts +29 -0
  31. package/dist/es/es2018/types/src/generated/types/CsvMappingRepresentation.d.ts +38 -0
  32. package/dist/es/es2018/types/src/generated/types/CsvPreviewOutputRepresentation.d.ts +31 -0
  33. package/dist/es/es2018/types/src/generated/types/DPEDefinitionOutputRepresentation.d.ts +29 -0
  34. package/dist/es/es2018/types/src/generated/types/DPEDefinitionRepresentation.d.ts +34 -0
  35. package/dist/es/es2018/types/src/generated/types/FieldConfigurationInputRepresentation.d.ts +43 -0
  36. package/dist/es/es2018/types/src/generated/types/FieldInfoOutputRepresentation.d.ts +29 -0
  37. package/dist/es/es2018/types/src/generated/types/FieldInfoRepresentation.d.ts +71 -0
  38. package/dist/es/es2018/types/src/generated/types/FileBasedDataImportByUserResultRepresentation.d.ts +41 -0
  39. package/dist/es/es2018/types/src/generated/types/FileBasedDataImportInputRep.d.ts +70 -0
  40. package/dist/es/es2018/types/src/generated/types/FileBasedDataImportRepresentation.d.ts +91 -0
  41. package/dist/es/es2018/types/src/generated/types/FileBasedDataImportUpdateInputRep.d.ts +67 -0
  42. package/dist/es/es2018/types/src/generated/types/FileImportInputRepresentation.d.ts +34 -0
  43. package/dist/es/es2018/types/src/generated/types/FileImportOutputRepresentation.d.ts +40 -0
  44. package/dist/es/es2018/types/src/generated/types/ImportOperationInputRepresentation.d.ts +31 -0
  45. package/dist/es/es2018/types/src/generated/types/ImportOptionsInputRepresentation.d.ts +39 -0
  46. package/dist/es/es2018/types/src/generated/types/ObjectInfoDirectoryEntryRepresentation.d.ts +43 -0
  47. package/dist/es/es2018/types/src/generated/types/ObjectInfoDirectoryRepresentation.d.ts +33 -0
  48. package/dist/es/es2018/types/src/generated/types/ReferenceEntityInfo.d.ts +35 -0
  49. package/dist/es/es2018/types/src/generated/types/ReferenceFieldInfo.d.ts +31 -0
  50. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  51. package/package.json +68 -0
  52. package/sfdc/index.d.ts +1 -0
  53. package/sfdc/index.js +3972 -0
  54. package/src/raml/api.raml +760 -0
  55. package/src/raml/luvio.raml +114 -0
@@ -0,0 +1,3827 @@
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$7, StoreKeyMap, createResourceParams as createResourceParams$c, typeCheckConfig as typeCheckConfig$c } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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$1(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 = 'fileBased-dataimport';
73
+
74
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
75
+ const { isArray: ArrayIsArray } = Array;
76
+ const { stringify: JSONStringify } = JSON;
77
+ function equalsArray(a, b, equalsItem) {
78
+ const aLength = a.length;
79
+ const bLength = b.length;
80
+ if (aLength !== bLength) {
81
+ return false;
82
+ }
83
+ for (let i = 0; i < aLength; i++) {
84
+ if (equalsItem(a[i], b[i]) === false) {
85
+ return false;
86
+ }
87
+ }
88
+ return true;
89
+ }
90
+ function createLink(ref) {
91
+ return {
92
+ __ref: serializeStructuredKey(ref),
93
+ };
94
+ }
95
+
96
+ const VERSION$c = "d31c2d618b5ff6607036493cc0a3cca4";
97
+ function validate$g(obj, path = 'FileBasedDataImportRepresentation') {
98
+ const v_error = (() => {
99
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
100
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
101
+ }
102
+ if (obj.createdBy !== undefined) {
103
+ const obj_createdBy = obj.createdBy;
104
+ const path_createdBy = path + '.createdBy';
105
+ if (typeof obj_createdBy !== 'string') {
106
+ return new TypeError('Expected "string" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
107
+ }
108
+ }
109
+ if (obj.createdDate !== undefined) {
110
+ const obj_createdDate = obj.createdDate;
111
+ const path_createdDate = path + '.createdDate';
112
+ if (typeof obj_createdDate !== 'string') {
113
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
114
+ }
115
+ }
116
+ if (obj.failedRecordsCount !== undefined) {
117
+ const obj_failedRecordsCount = obj.failedRecordsCount;
118
+ const path_failedRecordsCount = path + '.failedRecordsCount';
119
+ if (typeof obj_failedRecordsCount !== 'number' || (typeof obj_failedRecordsCount === 'number' && Math.floor(obj_failedRecordsCount) !== obj_failedRecordsCount)) {
120
+ return new TypeError('Expected "integer" but received "' + typeof obj_failedRecordsCount + '" (at "' + path_failedRecordsCount + '")');
121
+ }
122
+ }
123
+ if (obj.failedResults !== undefined) {
124
+ const obj_failedResults = obj.failedResults;
125
+ const path_failedResults = path + '.failedResults';
126
+ let obj_failedResults_union0 = null;
127
+ const obj_failedResults_union0_error = (() => {
128
+ if (typeof obj_failedResults !== 'string') {
129
+ return new TypeError('Expected "string" but received "' + typeof obj_failedResults + '" (at "' + path_failedResults + '")');
130
+ }
131
+ })();
132
+ if (obj_failedResults_union0_error != null) {
133
+ obj_failedResults_union0 = obj_failedResults_union0_error.message;
134
+ }
135
+ let obj_failedResults_union1 = null;
136
+ const obj_failedResults_union1_error = (() => {
137
+ if (obj_failedResults !== null) {
138
+ return new TypeError('Expected "null" but received "' + typeof obj_failedResults + '" (at "' + path_failedResults + '")');
139
+ }
140
+ })();
141
+ if (obj_failedResults_union1_error != null) {
142
+ obj_failedResults_union1 = obj_failedResults_union1_error.message;
143
+ }
144
+ if (obj_failedResults_union0 && obj_failedResults_union1) {
145
+ let message = 'Object doesn\'t match union (at "' + path_failedResults + '")';
146
+ message += '\n' + obj_failedResults_union0.split('\n').map((line) => '\t' + line).join('\n');
147
+ message += '\n' + obj_failedResults_union1.split('\n').map((line) => '\t' + line).join('\n');
148
+ return new TypeError(message);
149
+ }
150
+ }
151
+ const obj_fileBasedImportType = obj.fileBasedImportType;
152
+ const path_fileBasedImportType = path + '.fileBasedImportType';
153
+ if (typeof obj_fileBasedImportType !== 'string') {
154
+ return new TypeError('Expected "string" but received "' + typeof obj_fileBasedImportType + '" (at "' + path_fileBasedImportType + '")');
155
+ }
156
+ const obj_id = obj.id;
157
+ const path_id = path + '.id';
158
+ if (typeof obj_id !== 'string') {
159
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
160
+ }
161
+ const obj_importOperationType = obj.importOperationType;
162
+ const path_importOperationType = path + '.importOperationType';
163
+ if (typeof obj_importOperationType !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_importOperationType + '" (at "' + path_importOperationType + '")');
165
+ }
166
+ if (obj.jobIdentifier !== undefined) {
167
+ const obj_jobIdentifier = obj.jobIdentifier;
168
+ const path_jobIdentifier = path + '.jobIdentifier';
169
+ let obj_jobIdentifier_union0 = null;
170
+ const obj_jobIdentifier_union0_error = (() => {
171
+ if (typeof obj_jobIdentifier !== 'string') {
172
+ return new TypeError('Expected "string" but received "' + typeof obj_jobIdentifier + '" (at "' + path_jobIdentifier + '")');
173
+ }
174
+ })();
175
+ if (obj_jobIdentifier_union0_error != null) {
176
+ obj_jobIdentifier_union0 = obj_jobIdentifier_union0_error.message;
177
+ }
178
+ let obj_jobIdentifier_union1 = null;
179
+ const obj_jobIdentifier_union1_error = (() => {
180
+ if (obj_jobIdentifier !== null) {
181
+ return new TypeError('Expected "null" but received "' + typeof obj_jobIdentifier + '" (at "' + path_jobIdentifier + '")');
182
+ }
183
+ })();
184
+ if (obj_jobIdentifier_union1_error != null) {
185
+ obj_jobIdentifier_union1 = obj_jobIdentifier_union1_error.message;
186
+ }
187
+ if (obj_jobIdentifier_union0 && obj_jobIdentifier_union1) {
188
+ let message = 'Object doesn\'t match union (at "' + path_jobIdentifier + '")';
189
+ message += '\n' + obj_jobIdentifier_union0.split('\n').map((line) => '\t' + line).join('\n');
190
+ message += '\n' + obj_jobIdentifier_union1.split('\n').map((line) => '\t' + line).join('\n');
191
+ return new TypeError(message);
192
+ }
193
+ }
194
+ if (obj.lastModifiedDate !== undefined) {
195
+ const obj_lastModifiedDate = obj.lastModifiedDate;
196
+ const path_lastModifiedDate = path + '.lastModifiedDate';
197
+ if (typeof obj_lastModifiedDate !== 'string') {
198
+ return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
199
+ }
200
+ }
201
+ if (obj.parentJobId !== undefined) {
202
+ const obj_parentJobId = obj.parentJobId;
203
+ const path_parentJobId = path + '.parentJobId';
204
+ let obj_parentJobId_union0 = null;
205
+ const obj_parentJobId_union0_error = (() => {
206
+ if (typeof obj_parentJobId !== 'string') {
207
+ return new TypeError('Expected "string" but received "' + typeof obj_parentJobId + '" (at "' + path_parentJobId + '")');
208
+ }
209
+ })();
210
+ if (obj_parentJobId_union0_error != null) {
211
+ obj_parentJobId_union0 = obj_parentJobId_union0_error.message;
212
+ }
213
+ let obj_parentJobId_union1 = null;
214
+ const obj_parentJobId_union1_error = (() => {
215
+ if (obj_parentJobId !== null) {
216
+ return new TypeError('Expected "null" but received "' + typeof obj_parentJobId + '" (at "' + path_parentJobId + '")');
217
+ }
218
+ })();
219
+ if (obj_parentJobId_union1_error != null) {
220
+ obj_parentJobId_union1 = obj_parentJobId_union1_error.message;
221
+ }
222
+ if (obj_parentJobId_union0 && obj_parentJobId_union1) {
223
+ let message = 'Object doesn\'t match union (at "' + path_parentJobId + '")';
224
+ message += '\n' + obj_parentJobId_union0.split('\n').map((line) => '\t' + line).join('\n');
225
+ message += '\n' + obj_parentJobId_union1.split('\n').map((line) => '\t' + line).join('\n');
226
+ return new TypeError(message);
227
+ }
228
+ }
229
+ if (obj.sourceContentDocument !== undefined) {
230
+ const obj_sourceContentDocument = obj.sourceContentDocument;
231
+ const path_sourceContentDocument = path + '.sourceContentDocument';
232
+ let obj_sourceContentDocument_union0 = null;
233
+ const obj_sourceContentDocument_union0_error = (() => {
234
+ if (typeof obj_sourceContentDocument !== 'string') {
235
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceContentDocument + '" (at "' + path_sourceContentDocument + '")');
236
+ }
237
+ })();
238
+ if (obj_sourceContentDocument_union0_error != null) {
239
+ obj_sourceContentDocument_union0 = obj_sourceContentDocument_union0_error.message;
240
+ }
241
+ let obj_sourceContentDocument_union1 = null;
242
+ const obj_sourceContentDocument_union1_error = (() => {
243
+ if (obj_sourceContentDocument !== null) {
244
+ return new TypeError('Expected "null" but received "' + typeof obj_sourceContentDocument + '" (at "' + path_sourceContentDocument + '")');
245
+ }
246
+ })();
247
+ if (obj_sourceContentDocument_union1_error != null) {
248
+ obj_sourceContentDocument_union1 = obj_sourceContentDocument_union1_error.message;
249
+ }
250
+ if (obj_sourceContentDocument_union0 && obj_sourceContentDocument_union1) {
251
+ let message = 'Object doesn\'t match union (at "' + path_sourceContentDocument + '")';
252
+ message += '\n' + obj_sourceContentDocument_union0.split('\n').map((line) => '\t' + line).join('\n');
253
+ message += '\n' + obj_sourceContentDocument_union1.split('\n').map((line) => '\t' + line).join('\n');
254
+ return new TypeError(message);
255
+ }
256
+ }
257
+ const obj_sourceFileName = obj.sourceFileName;
258
+ const path_sourceFileName = path + '.sourceFileName';
259
+ if (typeof obj_sourceFileName !== 'string') {
260
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceFileName + '" (at "' + path_sourceFileName + '")');
261
+ }
262
+ const obj_status = obj.status;
263
+ const path_status = path + '.status';
264
+ if (typeof obj_status !== 'string') {
265
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
266
+ }
267
+ if (obj.statusReason !== undefined) {
268
+ const obj_statusReason = obj.statusReason;
269
+ const path_statusReason = path + '.statusReason';
270
+ let obj_statusReason_union0 = null;
271
+ const obj_statusReason_union0_error = (() => {
272
+ if (typeof obj_statusReason !== 'string') {
273
+ return new TypeError('Expected "string" but received "' + typeof obj_statusReason + '" (at "' + path_statusReason + '")');
274
+ }
275
+ })();
276
+ if (obj_statusReason_union0_error != null) {
277
+ obj_statusReason_union0 = obj_statusReason_union0_error.message;
278
+ }
279
+ let obj_statusReason_union1 = null;
280
+ const obj_statusReason_union1_error = (() => {
281
+ if (obj_statusReason !== null) {
282
+ return new TypeError('Expected "null" but received "' + typeof obj_statusReason + '" (at "' + path_statusReason + '")');
283
+ }
284
+ })();
285
+ if (obj_statusReason_union1_error != null) {
286
+ obj_statusReason_union1 = obj_statusReason_union1_error.message;
287
+ }
288
+ if (obj_statusReason_union0 && obj_statusReason_union1) {
289
+ let message = 'Object doesn\'t match union (at "' + path_statusReason + '")';
290
+ message += '\n' + obj_statusReason_union0.split('\n').map((line) => '\t' + line).join('\n');
291
+ message += '\n' + obj_statusReason_union1.split('\n').map((line) => '\t' + line).join('\n');
292
+ return new TypeError(message);
293
+ }
294
+ }
295
+ if (obj.successRecordsCount !== undefined) {
296
+ const obj_successRecordsCount = obj.successRecordsCount;
297
+ const path_successRecordsCount = path + '.successRecordsCount';
298
+ if (typeof obj_successRecordsCount !== 'number' || (typeof obj_successRecordsCount === 'number' && Math.floor(obj_successRecordsCount) !== obj_successRecordsCount)) {
299
+ return new TypeError('Expected "integer" but received "' + typeof obj_successRecordsCount + '" (at "' + path_successRecordsCount + '")');
300
+ }
301
+ }
302
+ if (obj.successfulResults !== undefined) {
303
+ const obj_successfulResults = obj.successfulResults;
304
+ const path_successfulResults = path + '.successfulResults';
305
+ let obj_successfulResults_union0 = null;
306
+ const obj_successfulResults_union0_error = (() => {
307
+ if (typeof obj_successfulResults !== 'string') {
308
+ return new TypeError('Expected "string" but received "' + typeof obj_successfulResults + '" (at "' + path_successfulResults + '")');
309
+ }
310
+ })();
311
+ if (obj_successfulResults_union0_error != null) {
312
+ obj_successfulResults_union0 = obj_successfulResults_union0_error.message;
313
+ }
314
+ let obj_successfulResults_union1 = null;
315
+ const obj_successfulResults_union1_error = (() => {
316
+ if (obj_successfulResults !== null) {
317
+ return new TypeError('Expected "null" but received "' + typeof obj_successfulResults + '" (at "' + path_successfulResults + '")');
318
+ }
319
+ })();
320
+ if (obj_successfulResults_union1_error != null) {
321
+ obj_successfulResults_union1 = obj_successfulResults_union1_error.message;
322
+ }
323
+ if (obj_successfulResults_union0 && obj_successfulResults_union1) {
324
+ let message = 'Object doesn\'t match union (at "' + path_successfulResults + '")';
325
+ message += '\n' + obj_successfulResults_union0.split('\n').map((line) => '\t' + line).join('\n');
326
+ message += '\n' + obj_successfulResults_union1.split('\n').map((line) => '\t' + line).join('\n');
327
+ return new TypeError(message);
328
+ }
329
+ }
330
+ if (obj.targetContext !== undefined) {
331
+ const obj_targetContext = obj.targetContext;
332
+ const path_targetContext = path + '.targetContext';
333
+ let obj_targetContext_union0 = null;
334
+ const obj_targetContext_union0_error = (() => {
335
+ if (typeof obj_targetContext !== 'string') {
336
+ return new TypeError('Expected "string" but received "' + typeof obj_targetContext + '" (at "' + path_targetContext + '")');
337
+ }
338
+ })();
339
+ if (obj_targetContext_union0_error != null) {
340
+ obj_targetContext_union0 = obj_targetContext_union0_error.message;
341
+ }
342
+ let obj_targetContext_union1 = null;
343
+ const obj_targetContext_union1_error = (() => {
344
+ if (obj_targetContext !== null) {
345
+ return new TypeError('Expected "null" but received "' + typeof obj_targetContext + '" (at "' + path_targetContext + '")');
346
+ }
347
+ })();
348
+ if (obj_targetContext_union1_error != null) {
349
+ obj_targetContext_union1 = obj_targetContext_union1_error.message;
350
+ }
351
+ if (obj_targetContext_union0 && obj_targetContext_union1) {
352
+ let message = 'Object doesn\'t match union (at "' + path_targetContext + '")';
353
+ message += '\n' + obj_targetContext_union0.split('\n').map((line) => '\t' + line).join('\n');
354
+ message += '\n' + obj_targetContext_union1.split('\n').map((line) => '\t' + line).join('\n');
355
+ return new TypeError(message);
356
+ }
357
+ }
358
+ if (obj.unprocessedRecords !== undefined) {
359
+ const obj_unprocessedRecords = obj.unprocessedRecords;
360
+ const path_unprocessedRecords = path + '.unprocessedRecords';
361
+ let obj_unprocessedRecords_union0 = null;
362
+ const obj_unprocessedRecords_union0_error = (() => {
363
+ if (typeof obj_unprocessedRecords !== 'string') {
364
+ return new TypeError('Expected "string" but received "' + typeof obj_unprocessedRecords + '" (at "' + path_unprocessedRecords + '")');
365
+ }
366
+ })();
367
+ if (obj_unprocessedRecords_union0_error != null) {
368
+ obj_unprocessedRecords_union0 = obj_unprocessedRecords_union0_error.message;
369
+ }
370
+ let obj_unprocessedRecords_union1 = null;
371
+ const obj_unprocessedRecords_union1_error = (() => {
372
+ if (obj_unprocessedRecords !== null) {
373
+ return new TypeError('Expected "null" but received "' + typeof obj_unprocessedRecords + '" (at "' + path_unprocessedRecords + '")');
374
+ }
375
+ })();
376
+ if (obj_unprocessedRecords_union1_error != null) {
377
+ obj_unprocessedRecords_union1 = obj_unprocessedRecords_union1_error.message;
378
+ }
379
+ if (obj_unprocessedRecords_union0 && obj_unprocessedRecords_union1) {
380
+ let message = 'Object doesn\'t match union (at "' + path_unprocessedRecords + '")';
381
+ message += '\n' + obj_unprocessedRecords_union0.split('\n').map((line) => '\t' + line).join('\n');
382
+ message += '\n' + obj_unprocessedRecords_union1.split('\n').map((line) => '\t' + line).join('\n');
383
+ return new TypeError(message);
384
+ }
385
+ }
386
+ if (obj.unprocessedRecordsCount !== undefined) {
387
+ const obj_unprocessedRecordsCount = obj.unprocessedRecordsCount;
388
+ const path_unprocessedRecordsCount = path + '.unprocessedRecordsCount';
389
+ if (typeof obj_unprocessedRecordsCount !== 'number' || (typeof obj_unprocessedRecordsCount === 'number' && Math.floor(obj_unprocessedRecordsCount) !== obj_unprocessedRecordsCount)) {
390
+ return new TypeError('Expected "integer" but received "' + typeof obj_unprocessedRecordsCount + '" (at "' + path_unprocessedRecordsCount + '")');
391
+ }
392
+ }
393
+ })();
394
+ return v_error === undefined ? null : v_error;
395
+ }
396
+ const RepresentationType$7 = 'FileBasedDataImportRepresentation';
397
+ function keyBuilder$g(luvio, config) {
398
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.id;
399
+ }
400
+ function keyBuilderFromType$1(luvio, object) {
401
+ const keyParams = {
402
+ id: object.id
403
+ };
404
+ return keyBuilder$g(luvio, keyParams);
405
+ }
406
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
407
+ return input;
408
+ }
409
+ const select$n = function FileBasedDataImportRepresentationSelect() {
410
+ return {
411
+ kind: 'Fragment',
412
+ version: VERSION$c,
413
+ private: [],
414
+ selections: [
415
+ {
416
+ name: 'createdBy',
417
+ kind: 'Scalar',
418
+ required: false
419
+ },
420
+ {
421
+ name: 'createdDate',
422
+ kind: 'Scalar',
423
+ required: false
424
+ },
425
+ {
426
+ name: 'failedRecordsCount',
427
+ kind: 'Scalar',
428
+ required: false
429
+ },
430
+ {
431
+ name: 'failedResults',
432
+ kind: 'Scalar',
433
+ required: false
434
+ },
435
+ {
436
+ name: 'fileBasedImportType',
437
+ kind: 'Scalar'
438
+ },
439
+ {
440
+ name: 'id',
441
+ kind: 'Scalar'
442
+ },
443
+ {
444
+ name: 'importOperationType',
445
+ kind: 'Scalar'
446
+ },
447
+ {
448
+ name: 'jobIdentifier',
449
+ kind: 'Scalar',
450
+ required: false
451
+ },
452
+ {
453
+ name: 'lastModifiedDate',
454
+ kind: 'Scalar',
455
+ required: false
456
+ },
457
+ {
458
+ name: 'parentJobId',
459
+ kind: 'Scalar',
460
+ required: false
461
+ },
462
+ {
463
+ name: 'sourceContentDocument',
464
+ kind: 'Scalar',
465
+ required: false
466
+ },
467
+ {
468
+ name: 'sourceFileName',
469
+ kind: 'Scalar'
470
+ },
471
+ {
472
+ name: 'status',
473
+ kind: 'Scalar'
474
+ },
475
+ {
476
+ name: 'statusReason',
477
+ kind: 'Scalar',
478
+ required: false
479
+ },
480
+ {
481
+ name: 'successRecordsCount',
482
+ kind: 'Scalar',
483
+ required: false
484
+ },
485
+ {
486
+ name: 'successfulResults',
487
+ kind: 'Scalar',
488
+ required: false
489
+ },
490
+ {
491
+ name: 'targetContext',
492
+ kind: 'Scalar',
493
+ required: false
494
+ },
495
+ {
496
+ name: 'unprocessedRecords',
497
+ kind: 'Scalar',
498
+ required: false
499
+ },
500
+ {
501
+ name: 'unprocessedRecordsCount',
502
+ kind: 'Scalar',
503
+ required: false
504
+ }
505
+ ]
506
+ };
507
+ };
508
+ function equals$c(existing, incoming) {
509
+ const existing_failedRecordsCount = existing.failedRecordsCount;
510
+ const incoming_failedRecordsCount = incoming.failedRecordsCount;
511
+ // if at least one of these optionals is defined
512
+ if (existing_failedRecordsCount !== undefined || incoming_failedRecordsCount !== undefined) {
513
+ // if one of these is not defined we know the other is defined and therefore
514
+ // not equal
515
+ if (existing_failedRecordsCount === undefined || incoming_failedRecordsCount === undefined) {
516
+ return false;
517
+ }
518
+ if (!(existing_failedRecordsCount === incoming_failedRecordsCount)) {
519
+ return false;
520
+ }
521
+ }
522
+ const existing_successRecordsCount = existing.successRecordsCount;
523
+ const incoming_successRecordsCount = incoming.successRecordsCount;
524
+ // if at least one of these optionals is defined
525
+ if (existing_successRecordsCount !== undefined || incoming_successRecordsCount !== undefined) {
526
+ // if one of these is not defined we know the other is defined and therefore
527
+ // not equal
528
+ if (existing_successRecordsCount === undefined || incoming_successRecordsCount === undefined) {
529
+ return false;
530
+ }
531
+ if (!(existing_successRecordsCount === incoming_successRecordsCount)) {
532
+ return false;
533
+ }
534
+ }
535
+ const existing_unprocessedRecordsCount = existing.unprocessedRecordsCount;
536
+ const incoming_unprocessedRecordsCount = incoming.unprocessedRecordsCount;
537
+ // if at least one of these optionals is defined
538
+ if (existing_unprocessedRecordsCount !== undefined || incoming_unprocessedRecordsCount !== undefined) {
539
+ // if one of these is not defined we know the other is defined and therefore
540
+ // not equal
541
+ if (existing_unprocessedRecordsCount === undefined || incoming_unprocessedRecordsCount === undefined) {
542
+ return false;
543
+ }
544
+ if (!(existing_unprocessedRecordsCount === incoming_unprocessedRecordsCount)) {
545
+ return false;
546
+ }
547
+ }
548
+ const existing_createdBy = existing.createdBy;
549
+ const incoming_createdBy = incoming.createdBy;
550
+ // if at least one of these optionals is defined
551
+ if (existing_createdBy !== undefined || incoming_createdBy !== undefined) {
552
+ // if one of these is not defined we know the other is defined and therefore
553
+ // not equal
554
+ if (existing_createdBy === undefined || incoming_createdBy === undefined) {
555
+ return false;
556
+ }
557
+ if (!(existing_createdBy === incoming_createdBy)) {
558
+ return false;
559
+ }
560
+ }
561
+ const existing_createdDate = existing.createdDate;
562
+ const incoming_createdDate = incoming.createdDate;
563
+ // if at least one of these optionals is defined
564
+ if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
565
+ // if one of these is not defined we know the other is defined and therefore
566
+ // not equal
567
+ if (existing_createdDate === undefined || incoming_createdDate === undefined) {
568
+ return false;
569
+ }
570
+ if (!(existing_createdDate === incoming_createdDate)) {
571
+ return false;
572
+ }
573
+ }
574
+ const existing_fileBasedImportType = existing.fileBasedImportType;
575
+ const incoming_fileBasedImportType = incoming.fileBasedImportType;
576
+ if (!(existing_fileBasedImportType === incoming_fileBasedImportType)) {
577
+ return false;
578
+ }
579
+ const existing_id = existing.id;
580
+ const incoming_id = incoming.id;
581
+ if (!(existing_id === incoming_id)) {
582
+ return false;
583
+ }
584
+ const existing_importOperationType = existing.importOperationType;
585
+ const incoming_importOperationType = incoming.importOperationType;
586
+ if (!(existing_importOperationType === incoming_importOperationType)) {
587
+ return false;
588
+ }
589
+ const existing_lastModifiedDate = existing.lastModifiedDate;
590
+ const incoming_lastModifiedDate = incoming.lastModifiedDate;
591
+ // if at least one of these optionals is defined
592
+ if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
593
+ // if one of these is not defined we know the other is defined and therefore
594
+ // not equal
595
+ if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
596
+ return false;
597
+ }
598
+ if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
599
+ return false;
600
+ }
601
+ }
602
+ const existing_sourceFileName = existing.sourceFileName;
603
+ const incoming_sourceFileName = incoming.sourceFileName;
604
+ if (!(existing_sourceFileName === incoming_sourceFileName)) {
605
+ return false;
606
+ }
607
+ const existing_status = existing.status;
608
+ const incoming_status = incoming.status;
609
+ if (!(existing_status === incoming_status)) {
610
+ return false;
611
+ }
612
+ const existing_failedResults = existing.failedResults;
613
+ const incoming_failedResults = incoming.failedResults;
614
+ // if at least one of these optionals is defined
615
+ if (existing_failedResults !== undefined || incoming_failedResults !== undefined) {
616
+ // if one of these is not defined we know the other is defined and therefore
617
+ // not equal
618
+ if (existing_failedResults === undefined || incoming_failedResults === undefined) {
619
+ return false;
620
+ }
621
+ if (!(existing_failedResults === incoming_failedResults)) {
622
+ return false;
623
+ }
624
+ }
625
+ const existing_jobIdentifier = existing.jobIdentifier;
626
+ const incoming_jobIdentifier = incoming.jobIdentifier;
627
+ // if at least one of these optionals is defined
628
+ if (existing_jobIdentifier !== undefined || incoming_jobIdentifier !== undefined) {
629
+ // if one of these is not defined we know the other is defined and therefore
630
+ // not equal
631
+ if (existing_jobIdentifier === undefined || incoming_jobIdentifier === undefined) {
632
+ return false;
633
+ }
634
+ if (!(existing_jobIdentifier === incoming_jobIdentifier)) {
635
+ return false;
636
+ }
637
+ }
638
+ const existing_parentJobId = existing.parentJobId;
639
+ const incoming_parentJobId = incoming.parentJobId;
640
+ // if at least one of these optionals is defined
641
+ if (existing_parentJobId !== undefined || incoming_parentJobId !== undefined) {
642
+ // if one of these is not defined we know the other is defined and therefore
643
+ // not equal
644
+ if (existing_parentJobId === undefined || incoming_parentJobId === undefined) {
645
+ return false;
646
+ }
647
+ if (!(existing_parentJobId === incoming_parentJobId)) {
648
+ return false;
649
+ }
650
+ }
651
+ const existing_sourceContentDocument = existing.sourceContentDocument;
652
+ const incoming_sourceContentDocument = incoming.sourceContentDocument;
653
+ // if at least one of these optionals is defined
654
+ if (existing_sourceContentDocument !== undefined || incoming_sourceContentDocument !== undefined) {
655
+ // if one of these is not defined we know the other is defined and therefore
656
+ // not equal
657
+ if (existing_sourceContentDocument === undefined || incoming_sourceContentDocument === undefined) {
658
+ return false;
659
+ }
660
+ if (!(existing_sourceContentDocument === incoming_sourceContentDocument)) {
661
+ return false;
662
+ }
663
+ }
664
+ const existing_statusReason = existing.statusReason;
665
+ const incoming_statusReason = incoming.statusReason;
666
+ // if at least one of these optionals is defined
667
+ if (existing_statusReason !== undefined || incoming_statusReason !== undefined) {
668
+ // if one of these is not defined we know the other is defined and therefore
669
+ // not equal
670
+ if (existing_statusReason === undefined || incoming_statusReason === undefined) {
671
+ return false;
672
+ }
673
+ if (!(existing_statusReason === incoming_statusReason)) {
674
+ return false;
675
+ }
676
+ }
677
+ const existing_successfulResults = existing.successfulResults;
678
+ const incoming_successfulResults = incoming.successfulResults;
679
+ // if at least one of these optionals is defined
680
+ if (existing_successfulResults !== undefined || incoming_successfulResults !== undefined) {
681
+ // if one of these is not defined we know the other is defined and therefore
682
+ // not equal
683
+ if (existing_successfulResults === undefined || incoming_successfulResults === undefined) {
684
+ return false;
685
+ }
686
+ if (!(existing_successfulResults === incoming_successfulResults)) {
687
+ return false;
688
+ }
689
+ }
690
+ const existing_targetContext = existing.targetContext;
691
+ const incoming_targetContext = incoming.targetContext;
692
+ // if at least one of these optionals is defined
693
+ if (existing_targetContext !== undefined || incoming_targetContext !== undefined) {
694
+ // if one of these is not defined we know the other is defined and therefore
695
+ // not equal
696
+ if (existing_targetContext === undefined || incoming_targetContext === undefined) {
697
+ return false;
698
+ }
699
+ if (!(existing_targetContext === incoming_targetContext)) {
700
+ return false;
701
+ }
702
+ }
703
+ const existing_unprocessedRecords = existing.unprocessedRecords;
704
+ const incoming_unprocessedRecords = incoming.unprocessedRecords;
705
+ // if at least one of these optionals is defined
706
+ if (existing_unprocessedRecords !== undefined || incoming_unprocessedRecords !== undefined) {
707
+ // if one of these is not defined we know the other is defined and therefore
708
+ // not equal
709
+ if (existing_unprocessedRecords === undefined || incoming_unprocessedRecords === undefined) {
710
+ return false;
711
+ }
712
+ if (!(existing_unprocessedRecords === incoming_unprocessedRecords)) {
713
+ return false;
714
+ }
715
+ }
716
+ return true;
717
+ }
718
+ const ingest$7 = function FileBasedDataImportRepresentationIngest(input, path, luvio, store, timestamp) {
719
+ if (process.env.NODE_ENV !== 'production') {
720
+ const validateError = validate$g(input);
721
+ if (validateError !== null) {
722
+ throw validateError;
723
+ }
724
+ }
725
+ const key = keyBuilderFromType$1(luvio, input);
726
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
727
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "fileBased-dataimport", VERSION$c, RepresentationType$7, equals$c);
728
+ return createLink(key);
729
+ };
730
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
731
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
732
+ const rootKey = keyBuilderFromType$1(luvio, input);
733
+ rootKeySet.set(rootKey, {
734
+ namespace: keyPrefix,
735
+ representationName: RepresentationType$7,
736
+ mergeable: false
737
+ });
738
+ }
739
+
740
+ const VERSION$b = "5ba99358bf109c24644c99238f9a172c";
741
+ function validate$f(obj, path = 'FileBasedDataImportByUserResultRepresentation') {
742
+ const v_error = (() => {
743
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
744
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
745
+ }
746
+ if (obj.fileBasedDataImportRepresentations !== undefined) {
747
+ const obj_fileBasedDataImportRepresentations = obj.fileBasedDataImportRepresentations;
748
+ const path_fileBasedDataImportRepresentations = path + '.fileBasedDataImportRepresentations';
749
+ if (!ArrayIsArray(obj_fileBasedDataImportRepresentations)) {
750
+ return new TypeError('Expected "array" but received "' + typeof obj_fileBasedDataImportRepresentations + '" (at "' + path_fileBasedDataImportRepresentations + '")');
751
+ }
752
+ for (let i = 0; i < obj_fileBasedDataImportRepresentations.length; i++) {
753
+ const obj_fileBasedDataImportRepresentations_item = obj_fileBasedDataImportRepresentations[i];
754
+ const path_fileBasedDataImportRepresentations_item = path_fileBasedDataImportRepresentations + '[' + i + ']';
755
+ if (typeof obj_fileBasedDataImportRepresentations_item !== 'object' || Array.isArray(obj_fileBasedDataImportRepresentations_item)) {
756
+ return new TypeError('Expected "object" but received "' + typeof obj_fileBasedDataImportRepresentations_item + '" (at "' + path_fileBasedDataImportRepresentations_item + '")');
757
+ }
758
+ }
759
+ }
760
+ if (obj.isAdminUser !== undefined) {
761
+ const obj_isAdminUser = obj.isAdminUser;
762
+ const path_isAdminUser = path + '.isAdminUser';
763
+ if (typeof obj_isAdminUser !== 'boolean') {
764
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isAdminUser + '" (at "' + path_isAdminUser + '")');
765
+ }
766
+ }
767
+ })();
768
+ return v_error === undefined ? null : v_error;
769
+ }
770
+ const RepresentationType$6 = 'FileBasedDataImportByUserResultRepresentation';
771
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
772
+ const input_fileBasedDataImportRepresentations = input.fileBasedDataImportRepresentations;
773
+ const input_fileBasedDataImportRepresentations_id = path.fullPath + '__fileBasedDataImportRepresentations';
774
+ if (input_fileBasedDataImportRepresentations !== undefined) {
775
+ for (let i = 0; i < input_fileBasedDataImportRepresentations.length; i++) {
776
+ const input_fileBasedDataImportRepresentations_item = input_fileBasedDataImportRepresentations[i];
777
+ let input_fileBasedDataImportRepresentations_item_id = input_fileBasedDataImportRepresentations_id + '__' + i;
778
+ input_fileBasedDataImportRepresentations[i] = ingest$7(input_fileBasedDataImportRepresentations_item, {
779
+ fullPath: input_fileBasedDataImportRepresentations_item_id,
780
+ propertyName: i,
781
+ parent: {
782
+ data: input,
783
+ key: path.fullPath,
784
+ existing: existing,
785
+ },
786
+ ttl: path.ttl
787
+ }, luvio, store, timestamp);
788
+ }
789
+ }
790
+ return input;
791
+ }
792
+ const select$m = function FileBasedDataImportByUserResultRepresentationSelect() {
793
+ return {
794
+ kind: 'Fragment',
795
+ version: VERSION$b,
796
+ private: [],
797
+ selections: [
798
+ {
799
+ name: 'fileBasedDataImportRepresentations',
800
+ kind: 'Link',
801
+ plural: true,
802
+ required: false,
803
+ fragment: select$n()
804
+ },
805
+ {
806
+ name: 'isAdminUser',
807
+ kind: 'Scalar',
808
+ required: false
809
+ }
810
+ ]
811
+ };
812
+ };
813
+ function equals$b(existing, incoming) {
814
+ const existing_isAdminUser = existing.isAdminUser;
815
+ const incoming_isAdminUser = incoming.isAdminUser;
816
+ // if at least one of these optionals is defined
817
+ if (existing_isAdminUser !== undefined || incoming_isAdminUser !== undefined) {
818
+ // if one of these is not defined we know the other is defined and therefore
819
+ // not equal
820
+ if (existing_isAdminUser === undefined || incoming_isAdminUser === undefined) {
821
+ return false;
822
+ }
823
+ if (!(existing_isAdminUser === incoming_isAdminUser)) {
824
+ return false;
825
+ }
826
+ }
827
+ const existing_fileBasedDataImportRepresentations = existing.fileBasedDataImportRepresentations;
828
+ const incoming_fileBasedDataImportRepresentations = incoming.fileBasedDataImportRepresentations;
829
+ // if at least one of these optionals is defined
830
+ if (existing_fileBasedDataImportRepresentations !== undefined || incoming_fileBasedDataImportRepresentations !== undefined) {
831
+ // if one of these is not defined we know the other is defined and therefore
832
+ // not equal
833
+ if (existing_fileBasedDataImportRepresentations === undefined || incoming_fileBasedDataImportRepresentations === undefined) {
834
+ return false;
835
+ }
836
+ const equals_fileBasedDataImportRepresentations_items = equalsArray(existing_fileBasedDataImportRepresentations, incoming_fileBasedDataImportRepresentations, (existing_fileBasedDataImportRepresentations_item, incoming_fileBasedDataImportRepresentations_item) => {
837
+ if (!(existing_fileBasedDataImportRepresentations_item.__ref === incoming_fileBasedDataImportRepresentations_item.__ref)) {
838
+ return false;
839
+ }
840
+ });
841
+ if (equals_fileBasedDataImportRepresentations_items === false) {
842
+ return false;
843
+ }
844
+ }
845
+ return true;
846
+ }
847
+ const ingest$6 = function FileBasedDataImportByUserResultRepresentationIngest(input, path, luvio, store, timestamp) {
848
+ if (process.env.NODE_ENV !== 'production') {
849
+ const validateError = validate$f(input);
850
+ if (validateError !== null) {
851
+ throw validateError;
852
+ }
853
+ }
854
+ const key = path.fullPath;
855
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
856
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "fileBased-dataimport", VERSION$b, RepresentationType$6, equals$b);
857
+ return createLink(key);
858
+ };
859
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
860
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
861
+ const rootKey = fullPathFactory();
862
+ rootKeySet.set(rootKey, {
863
+ namespace: keyPrefix,
864
+ representationName: RepresentationType$6,
865
+ mergeable: false
866
+ });
867
+ if (input.fileBasedDataImportRepresentations !== undefined) {
868
+ const input_fileBasedDataImportRepresentations_length = input.fileBasedDataImportRepresentations.length;
869
+ for (let i = 0; i < input_fileBasedDataImportRepresentations_length; i++) {
870
+ getTypeCacheKeys$7(rootKeySet, luvio, input.fileBasedDataImportRepresentations[i]);
871
+ }
872
+ }
873
+ }
874
+
875
+ function select$l(luvio, params) {
876
+ return select$m();
877
+ }
878
+ function keyBuilder$f(luvio, params) {
879
+ return keyPrefix + '::FileBasedDataImportByUserResultRepresentation:(' + ')';
880
+ }
881
+ function getResponseCacheKeys$b(storeKeyMap, luvio, resourceParams, response) {
882
+ getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$f());
883
+ }
884
+ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
885
+ const { body } = response;
886
+ const key = keyBuilder$f();
887
+ luvio.storeIngest(key, ingest$6, body);
888
+ const snapshot = luvio.storeLookup({
889
+ recordId: key,
890
+ node: select$l(),
891
+ variables: {},
892
+ }, snapshotRefresh);
893
+ if (process.env.NODE_ENV !== 'production') {
894
+ if (snapshot.state !== 'Fulfilled') {
895
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
896
+ }
897
+ }
898
+ deepFreeze(snapshot.data);
899
+ return snapshot;
900
+ }
901
+ function ingestError$6(luvio, params, error, snapshotRefresh) {
902
+ const key = keyBuilder$f();
903
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
904
+ luvio.storeIngestError(key, errorSnapshot);
905
+ return errorSnapshot;
906
+ }
907
+ function createResourceRequest$b(config) {
908
+ const headers = {};
909
+ return {
910
+ baseUri: '/services/data/v66.0',
911
+ basePath: '/connect/industries/fileBasedDataImports',
912
+ method: 'get',
913
+ body: null,
914
+ urlParams: {},
915
+ queryParams: {},
916
+ headers,
917
+ priority: 'normal',
918
+ };
919
+ }
920
+
921
+ const adapterName$b = 'getFileBasedDataImports';
922
+ const getFileBasedDataImports_ConfigPropertyMetadata = [];
923
+ const getFileBasedDataImports_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$b, getFileBasedDataImports_ConfigPropertyMetadata);
924
+ const createResourceParams$b = /*#__PURE__*/ createResourceParams$c(getFileBasedDataImports_ConfigPropertyMetadata);
925
+ function keyBuilder$e(luvio, config) {
926
+ createResourceParams$b(config);
927
+ return keyBuilder$f();
928
+ }
929
+ function typeCheckConfig$b(untrustedConfig) {
930
+ const config = {};
931
+ return config;
932
+ }
933
+ function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
934
+ if (!untrustedIsObject(untrustedConfig)) {
935
+ return null;
936
+ }
937
+ if (process.env.NODE_ENV !== 'production') {
938
+ validateConfig(untrustedConfig, configPropertyNames);
939
+ }
940
+ const config = typeCheckConfig$b();
941
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
942
+ return null;
943
+ }
944
+ return config;
945
+ }
946
+ function adapterFragment$6(luvio, config) {
947
+ createResourceParams$b(config);
948
+ return select$l();
949
+ }
950
+ function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
951
+ const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
952
+ config,
953
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
954
+ });
955
+ return luvio.storeBroadcast().then(() => snapshot);
956
+ }
957
+ function onFetchResponseError$6(luvio, config, resourceParams, response) {
958
+ const snapshot = ingestError$6(luvio, resourceParams, response, {
959
+ config,
960
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
961
+ });
962
+ return luvio.storeBroadcast().then(() => snapshot);
963
+ }
964
+ function buildNetworkSnapshot$b(luvio, config, options) {
965
+ const resourceParams = createResourceParams$b(config);
966
+ const request = createResourceRequest$b();
967
+ return luvio.dispatchResourceRequest(request, options)
968
+ .then((response) => {
969
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$6(luvio, config, resourceParams, response), () => {
970
+ const cache = new StoreKeyMap();
971
+ getResponseCacheKeys$b(cache, luvio, resourceParams, response.body);
972
+ return cache;
973
+ });
974
+ }, (response) => {
975
+ return luvio.handleErrorResponse(() => onFetchResponseError$6(luvio, config, resourceParams, response));
976
+ });
977
+ }
978
+ function buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext) {
979
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$b, undefined, false);
980
+ }
981
+ function buildCachedSnapshotCachePolicy$6(context, storeLookup) {
982
+ const { luvio, config } = context;
983
+ const selector = {
984
+ recordId: keyBuilder$e(luvio, config),
985
+ node: adapterFragment$6(luvio, config),
986
+ variables: {},
987
+ };
988
+ const cacheSnapshot = storeLookup(selector, {
989
+ config,
990
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
991
+ });
992
+ return cacheSnapshot;
993
+ }
994
+ const getFileBasedDataImportsAdapterFactory = (luvio) => function fileBasedDataimport__getFileBasedDataImports(untrustedConfig, requestContext) {
995
+ const config = validateAdapterConfig$b(untrustedConfig, getFileBasedDataImports_ConfigPropertyNames);
996
+ // Invalid or incomplete config
997
+ if (config === null) {
998
+ return null;
999
+ }
1000
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1001
+ buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$6);
1002
+ };
1003
+
1004
+ function select$k(luvio, params) {
1005
+ return select$n();
1006
+ }
1007
+ function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
1008
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
1009
+ }
1010
+ function ingestSuccess$9(luvio, resourceParams, response) {
1011
+ const { body } = response;
1012
+ const key = keyBuilderFromType$1(luvio, body);
1013
+ luvio.storeIngest(key, ingest$7, body);
1014
+ const snapshot = luvio.storeLookup({
1015
+ recordId: key,
1016
+ node: select$k(),
1017
+ variables: {},
1018
+ });
1019
+ if (process.env.NODE_ENV !== 'production') {
1020
+ if (snapshot.state !== 'Fulfilled') {
1021
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1022
+ }
1023
+ }
1024
+ deepFreeze(snapshot.data);
1025
+ return snapshot;
1026
+ }
1027
+ function createResourceRequest$a(config) {
1028
+ const headers = {};
1029
+ return {
1030
+ baseUri: '/services/data/v66.0',
1031
+ basePath: '/connect/industries/fileBasedDataImports',
1032
+ method: 'post',
1033
+ body: config.body,
1034
+ urlParams: {},
1035
+ queryParams: {},
1036
+ headers,
1037
+ priority: 'normal',
1038
+ };
1039
+ }
1040
+
1041
+ const adapterName$a = 'createFileBasedDataImport';
1042
+ const createFileBasedDataImport_ConfigPropertyMetadata = [
1043
+ generateParamConfigMetadata('failedRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1044
+ generateParamConfigMetadata('failedRecordCount', false, 2 /* Body */, 3 /* Integer */),
1045
+ generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
1046
+ generateParamConfigMetadata('importOperationType', false, 2 /* Body */, 0 /* String */),
1047
+ generateParamConfigMetadata('importType', false, 2 /* Body */, 0 /* String */),
1048
+ generateParamConfigMetadata('jobIdentifier', false, 2 /* Body */, 0 /* String */),
1049
+ generateParamConfigMetadata('sourceContentDocument', false, 2 /* Body */, 0 /* String */),
1050
+ generateParamConfigMetadata('sourceFileName', true, 2 /* Body */, 0 /* String */),
1051
+ generateParamConfigMetadata('status', false, 2 /* Body */, 0 /* String */),
1052
+ generateParamConfigMetadata('statusReason', false, 2 /* Body */, 0 /* String */),
1053
+ generateParamConfigMetadata('successfulRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1054
+ generateParamConfigMetadata('successfulRecordCount', false, 2 /* Body */, 3 /* Integer */),
1055
+ generateParamConfigMetadata('targetContext', false, 2 /* Body */, 0 /* String */),
1056
+ generateParamConfigMetadata('unprocessedRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1057
+ generateParamConfigMetadata('unprocessedRecordCount', false, 2 /* Body */, 3 /* Integer */),
1058
+ ];
1059
+ const createFileBasedDataImport_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, createFileBasedDataImport_ConfigPropertyMetadata);
1060
+ const createResourceParams$a = /*#__PURE__*/ createResourceParams$c(createFileBasedDataImport_ConfigPropertyMetadata);
1061
+ function typeCheckConfig$a(untrustedConfig) {
1062
+ const config = {};
1063
+ typeCheckConfig$c(untrustedConfig, config, createFileBasedDataImport_ConfigPropertyMetadata);
1064
+ return config;
1065
+ }
1066
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
1067
+ if (!untrustedIsObject(untrustedConfig)) {
1068
+ return null;
1069
+ }
1070
+ if (process.env.NODE_ENV !== 'production') {
1071
+ validateConfig(untrustedConfig, configPropertyNames);
1072
+ }
1073
+ const config = typeCheckConfig$a(untrustedConfig);
1074
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1075
+ return null;
1076
+ }
1077
+ return config;
1078
+ }
1079
+ function buildNetworkSnapshot$a(luvio, config, options) {
1080
+ const resourceParams = createResourceParams$a(config);
1081
+ const request = createResourceRequest$a(resourceParams);
1082
+ return luvio.dispatchResourceRequest(request, options)
1083
+ .then((response) => {
1084
+ return luvio.handleSuccessResponse(() => {
1085
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response);
1086
+ return luvio.storeBroadcast().then(() => snapshot);
1087
+ }, () => {
1088
+ const cache = new StoreKeyMap();
1089
+ getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
1090
+ return cache;
1091
+ });
1092
+ }, (response) => {
1093
+ deepFreeze(response);
1094
+ throw response;
1095
+ });
1096
+ }
1097
+ const createFileBasedDataImportAdapterFactory = (luvio) => {
1098
+ return function createFileBasedDataImport(untrustedConfig) {
1099
+ const config = validateAdapterConfig$a(untrustedConfig, createFileBasedDataImport_ConfigPropertyNames);
1100
+ // Invalid or incomplete config
1101
+ if (config === null) {
1102
+ throw new Error('Invalid config for "createFileBasedDataImport"');
1103
+ }
1104
+ return buildNetworkSnapshot$a(luvio, config);
1105
+ };
1106
+ };
1107
+
1108
+ function validate$e(obj, path = 'FieldConfigurationInputRepresentation') {
1109
+ const v_error = (() => {
1110
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1111
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1112
+ }
1113
+ if (obj.isLookupRelationship !== undefined) {
1114
+ const obj_isLookupRelationship = obj.isLookupRelationship;
1115
+ const path_isLookupRelationship = path + '.isLookupRelationship';
1116
+ if (typeof obj_isLookupRelationship !== 'boolean') {
1117
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isLookupRelationship + '" (at "' + path_isLookupRelationship + '")');
1118
+ }
1119
+ }
1120
+ if (obj.relatedFieldName !== undefined) {
1121
+ const obj_relatedFieldName = obj.relatedFieldName;
1122
+ const path_relatedFieldName = path + '.relatedFieldName';
1123
+ if (typeof obj_relatedFieldName !== 'string') {
1124
+ return new TypeError('Expected "string" but received "' + typeof obj_relatedFieldName + '" (at "' + path_relatedFieldName + '")');
1125
+ }
1126
+ }
1127
+ if (obj.relatedObjectName !== undefined) {
1128
+ const obj_relatedObjectName = obj.relatedObjectName;
1129
+ const path_relatedObjectName = path + '.relatedObjectName';
1130
+ if (typeof obj_relatedObjectName !== 'string') {
1131
+ return new TypeError('Expected "string" but received "' + typeof obj_relatedObjectName + '" (at "' + path_relatedObjectName + '")');
1132
+ }
1133
+ }
1134
+ if (obj.relationshipName !== undefined) {
1135
+ const obj_relationshipName = obj.relationshipName;
1136
+ const path_relationshipName = path + '.relationshipName';
1137
+ if (typeof obj_relationshipName !== 'string') {
1138
+ return new TypeError('Expected "string" but received "' + typeof obj_relationshipName + '" (at "' + path_relationshipName + '")');
1139
+ }
1140
+ }
1141
+ if (obj.sourceColumnName !== undefined) {
1142
+ const obj_sourceColumnName = obj.sourceColumnName;
1143
+ const path_sourceColumnName = path + '.sourceColumnName';
1144
+ if (typeof obj_sourceColumnName !== 'string') {
1145
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceColumnName + '" (at "' + path_sourceColumnName + '")');
1146
+ }
1147
+ }
1148
+ if (obj.targetFieldName !== undefined) {
1149
+ const obj_targetFieldName = obj.targetFieldName;
1150
+ const path_targetFieldName = path + '.targetFieldName';
1151
+ if (typeof obj_targetFieldName !== 'string') {
1152
+ return new TypeError('Expected "string" but received "' + typeof obj_targetFieldName + '" (at "' + path_targetFieldName + '")');
1153
+ }
1154
+ }
1155
+ })();
1156
+ return v_error === undefined ? null : v_error;
1157
+ }
1158
+
1159
+ function validate$d(obj, path = 'ImportOperationInputRepresentation') {
1160
+ const v_error = (() => {
1161
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1162
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1163
+ }
1164
+ if (obj.operationType !== undefined) {
1165
+ const obj_operationType = obj.operationType;
1166
+ const path_operationType = path + '.operationType';
1167
+ if (typeof obj_operationType !== 'string') {
1168
+ return new TypeError('Expected "string" but received "' + typeof obj_operationType + '" (at "' + path_operationType + '")');
1169
+ }
1170
+ }
1171
+ if (obj.uniqueFields !== undefined) {
1172
+ const obj_uniqueFields = obj.uniqueFields;
1173
+ const path_uniqueFields = path + '.uniqueFields';
1174
+ if (!ArrayIsArray(obj_uniqueFields)) {
1175
+ return new TypeError('Expected "array" but received "' + typeof obj_uniqueFields + '" (at "' + path_uniqueFields + '")');
1176
+ }
1177
+ for (let i = 0; i < obj_uniqueFields.length; i++) {
1178
+ const obj_uniqueFields_item = obj_uniqueFields[i];
1179
+ const path_uniqueFields_item = path_uniqueFields + '[' + i + ']';
1180
+ if (typeof obj_uniqueFields_item !== 'string') {
1181
+ return new TypeError('Expected "string" but received "' + typeof obj_uniqueFields_item + '" (at "' + path_uniqueFields_item + '")');
1182
+ }
1183
+ }
1184
+ }
1185
+ })();
1186
+ return v_error === undefined ? null : v_error;
1187
+ }
1188
+
1189
+ function validate$c(obj, path = 'ImportOptionsInputRepresentation') {
1190
+ const v_error = (() => {
1191
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1192
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1193
+ }
1194
+ if (obj.delimiter !== undefined) {
1195
+ const obj_delimiter = obj.delimiter;
1196
+ const path_delimiter = path + '.delimiter';
1197
+ if (typeof obj_delimiter !== 'string') {
1198
+ return new TypeError('Expected "string" but received "' + typeof obj_delimiter + '" (at "' + path_delimiter + '")');
1199
+ }
1200
+ }
1201
+ if (obj.eol !== undefined) {
1202
+ const obj_eol = obj.eol;
1203
+ const path_eol = path + '.eol';
1204
+ if (typeof obj_eol !== 'string') {
1205
+ return new TypeError('Expected "string" but received "' + typeof obj_eol + '" (at "' + path_eol + '")');
1206
+ }
1207
+ }
1208
+ if (obj.fieldConfigurations !== undefined) {
1209
+ const obj_fieldConfigurations = obj.fieldConfigurations;
1210
+ const path_fieldConfigurations = path + '.fieldConfigurations';
1211
+ if (!ArrayIsArray(obj_fieldConfigurations)) {
1212
+ return new TypeError('Expected "array" but received "' + typeof obj_fieldConfigurations + '" (at "' + path_fieldConfigurations + '")');
1213
+ }
1214
+ for (let i = 0; i < obj_fieldConfigurations.length; i++) {
1215
+ const obj_fieldConfigurations_item = obj_fieldConfigurations[i];
1216
+ const path_fieldConfigurations_item = path_fieldConfigurations + '[' + i + ']';
1217
+ const referencepath_fieldConfigurations_itemValidationError = validate$e(obj_fieldConfigurations_item, path_fieldConfigurations_item);
1218
+ if (referencepath_fieldConfigurations_itemValidationError !== null) {
1219
+ let message = 'Object doesn\'t match FieldConfigurationInputRepresentation (at "' + path_fieldConfigurations_item + '")\n';
1220
+ message += referencepath_fieldConfigurations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1221
+ return new TypeError(message);
1222
+ }
1223
+ }
1224
+ }
1225
+ if (obj.operation !== undefined) {
1226
+ const obj_operation = obj.operation;
1227
+ const path_operation = path + '.operation';
1228
+ const referencepath_operationValidationError = validate$d(obj_operation, path_operation);
1229
+ if (referencepath_operationValidationError !== null) {
1230
+ let message = 'Object doesn\'t match ImportOperationInputRepresentation (at "' + path_operation + '")\n';
1231
+ message += referencepath_operationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1232
+ return new TypeError(message);
1233
+ }
1234
+ }
1235
+ })();
1236
+ return v_error === undefined ? null : v_error;
1237
+ }
1238
+
1239
+ const VERSION$a = "0f74d1482de21ff21d94491b9f9b869a";
1240
+ function validate$b(obj, path = 'FileImportOutputRepresentation') {
1241
+ const v_error = (() => {
1242
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1243
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1244
+ }
1245
+ const obj_statusCode = obj.statusCode;
1246
+ const path_statusCode = path + '.statusCode';
1247
+ if (typeof obj_statusCode !== 'string') {
1248
+ return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
1249
+ }
1250
+ const obj_statusMessage = obj.statusMessage;
1251
+ const path_statusMessage = path + '.statusMessage';
1252
+ if (typeof obj_statusMessage !== 'string') {
1253
+ return new TypeError('Expected "string" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
1254
+ }
1255
+ })();
1256
+ return v_error === undefined ? null : v_error;
1257
+ }
1258
+ const RepresentationType$5 = 'FileImportOutputRepresentation';
1259
+ function keyBuilder$d(luvio, config) {
1260
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.statusCode;
1261
+ }
1262
+ function keyBuilderFromType(luvio, object) {
1263
+ const keyParams = {
1264
+ statusCode: object.statusCode
1265
+ };
1266
+ return keyBuilder$d(luvio, keyParams);
1267
+ }
1268
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
1269
+ return input;
1270
+ }
1271
+ const select$j = function FileImportOutputRepresentationSelect() {
1272
+ return {
1273
+ kind: 'Fragment',
1274
+ version: VERSION$a,
1275
+ private: [],
1276
+ selections: [
1277
+ {
1278
+ name: 'statusCode',
1279
+ kind: 'Scalar'
1280
+ },
1281
+ {
1282
+ name: 'statusMessage',
1283
+ kind: 'Scalar'
1284
+ }
1285
+ ]
1286
+ };
1287
+ };
1288
+ function equals$a(existing, incoming) {
1289
+ const existing_statusCode = existing.statusCode;
1290
+ const incoming_statusCode = incoming.statusCode;
1291
+ if (!(existing_statusCode === incoming_statusCode)) {
1292
+ return false;
1293
+ }
1294
+ const existing_statusMessage = existing.statusMessage;
1295
+ const incoming_statusMessage = incoming.statusMessage;
1296
+ if (!(existing_statusMessage === incoming_statusMessage)) {
1297
+ return false;
1298
+ }
1299
+ return true;
1300
+ }
1301
+ const ingest$5 = function FileImportOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1302
+ if (process.env.NODE_ENV !== 'production') {
1303
+ const validateError = validate$b(input);
1304
+ if (validateError !== null) {
1305
+ throw validateError;
1306
+ }
1307
+ }
1308
+ const key = keyBuilderFromType(luvio, input);
1309
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
1310
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "fileBased-dataimport", VERSION$a, RepresentationType$5, equals$a);
1311
+ return createLink(key);
1312
+ };
1313
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
1314
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1315
+ const rootKey = keyBuilderFromType(luvio, input);
1316
+ rootKeySet.set(rootKey, {
1317
+ namespace: keyPrefix,
1318
+ representationName: RepresentationType$5,
1319
+ mergeable: false
1320
+ });
1321
+ }
1322
+
1323
+ function select$i(luvio, params) {
1324
+ return select$j();
1325
+ }
1326
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
1327
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
1328
+ }
1329
+ function ingestSuccess$8(luvio, resourceParams, response) {
1330
+ const { body } = response;
1331
+ const key = keyBuilderFromType(luvio, body);
1332
+ luvio.storeIngest(key, ingest$5, body);
1333
+ const snapshot = luvio.storeLookup({
1334
+ recordId: key,
1335
+ node: select$i(),
1336
+ variables: {},
1337
+ });
1338
+ if (process.env.NODE_ENV !== 'production') {
1339
+ if (snapshot.state !== 'Fulfilled') {
1340
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1341
+ }
1342
+ }
1343
+ deepFreeze(snapshot.data);
1344
+ return snapshot;
1345
+ }
1346
+ function createResourceRequest$9(config) {
1347
+ const headers = {};
1348
+ return {
1349
+ baseUri: '/services/data/v66.0',
1350
+ basePath: '/connect/industries/fileBasedDataImports/advanceImport',
1351
+ method: 'post',
1352
+ body: config.body,
1353
+ urlParams: {},
1354
+ queryParams: {},
1355
+ headers,
1356
+ priority: 'normal',
1357
+ };
1358
+ }
1359
+
1360
+ const adapterName$9 = 'startAdvanceImport';
1361
+ const startAdvanceImport_ConfigPropertyMetadata = [
1362
+ generateParamConfigMetadata('importReferenceId', true, 2 /* Body */, 0 /* String */),
1363
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1364
+ generateParamConfigMetadata('targetContext', true, 2 /* Body */, 0 /* String */),
1365
+ ];
1366
+ const startAdvanceImport_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, startAdvanceImport_ConfigPropertyMetadata);
1367
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$c(startAdvanceImport_ConfigPropertyMetadata);
1368
+ function typeCheckConfig$9(untrustedConfig) {
1369
+ const config = {};
1370
+ typeCheckConfig$c(untrustedConfig, config, startAdvanceImport_ConfigPropertyMetadata);
1371
+ const untrustedConfig_options = untrustedConfig.options;
1372
+ const referenceImportOptionsInputRepresentationValidationError = validate$c(untrustedConfig_options);
1373
+ if (referenceImportOptionsInputRepresentationValidationError === null) {
1374
+ config.options = untrustedConfig_options;
1375
+ }
1376
+ return config;
1377
+ }
1378
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
1379
+ if (!untrustedIsObject(untrustedConfig)) {
1380
+ return null;
1381
+ }
1382
+ if (process.env.NODE_ENV !== 'production') {
1383
+ validateConfig(untrustedConfig, configPropertyNames);
1384
+ }
1385
+ const config = typeCheckConfig$9(untrustedConfig);
1386
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1387
+ return null;
1388
+ }
1389
+ return config;
1390
+ }
1391
+ function buildNetworkSnapshot$9(luvio, config, options) {
1392
+ const resourceParams = createResourceParams$9(config);
1393
+ const request = createResourceRequest$9(resourceParams);
1394
+ return luvio.dispatchResourceRequest(request, options)
1395
+ .then((response) => {
1396
+ return luvio.handleSuccessResponse(() => {
1397
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
1398
+ return luvio.storeBroadcast().then(() => snapshot);
1399
+ }, () => {
1400
+ const cache = new StoreKeyMap();
1401
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
1402
+ return cache;
1403
+ });
1404
+ }, (response) => {
1405
+ deepFreeze(response);
1406
+ throw response;
1407
+ });
1408
+ }
1409
+ const startAdvanceImportAdapterFactory = (luvio) => {
1410
+ return function startAdvanceImport(untrustedConfig) {
1411
+ const config = validateAdapterConfig$9(untrustedConfig, startAdvanceImport_ConfigPropertyNames);
1412
+ // Invalid or incomplete config
1413
+ if (config === null) {
1414
+ throw new Error('Invalid config for "startAdvanceImport"');
1415
+ }
1416
+ return buildNetworkSnapshot$9(luvio, config);
1417
+ };
1418
+ };
1419
+
1420
+ function select$h(luvio, params) {
1421
+ return select$j();
1422
+ }
1423
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
1424
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
1425
+ }
1426
+ function ingestSuccess$7(luvio, resourceParams, response) {
1427
+ const { body } = response;
1428
+ const key = keyBuilderFromType(luvio, body);
1429
+ luvio.storeIngest(key, ingest$5, body);
1430
+ const snapshot = luvio.storeLookup({
1431
+ recordId: key,
1432
+ node: select$h(),
1433
+ variables: {},
1434
+ });
1435
+ if (process.env.NODE_ENV !== 'production') {
1436
+ if (snapshot.state !== 'Fulfilled') {
1437
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1438
+ }
1439
+ }
1440
+ deepFreeze(snapshot.data);
1441
+ return snapshot;
1442
+ }
1443
+ function createResourceRequest$8(config) {
1444
+ const headers = {};
1445
+ return {
1446
+ baseUri: '/services/data/v66.0',
1447
+ basePath: '/connect/industries/fileBasedDataImports/simpleImport',
1448
+ method: 'post',
1449
+ body: config.body,
1450
+ urlParams: {},
1451
+ queryParams: {},
1452
+ headers,
1453
+ priority: 'normal',
1454
+ };
1455
+ }
1456
+
1457
+ const adapterName$8 = 'startSimpleImport';
1458
+ const startSimpleImport_ConfigPropertyMetadata = [
1459
+ generateParamConfigMetadata('importReferenceId', true, 2 /* Body */, 0 /* String */),
1460
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1461
+ generateParamConfigMetadata('targetContext', true, 2 /* Body */, 0 /* String */),
1462
+ ];
1463
+ const startSimpleImport_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, startSimpleImport_ConfigPropertyMetadata);
1464
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$c(startSimpleImport_ConfigPropertyMetadata);
1465
+ function typeCheckConfig$8(untrustedConfig) {
1466
+ const config = {};
1467
+ typeCheckConfig$c(untrustedConfig, config, startSimpleImport_ConfigPropertyMetadata);
1468
+ const untrustedConfig_options = untrustedConfig.options;
1469
+ const referenceImportOptionsInputRepresentationValidationError = validate$c(untrustedConfig_options);
1470
+ if (referenceImportOptionsInputRepresentationValidationError === null) {
1471
+ config.options = untrustedConfig_options;
1472
+ }
1473
+ return config;
1474
+ }
1475
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1476
+ if (!untrustedIsObject(untrustedConfig)) {
1477
+ return null;
1478
+ }
1479
+ if (process.env.NODE_ENV !== 'production') {
1480
+ validateConfig(untrustedConfig, configPropertyNames);
1481
+ }
1482
+ const config = typeCheckConfig$8(untrustedConfig);
1483
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1484
+ return null;
1485
+ }
1486
+ return config;
1487
+ }
1488
+ function buildNetworkSnapshot$8(luvio, config, options) {
1489
+ const resourceParams = createResourceParams$8(config);
1490
+ const request = createResourceRequest$8(resourceParams);
1491
+ return luvio.dispatchResourceRequest(request, options)
1492
+ .then((response) => {
1493
+ return luvio.handleSuccessResponse(() => {
1494
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response);
1495
+ return luvio.storeBroadcast().then(() => snapshot);
1496
+ }, () => {
1497
+ const cache = new StoreKeyMap();
1498
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
1499
+ return cache;
1500
+ });
1501
+ }, (response) => {
1502
+ deepFreeze(response);
1503
+ throw response;
1504
+ });
1505
+ }
1506
+ const startSimpleImportAdapterFactory = (luvio) => {
1507
+ return function startSimpleImport(untrustedConfig) {
1508
+ const config = validateAdapterConfig$8(untrustedConfig, startSimpleImport_ConfigPropertyNames);
1509
+ // Invalid or incomplete config
1510
+ if (config === null) {
1511
+ throw new Error('Invalid config for "startSimpleImport"');
1512
+ }
1513
+ return buildNetworkSnapshot$8(luvio, config);
1514
+ };
1515
+ };
1516
+
1517
+ function keyBuilder$c(luvio, params) {
1518
+ return keyBuilder$g(luvio, {
1519
+ id: params.urlParams.fileBasedImportId
1520
+ });
1521
+ }
1522
+ function getResponseCacheKeys$7(cacheKeyMap, luvio, resourceParams) {
1523
+ const key = keyBuilder$c(luvio, resourceParams);
1524
+ cacheKeyMap.set(key, {
1525
+ namespace: keyPrefix,
1526
+ representationName: RepresentationType$7,
1527
+ mergeable: false
1528
+ });
1529
+ }
1530
+ function evictSuccess(luvio, resourceParams) {
1531
+ const key = keyBuilder$c(luvio, resourceParams);
1532
+ luvio.storeEvict(key);
1533
+ }
1534
+ function createResourceRequest$7(config) {
1535
+ const headers = {};
1536
+ return {
1537
+ baseUri: '/services/data/v66.0',
1538
+ basePath: '/connect/industries/fileBasedDataImports/' + config.urlParams.fileBasedImportId + '',
1539
+ method: 'delete',
1540
+ body: null,
1541
+ urlParams: config.urlParams,
1542
+ queryParams: {},
1543
+ headers,
1544
+ priority: 'normal',
1545
+ };
1546
+ }
1547
+
1548
+ const adapterName$7 = 'deleteFileBasedDataImport';
1549
+ const deleteFileBasedDataImport_ConfigPropertyMetadata = [
1550
+ generateParamConfigMetadata('fileBasedImportId', true, 0 /* UrlParameter */, 0 /* String */),
1551
+ ];
1552
+ const deleteFileBasedDataImport_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, deleteFileBasedDataImport_ConfigPropertyMetadata);
1553
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$c(deleteFileBasedDataImport_ConfigPropertyMetadata);
1554
+ function typeCheckConfig$7(untrustedConfig) {
1555
+ const config = {};
1556
+ typeCheckConfig$c(untrustedConfig, config, deleteFileBasedDataImport_ConfigPropertyMetadata);
1557
+ return config;
1558
+ }
1559
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1560
+ if (!untrustedIsObject(untrustedConfig)) {
1561
+ return null;
1562
+ }
1563
+ if (process.env.NODE_ENV !== 'production') {
1564
+ validateConfig(untrustedConfig, configPropertyNames);
1565
+ }
1566
+ const config = typeCheckConfig$7(untrustedConfig);
1567
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1568
+ return null;
1569
+ }
1570
+ return config;
1571
+ }
1572
+ function buildNetworkSnapshot$7(luvio, config, options) {
1573
+ const resourceParams = createResourceParams$7(config);
1574
+ const request = createResourceRequest$7(resourceParams);
1575
+ return luvio.dispatchResourceRequest(request, options)
1576
+ .then(() => {
1577
+ return luvio.handleSuccessResponse(() => {
1578
+ evictSuccess(luvio, resourceParams);
1579
+ return luvio.storeBroadcast();
1580
+ }, () => {
1581
+ const cache = new StoreKeyMap();
1582
+ getResponseCacheKeys$7(cache, luvio, resourceParams);
1583
+ return cache;
1584
+ });
1585
+ }, (response) => {
1586
+ deepFreeze(response);
1587
+ throw response;
1588
+ });
1589
+ }
1590
+ const deleteFileBasedDataImportAdapterFactory = (luvio) => {
1591
+ return function fileBasedDataimportdeleteFileBasedDataImport(untrustedConfig) {
1592
+ const config = validateAdapterConfig$7(untrustedConfig, deleteFileBasedDataImport_ConfigPropertyNames);
1593
+ // Invalid or incomplete config
1594
+ if (config === null) {
1595
+ throw new Error(`Invalid config for "${adapterName$7}"`);
1596
+ }
1597
+ return buildNetworkSnapshot$7(luvio, config);
1598
+ };
1599
+ };
1600
+
1601
+ function select$g(luvio, params) {
1602
+ return select$n();
1603
+ }
1604
+ function keyBuilder$b(luvio, params) {
1605
+ return keyBuilder$g(luvio, {
1606
+ id: params.urlParams.fileBasedImportId
1607
+ });
1608
+ }
1609
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
1610
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
1611
+ }
1612
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
1613
+ const { body } = response;
1614
+ const key = keyBuilder$b(luvio, resourceParams);
1615
+ luvio.storeIngest(key, ingest$7, body);
1616
+ const snapshot = luvio.storeLookup({
1617
+ recordId: key,
1618
+ node: select$g(),
1619
+ variables: {},
1620
+ }, snapshotRefresh);
1621
+ if (process.env.NODE_ENV !== 'production') {
1622
+ if (snapshot.state !== 'Fulfilled') {
1623
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1624
+ }
1625
+ }
1626
+ deepFreeze(snapshot.data);
1627
+ return snapshot;
1628
+ }
1629
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
1630
+ const key = keyBuilder$b(luvio, params);
1631
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1632
+ luvio.storeIngestError(key, errorSnapshot);
1633
+ return errorSnapshot;
1634
+ }
1635
+ function createResourceRequest$6(config) {
1636
+ const headers = {};
1637
+ return {
1638
+ baseUri: '/services/data/v66.0',
1639
+ basePath: '/connect/industries/fileBasedDataImports/' + config.urlParams.fileBasedImportId + '',
1640
+ method: 'get',
1641
+ body: null,
1642
+ urlParams: config.urlParams,
1643
+ queryParams: {},
1644
+ headers,
1645
+ priority: 'normal',
1646
+ };
1647
+ }
1648
+
1649
+ const adapterName$6 = 'getFileBasedDataImportById';
1650
+ const getFileBasedDataImportById_ConfigPropertyMetadata = [
1651
+ generateParamConfigMetadata('fileBasedImportId', true, 0 /* UrlParameter */, 0 /* String */),
1652
+ ];
1653
+ const getFileBasedDataImportById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getFileBasedDataImportById_ConfigPropertyMetadata);
1654
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$c(getFileBasedDataImportById_ConfigPropertyMetadata);
1655
+ function keyBuilder$a(luvio, config) {
1656
+ const resourceParams = createResourceParams$6(config);
1657
+ return keyBuilder$b(luvio, resourceParams);
1658
+ }
1659
+ function typeCheckConfig$6(untrustedConfig) {
1660
+ const config = {};
1661
+ typeCheckConfig$c(untrustedConfig, config, getFileBasedDataImportById_ConfigPropertyMetadata);
1662
+ return config;
1663
+ }
1664
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
1665
+ if (!untrustedIsObject(untrustedConfig)) {
1666
+ return null;
1667
+ }
1668
+ if (process.env.NODE_ENV !== 'production') {
1669
+ validateConfig(untrustedConfig, configPropertyNames);
1670
+ }
1671
+ const config = typeCheckConfig$6(untrustedConfig);
1672
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1673
+ return null;
1674
+ }
1675
+ return config;
1676
+ }
1677
+ function adapterFragment$5(luvio, config) {
1678
+ createResourceParams$6(config);
1679
+ return select$g();
1680
+ }
1681
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
1682
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
1683
+ config,
1684
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1685
+ });
1686
+ return luvio.storeBroadcast().then(() => snapshot);
1687
+ }
1688
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
1689
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
1690
+ config,
1691
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1692
+ });
1693
+ return luvio.storeBroadcast().then(() => snapshot);
1694
+ }
1695
+ function buildNetworkSnapshot$6(luvio, config, options) {
1696
+ const resourceParams = createResourceParams$6(config);
1697
+ const request = createResourceRequest$6(resourceParams);
1698
+ return luvio.dispatchResourceRequest(request, options)
1699
+ .then((response) => {
1700
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
1701
+ const cache = new StoreKeyMap();
1702
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
1703
+ return cache;
1704
+ });
1705
+ }, (response) => {
1706
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
1707
+ });
1708
+ }
1709
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
1710
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
1711
+ }
1712
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
1713
+ const { luvio, config } = context;
1714
+ const selector = {
1715
+ recordId: keyBuilder$a(luvio, config),
1716
+ node: adapterFragment$5(luvio, config),
1717
+ variables: {},
1718
+ };
1719
+ const cacheSnapshot = storeLookup(selector, {
1720
+ config,
1721
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1722
+ });
1723
+ return cacheSnapshot;
1724
+ }
1725
+ const getFileBasedDataImportByIdAdapterFactory = (luvio) => function fileBasedDataimport__getFileBasedDataImportById(untrustedConfig, requestContext) {
1726
+ const config = validateAdapterConfig$6(untrustedConfig, getFileBasedDataImportById_ConfigPropertyNames);
1727
+ // Invalid or incomplete config
1728
+ if (config === null) {
1729
+ return null;
1730
+ }
1731
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1732
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
1733
+ };
1734
+
1735
+ function select$f(luvio, params) {
1736
+ return select$n();
1737
+ }
1738
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
1739
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
1740
+ }
1741
+ function ingestSuccess$5(luvio, resourceParams, response) {
1742
+ const { body } = response;
1743
+ const key = keyBuilderFromType$1(luvio, body);
1744
+ luvio.storeIngest(key, ingest$7, body);
1745
+ const snapshot = luvio.storeLookup({
1746
+ recordId: key,
1747
+ node: select$f(),
1748
+ variables: {},
1749
+ });
1750
+ if (process.env.NODE_ENV !== 'production') {
1751
+ if (snapshot.state !== 'Fulfilled') {
1752
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1753
+ }
1754
+ }
1755
+ deepFreeze(snapshot.data);
1756
+ return snapshot;
1757
+ }
1758
+ function createResourceRequest$5(config) {
1759
+ const headers = {};
1760
+ return {
1761
+ baseUri: '/services/data/v66.0',
1762
+ basePath: '/connect/industries/fileBasedDataImports/' + config.urlParams.fileBasedImportId + '',
1763
+ method: 'patch',
1764
+ body: config.body,
1765
+ urlParams: config.urlParams,
1766
+ queryParams: {},
1767
+ headers,
1768
+ priority: 'normal',
1769
+ };
1770
+ }
1771
+
1772
+ const adapterName$5 = 'updateFileBasedDataImport';
1773
+ const updateFileBasedDataImport_ConfigPropertyMetadata = [
1774
+ generateParamConfigMetadata('fileBasedImportId', true, 0 /* UrlParameter */, 0 /* String */),
1775
+ generateParamConfigMetadata('failedRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1776
+ generateParamConfigMetadata('failedRecordCount', false, 2 /* Body */, 3 /* Integer */),
1777
+ generateParamConfigMetadata('importOperationType', false, 2 /* Body */, 0 /* String */),
1778
+ generateParamConfigMetadata('importType', false, 2 /* Body */, 0 /* String */),
1779
+ generateParamConfigMetadata('jobIdentifier', false, 2 /* Body */, 0 /* String */),
1780
+ generateParamConfigMetadata('sourceContentDocument', false, 2 /* Body */, 0 /* String */),
1781
+ generateParamConfigMetadata('sourceFileName', false, 2 /* Body */, 0 /* String */),
1782
+ generateParamConfigMetadata('status', false, 2 /* Body */, 0 /* String */),
1783
+ generateParamConfigMetadata('statusReason', false, 2 /* Body */, 0 /* String */),
1784
+ generateParamConfigMetadata('successfulRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1785
+ generateParamConfigMetadata('successfulRecordCount', false, 2 /* Body */, 3 /* Integer */),
1786
+ generateParamConfigMetadata('targetContext', false, 2 /* Body */, 0 /* String */),
1787
+ generateParamConfigMetadata('unprocessedRecordContentDoc', false, 2 /* Body */, 0 /* String */),
1788
+ generateParamConfigMetadata('unprocessedRecordCount', false, 2 /* Body */, 3 /* Integer */),
1789
+ ];
1790
+ const updateFileBasedDataImport_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, updateFileBasedDataImport_ConfigPropertyMetadata);
1791
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$c(updateFileBasedDataImport_ConfigPropertyMetadata);
1792
+ function typeCheckConfig$5(untrustedConfig) {
1793
+ const config = {};
1794
+ typeCheckConfig$c(untrustedConfig, config, updateFileBasedDataImport_ConfigPropertyMetadata);
1795
+ return config;
1796
+ }
1797
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1798
+ if (!untrustedIsObject(untrustedConfig)) {
1799
+ return null;
1800
+ }
1801
+ if (process.env.NODE_ENV !== 'production') {
1802
+ validateConfig(untrustedConfig, configPropertyNames);
1803
+ }
1804
+ const config = typeCheckConfig$5(untrustedConfig);
1805
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1806
+ return null;
1807
+ }
1808
+ return config;
1809
+ }
1810
+ function buildNetworkSnapshot$5(luvio, config, options) {
1811
+ const resourceParams = createResourceParams$5(config);
1812
+ const request = createResourceRequest$5(resourceParams);
1813
+ return luvio.dispatchResourceRequest(request, options)
1814
+ .then((response) => {
1815
+ return luvio.handleSuccessResponse(() => {
1816
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
1817
+ return luvio.storeBroadcast().then(() => snapshot);
1818
+ }, () => {
1819
+ const cache = new StoreKeyMap();
1820
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
1821
+ return cache;
1822
+ });
1823
+ }, (response) => {
1824
+ deepFreeze(response);
1825
+ throw response;
1826
+ });
1827
+ }
1828
+ const updateFileBasedDataImportAdapterFactory = (luvio) => {
1829
+ return function updateFileBasedDataImport(untrustedConfig) {
1830
+ const config = validateAdapterConfig$5(untrustedConfig, updateFileBasedDataImport_ConfigPropertyNames);
1831
+ // Invalid or incomplete config
1832
+ if (config === null) {
1833
+ throw new Error('Invalid config for "updateFileBasedDataImport"');
1834
+ }
1835
+ return buildNetworkSnapshot$5(luvio, config);
1836
+ };
1837
+ };
1838
+
1839
+ const VERSION$9 = "3f89a0e0e670920259887253d71fcaf0";
1840
+ function validate$a(obj, path = 'CsvPreviewOutputRepresentation') {
1841
+ const v_error = (() => {
1842
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1843
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1844
+ }
1845
+ const obj_headers = obj.headers;
1846
+ const path_headers = path + '.headers';
1847
+ if (!ArrayIsArray(obj_headers)) {
1848
+ return new TypeError('Expected "array" but received "' + typeof obj_headers + '" (at "' + path_headers + '")');
1849
+ }
1850
+ for (let i = 0; i < obj_headers.length; i++) {
1851
+ const obj_headers_item = obj_headers[i];
1852
+ const path_headers_item = path_headers + '[' + i + ']';
1853
+ if (typeof obj_headers_item !== 'string') {
1854
+ return new TypeError('Expected "string" but received "' + typeof obj_headers_item + '" (at "' + path_headers_item + '")');
1855
+ }
1856
+ }
1857
+ if (obj.rows !== undefined) {
1858
+ const obj_rows = obj.rows;
1859
+ const path_rows = path + '.rows';
1860
+ if (!ArrayIsArray(obj_rows)) {
1861
+ return new TypeError('Expected "array" but received "' + typeof obj_rows + '" (at "' + path_rows + '")');
1862
+ }
1863
+ for (let i = 0; i < obj_rows.length; i++) {
1864
+ const obj_rows_item = obj_rows[i];
1865
+ const path_rows_item = path_rows + '[' + i + ']';
1866
+ if (!ArrayIsArray(obj_rows_item)) {
1867
+ return new TypeError('Expected "array" but received "' + typeof obj_rows_item + '" (at "' + path_rows_item + '")');
1868
+ }
1869
+ for (let i = 0; i < obj_rows_item.length; i++) {
1870
+ const obj_rows_item_item = obj_rows_item[i];
1871
+ const path_rows_item_item = path_rows_item + '[' + i + ']';
1872
+ let obj_rows_item_item_union0 = null;
1873
+ const obj_rows_item_item_union0_error = (() => {
1874
+ if (typeof obj_rows_item_item !== 'string') {
1875
+ return new TypeError('Expected "string" but received "' + typeof obj_rows_item_item + '" (at "' + path_rows_item_item + '")');
1876
+ }
1877
+ })();
1878
+ if (obj_rows_item_item_union0_error != null) {
1879
+ obj_rows_item_item_union0 = obj_rows_item_item_union0_error.message;
1880
+ }
1881
+ let obj_rows_item_item_union1 = null;
1882
+ const obj_rows_item_item_union1_error = (() => {
1883
+ if (obj_rows_item_item !== null) {
1884
+ return new TypeError('Expected "null" but received "' + typeof obj_rows_item_item + '" (at "' + path_rows_item_item + '")');
1885
+ }
1886
+ })();
1887
+ if (obj_rows_item_item_union1_error != null) {
1888
+ obj_rows_item_item_union1 = obj_rows_item_item_union1_error.message;
1889
+ }
1890
+ if (obj_rows_item_item_union0 && obj_rows_item_item_union1) {
1891
+ let message = 'Object doesn\'t match union (at "' + path_rows_item_item + '")';
1892
+ message += '\n' + obj_rows_item_item_union0.split('\n').map((line) => '\t' + line).join('\n');
1893
+ message += '\n' + obj_rows_item_item_union1.split('\n').map((line) => '\t' + line).join('\n');
1894
+ return new TypeError(message);
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+ })();
1900
+ return v_error === undefined ? null : v_error;
1901
+ }
1902
+ const RepresentationType$4 = 'CsvPreviewOutputRepresentation';
1903
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
1904
+ return input;
1905
+ }
1906
+ const select$e = function CsvPreviewOutputRepresentationSelect() {
1907
+ return {
1908
+ kind: 'Fragment',
1909
+ version: VERSION$9,
1910
+ private: [],
1911
+ selections: [
1912
+ {
1913
+ name: 'headers',
1914
+ kind: 'Scalar',
1915
+ plural: true
1916
+ },
1917
+ {
1918
+ name: 'rows',
1919
+ kind: 'Scalar',
1920
+ plural: true,
1921
+ required: false
1922
+ }
1923
+ ]
1924
+ };
1925
+ };
1926
+ function equals$9(existing, incoming) {
1927
+ const existing_headers = existing.headers;
1928
+ const incoming_headers = incoming.headers;
1929
+ const equals_headers_items = equalsArray(existing_headers, incoming_headers, (existing_headers_item, incoming_headers_item) => {
1930
+ if (!(existing_headers_item === incoming_headers_item)) {
1931
+ return false;
1932
+ }
1933
+ });
1934
+ if (equals_headers_items === false) {
1935
+ return false;
1936
+ }
1937
+ const existing_rows = existing.rows;
1938
+ const incoming_rows = incoming.rows;
1939
+ // if at least one of these optionals is defined
1940
+ if (existing_rows !== undefined || incoming_rows !== undefined) {
1941
+ // if one of these is not defined we know the other is defined and therefore
1942
+ // not equal
1943
+ if (existing_rows === undefined || incoming_rows === undefined) {
1944
+ return false;
1945
+ }
1946
+ const equals_rows_items = equalsArray(existing_rows, incoming_rows, (existing_rows_item, incoming_rows_item) => {
1947
+ const equals_rows_items_items = equalsArray(existing_rows_item, incoming_rows_item, (existing_rows_item_item, incoming_rows_item_item) => {
1948
+ if (!(existing_rows_item_item === incoming_rows_item_item)) {
1949
+ return false;
1950
+ }
1951
+ });
1952
+ if (equals_rows_items_items === false) {
1953
+ return false;
1954
+ }
1955
+ });
1956
+ if (equals_rows_items === false) {
1957
+ return false;
1958
+ }
1959
+ }
1960
+ return true;
1961
+ }
1962
+ const ingest$4 = function CsvPreviewOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1963
+ if (process.env.NODE_ENV !== 'production') {
1964
+ const validateError = validate$a(input);
1965
+ if (validateError !== null) {
1966
+ throw validateError;
1967
+ }
1968
+ }
1969
+ const key = path.fullPath;
1970
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
1971
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "fileBased-dataimport", VERSION$9, RepresentationType$4, equals$9);
1972
+ return createLink(key);
1973
+ };
1974
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
1975
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1976
+ const rootKey = fullPathFactory();
1977
+ rootKeySet.set(rootKey, {
1978
+ namespace: keyPrefix,
1979
+ representationName: RepresentationType$4,
1980
+ mergeable: false
1981
+ });
1982
+ }
1983
+
1984
+ function select$d(luvio, params) {
1985
+ return select$e();
1986
+ }
1987
+ function keyBuilder$9(luvio, params) {
1988
+ return keyPrefix + '::CsvPreviewOutputRepresentation:(' + 'delimiter:' + params.queryParams.delimiter + ',' + 'endOfLine:' + params.queryParams.endOfLine + ',' + 'numberOfRows:' + params.queryParams.numberOfRows + ',' + 'fileBasedImportId:' + params.urlParams.fileBasedImportId + ')';
1989
+ }
1990
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1991
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
1992
+ }
1993
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1994
+ const { body } = response;
1995
+ const key = keyBuilder$9(luvio, resourceParams);
1996
+ luvio.storeIngest(key, ingest$4, body);
1997
+ const snapshot = luvio.storeLookup({
1998
+ recordId: key,
1999
+ node: select$d(),
2000
+ variables: {},
2001
+ }, snapshotRefresh);
2002
+ if (process.env.NODE_ENV !== 'production') {
2003
+ if (snapshot.state !== 'Fulfilled') {
2004
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2005
+ }
2006
+ }
2007
+ deepFreeze(snapshot.data);
2008
+ return snapshot;
2009
+ }
2010
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
2011
+ const key = keyBuilder$9(luvio, params);
2012
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2013
+ luvio.storeIngestError(key, errorSnapshot);
2014
+ return errorSnapshot;
2015
+ }
2016
+ function createResourceRequest$4(config) {
2017
+ const headers = {};
2018
+ return {
2019
+ baseUri: '/services/data/v66.0',
2020
+ basePath: '/connect/industries/fileBasedDataImports/' + config.urlParams.fileBasedImportId + '/preview',
2021
+ method: 'get',
2022
+ body: null,
2023
+ urlParams: config.urlParams,
2024
+ queryParams: config.queryParams,
2025
+ headers,
2026
+ priority: 'normal',
2027
+ };
2028
+ }
2029
+
2030
+ const adapterName$4 = 'getCsvPreviewData';
2031
+ const getCsvPreviewData_ConfigPropertyMetadata = [
2032
+ generateParamConfigMetadata('fileBasedImportId', true, 0 /* UrlParameter */, 0 /* String */),
2033
+ generateParamConfigMetadata('delimiter', false, 1 /* QueryParameter */, 0 /* String */),
2034
+ generateParamConfigMetadata('endOfLine', false, 1 /* QueryParameter */, 0 /* String */),
2035
+ generateParamConfigMetadata('numberOfRows', false, 1 /* QueryParameter */, 3 /* Integer */),
2036
+ ];
2037
+ const getCsvPreviewData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getCsvPreviewData_ConfigPropertyMetadata);
2038
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$c(getCsvPreviewData_ConfigPropertyMetadata);
2039
+ function keyBuilder$8(luvio, config) {
2040
+ const resourceParams = createResourceParams$4(config);
2041
+ return keyBuilder$9(luvio, resourceParams);
2042
+ }
2043
+ function typeCheckConfig$4(untrustedConfig) {
2044
+ const config = {};
2045
+ typeCheckConfig$c(untrustedConfig, config, getCsvPreviewData_ConfigPropertyMetadata);
2046
+ return config;
2047
+ }
2048
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
2049
+ if (!untrustedIsObject(untrustedConfig)) {
2050
+ return null;
2051
+ }
2052
+ if (process.env.NODE_ENV !== 'production') {
2053
+ validateConfig(untrustedConfig, configPropertyNames);
2054
+ }
2055
+ const config = typeCheckConfig$4(untrustedConfig);
2056
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2057
+ return null;
2058
+ }
2059
+ return config;
2060
+ }
2061
+ function adapterFragment$4(luvio, config) {
2062
+ createResourceParams$4(config);
2063
+ return select$d();
2064
+ }
2065
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
2066
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
2067
+ config,
2068
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2069
+ });
2070
+ return luvio.storeBroadcast().then(() => snapshot);
2071
+ }
2072
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
2073
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
2074
+ config,
2075
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2076
+ });
2077
+ return luvio.storeBroadcast().then(() => snapshot);
2078
+ }
2079
+ function buildNetworkSnapshot$4(luvio, config, options) {
2080
+ const resourceParams = createResourceParams$4(config);
2081
+ const request = createResourceRequest$4(resourceParams);
2082
+ return luvio.dispatchResourceRequest(request, options)
2083
+ .then((response) => {
2084
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
2085
+ const cache = new StoreKeyMap();
2086
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
2087
+ return cache;
2088
+ });
2089
+ }, (response) => {
2090
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
2091
+ });
2092
+ }
2093
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
2094
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
2095
+ }
2096
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
2097
+ const { luvio, config } = context;
2098
+ const selector = {
2099
+ recordId: keyBuilder$8(luvio, config),
2100
+ node: adapterFragment$4(luvio, config),
2101
+ variables: {},
2102
+ };
2103
+ const cacheSnapshot = storeLookup(selector, {
2104
+ config,
2105
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2106
+ });
2107
+ return cacheSnapshot;
2108
+ }
2109
+ const getCsvPreviewDataAdapterFactory = (luvio) => function fileBasedDataimport__getCsvPreviewData(untrustedConfig, requestContext) {
2110
+ const config = validateAdapterConfig$4(untrustedConfig, getCsvPreviewData_ConfigPropertyNames);
2111
+ // Invalid or incomplete config
2112
+ if (config === null) {
2113
+ return null;
2114
+ }
2115
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2116
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
2117
+ };
2118
+
2119
+ const VERSION$8 = "4ec3aa5aac6556898543c214a1630f30";
2120
+ function validate$9(obj, path = 'DPEDefinitionRepresentation') {
2121
+ const v_error = (() => {
2122
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2123
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2124
+ }
2125
+ const obj_id = obj.id;
2126
+ const path_id = path + '.id';
2127
+ if (typeof obj_id !== 'string') {
2128
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2129
+ }
2130
+ const obj_name = obj.name;
2131
+ const path_name = path + '.name';
2132
+ if (typeof obj_name !== 'string') {
2133
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2134
+ }
2135
+ const obj_type = obj.type;
2136
+ const path_type = path + '.type';
2137
+ if (typeof obj_type !== 'string') {
2138
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2139
+ }
2140
+ })();
2141
+ return v_error === undefined ? null : v_error;
2142
+ }
2143
+ const select$c = function DPEDefinitionRepresentationSelect() {
2144
+ return {
2145
+ kind: 'Fragment',
2146
+ version: VERSION$8,
2147
+ private: [],
2148
+ selections: [
2149
+ {
2150
+ name: 'id',
2151
+ kind: 'Scalar'
2152
+ },
2153
+ {
2154
+ name: 'name',
2155
+ kind: 'Scalar'
2156
+ },
2157
+ {
2158
+ name: 'type',
2159
+ kind: 'Scalar'
2160
+ }
2161
+ ]
2162
+ };
2163
+ };
2164
+ function equals$8(existing, incoming) {
2165
+ const existing_id = existing.id;
2166
+ const incoming_id = incoming.id;
2167
+ if (!(existing_id === incoming_id)) {
2168
+ return false;
2169
+ }
2170
+ const existing_name = existing.name;
2171
+ const incoming_name = incoming.name;
2172
+ if (!(existing_name === incoming_name)) {
2173
+ return false;
2174
+ }
2175
+ const existing_type = existing.type;
2176
+ const incoming_type = incoming.type;
2177
+ if (!(existing_type === incoming_type)) {
2178
+ return false;
2179
+ }
2180
+ return true;
2181
+ }
2182
+
2183
+ const VERSION$7 = "11962640986f27c1e05a2a2c80f391fb";
2184
+ function validate$8(obj, path = 'DPEDefinitionOutputRepresentation') {
2185
+ const v_error = (() => {
2186
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2187
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2188
+ }
2189
+ const obj_dpeDefinitions = obj.dpeDefinitions;
2190
+ const path_dpeDefinitions = path + '.dpeDefinitions';
2191
+ if (!ArrayIsArray(obj_dpeDefinitions)) {
2192
+ return new TypeError('Expected "array" but received "' + typeof obj_dpeDefinitions + '" (at "' + path_dpeDefinitions + '")');
2193
+ }
2194
+ for (let i = 0; i < obj_dpeDefinitions.length; i++) {
2195
+ const obj_dpeDefinitions_item = obj_dpeDefinitions[i];
2196
+ const path_dpeDefinitions_item = path_dpeDefinitions + '[' + i + ']';
2197
+ const referencepath_dpeDefinitions_itemValidationError = validate$9(obj_dpeDefinitions_item, path_dpeDefinitions_item);
2198
+ if (referencepath_dpeDefinitions_itemValidationError !== null) {
2199
+ let message = 'Object doesn\'t match DPEDefinitionRepresentation (at "' + path_dpeDefinitions_item + '")\n';
2200
+ message += referencepath_dpeDefinitions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2201
+ return new TypeError(message);
2202
+ }
2203
+ }
2204
+ })();
2205
+ return v_error === undefined ? null : v_error;
2206
+ }
2207
+ const RepresentationType$3 = 'DPEDefinitionOutputRepresentation';
2208
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2209
+ return input;
2210
+ }
2211
+ const select$b = function DPEDefinitionOutputRepresentationSelect() {
2212
+ const { selections: DPEDefinitionRepresentation__selections, opaque: DPEDefinitionRepresentation__opaque, } = select$c();
2213
+ return {
2214
+ kind: 'Fragment',
2215
+ version: VERSION$7,
2216
+ private: [],
2217
+ selections: [
2218
+ {
2219
+ name: 'dpeDefinitions',
2220
+ kind: 'Object',
2221
+ plural: true,
2222
+ selections: DPEDefinitionRepresentation__selections
2223
+ }
2224
+ ]
2225
+ };
2226
+ };
2227
+ function equals$7(existing, incoming) {
2228
+ const existing_dpeDefinitions = existing.dpeDefinitions;
2229
+ const incoming_dpeDefinitions = incoming.dpeDefinitions;
2230
+ const equals_dpeDefinitions_items = equalsArray(existing_dpeDefinitions, incoming_dpeDefinitions, (existing_dpeDefinitions_item, incoming_dpeDefinitions_item) => {
2231
+ if (!(equals$8(existing_dpeDefinitions_item, incoming_dpeDefinitions_item))) {
2232
+ return false;
2233
+ }
2234
+ });
2235
+ if (equals_dpeDefinitions_items === false) {
2236
+ return false;
2237
+ }
2238
+ return true;
2239
+ }
2240
+ const ingest$3 = function DPEDefinitionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2241
+ if (process.env.NODE_ENV !== 'production') {
2242
+ const validateError = validate$8(input);
2243
+ if (validateError !== null) {
2244
+ throw validateError;
2245
+ }
2246
+ }
2247
+ const key = path.fullPath;
2248
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
2249
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "fileBased-dataimport", VERSION$7, RepresentationType$3, equals$7);
2250
+ return createLink(key);
2251
+ };
2252
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
2253
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2254
+ const rootKey = fullPathFactory();
2255
+ rootKeySet.set(rootKey, {
2256
+ namespace: keyPrefix,
2257
+ representationName: RepresentationType$3,
2258
+ mergeable: false
2259
+ });
2260
+ }
2261
+
2262
+ function select$a(luvio, params) {
2263
+ return select$b();
2264
+ }
2265
+ function keyBuilder$7(luvio, params) {
2266
+ return keyPrefix + '::DPEDefinitionOutputRepresentation:(' + ')';
2267
+ }
2268
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2269
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$7());
2270
+ }
2271
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
2272
+ const { body } = response;
2273
+ const key = keyBuilder$7();
2274
+ luvio.storeIngest(key, ingest$3, body);
2275
+ const snapshot = luvio.storeLookup({
2276
+ recordId: key,
2277
+ node: select$a(),
2278
+ variables: {},
2279
+ }, snapshotRefresh);
2280
+ if (process.env.NODE_ENV !== 'production') {
2281
+ if (snapshot.state !== 'Fulfilled') {
2282
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2283
+ }
2284
+ }
2285
+ deepFreeze(snapshot.data);
2286
+ return snapshot;
2287
+ }
2288
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2289
+ const key = keyBuilder$7();
2290
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2291
+ luvio.storeIngestError(key, errorSnapshot);
2292
+ return errorSnapshot;
2293
+ }
2294
+ function createResourceRequest$3(config) {
2295
+ const headers = {};
2296
+ return {
2297
+ baseUri: '/services/data/v66.0',
2298
+ basePath: '/connect/industries/fileBasedDataImports/dpeDefinitions',
2299
+ method: 'get',
2300
+ body: null,
2301
+ urlParams: {},
2302
+ queryParams: {},
2303
+ headers,
2304
+ priority: 'normal',
2305
+ };
2306
+ }
2307
+
2308
+ const adapterName$3 = 'getDPEDefinitions';
2309
+ const getDPEDefinitions_ConfigPropertyMetadata = [];
2310
+ const getDPEDefinitions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getDPEDefinitions_ConfigPropertyMetadata);
2311
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$c(getDPEDefinitions_ConfigPropertyMetadata);
2312
+ function keyBuilder$6(luvio, config) {
2313
+ createResourceParams$3(config);
2314
+ return keyBuilder$7();
2315
+ }
2316
+ function typeCheckConfig$3(untrustedConfig) {
2317
+ const config = {};
2318
+ return config;
2319
+ }
2320
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2321
+ if (!untrustedIsObject(untrustedConfig)) {
2322
+ return null;
2323
+ }
2324
+ if (process.env.NODE_ENV !== 'production') {
2325
+ validateConfig(untrustedConfig, configPropertyNames);
2326
+ }
2327
+ const config = typeCheckConfig$3();
2328
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2329
+ return null;
2330
+ }
2331
+ return config;
2332
+ }
2333
+ function adapterFragment$3(luvio, config) {
2334
+ createResourceParams$3(config);
2335
+ return select$a();
2336
+ }
2337
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2338
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
2339
+ config,
2340
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2341
+ });
2342
+ return luvio.storeBroadcast().then(() => snapshot);
2343
+ }
2344
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2345
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
2346
+ config,
2347
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2348
+ });
2349
+ return luvio.storeBroadcast().then(() => snapshot);
2350
+ }
2351
+ function buildNetworkSnapshot$3(luvio, config, options) {
2352
+ const resourceParams = createResourceParams$3(config);
2353
+ const request = createResourceRequest$3();
2354
+ return luvio.dispatchResourceRequest(request, options)
2355
+ .then((response) => {
2356
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
2357
+ const cache = new StoreKeyMap();
2358
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
2359
+ return cache;
2360
+ });
2361
+ }, (response) => {
2362
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
2363
+ });
2364
+ }
2365
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2366
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
2367
+ }
2368
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2369
+ const { luvio, config } = context;
2370
+ const selector = {
2371
+ recordId: keyBuilder$6(luvio, config),
2372
+ node: adapterFragment$3(luvio, config),
2373
+ variables: {},
2374
+ };
2375
+ const cacheSnapshot = storeLookup(selector, {
2376
+ config,
2377
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2378
+ });
2379
+ return cacheSnapshot;
2380
+ }
2381
+ const getDPEDefinitionsAdapterFactory = (luvio) => function fileBasedDataimport__getDPEDefinitions(untrustedConfig, requestContext) {
2382
+ const config = validateAdapterConfig$3(untrustedConfig, getDPEDefinitions_ConfigPropertyNames);
2383
+ // Invalid or incomplete config
2384
+ if (config === null) {
2385
+ return null;
2386
+ }
2387
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2388
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2389
+ };
2390
+
2391
+ function validate$7(obj, path = 'ObjectInfoDirectoryEntryRepresentation') {
2392
+ const v_error = (() => {
2393
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2394
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2395
+ }
2396
+ const obj_apiName = obj.apiName;
2397
+ const path_apiName = path + '.apiName';
2398
+ if (typeof obj_apiName !== 'string') {
2399
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
2400
+ }
2401
+ const obj_keyPrefix = obj.keyPrefix;
2402
+ const path_keyPrefix = path + '.keyPrefix';
2403
+ let obj_keyPrefix_union0 = null;
2404
+ const obj_keyPrefix_union0_error = (() => {
2405
+ if (typeof obj_keyPrefix !== 'string') {
2406
+ return new TypeError('Expected "string" but received "' + typeof obj_keyPrefix + '" (at "' + path_keyPrefix + '")');
2407
+ }
2408
+ })();
2409
+ if (obj_keyPrefix_union0_error != null) {
2410
+ obj_keyPrefix_union0 = obj_keyPrefix_union0_error.message;
2411
+ }
2412
+ let obj_keyPrefix_union1 = null;
2413
+ const obj_keyPrefix_union1_error = (() => {
2414
+ if (obj_keyPrefix !== null) {
2415
+ return new TypeError('Expected "null" but received "' + typeof obj_keyPrefix + '" (at "' + path_keyPrefix + '")');
2416
+ }
2417
+ })();
2418
+ if (obj_keyPrefix_union1_error != null) {
2419
+ obj_keyPrefix_union1 = obj_keyPrefix_union1_error.message;
2420
+ }
2421
+ if (obj_keyPrefix_union0 && obj_keyPrefix_union1) {
2422
+ let message = 'Object doesn\'t match union (at "' + path_keyPrefix + '")';
2423
+ message += '\n' + obj_keyPrefix_union0.split('\n').map((line) => '\t' + line).join('\n');
2424
+ message += '\n' + obj_keyPrefix_union1.split('\n').map((line) => '\t' + line).join('\n');
2425
+ return new TypeError(message);
2426
+ }
2427
+ const obj_label = obj.label;
2428
+ const path_label = path + '.label';
2429
+ if (typeof obj_label !== 'string') {
2430
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2431
+ }
2432
+ const obj_labelPlural = obj.labelPlural;
2433
+ const path_labelPlural = path + '.labelPlural';
2434
+ if (typeof obj_labelPlural !== 'string') {
2435
+ return new TypeError('Expected "string" but received "' + typeof obj_labelPlural + '" (at "' + path_labelPlural + '")');
2436
+ }
2437
+ const obj_nameFields = obj.nameFields;
2438
+ const path_nameFields = path + '.nameFields';
2439
+ if (!ArrayIsArray(obj_nameFields)) {
2440
+ return new TypeError('Expected "array" but received "' + typeof obj_nameFields + '" (at "' + path_nameFields + '")');
2441
+ }
2442
+ for (let i = 0; i < obj_nameFields.length; i++) {
2443
+ const obj_nameFields_item = obj_nameFields[i];
2444
+ const path_nameFields_item = path_nameFields + '[' + i + ']';
2445
+ if (typeof obj_nameFields_item !== 'string') {
2446
+ return new TypeError('Expected "string" but received "' + typeof obj_nameFields_item + '" (at "' + path_nameFields_item + '")');
2447
+ }
2448
+ }
2449
+ const obj_objectInfoUrl = obj.objectInfoUrl;
2450
+ const path_objectInfoUrl = path + '.objectInfoUrl';
2451
+ if (typeof obj_objectInfoUrl !== 'string') {
2452
+ return new TypeError('Expected "string" but received "' + typeof obj_objectInfoUrl + '" (at "' + path_objectInfoUrl + '")');
2453
+ }
2454
+ })();
2455
+ return v_error === undefined ? null : v_error;
2456
+ }
2457
+
2458
+ const VERSION$6 = "c040e955efdc64a496f748f728dcbe5f";
2459
+ function validate$6(obj, path = 'ObjectInfoDirectoryRepresentation') {
2460
+ const v_error = (() => {
2461
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2462
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2463
+ }
2464
+ const obj_objects = obj.objects;
2465
+ const path_objects = path + '.objects';
2466
+ if (typeof obj_objects !== 'object' || ArrayIsArray(obj_objects) || obj_objects === null) {
2467
+ return new TypeError('Expected "object" but received "' + typeof obj_objects + '" (at "' + path_objects + '")');
2468
+ }
2469
+ const obj_objects_keys = ObjectKeys(obj_objects);
2470
+ for (let i = 0; i < obj_objects_keys.length; i++) {
2471
+ const key = obj_objects_keys[i];
2472
+ const obj_objects_prop = obj_objects[key];
2473
+ const path_objects_prop = path_objects + '["' + key + '"]';
2474
+ const referencepath_objects_propValidationError = validate$7(obj_objects_prop, path_objects_prop);
2475
+ if (referencepath_objects_propValidationError !== null) {
2476
+ let message = 'Object doesn\'t match ObjectInfoDirectoryEntryRepresentation (at "' + path_objects_prop + '")\n';
2477
+ message += referencepath_objects_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2478
+ return new TypeError(message);
2479
+ }
2480
+ }
2481
+ })();
2482
+ return v_error === undefined ? null : v_error;
2483
+ }
2484
+ const RepresentationType$2 = 'ObjectInfoDirectoryRepresentation';
2485
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
2486
+ return input;
2487
+ }
2488
+ const select$9 = function ObjectInfoDirectoryRepresentationSelect() {
2489
+ return {
2490
+ kind: 'Fragment',
2491
+ version: VERSION$6,
2492
+ private: [],
2493
+ opaque: true
2494
+ };
2495
+ };
2496
+ function equals$6(existing, incoming) {
2497
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2498
+ return false;
2499
+ }
2500
+ return true;
2501
+ }
2502
+ const ingest$2 = function ObjectInfoDirectoryRepresentationIngest(input, path, luvio, store, timestamp) {
2503
+ if (process.env.NODE_ENV !== 'production') {
2504
+ const validateError = validate$6(input);
2505
+ if (validateError !== null) {
2506
+ throw validateError;
2507
+ }
2508
+ }
2509
+ const key = path.fullPath;
2510
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
2511
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "fileBased-dataimport", VERSION$6, RepresentationType$2, equals$6);
2512
+ return createLink(key);
2513
+ };
2514
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2515
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2516
+ const rootKey = fullPathFactory();
2517
+ rootKeySet.set(rootKey, {
2518
+ namespace: keyPrefix,
2519
+ representationName: RepresentationType$2,
2520
+ mergeable: false
2521
+ });
2522
+ }
2523
+
2524
+ function select$8(luvio, params) {
2525
+ return select$9();
2526
+ }
2527
+ function keyBuilder$5(luvio, params) {
2528
+ return keyPrefix + '::ObjectInfoDirectoryRepresentation:(' + 'batchSize:' + params.queryParams.batchSize + ',' + 'searchText:' + params.queryParams.searchText + ',' + 'startOffset:' + params.queryParams.startOffset + ')';
2529
+ }
2530
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2531
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
2532
+ }
2533
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
2534
+ const { body } = response;
2535
+ const key = keyBuilder$5(luvio, resourceParams);
2536
+ luvio.storeIngest(key, ingest$2, body);
2537
+ const snapshot = luvio.storeLookup({
2538
+ recordId: key,
2539
+ node: select$8(),
2540
+ variables: {},
2541
+ }, snapshotRefresh);
2542
+ if (process.env.NODE_ENV !== 'production') {
2543
+ if (snapshot.state !== 'Fulfilled') {
2544
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2545
+ }
2546
+ }
2547
+ deepFreeze(snapshot.data);
2548
+ return snapshot;
2549
+ }
2550
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
2551
+ const key = keyBuilder$5(luvio, params);
2552
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2553
+ luvio.storeIngestError(key, errorSnapshot);
2554
+ return errorSnapshot;
2555
+ }
2556
+ function createResourceRequest$2(config) {
2557
+ const headers = {};
2558
+ return {
2559
+ baseUri: '/services/data/v66.0',
2560
+ basePath: '/connect/industries/fileBasedDataImports/entities',
2561
+ method: 'get',
2562
+ body: null,
2563
+ urlParams: {},
2564
+ queryParams: config.queryParams,
2565
+ headers,
2566
+ priority: 'normal',
2567
+ };
2568
+ }
2569
+
2570
+ const adapterName$2 = 'getAllSobjects';
2571
+ const getAllSobjects_ConfigPropertyMetadata = [
2572
+ generateParamConfigMetadata('batchSize', false, 1 /* QueryParameter */, 3 /* Integer */),
2573
+ generateParamConfigMetadata('searchText', false, 1 /* QueryParameter */, 0 /* String */),
2574
+ generateParamConfigMetadata('startOffset', false, 1 /* QueryParameter */, 3 /* Integer */),
2575
+ ];
2576
+ const getAllSobjects_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getAllSobjects_ConfigPropertyMetadata);
2577
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$c(getAllSobjects_ConfigPropertyMetadata);
2578
+ function keyBuilder$4(luvio, config) {
2579
+ const resourceParams = createResourceParams$2(config);
2580
+ return keyBuilder$5(luvio, resourceParams);
2581
+ }
2582
+ function typeCheckConfig$2(untrustedConfig) {
2583
+ const config = {};
2584
+ typeCheckConfig$c(untrustedConfig, config, getAllSobjects_ConfigPropertyMetadata);
2585
+ return config;
2586
+ }
2587
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2588
+ if (!untrustedIsObject(untrustedConfig)) {
2589
+ return null;
2590
+ }
2591
+ if (process.env.NODE_ENV !== 'production') {
2592
+ validateConfig(untrustedConfig, configPropertyNames);
2593
+ }
2594
+ const config = typeCheckConfig$2(untrustedConfig);
2595
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2596
+ return null;
2597
+ }
2598
+ return config;
2599
+ }
2600
+ function adapterFragment$2(luvio, config) {
2601
+ createResourceParams$2(config);
2602
+ return select$8();
2603
+ }
2604
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
2605
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
2606
+ config,
2607
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2608
+ });
2609
+ return luvio.storeBroadcast().then(() => snapshot);
2610
+ }
2611
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
2612
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
2613
+ config,
2614
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2615
+ });
2616
+ return luvio.storeBroadcast().then(() => snapshot);
2617
+ }
2618
+ function buildNetworkSnapshot$2(luvio, config, options) {
2619
+ const resourceParams = createResourceParams$2(config);
2620
+ const request = createResourceRequest$2(resourceParams);
2621
+ return luvio.dispatchResourceRequest(request, options)
2622
+ .then((response) => {
2623
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
2624
+ const cache = new StoreKeyMap();
2625
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2626
+ return cache;
2627
+ });
2628
+ }, (response) => {
2629
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
2630
+ });
2631
+ }
2632
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
2633
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
2634
+ }
2635
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
2636
+ const { luvio, config } = context;
2637
+ const selector = {
2638
+ recordId: keyBuilder$4(luvio, config),
2639
+ node: adapterFragment$2(luvio, config),
2640
+ variables: {},
2641
+ };
2642
+ const cacheSnapshot = storeLookup(selector, {
2643
+ config,
2644
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2645
+ });
2646
+ return cacheSnapshot;
2647
+ }
2648
+ const getAllSobjectsAdapterFactory = (luvio) => function fileBasedDataimport__getAllSobjects(untrustedConfig, requestContext) {
2649
+ const config = validateAdapterConfig$2(untrustedConfig, getAllSobjects_ConfigPropertyNames);
2650
+ // Invalid or incomplete config
2651
+ if (config === null) {
2652
+ return null;
2653
+ }
2654
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2655
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
2656
+ };
2657
+
2658
+ const VERSION$5 = "79cbc962b5b6429d024e384c92f23cda";
2659
+ function validate$5(obj, path = 'ReferenceFieldInfo') {
2660
+ const v_error = (() => {
2661
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2662
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2663
+ }
2664
+ const obj_fieldLabel = obj.fieldLabel;
2665
+ const path_fieldLabel = path + '.fieldLabel';
2666
+ if (typeof obj_fieldLabel !== 'string') {
2667
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldLabel + '" (at "' + path_fieldLabel + '")');
2668
+ }
2669
+ const obj_fieldName = obj.fieldName;
2670
+ const path_fieldName = path + '.fieldName';
2671
+ if (typeof obj_fieldName !== 'string') {
2672
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
2673
+ }
2674
+ })();
2675
+ return v_error === undefined ? null : v_error;
2676
+ }
2677
+ const select$7 = function ReferenceFieldInfoSelect() {
2678
+ return {
2679
+ kind: 'Fragment',
2680
+ version: VERSION$5,
2681
+ private: [],
2682
+ selections: [
2683
+ {
2684
+ name: 'fieldLabel',
2685
+ kind: 'Scalar'
2686
+ },
2687
+ {
2688
+ name: 'fieldName',
2689
+ kind: 'Scalar'
2690
+ }
2691
+ ]
2692
+ };
2693
+ };
2694
+ function equals$5(existing, incoming) {
2695
+ const existing_fieldLabel = existing.fieldLabel;
2696
+ const incoming_fieldLabel = incoming.fieldLabel;
2697
+ if (!(existing_fieldLabel === incoming_fieldLabel)) {
2698
+ return false;
2699
+ }
2700
+ const existing_fieldName = existing.fieldName;
2701
+ const incoming_fieldName = incoming.fieldName;
2702
+ if (!(existing_fieldName === incoming_fieldName)) {
2703
+ return false;
2704
+ }
2705
+ return true;
2706
+ }
2707
+
2708
+ const VERSION$4 = "b3d49ed32b6dfdd7e4f99ef7e3629860";
2709
+ function validate$4(obj, path = 'ReferenceEntityInfo') {
2710
+ const v_error = (() => {
2711
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2712
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2713
+ }
2714
+ const obj_entityLabel = obj.entityLabel;
2715
+ const path_entityLabel = path + '.entityLabel';
2716
+ if (typeof obj_entityLabel !== 'string') {
2717
+ return new TypeError('Expected "string" but received "' + typeof obj_entityLabel + '" (at "' + path_entityLabel + '")');
2718
+ }
2719
+ const obj_entityName = obj.entityName;
2720
+ const path_entityName = path + '.entityName';
2721
+ if (typeof obj_entityName !== 'string') {
2722
+ return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
2723
+ }
2724
+ const obj_fields = obj.fields;
2725
+ const path_fields = path + '.fields';
2726
+ if (!ArrayIsArray(obj_fields)) {
2727
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
2728
+ }
2729
+ for (let i = 0; i < obj_fields.length; i++) {
2730
+ const obj_fields_item = obj_fields[i];
2731
+ const path_fields_item = path_fields + '[' + i + ']';
2732
+ const referencepath_fields_itemValidationError = validate$5(obj_fields_item, path_fields_item);
2733
+ if (referencepath_fields_itemValidationError !== null) {
2734
+ let message = 'Object doesn\'t match ReferenceFieldInfo (at "' + path_fields_item + '")\n';
2735
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2736
+ return new TypeError(message);
2737
+ }
2738
+ }
2739
+ })();
2740
+ return v_error === undefined ? null : v_error;
2741
+ }
2742
+ const select$6 = function ReferenceEntityInfoSelect() {
2743
+ const { selections: ReferenceFieldInfo__selections, opaque: ReferenceFieldInfo__opaque, } = select$7();
2744
+ return {
2745
+ kind: 'Fragment',
2746
+ version: VERSION$4,
2747
+ private: [],
2748
+ selections: [
2749
+ {
2750
+ name: 'entityLabel',
2751
+ kind: 'Scalar'
2752
+ },
2753
+ {
2754
+ name: 'entityName',
2755
+ kind: 'Scalar'
2756
+ },
2757
+ {
2758
+ name: 'fields',
2759
+ kind: 'Object',
2760
+ plural: true,
2761
+ selections: ReferenceFieldInfo__selections
2762
+ }
2763
+ ]
2764
+ };
2765
+ };
2766
+ function equals$4(existing, incoming) {
2767
+ const existing_entityLabel = existing.entityLabel;
2768
+ const incoming_entityLabel = incoming.entityLabel;
2769
+ if (!(existing_entityLabel === incoming_entityLabel)) {
2770
+ return false;
2771
+ }
2772
+ const existing_entityName = existing.entityName;
2773
+ const incoming_entityName = incoming.entityName;
2774
+ if (!(existing_entityName === incoming_entityName)) {
2775
+ return false;
2776
+ }
2777
+ const existing_fields = existing.fields;
2778
+ const incoming_fields = incoming.fields;
2779
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
2780
+ if (!(equals$5(existing_fields_item, incoming_fields_item))) {
2781
+ return false;
2782
+ }
2783
+ });
2784
+ if (equals_fields_items === false) {
2785
+ return false;
2786
+ }
2787
+ return true;
2788
+ }
2789
+
2790
+ const VERSION$3 = "d025efb11c01b8dbb85eeae1ab377c2a";
2791
+ function validate$3(obj, path = 'FieldInfoRepresentation') {
2792
+ const v_error = (() => {
2793
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2794
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2795
+ }
2796
+ if (obj.createable !== undefined) {
2797
+ const obj_createable = obj.createable;
2798
+ const path_createable = path + '.createable';
2799
+ if (typeof obj_createable !== 'boolean') {
2800
+ return new TypeError('Expected "boolean" but received "' + typeof obj_createable + '" (at "' + path_createable + '")');
2801
+ }
2802
+ }
2803
+ if (obj.custom !== undefined) {
2804
+ const obj_custom = obj.custom;
2805
+ const path_custom = path + '.custom';
2806
+ if (typeof obj_custom !== 'boolean') {
2807
+ return new TypeError('Expected "boolean" but received "' + typeof obj_custom + '" (at "' + path_custom + '")');
2808
+ }
2809
+ }
2810
+ if (obj.dataType !== undefined) {
2811
+ const obj_dataType = obj.dataType;
2812
+ const path_dataType = path + '.dataType';
2813
+ if (typeof obj_dataType !== 'string') {
2814
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
2815
+ }
2816
+ }
2817
+ if (obj.externalId !== undefined) {
2818
+ const obj_externalId = obj.externalId;
2819
+ const path_externalId = path + '.externalId';
2820
+ if (typeof obj_externalId !== 'boolean') {
2821
+ return new TypeError('Expected "boolean" but received "' + typeof obj_externalId + '" (at "' + path_externalId + '")');
2822
+ }
2823
+ }
2824
+ if (obj.filterable !== undefined) {
2825
+ const obj_filterable = obj.filterable;
2826
+ const path_filterable = path + '.filterable';
2827
+ if (typeof obj_filterable !== 'boolean') {
2828
+ return new TypeError('Expected "boolean" but received "' + typeof obj_filterable + '" (at "' + path_filterable + '")');
2829
+ }
2830
+ }
2831
+ if (obj.idLookup !== undefined) {
2832
+ const obj_idLookup = obj.idLookup;
2833
+ const path_idLookup = path + '.idLookup';
2834
+ if (typeof obj_idLookup !== 'boolean') {
2835
+ return new TypeError('Expected "boolean" but received "' + typeof obj_idLookup + '" (at "' + path_idLookup + '")');
2836
+ }
2837
+ }
2838
+ if (obj.label !== undefined) {
2839
+ const obj_label = obj.label;
2840
+ const path_label = path + '.label';
2841
+ if (typeof obj_label !== 'string') {
2842
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2843
+ }
2844
+ }
2845
+ if (obj.mandatory !== undefined) {
2846
+ const obj_mandatory = obj.mandatory;
2847
+ const path_mandatory = path + '.mandatory';
2848
+ if (typeof obj_mandatory !== 'boolean') {
2849
+ return new TypeError('Expected "boolean" but received "' + typeof obj_mandatory + '" (at "' + path_mandatory + '")');
2850
+ }
2851
+ }
2852
+ if (obj.name !== undefined) {
2853
+ const obj_name = obj.name;
2854
+ const path_name = path + '.name';
2855
+ if (typeof obj_name !== 'string') {
2856
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2857
+ }
2858
+ }
2859
+ if (obj.referenceTo !== undefined) {
2860
+ const obj_referenceTo = obj.referenceTo;
2861
+ const path_referenceTo = path + '.referenceTo';
2862
+ if (!ArrayIsArray(obj_referenceTo)) {
2863
+ return new TypeError('Expected "array" but received "' + typeof obj_referenceTo + '" (at "' + path_referenceTo + '")');
2864
+ }
2865
+ for (let i = 0; i < obj_referenceTo.length; i++) {
2866
+ const obj_referenceTo_item = obj_referenceTo[i];
2867
+ const path_referenceTo_item = path_referenceTo + '[' + i + ']';
2868
+ const referencepath_referenceTo_itemValidationError = validate$4(obj_referenceTo_item, path_referenceTo_item);
2869
+ if (referencepath_referenceTo_itemValidationError !== null) {
2870
+ let message = 'Object doesn\'t match ReferenceEntityInfo (at "' + path_referenceTo_item + '")\n';
2871
+ message += referencepath_referenceTo_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2872
+ return new TypeError(message);
2873
+ }
2874
+ }
2875
+ }
2876
+ if (obj.relationshipName !== undefined) {
2877
+ const obj_relationshipName = obj.relationshipName;
2878
+ const path_relationshipName = path + '.relationshipName';
2879
+ if (typeof obj_relationshipName !== 'string') {
2880
+ return new TypeError('Expected "string" but received "' + typeof obj_relationshipName + '" (at "' + path_relationshipName + '")');
2881
+ }
2882
+ }
2883
+ if (obj.required !== undefined) {
2884
+ const obj_required = obj.required;
2885
+ const path_required = path + '.required';
2886
+ if (typeof obj_required !== 'boolean') {
2887
+ return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
2888
+ }
2889
+ }
2890
+ if (obj.sortable !== undefined) {
2891
+ const obj_sortable = obj.sortable;
2892
+ const path_sortable = path + '.sortable';
2893
+ if (typeof obj_sortable !== 'boolean') {
2894
+ return new TypeError('Expected "boolean" but received "' + typeof obj_sortable + '" (at "' + path_sortable + '")');
2895
+ }
2896
+ }
2897
+ if (obj.unique !== undefined) {
2898
+ const obj_unique = obj.unique;
2899
+ const path_unique = path + '.unique';
2900
+ if (typeof obj_unique !== 'boolean') {
2901
+ return new TypeError('Expected "boolean" but received "' + typeof obj_unique + '" (at "' + path_unique + '")');
2902
+ }
2903
+ }
2904
+ if (obj.updateable !== undefined) {
2905
+ const obj_updateable = obj.updateable;
2906
+ const path_updateable = path + '.updateable';
2907
+ if (typeof obj_updateable !== 'boolean') {
2908
+ return new TypeError('Expected "boolean" but received "' + typeof obj_updateable + '" (at "' + path_updateable + '")');
2909
+ }
2910
+ }
2911
+ })();
2912
+ return v_error === undefined ? null : v_error;
2913
+ }
2914
+ const select$5 = function FieldInfoRepresentationSelect() {
2915
+ const { selections: ReferenceEntityInfo__selections, opaque: ReferenceEntityInfo__opaque, } = select$6();
2916
+ return {
2917
+ kind: 'Fragment',
2918
+ version: VERSION$3,
2919
+ private: [],
2920
+ selections: [
2921
+ {
2922
+ name: 'createable',
2923
+ kind: 'Scalar',
2924
+ required: false
2925
+ },
2926
+ {
2927
+ name: 'custom',
2928
+ kind: 'Scalar',
2929
+ required: false
2930
+ },
2931
+ {
2932
+ name: 'dataType',
2933
+ kind: 'Scalar',
2934
+ required: false
2935
+ },
2936
+ {
2937
+ name: 'externalId',
2938
+ kind: 'Scalar',
2939
+ required: false
2940
+ },
2941
+ {
2942
+ name: 'filterable',
2943
+ kind: 'Scalar',
2944
+ required: false
2945
+ },
2946
+ {
2947
+ name: 'idLookup',
2948
+ kind: 'Scalar',
2949
+ required: false
2950
+ },
2951
+ {
2952
+ name: 'label',
2953
+ kind: 'Scalar',
2954
+ required: false
2955
+ },
2956
+ {
2957
+ name: 'mandatory',
2958
+ kind: 'Scalar',
2959
+ required: false
2960
+ },
2961
+ {
2962
+ name: 'name',
2963
+ kind: 'Scalar',
2964
+ required: false
2965
+ },
2966
+ {
2967
+ name: 'referenceTo',
2968
+ kind: 'Object',
2969
+ plural: true,
2970
+ selections: ReferenceEntityInfo__selections,
2971
+ required: false
2972
+ },
2973
+ {
2974
+ name: 'relationshipName',
2975
+ kind: 'Scalar',
2976
+ required: false
2977
+ },
2978
+ {
2979
+ name: 'required',
2980
+ kind: 'Scalar',
2981
+ required: false
2982
+ },
2983
+ {
2984
+ name: 'sortable',
2985
+ kind: 'Scalar',
2986
+ required: false
2987
+ },
2988
+ {
2989
+ name: 'unique',
2990
+ kind: 'Scalar',
2991
+ required: false
2992
+ },
2993
+ {
2994
+ name: 'updateable',
2995
+ kind: 'Scalar',
2996
+ required: false
2997
+ }
2998
+ ]
2999
+ };
3000
+ };
3001
+ function equals$3(existing, incoming) {
3002
+ const existing_createable = existing.createable;
3003
+ const incoming_createable = incoming.createable;
3004
+ // if at least one of these optionals is defined
3005
+ if (existing_createable !== undefined || incoming_createable !== undefined) {
3006
+ // if one of these is not defined we know the other is defined and therefore
3007
+ // not equal
3008
+ if (existing_createable === undefined || incoming_createable === undefined) {
3009
+ return false;
3010
+ }
3011
+ if (!(existing_createable === incoming_createable)) {
3012
+ return false;
3013
+ }
3014
+ }
3015
+ const existing_custom = existing.custom;
3016
+ const incoming_custom = incoming.custom;
3017
+ // if at least one of these optionals is defined
3018
+ if (existing_custom !== undefined || incoming_custom !== undefined) {
3019
+ // if one of these is not defined we know the other is defined and therefore
3020
+ // not equal
3021
+ if (existing_custom === undefined || incoming_custom === undefined) {
3022
+ return false;
3023
+ }
3024
+ if (!(existing_custom === incoming_custom)) {
3025
+ return false;
3026
+ }
3027
+ }
3028
+ const existing_externalId = existing.externalId;
3029
+ const incoming_externalId = incoming.externalId;
3030
+ // if at least one of these optionals is defined
3031
+ if (existing_externalId !== undefined || incoming_externalId !== undefined) {
3032
+ // if one of these is not defined we know the other is defined and therefore
3033
+ // not equal
3034
+ if (existing_externalId === undefined || incoming_externalId === undefined) {
3035
+ return false;
3036
+ }
3037
+ if (!(existing_externalId === incoming_externalId)) {
3038
+ return false;
3039
+ }
3040
+ }
3041
+ const existing_filterable = existing.filterable;
3042
+ const incoming_filterable = incoming.filterable;
3043
+ // if at least one of these optionals is defined
3044
+ if (existing_filterable !== undefined || incoming_filterable !== undefined) {
3045
+ // if one of these is not defined we know the other is defined and therefore
3046
+ // not equal
3047
+ if (existing_filterable === undefined || incoming_filterable === undefined) {
3048
+ return false;
3049
+ }
3050
+ if (!(existing_filterable === incoming_filterable)) {
3051
+ return false;
3052
+ }
3053
+ }
3054
+ const existing_idLookup = existing.idLookup;
3055
+ const incoming_idLookup = incoming.idLookup;
3056
+ // if at least one of these optionals is defined
3057
+ if (existing_idLookup !== undefined || incoming_idLookup !== undefined) {
3058
+ // if one of these is not defined we know the other is defined and therefore
3059
+ // not equal
3060
+ if (existing_idLookup === undefined || incoming_idLookup === undefined) {
3061
+ return false;
3062
+ }
3063
+ if (!(existing_idLookup === incoming_idLookup)) {
3064
+ return false;
3065
+ }
3066
+ }
3067
+ const existing_mandatory = existing.mandatory;
3068
+ const incoming_mandatory = incoming.mandatory;
3069
+ // if at least one of these optionals is defined
3070
+ if (existing_mandatory !== undefined || incoming_mandatory !== undefined) {
3071
+ // if one of these is not defined we know the other is defined and therefore
3072
+ // not equal
3073
+ if (existing_mandatory === undefined || incoming_mandatory === undefined) {
3074
+ return false;
3075
+ }
3076
+ if (!(existing_mandatory === incoming_mandatory)) {
3077
+ return false;
3078
+ }
3079
+ }
3080
+ const existing_required = existing.required;
3081
+ const incoming_required = incoming.required;
3082
+ // if at least one of these optionals is defined
3083
+ if (existing_required !== undefined || incoming_required !== undefined) {
3084
+ // if one of these is not defined we know the other is defined and therefore
3085
+ // not equal
3086
+ if (existing_required === undefined || incoming_required === undefined) {
3087
+ return false;
3088
+ }
3089
+ if (!(existing_required === incoming_required)) {
3090
+ return false;
3091
+ }
3092
+ }
3093
+ const existing_sortable = existing.sortable;
3094
+ const incoming_sortable = incoming.sortable;
3095
+ // if at least one of these optionals is defined
3096
+ if (existing_sortable !== undefined || incoming_sortable !== undefined) {
3097
+ // if one of these is not defined we know the other is defined and therefore
3098
+ // not equal
3099
+ if (existing_sortable === undefined || incoming_sortable === undefined) {
3100
+ return false;
3101
+ }
3102
+ if (!(existing_sortable === incoming_sortable)) {
3103
+ return false;
3104
+ }
3105
+ }
3106
+ const existing_unique = existing.unique;
3107
+ const incoming_unique = incoming.unique;
3108
+ // if at least one of these optionals is defined
3109
+ if (existing_unique !== undefined || incoming_unique !== undefined) {
3110
+ // if one of these is not defined we know the other is defined and therefore
3111
+ // not equal
3112
+ if (existing_unique === undefined || incoming_unique === undefined) {
3113
+ return false;
3114
+ }
3115
+ if (!(existing_unique === incoming_unique)) {
3116
+ return false;
3117
+ }
3118
+ }
3119
+ const existing_updateable = existing.updateable;
3120
+ const incoming_updateable = incoming.updateable;
3121
+ // if at least one of these optionals is defined
3122
+ if (existing_updateable !== undefined || incoming_updateable !== undefined) {
3123
+ // if one of these is not defined we know the other is defined and therefore
3124
+ // not equal
3125
+ if (existing_updateable === undefined || incoming_updateable === undefined) {
3126
+ return false;
3127
+ }
3128
+ if (!(existing_updateable === incoming_updateable)) {
3129
+ return false;
3130
+ }
3131
+ }
3132
+ const existing_dataType = existing.dataType;
3133
+ const incoming_dataType = incoming.dataType;
3134
+ // if at least one of these optionals is defined
3135
+ if (existing_dataType !== undefined || incoming_dataType !== undefined) {
3136
+ // if one of these is not defined we know the other is defined and therefore
3137
+ // not equal
3138
+ if (existing_dataType === undefined || incoming_dataType === undefined) {
3139
+ return false;
3140
+ }
3141
+ if (!(existing_dataType === incoming_dataType)) {
3142
+ return false;
3143
+ }
3144
+ }
3145
+ const existing_label = existing.label;
3146
+ const incoming_label = incoming.label;
3147
+ // if at least one of these optionals is defined
3148
+ if (existing_label !== undefined || incoming_label !== undefined) {
3149
+ // if one of these is not defined we know the other is defined and therefore
3150
+ // not equal
3151
+ if (existing_label === undefined || incoming_label === undefined) {
3152
+ return false;
3153
+ }
3154
+ if (!(existing_label === incoming_label)) {
3155
+ return false;
3156
+ }
3157
+ }
3158
+ const existing_name = existing.name;
3159
+ const incoming_name = incoming.name;
3160
+ // if at least one of these optionals is defined
3161
+ if (existing_name !== undefined || incoming_name !== undefined) {
3162
+ // if one of these is not defined we know the other is defined and therefore
3163
+ // not equal
3164
+ if (existing_name === undefined || incoming_name === undefined) {
3165
+ return false;
3166
+ }
3167
+ if (!(existing_name === incoming_name)) {
3168
+ return false;
3169
+ }
3170
+ }
3171
+ const existing_relationshipName = existing.relationshipName;
3172
+ const incoming_relationshipName = incoming.relationshipName;
3173
+ // if at least one of these optionals is defined
3174
+ if (existing_relationshipName !== undefined || incoming_relationshipName !== undefined) {
3175
+ // if one of these is not defined we know the other is defined and therefore
3176
+ // not equal
3177
+ if (existing_relationshipName === undefined || incoming_relationshipName === undefined) {
3178
+ return false;
3179
+ }
3180
+ if (!(existing_relationshipName === incoming_relationshipName)) {
3181
+ return false;
3182
+ }
3183
+ }
3184
+ const existing_referenceTo = existing.referenceTo;
3185
+ const incoming_referenceTo = incoming.referenceTo;
3186
+ // if at least one of these optionals is defined
3187
+ if (existing_referenceTo !== undefined || incoming_referenceTo !== undefined) {
3188
+ // if one of these is not defined we know the other is defined and therefore
3189
+ // not equal
3190
+ if (existing_referenceTo === undefined || incoming_referenceTo === undefined) {
3191
+ return false;
3192
+ }
3193
+ const equals_referenceTo_items = equalsArray(existing_referenceTo, incoming_referenceTo, (existing_referenceTo_item, incoming_referenceTo_item) => {
3194
+ if (!(equals$4(existing_referenceTo_item, incoming_referenceTo_item))) {
3195
+ return false;
3196
+ }
3197
+ });
3198
+ if (equals_referenceTo_items === false) {
3199
+ return false;
3200
+ }
3201
+ }
3202
+ return true;
3203
+ }
3204
+
3205
+ const VERSION$2 = "fb84569fbdb1214096f70e7d0a82aa88";
3206
+ function validate$2(obj, path = 'FieldInfoOutputRepresentation') {
3207
+ const v_error = (() => {
3208
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3209
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3210
+ }
3211
+ if (obj.fields !== undefined) {
3212
+ const obj_fields = obj.fields;
3213
+ const path_fields = path + '.fields';
3214
+ if (!ArrayIsArray(obj_fields)) {
3215
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
3216
+ }
3217
+ for (let i = 0; i < obj_fields.length; i++) {
3218
+ const obj_fields_item = obj_fields[i];
3219
+ const path_fields_item = path_fields + '[' + i + ']';
3220
+ const referencepath_fields_itemValidationError = validate$3(obj_fields_item, path_fields_item);
3221
+ if (referencepath_fields_itemValidationError !== null) {
3222
+ let message = 'Object doesn\'t match FieldInfoRepresentation (at "' + path_fields_item + '")\n';
3223
+ message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3224
+ return new TypeError(message);
3225
+ }
3226
+ }
3227
+ }
3228
+ })();
3229
+ return v_error === undefined ? null : v_error;
3230
+ }
3231
+ const RepresentationType$1 = 'FieldInfoOutputRepresentation';
3232
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3233
+ return input;
3234
+ }
3235
+ const select$4 = function FieldInfoOutputRepresentationSelect() {
3236
+ const { selections: FieldInfoRepresentation__selections, opaque: FieldInfoRepresentation__opaque, } = select$5();
3237
+ return {
3238
+ kind: 'Fragment',
3239
+ version: VERSION$2,
3240
+ private: [],
3241
+ selections: [
3242
+ {
3243
+ name: 'fields',
3244
+ kind: 'Object',
3245
+ plural: true,
3246
+ selections: FieldInfoRepresentation__selections,
3247
+ required: false
3248
+ }
3249
+ ]
3250
+ };
3251
+ };
3252
+ function equals$2(existing, incoming) {
3253
+ const existing_fields = existing.fields;
3254
+ const incoming_fields = incoming.fields;
3255
+ // if at least one of these optionals is defined
3256
+ if (existing_fields !== undefined || incoming_fields !== undefined) {
3257
+ // if one of these is not defined we know the other is defined and therefore
3258
+ // not equal
3259
+ if (existing_fields === undefined || incoming_fields === undefined) {
3260
+ return false;
3261
+ }
3262
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
3263
+ if (!(equals$3(existing_fields_item, incoming_fields_item))) {
3264
+ return false;
3265
+ }
3266
+ });
3267
+ if (equals_fields_items === false) {
3268
+ return false;
3269
+ }
3270
+ }
3271
+ return true;
3272
+ }
3273
+ const ingest$1 = function FieldInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3274
+ if (process.env.NODE_ENV !== 'production') {
3275
+ const validateError = validate$2(input);
3276
+ if (validateError !== null) {
3277
+ throw validateError;
3278
+ }
3279
+ }
3280
+ const key = path.fullPath;
3281
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
3282
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "fileBased-dataimport", VERSION$2, RepresentationType$1, equals$2);
3283
+ return createLink(key);
3284
+ };
3285
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
3286
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3287
+ const rootKey = fullPathFactory();
3288
+ rootKeySet.set(rootKey, {
3289
+ namespace: keyPrefix,
3290
+ representationName: RepresentationType$1,
3291
+ mergeable: false
3292
+ });
3293
+ }
3294
+
3295
+ function select$3(luvio, params) {
3296
+ return select$4();
3297
+ }
3298
+ function keyBuilder$3(luvio, params) {
3299
+ return keyPrefix + '::FieldInfoOutputRepresentation:(' + 'batchSize:' + params.queryParams.batchSize + ',' + 'fieldName:' + params.queryParams.fieldName + ',' + 'startOffset:' + params.queryParams.startOffset + ',' + 'entityApiName:' + params.urlParams.entityApiName + ')';
3300
+ }
3301
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
3302
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
3303
+ }
3304
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
3305
+ const { body } = response;
3306
+ const key = keyBuilder$3(luvio, resourceParams);
3307
+ luvio.storeIngest(key, ingest$1, body);
3308
+ const snapshot = luvio.storeLookup({
3309
+ recordId: key,
3310
+ node: select$3(),
3311
+ variables: {},
3312
+ }, snapshotRefresh);
3313
+ if (process.env.NODE_ENV !== 'production') {
3314
+ if (snapshot.state !== 'Fulfilled') {
3315
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3316
+ }
3317
+ }
3318
+ deepFreeze(snapshot.data);
3319
+ return snapshot;
3320
+ }
3321
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3322
+ const key = keyBuilder$3(luvio, params);
3323
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3324
+ luvio.storeIngestError(key, errorSnapshot);
3325
+ return errorSnapshot;
3326
+ }
3327
+ function createResourceRequest$1(config) {
3328
+ const headers = {};
3329
+ return {
3330
+ baseUri: '/services/data/v66.0',
3331
+ basePath: '/connect/industries/fileBasedDataImports/entities/' + config.urlParams.entityApiName + '/fields',
3332
+ method: 'get',
3333
+ body: null,
3334
+ urlParams: config.urlParams,
3335
+ queryParams: config.queryParams,
3336
+ headers,
3337
+ priority: 'normal',
3338
+ };
3339
+ }
3340
+
3341
+ const adapterName$1 = 'getAllFields';
3342
+ const getAllFields_ConfigPropertyMetadata = [
3343
+ generateParamConfigMetadata('entityApiName', true, 0 /* UrlParameter */, 0 /* String */),
3344
+ generateParamConfigMetadata('batchSize', false, 1 /* QueryParameter */, 3 /* Integer */),
3345
+ generateParamConfigMetadata('fieldName', false, 1 /* QueryParameter */, 0 /* String */),
3346
+ generateParamConfigMetadata('startOffset', false, 1 /* QueryParameter */, 3 /* Integer */),
3347
+ ];
3348
+ const getAllFields_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAllFields_ConfigPropertyMetadata);
3349
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$c(getAllFields_ConfigPropertyMetadata);
3350
+ function keyBuilder$2(luvio, config) {
3351
+ const resourceParams = createResourceParams$1(config);
3352
+ return keyBuilder$3(luvio, resourceParams);
3353
+ }
3354
+ function typeCheckConfig$1(untrustedConfig) {
3355
+ const config = {};
3356
+ typeCheckConfig$c(untrustedConfig, config, getAllFields_ConfigPropertyMetadata);
3357
+ return config;
3358
+ }
3359
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
3360
+ if (!untrustedIsObject(untrustedConfig)) {
3361
+ return null;
3362
+ }
3363
+ if (process.env.NODE_ENV !== 'production') {
3364
+ validateConfig(untrustedConfig, configPropertyNames);
3365
+ }
3366
+ const config = typeCheckConfig$1(untrustedConfig);
3367
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3368
+ return null;
3369
+ }
3370
+ return config;
3371
+ }
3372
+ function adapterFragment$1(luvio, config) {
3373
+ createResourceParams$1(config);
3374
+ return select$3();
3375
+ }
3376
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3377
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
3378
+ config,
3379
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
3380
+ });
3381
+ return luvio.storeBroadcast().then(() => snapshot);
3382
+ }
3383
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3384
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
3385
+ config,
3386
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
3387
+ });
3388
+ return luvio.storeBroadcast().then(() => snapshot);
3389
+ }
3390
+ function buildNetworkSnapshot$1(luvio, config, options) {
3391
+ const resourceParams = createResourceParams$1(config);
3392
+ const request = createResourceRequest$1(resourceParams);
3393
+ return luvio.dispatchResourceRequest(request, options)
3394
+ .then((response) => {
3395
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
3396
+ const cache = new StoreKeyMap();
3397
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
3398
+ return cache;
3399
+ });
3400
+ }, (response) => {
3401
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
3402
+ });
3403
+ }
3404
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3405
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
3406
+ }
3407
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3408
+ const { luvio, config } = context;
3409
+ const selector = {
3410
+ recordId: keyBuilder$2(luvio, config),
3411
+ node: adapterFragment$1(luvio, config),
3412
+ variables: {},
3413
+ };
3414
+ const cacheSnapshot = storeLookup(selector, {
3415
+ config,
3416
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
3417
+ });
3418
+ return cacheSnapshot;
3419
+ }
3420
+ const getAllFieldsAdapterFactory = (luvio) => function fileBasedDataimport__getAllFields(untrustedConfig, requestContext) {
3421
+ const config = validateAdapterConfig$1(untrustedConfig, getAllFields_ConfigPropertyNames);
3422
+ // Invalid or incomplete config
3423
+ if (config === null) {
3424
+ return null;
3425
+ }
3426
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3427
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3428
+ };
3429
+
3430
+ const VERSION$1 = "71048d5cd1af46b5223f16a75389f1b1";
3431
+ function validate$1(obj, path = 'CsvMappingRepresentation') {
3432
+ const v_error = (() => {
3433
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3434
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3435
+ }
3436
+ const obj_csvHeader = obj.csvHeader;
3437
+ const path_csvHeader = path + '.csvHeader';
3438
+ if (typeof obj_csvHeader !== 'string') {
3439
+ return new TypeError('Expected "string" but received "' + typeof obj_csvHeader + '" (at "' + path_csvHeader + '")');
3440
+ }
3441
+ if (obj.hasUserAccess !== undefined) {
3442
+ const obj_hasUserAccess = obj.hasUserAccess;
3443
+ const path_hasUserAccess = path + '.hasUserAccess';
3444
+ let obj_hasUserAccess_union0 = null;
3445
+ const obj_hasUserAccess_union0_error = (() => {
3446
+ if (typeof obj_hasUserAccess !== 'boolean') {
3447
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasUserAccess + '" (at "' + path_hasUserAccess + '")');
3448
+ }
3449
+ })();
3450
+ if (obj_hasUserAccess_union0_error != null) {
3451
+ obj_hasUserAccess_union0 = obj_hasUserAccess_union0_error.message;
3452
+ }
3453
+ let obj_hasUserAccess_union1 = null;
3454
+ const obj_hasUserAccess_union1_error = (() => {
3455
+ if (obj_hasUserAccess !== null) {
3456
+ return new TypeError('Expected "null" but received "' + typeof obj_hasUserAccess + '" (at "' + path_hasUserAccess + '")');
3457
+ }
3458
+ })();
3459
+ if (obj_hasUserAccess_union1_error != null) {
3460
+ obj_hasUserAccess_union1 = obj_hasUserAccess_union1_error.message;
3461
+ }
3462
+ if (obj_hasUserAccess_union0 && obj_hasUserAccess_union1) {
3463
+ let message = 'Object doesn\'t match union (at "' + path_hasUserAccess + '")';
3464
+ message += '\n' + obj_hasUserAccess_union0.split('\n').map((line) => '\t' + line).join('\n');
3465
+ message += '\n' + obj_hasUserAccess_union1.split('\n').map((line) => '\t' + line).join('\n');
3466
+ return new TypeError(message);
3467
+ }
3468
+ }
3469
+ if (obj.mappedEntityColumn !== undefined) {
3470
+ const obj_mappedEntityColumn = obj.mappedEntityColumn;
3471
+ const path_mappedEntityColumn = path + '.mappedEntityColumn';
3472
+ let obj_mappedEntityColumn_union0 = null;
3473
+ const obj_mappedEntityColumn_union0_error = (() => {
3474
+ const referencepath_mappedEntityColumnValidationError = validate$3(obj_mappedEntityColumn, path_mappedEntityColumn);
3475
+ if (referencepath_mappedEntityColumnValidationError !== null) {
3476
+ let message = 'Object doesn\'t match FieldInfoRepresentation (at "' + path_mappedEntityColumn + '")\n';
3477
+ message += referencepath_mappedEntityColumnValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3478
+ return new TypeError(message);
3479
+ }
3480
+ })();
3481
+ if (obj_mappedEntityColumn_union0_error != null) {
3482
+ obj_mappedEntityColumn_union0 = obj_mappedEntityColumn_union0_error.message;
3483
+ }
3484
+ let obj_mappedEntityColumn_union1 = null;
3485
+ const obj_mappedEntityColumn_union1_error = (() => {
3486
+ if (obj_mappedEntityColumn !== null) {
3487
+ return new TypeError('Expected "null" but received "' + typeof obj_mappedEntityColumn + '" (at "' + path_mappedEntityColumn + '")');
3488
+ }
3489
+ })();
3490
+ if (obj_mappedEntityColumn_union1_error != null) {
3491
+ obj_mappedEntityColumn_union1 = obj_mappedEntityColumn_union1_error.message;
3492
+ }
3493
+ if (obj_mappedEntityColumn_union0 && obj_mappedEntityColumn_union1) {
3494
+ let message = 'Object doesn\'t match union (at "' + path_mappedEntityColumn + '")';
3495
+ message += '\n' + obj_mappedEntityColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
3496
+ message += '\n' + obj_mappedEntityColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
3497
+ return new TypeError(message);
3498
+ }
3499
+ }
3500
+ if (obj.sampleValue !== undefined) {
3501
+ const obj_sampleValue = obj.sampleValue;
3502
+ const path_sampleValue = path + '.sampleValue';
3503
+ let obj_sampleValue_union0 = null;
3504
+ const obj_sampleValue_union0_error = (() => {
3505
+ if (typeof obj_sampleValue !== 'string') {
3506
+ return new TypeError('Expected "string" but received "' + typeof obj_sampleValue + '" (at "' + path_sampleValue + '")');
3507
+ }
3508
+ })();
3509
+ if (obj_sampleValue_union0_error != null) {
3510
+ obj_sampleValue_union0 = obj_sampleValue_union0_error.message;
3511
+ }
3512
+ let obj_sampleValue_union1 = null;
3513
+ const obj_sampleValue_union1_error = (() => {
3514
+ if (obj_sampleValue !== null) {
3515
+ return new TypeError('Expected "null" but received "' + typeof obj_sampleValue + '" (at "' + path_sampleValue + '")');
3516
+ }
3517
+ })();
3518
+ if (obj_sampleValue_union1_error != null) {
3519
+ obj_sampleValue_union1 = obj_sampleValue_union1_error.message;
3520
+ }
3521
+ if (obj_sampleValue_union0 && obj_sampleValue_union1) {
3522
+ let message = 'Object doesn\'t match union (at "' + path_sampleValue + '")';
3523
+ message += '\n' + obj_sampleValue_union0.split('\n').map((line) => '\t' + line).join('\n');
3524
+ message += '\n' + obj_sampleValue_union1.split('\n').map((line) => '\t' + line).join('\n');
3525
+ return new TypeError(message);
3526
+ }
3527
+ }
3528
+ })();
3529
+ return v_error === undefined ? null : v_error;
3530
+ }
3531
+ const select$2 = function CsvMappingRepresentationSelect() {
3532
+ const { selections: FieldInfoRepresentation__selections, opaque: FieldInfoRepresentation__opaque, } = select$5();
3533
+ return {
3534
+ kind: 'Fragment',
3535
+ version: VERSION$1,
3536
+ private: [],
3537
+ selections: [
3538
+ {
3539
+ name: 'csvHeader',
3540
+ kind: 'Scalar'
3541
+ },
3542
+ {
3543
+ name: 'hasUserAccess',
3544
+ kind: 'Scalar',
3545
+ required: false
3546
+ },
3547
+ {
3548
+ name: 'mappedEntityColumn',
3549
+ kind: 'Object',
3550
+ nullable: true,
3551
+ selections: FieldInfoRepresentation__selections,
3552
+ required: false
3553
+ },
3554
+ {
3555
+ name: 'sampleValue',
3556
+ kind: 'Scalar',
3557
+ required: false
3558
+ }
3559
+ ]
3560
+ };
3561
+ };
3562
+ function equals$1(existing, incoming) {
3563
+ const existing_csvHeader = existing.csvHeader;
3564
+ const incoming_csvHeader = incoming.csvHeader;
3565
+ if (!(existing_csvHeader === incoming_csvHeader)) {
3566
+ return false;
3567
+ }
3568
+ const existing_hasUserAccess = existing.hasUserAccess;
3569
+ const incoming_hasUserAccess = incoming.hasUserAccess;
3570
+ // if at least one of these optionals is defined
3571
+ if (existing_hasUserAccess !== undefined || incoming_hasUserAccess !== undefined) {
3572
+ // if one of these is not defined we know the other is defined and therefore
3573
+ // not equal
3574
+ if (existing_hasUserAccess === undefined || incoming_hasUserAccess === undefined) {
3575
+ return false;
3576
+ }
3577
+ if (!(existing_hasUserAccess === incoming_hasUserAccess)) {
3578
+ return false;
3579
+ }
3580
+ }
3581
+ const existing_mappedEntityColumn = existing.mappedEntityColumn;
3582
+ const incoming_mappedEntityColumn = incoming.mappedEntityColumn;
3583
+ // if at least one of these optionals is defined
3584
+ if (existing_mappedEntityColumn !== undefined || incoming_mappedEntityColumn !== undefined) {
3585
+ // if one of these is not defined we know the other is defined and therefore
3586
+ // not equal
3587
+ if (existing_mappedEntityColumn === undefined || incoming_mappedEntityColumn === undefined) {
3588
+ return false;
3589
+ }
3590
+ if (!(existing_mappedEntityColumn === incoming_mappedEntityColumn
3591
+ || (existing_mappedEntityColumn != null &&
3592
+ incoming_mappedEntityColumn != null &&
3593
+ equals$3(existing_mappedEntityColumn, incoming_mappedEntityColumn)))) {
3594
+ return false;
3595
+ }
3596
+ }
3597
+ const existing_sampleValue = existing.sampleValue;
3598
+ const incoming_sampleValue = incoming.sampleValue;
3599
+ // if at least one of these optionals is defined
3600
+ if (existing_sampleValue !== undefined || incoming_sampleValue !== undefined) {
3601
+ // if one of these is not defined we know the other is defined and therefore
3602
+ // not equal
3603
+ if (existing_sampleValue === undefined || incoming_sampleValue === undefined) {
3604
+ return false;
3605
+ }
3606
+ if (!(existing_sampleValue === incoming_sampleValue)) {
3607
+ return false;
3608
+ }
3609
+ }
3610
+ return true;
3611
+ }
3612
+
3613
+ const VERSION = "c72fdfb750120999744a8774e34025e1";
3614
+ function validate(obj, path = 'CSVMappingsResultRepresentation') {
3615
+ const v_error = (() => {
3616
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3617
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3618
+ }
3619
+ const obj_csvMappingRepresentations = obj.csvMappingRepresentations;
3620
+ const path_csvMappingRepresentations = path + '.csvMappingRepresentations';
3621
+ if (!ArrayIsArray(obj_csvMappingRepresentations)) {
3622
+ return new TypeError('Expected "array" but received "' + typeof obj_csvMappingRepresentations + '" (at "' + path_csvMappingRepresentations + '")');
3623
+ }
3624
+ for (let i = 0; i < obj_csvMappingRepresentations.length; i++) {
3625
+ const obj_csvMappingRepresentations_item = obj_csvMappingRepresentations[i];
3626
+ const path_csvMappingRepresentations_item = path_csvMappingRepresentations + '[' + i + ']';
3627
+ const referencepath_csvMappingRepresentations_itemValidationError = validate$1(obj_csvMappingRepresentations_item, path_csvMappingRepresentations_item);
3628
+ if (referencepath_csvMappingRepresentations_itemValidationError !== null) {
3629
+ let message = 'Object doesn\'t match CsvMappingRepresentation (at "' + path_csvMappingRepresentations_item + '")\n';
3630
+ message += referencepath_csvMappingRepresentations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3631
+ return new TypeError(message);
3632
+ }
3633
+ }
3634
+ })();
3635
+ return v_error === undefined ? null : v_error;
3636
+ }
3637
+ const RepresentationType = 'CSVMappingsResultRepresentation';
3638
+ function normalize(input, existing, path, luvio, store, timestamp) {
3639
+ return input;
3640
+ }
3641
+ const select$1 = function CSVMappingsResultRepresentationSelect() {
3642
+ const { selections: CsvMappingRepresentation__selections, opaque: CsvMappingRepresentation__opaque, } = select$2();
3643
+ return {
3644
+ kind: 'Fragment',
3645
+ version: VERSION,
3646
+ private: [],
3647
+ selections: [
3648
+ {
3649
+ name: 'csvMappingRepresentations',
3650
+ kind: 'Object',
3651
+ plural: true,
3652
+ selections: CsvMappingRepresentation__selections
3653
+ }
3654
+ ]
3655
+ };
3656
+ };
3657
+ function equals(existing, incoming) {
3658
+ const existing_csvMappingRepresentations = existing.csvMappingRepresentations;
3659
+ const incoming_csvMappingRepresentations = incoming.csvMappingRepresentations;
3660
+ const equals_csvMappingRepresentations_items = equalsArray(existing_csvMappingRepresentations, incoming_csvMappingRepresentations, (existing_csvMappingRepresentations_item, incoming_csvMappingRepresentations_item) => {
3661
+ if (!(equals$1(existing_csvMappingRepresentations_item, incoming_csvMappingRepresentations_item))) {
3662
+ return false;
3663
+ }
3664
+ });
3665
+ if (equals_csvMappingRepresentations_items === false) {
3666
+ return false;
3667
+ }
3668
+ return true;
3669
+ }
3670
+ const ingest = function CSVMappingsResultRepresentationIngest(input, path, luvio, store, timestamp) {
3671
+ if (process.env.NODE_ENV !== 'production') {
3672
+ const validateError = validate(input);
3673
+ if (validateError !== null) {
3674
+ throw validateError;
3675
+ }
3676
+ }
3677
+ const key = path.fullPath;
3678
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300;
3679
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "fileBased-dataimport", VERSION, RepresentationType, equals);
3680
+ return createLink(key);
3681
+ };
3682
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
3683
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3684
+ const rootKey = fullPathFactory();
3685
+ rootKeySet.set(rootKey, {
3686
+ namespace: keyPrefix,
3687
+ representationName: RepresentationType,
3688
+ mergeable: false
3689
+ });
3690
+ }
3691
+
3692
+ function select(luvio, params) {
3693
+ return select$1();
3694
+ }
3695
+ function keyBuilder$1(luvio, params) {
3696
+ return keyPrefix + '::CSVMappingsResultRepresentation:(' + 'contentDocumentId:' + params.queryParams.contentDocumentId + ',' + 'delimiter:' + params.queryParams.delimiter + ',' + 'endOfLine:' + params.queryParams.endOfLine + ',' + 'entityApiName:' + params.queryParams.entityApiName + ')';
3697
+ }
3698
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
3699
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
3700
+ }
3701
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
3702
+ const { body } = response;
3703
+ const key = keyBuilder$1(luvio, resourceParams);
3704
+ luvio.storeIngest(key, ingest, body);
3705
+ const snapshot = luvio.storeLookup({
3706
+ recordId: key,
3707
+ node: select(),
3708
+ variables: {},
3709
+ }, snapshotRefresh);
3710
+ if (process.env.NODE_ENV !== 'production') {
3711
+ if (snapshot.state !== 'Fulfilled') {
3712
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3713
+ }
3714
+ }
3715
+ deepFreeze(snapshot.data);
3716
+ return snapshot;
3717
+ }
3718
+ function ingestError(luvio, params, error, snapshotRefresh) {
3719
+ const key = keyBuilder$1(luvio, params);
3720
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3721
+ luvio.storeIngestError(key, errorSnapshot);
3722
+ return errorSnapshot;
3723
+ }
3724
+ function createResourceRequest(config) {
3725
+ const headers = {};
3726
+ return {
3727
+ baseUri: '/services/data/v66.0',
3728
+ basePath: '/connect/industries/fileBasedDataImports/automap',
3729
+ method: 'get',
3730
+ body: null,
3731
+ urlParams: {},
3732
+ queryParams: config.queryParams,
3733
+ headers,
3734
+ priority: 'normal',
3735
+ };
3736
+ }
3737
+
3738
+ const adapterName = 'getCsvAutoMap';
3739
+ const getCsvAutoMap_ConfigPropertyMetadata = [
3740
+ generateParamConfigMetadata('contentDocumentId', true, 1 /* QueryParameter */, 0 /* String */),
3741
+ generateParamConfigMetadata('delimiter', false, 1 /* QueryParameter */, 0 /* String */),
3742
+ generateParamConfigMetadata('endOfLine', false, 1 /* QueryParameter */, 0 /* String */),
3743
+ generateParamConfigMetadata('entityApiName', true, 1 /* QueryParameter */, 0 /* String */),
3744
+ ];
3745
+ const getCsvAutoMap_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getCsvAutoMap_ConfigPropertyMetadata);
3746
+ const createResourceParams = /*#__PURE__*/ createResourceParams$c(getCsvAutoMap_ConfigPropertyMetadata);
3747
+ function keyBuilder(luvio, config) {
3748
+ const resourceParams = createResourceParams(config);
3749
+ return keyBuilder$1(luvio, resourceParams);
3750
+ }
3751
+ function typeCheckConfig(untrustedConfig) {
3752
+ const config = {};
3753
+ typeCheckConfig$c(untrustedConfig, config, getCsvAutoMap_ConfigPropertyMetadata);
3754
+ return config;
3755
+ }
3756
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
3757
+ if (!untrustedIsObject(untrustedConfig)) {
3758
+ return null;
3759
+ }
3760
+ if (process.env.NODE_ENV !== 'production') {
3761
+ validateConfig(untrustedConfig, configPropertyNames);
3762
+ }
3763
+ const config = typeCheckConfig(untrustedConfig);
3764
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3765
+ return null;
3766
+ }
3767
+ return config;
3768
+ }
3769
+ function adapterFragment(luvio, config) {
3770
+ createResourceParams(config);
3771
+ return select();
3772
+ }
3773
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
3774
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
3775
+ config,
3776
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3777
+ });
3778
+ return luvio.storeBroadcast().then(() => snapshot);
3779
+ }
3780
+ function onFetchResponseError(luvio, config, resourceParams, response) {
3781
+ const snapshot = ingestError(luvio, resourceParams, response, {
3782
+ config,
3783
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3784
+ });
3785
+ return luvio.storeBroadcast().then(() => snapshot);
3786
+ }
3787
+ function buildNetworkSnapshot(luvio, config, options) {
3788
+ const resourceParams = createResourceParams(config);
3789
+ const request = createResourceRequest(resourceParams);
3790
+ return luvio.dispatchResourceRequest(request, options)
3791
+ .then((response) => {
3792
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
3793
+ const cache = new StoreKeyMap();
3794
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
3795
+ return cache;
3796
+ });
3797
+ }, (response) => {
3798
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
3799
+ });
3800
+ }
3801
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
3802
+ return buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
3803
+ }
3804
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
3805
+ const { luvio, config } = context;
3806
+ const selector = {
3807
+ recordId: keyBuilder(luvio, config),
3808
+ node: adapterFragment(luvio, config),
3809
+ variables: {},
3810
+ };
3811
+ const cacheSnapshot = storeLookup(selector, {
3812
+ config,
3813
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3814
+ });
3815
+ return cacheSnapshot;
3816
+ }
3817
+ const getCsvAutoMapAdapterFactory = (luvio) => function fileBasedDataimport__getCsvAutoMap(untrustedConfig, requestContext) {
3818
+ const config = validateAdapterConfig(untrustedConfig, getCsvAutoMap_ConfigPropertyNames);
3819
+ // Invalid or incomplete config
3820
+ if (config === null) {
3821
+ return null;
3822
+ }
3823
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3824
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
3825
+ };
3826
+
3827
+ export { createFileBasedDataImportAdapterFactory, deleteFileBasedDataImportAdapterFactory, getAllFieldsAdapterFactory, getAllSobjectsAdapterFactory, getCsvAutoMapAdapterFactory, getCsvPreviewDataAdapterFactory, getDPEDefinitionsAdapterFactory, getFileBasedDataImportByIdAdapterFactory, getFileBasedDataImportsAdapterFactory, startAdvanceImportAdapterFactory, startSimpleImportAdapterFactory, updateFileBasedDataImportAdapterFactory };