@salesforce/lds-adapters-industries-filebased-dataimport 1.250.1 → 1.252.0

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