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