@salesforce/lds-worker-api 1.433.0 → 1.434.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/sfdc/es/ldsWorkerApi.js +5 -3
- package/dist/sfdc/es/types/customLuvioAdapter.d.ts +2 -1
- package/dist/sfdc/es/types/standalone-stubs/unwrap.d.ts +5 -5
- package/dist/standalone/es/lds-worker-api.js +727 -784
- package/dist/standalone/es/types/customLuvioAdapter.d.ts +2 -1
- package/dist/standalone/es/types/standalone-stubs/unwrap.d.ts +5 -5
- package/dist/standalone/umd/lds-worker-api.js +727 -784
- package/dist/standalone/umd/types/customLuvioAdapter.d.ts +2 -1
- package/dist/standalone/umd/types/standalone-stubs/unwrap.d.ts +5 -5
- package/package.json +9 -9
|
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
callbacks.push(callback);
|
|
4276
4276
|
}
|
|
4277
|
-
// version: 1.
|
|
4277
|
+
// version: 1.434.0-d8deb0d4ea
|
|
4278
4278
|
|
|
4279
4279
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4280
4280
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5318,7 +5318,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5318
5318
|
const { apiFamily, name } = metadata;
|
|
5319
5319
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5320
5320
|
}
|
|
5321
|
-
// version: 1.
|
|
5321
|
+
// version: 1.434.0-d8deb0d4ea
|
|
5322
5322
|
|
|
5323
5323
|
function isSupportedEntity(_objectApiName) {
|
|
5324
5324
|
return true;
|
|
@@ -5455,28 +5455,23 @@ let configurableCreateContentVersion$3 = new Configurable$3();
|
|
|
5455
5455
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
5456
5456
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5457
5457
|
* be reached by following 1 relationship from the root record, etc.
|
|
5458
|
-
* @defaultValue '
|
|
5458
|
+
* @defaultValue '1'
|
|
5459
5459
|
*/
|
|
5460
|
-
let trackedFieldDepthOnCacheMiss$3 =
|
|
5460
|
+
let trackedFieldDepthOnCacheMiss$3 = 1;
|
|
5461
5461
|
/**
|
|
5462
5462
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
5463
5463
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5464
5464
|
* be reached by following 1 relationship from the root record, etc.
|
|
5465
|
-
* @defaultValue '
|
|
5465
|
+
* @defaultValue '1'
|
|
5466
5466
|
*/
|
|
5467
|
-
let trackedFieldDepthOnCacheMergeConflict$3 =
|
|
5467
|
+
let trackedFieldDepthOnCacheMergeConflict$3 = 1;
|
|
5468
5468
|
/**
|
|
5469
5469
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
5470
5470
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5471
5471
|
* be reached by following 1 relationship from the root record, etc.
|
|
5472
|
-
* @defaultValue '
|
|
5472
|
+
* @defaultValue '1'
|
|
5473
5473
|
*/
|
|
5474
|
-
let trackedFieldDepthOnNotifyChange$3 =
|
|
5475
|
-
/**
|
|
5476
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
5477
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
5478
|
-
*/
|
|
5479
|
-
let trackedFieldLeafNodeIdAndNameOnly$3 = false;
|
|
5474
|
+
let trackedFieldDepthOnNotifyChange$3 = 1;
|
|
5480
5475
|
/**
|
|
5481
5476
|
* One store enabled Get Object Info adapter
|
|
5482
5477
|
*/
|
|
@@ -5573,12 +5568,6 @@ const configurationForEnvironmentFactoryOverrides$3 = {
|
|
|
5573
5568
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
5574
5569
|
return trackedFieldDepthOnNotifyChange$3;
|
|
5575
5570
|
},
|
|
5576
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
5577
|
-
trackedFieldLeafNodeIdAndNameOnly$3 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
5578
|
-
},
|
|
5579
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
5580
|
-
return trackedFieldLeafNodeIdAndNameOnly$3;
|
|
5581
|
-
},
|
|
5582
5571
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
5583
5572
|
recordRepresentationIngestionOverride$3 = ingest;
|
|
5584
5573
|
},
|
|
@@ -5700,28 +5689,23 @@ let configurableCreateContentVersion$2 = new Configurable$2();
|
|
|
5700
5689
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
5701
5690
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5702
5691
|
* be reached by following 1 relationship from the root record, etc.
|
|
5703
|
-
* @defaultValue '
|
|
5692
|
+
* @defaultValue '1'
|
|
5704
5693
|
*/
|
|
5705
|
-
let trackedFieldDepthOnCacheMiss$2 =
|
|
5694
|
+
let trackedFieldDepthOnCacheMiss$2 = 1;
|
|
5706
5695
|
/**
|
|
5707
5696
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
5708
5697
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5709
5698
|
* be reached by following 1 relationship from the root record, etc.
|
|
5710
|
-
* @defaultValue '
|
|
5699
|
+
* @defaultValue '1'
|
|
5711
5700
|
*/
|
|
5712
|
-
let trackedFieldDepthOnCacheMergeConflict$2 =
|
|
5701
|
+
let trackedFieldDepthOnCacheMergeConflict$2 = 1;
|
|
5713
5702
|
/**
|
|
5714
5703
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
5715
5704
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5716
5705
|
* be reached by following 1 relationship from the root record, etc.
|
|
5717
|
-
* @defaultValue '
|
|
5706
|
+
* @defaultValue '1'
|
|
5718
5707
|
*/
|
|
5719
|
-
let trackedFieldDepthOnNotifyChange$2 =
|
|
5720
|
-
/**
|
|
5721
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
5722
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
5723
|
-
*/
|
|
5724
|
-
let trackedFieldLeafNodeIdAndNameOnly$2 = false;
|
|
5708
|
+
let trackedFieldDepthOnNotifyChange$2 = 1;
|
|
5725
5709
|
/**
|
|
5726
5710
|
* One store enabled Get Object Info adapter
|
|
5727
5711
|
*/
|
|
@@ -5827,12 +5811,6 @@ const configurationForRestAdapters$2 = {
|
|
|
5827
5811
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
5828
5812
|
return trackedFieldDepthOnNotifyChange$2;
|
|
5829
5813
|
},
|
|
5830
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
5831
|
-
trackedFieldLeafNodeIdAndNameOnly$2 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
5832
|
-
},
|
|
5833
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
5834
|
-
return trackedFieldLeafNodeIdAndNameOnly$2;
|
|
5835
|
-
},
|
|
5836
5814
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
5837
5815
|
recordRepresentationIngestionOverride$2 = ingest;
|
|
5838
5816
|
},
|
|
@@ -7673,6 +7651,9 @@ function buildSelectionFromRecord$1(record) {
|
|
|
7673
7651
|
return [...sel.selections, DRAFTS_SELECTION$1];
|
|
7674
7652
|
}
|
|
7675
7653
|
|
|
7654
|
+
// Unused suffixes, but leaving in as comments to avoid eslint errors
|
|
7655
|
+
// const CUSTOM_API_NAME_SUFFIX = '__c';
|
|
7656
|
+
// const DMO_API_NAME_SUFFIX = '__dlm';
|
|
7676
7657
|
const CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX$1 = '__x';
|
|
7677
7658
|
const RECORD_REPRESENTATION_ERROR_VERSION$1 = 'RECORD_REPRESENTATION_ERROR_VERSION_1';
|
|
7678
7659
|
const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS$1 = {
|
|
@@ -7736,13 +7717,11 @@ function extractTrackedFieldsToTrie$1(recordId, node, root, config, visitedRecor
|
|
|
7736
7717
|
if (!isGraphNode$1(field)) {
|
|
7737
7718
|
continue;
|
|
7738
7719
|
}
|
|
7739
|
-
const { maxDepth
|
|
7720
|
+
const { maxDepth } = config;
|
|
7740
7721
|
if (field.isScalar('value') === false && !Array.isArray(field.data?.value)) {
|
|
7741
7722
|
if (depth + 1 > maxDepth) {
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
addScalarFieldName$1(current);
|
|
7745
|
-
}
|
|
7723
|
+
addScalarFieldId$1(current);
|
|
7724
|
+
addScalarFieldName$1(current);
|
|
7746
7725
|
continue;
|
|
7747
7726
|
}
|
|
7748
7727
|
const spanningLink = field.link('value');
|
|
@@ -7764,19 +7743,10 @@ function extractTrackedFieldsToTrie$1(recordId, node, root, config, visitedRecor
|
|
|
7764
7743
|
current.children[key] = next;
|
|
7765
7744
|
}
|
|
7766
7745
|
else {
|
|
7767
|
-
// Skip the field, if its value is null at the max level depth.
|
|
7768
|
-
// Ideally, it should only skip relationship field. However,
|
|
7769
|
-
// on the client, there is not a reliable way to determine the
|
|
7770
|
-
// the field type.
|
|
7771
7746
|
if (depth === maxDepth) {
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
continue;
|
|
7776
|
-
}
|
|
7777
|
-
if (field.scalar('value') === null && !Array.isArray(field.data?.value)) {
|
|
7778
|
-
continue;
|
|
7779
|
-
}
|
|
7747
|
+
addScalarFieldId$1(current);
|
|
7748
|
+
addScalarFieldName$1(current);
|
|
7749
|
+
continue;
|
|
7780
7750
|
}
|
|
7781
7751
|
const state = fieldValueRep.linkData();
|
|
7782
7752
|
if (state !== undefined) {
|
|
@@ -8162,7 +8132,6 @@ function mergeRecordConflict$1(luvio, incoming, existing, recordConflictMap) {
|
|
|
8162
8132
|
};
|
|
8163
8133
|
const trackedFieldsConfig = {
|
|
8164
8134
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMergeConflict(),
|
|
8165
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8166
8135
|
};
|
|
8167
8136
|
extractTrackedFieldsToTrie$1(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
8168
8137
|
extractTrackedFieldsToTrie$1(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
@@ -8606,7 +8575,6 @@ function prepareRequest$7(luvio, config) {
|
|
|
8606
8575
|
const key = keyBuilder$28(luvio, createResourceParams$12(config));
|
|
8607
8576
|
const allTrackedFields = getTrackedFields$1(key, luvio.getNode(key), {
|
|
8608
8577
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
8609
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8610
8578
|
}, config.optionalFields);
|
|
8611
8579
|
const optionalFields = fields === undefined ? allTrackedFields : difference$1(allTrackedFields, fields);
|
|
8612
8580
|
const resourceParams = createResourceParams$12({
|
|
@@ -8733,7 +8701,6 @@ function ingestSuccessChildResourceParams$8(luvio, childResourceParamsArray, chi
|
|
|
8733
8701
|
};
|
|
8734
8702
|
const childTrackedFields = getTrackedFields$1(childKey, luvio.getNode(childKey), {
|
|
8735
8703
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
8736
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8737
8704
|
}, childResourceParams.queryParams.optionalFields);
|
|
8738
8705
|
const childSnapshot = ingestSuccess$S(luvio, {
|
|
8739
8706
|
recordId: childResourceParams.urlParams.recordId,
|
|
@@ -13906,7 +13873,6 @@ const notifyChangeFactory = (luvio) => {
|
|
|
13906
13873
|
const node = luvio.wrapNormalizedGraphNode(record, key);
|
|
13907
13874
|
const optionalFields = getTrackedFields$1(key, node, {
|
|
13908
13875
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnNotifyChange(),
|
|
13909
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
13910
13876
|
});
|
|
13911
13877
|
const refreshRequest = createResourceRequestFromRepresentation(record, optionalFields);
|
|
13912
13878
|
const existingWeakEtag = record.weakEtag;
|
|
@@ -16495,7 +16461,6 @@ function buildNetworkSnapshot$V(luvio, config, options) {
|
|
|
16495
16461
|
const key = keyBuilder$1w$2(luvio, config);
|
|
16496
16462
|
const trackedFieldsConfig = {
|
|
16497
16463
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
16498
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly()
|
|
16499
16464
|
};
|
|
16500
16465
|
const optionalFieldsTrie = convertFieldsToTrie$1(getTrackedFields$1(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
|
|
16501
16466
|
const fieldsTrie = BLANK_RECORD_FIELDS_TRIE$1;
|
|
@@ -30539,7 +30504,6 @@ const buildNetworkSnapshot$6$1 = (luvio, context, config, options) => {
|
|
|
30539
30504
|
...resourceRequest.queryParams,
|
|
30540
30505
|
optionalFields: getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
30541
30506
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
30542
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
30543
30507
|
}, config.optionalFields),
|
|
30544
30508
|
},
|
|
30545
30509
|
});
|
|
@@ -31074,7 +31038,6 @@ function prepareRequest$8(luvio, context, config) {
|
|
|
31074
31038
|
...resourceRequest.queryParams,
|
|
31075
31039
|
optionalFields: getTrackedFields$1(recordTemplateKey, luvio.getNode(recordTemplateKey), {
|
|
31076
31040
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
31077
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
31078
31041
|
}, config.optionalFields),
|
|
31079
31042
|
},
|
|
31080
31043
|
});
|
|
@@ -31094,7 +31057,6 @@ function onFetchResponseSuccess$O(luvio, context, config, request, response, res
|
|
|
31094
31057
|
});
|
|
31095
31058
|
const allTrackedFields = getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
31096
31059
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
31097
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
31098
31060
|
}, optionalFields);
|
|
31099
31061
|
const allTrackedFieldsTrie = convertFieldsToTrie$1(allTrackedFields, true);
|
|
31100
31062
|
const ingest = createFieldsIngestSuccess$4({
|
|
@@ -32550,7 +32512,7 @@ withDefaultLuvio((luvio) => {
|
|
|
32550
32512
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
32551
32513
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
32552
32514
|
});
|
|
32553
|
-
// version: 1.
|
|
32515
|
+
// version: 1.434.0-6aa2dd15e3
|
|
32554
32516
|
|
|
32555
32517
|
var allowUpdatesForNonCachedRecords = {
|
|
32556
32518
|
isOpen: function (e) {
|
|
@@ -44200,7 +44162,7 @@ const { create: create$7, freeze: freeze$4, keys: keys$8, entries: entries$5 } =
|
|
|
44200
44162
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
44201
44163
|
const { isArray: isArray$7 } = Array;
|
|
44202
44164
|
const { stringify: stringify$9, parse: parse$9 } = JSON;
|
|
44203
|
-
let Ok$
|
|
44165
|
+
let Ok$3 = class Ok {
|
|
44204
44166
|
constructor(value) {
|
|
44205
44167
|
this.value = value;
|
|
44206
44168
|
}
|
|
@@ -44211,7 +44173,7 @@ let Ok$4 = class Ok {
|
|
|
44211
44173
|
return !this.isOk();
|
|
44212
44174
|
}
|
|
44213
44175
|
};
|
|
44214
|
-
let Err$
|
|
44176
|
+
let Err$3 = class Err {
|
|
44215
44177
|
constructor(error) {
|
|
44216
44178
|
this.error = error;
|
|
44217
44179
|
}
|
|
@@ -44222,8 +44184,8 @@ let Err$4 = class Err {
|
|
|
44222
44184
|
return !this.isOk();
|
|
44223
44185
|
}
|
|
44224
44186
|
};
|
|
44225
|
-
const ok$
|
|
44226
|
-
const err$
|
|
44187
|
+
const ok$3 = (value) => new Ok$3(value);
|
|
44188
|
+
const err$3 = (err2) => new Err$3(err2);
|
|
44227
44189
|
function resolvedPromiseLike$4(result) {
|
|
44228
44190
|
if (isPromiseLike$4(result)) {
|
|
44229
44191
|
return result.then((nextResult) => nextResult);
|
|
@@ -44366,6 +44328,15 @@ function satisfies(provided, requested) {
|
|
|
44366
44328
|
const requestedN = requested.split(".").map((s) => parseInt(s));
|
|
44367
44329
|
return providedN[0] === requestedN[0] && providedN[1] >= requestedN[1];
|
|
44368
44330
|
}
|
|
44331
|
+
function isUserVisibleError$3(error) {
|
|
44332
|
+
return error instanceof Error && "type" in error && error.type === "user-visible";
|
|
44333
|
+
}
|
|
44334
|
+
function logError$2(error) {
|
|
44335
|
+
if (isUserVisibleError$3(error)) {
|
|
44336
|
+
return;
|
|
44337
|
+
}
|
|
44338
|
+
console.error("OneStore Command threw an error that we did not expect", error);
|
|
44339
|
+
}
|
|
44369
44340
|
|
|
44370
44341
|
/*!
|
|
44371
44342
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -44465,20 +44436,20 @@ class IdentifiableTypeRepository {
|
|
|
44465
44436
|
const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
|
|
44466
44437
|
const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
|
|
44467
44438
|
if (normalized.isErr()) {
|
|
44468
|
-
return err$
|
|
44439
|
+
return err$3(normalized.error);
|
|
44469
44440
|
}
|
|
44470
44441
|
cache.set(key, {
|
|
44471
44442
|
value: normalized.value,
|
|
44472
44443
|
metadata: this.cacheMetadata
|
|
44473
44444
|
});
|
|
44474
|
-
return ok$
|
|
44445
|
+
return ok$3({
|
|
44475
44446
|
type: "link",
|
|
44476
44447
|
linkedKey: key
|
|
44477
44448
|
});
|
|
44478
44449
|
}
|
|
44479
44450
|
validateEntry(entry) {
|
|
44480
44451
|
if (!isCacheEntryForType(entry, this)) {
|
|
44481
|
-
return err$
|
|
44452
|
+
return err$3([
|
|
44482
44453
|
{
|
|
44483
44454
|
type: "incorrectType",
|
|
44484
44455
|
expectedType: this.typeName,
|
|
@@ -44486,7 +44457,7 @@ class IdentifiableTypeRepository {
|
|
|
44486
44457
|
}
|
|
44487
44458
|
]);
|
|
44488
44459
|
}
|
|
44489
|
-
return ok$
|
|
44460
|
+
return ok$3(void 0);
|
|
44490
44461
|
}
|
|
44491
44462
|
query(cache, query) {
|
|
44492
44463
|
return this.read(cache, {
|
|
@@ -44504,12 +44475,12 @@ class IdentifiableTypeRepository {
|
|
|
44504
44475
|
if (cacheEntry) {
|
|
44505
44476
|
const validationResult = this.validateEntry(cacheEntry);
|
|
44506
44477
|
if (validationResult.isErr()) {
|
|
44507
|
-
return err$
|
|
44478
|
+
return err$3([...validationResult.error]);
|
|
44508
44479
|
}
|
|
44509
44480
|
const normalizedData = cacheEntry.value;
|
|
44510
44481
|
return this.denormalizeData(cache, { ...input, normalizedData });
|
|
44511
44482
|
}
|
|
44512
|
-
return err$
|
|
44483
|
+
return err$3([this.buildMissingDataError()]);
|
|
44513
44484
|
}
|
|
44514
44485
|
equals(x, y) {
|
|
44515
44486
|
return deepEquals$2(x, y);
|
|
@@ -44532,9 +44503,375 @@ function extractReadWriteData(result, errorCollector) {
|
|
|
44532
44503
|
}
|
|
44533
44504
|
function buildReadWriteResult(data, errors) {
|
|
44534
44505
|
if (errors.length > 0) {
|
|
44535
|
-
return err$
|
|
44506
|
+
return err$3(errors);
|
|
44536
44507
|
}
|
|
44537
|
-
return ok$
|
|
44508
|
+
return ok$3(data);
|
|
44509
|
+
}
|
|
44510
|
+
|
|
44511
|
+
/*!
|
|
44512
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
44513
|
+
* All rights reserved.
|
|
44514
|
+
* For full license text, see the LICENSE.txt file
|
|
44515
|
+
*/
|
|
44516
|
+
let JsonSchemaViolationError$1 = class JsonSchemaViolationError extends Error {
|
|
44517
|
+
constructor(message, validationErrors) {
|
|
44518
|
+
super(message);
|
|
44519
|
+
this.validationErrors = [];
|
|
44520
|
+
this.validationErrors = validationErrors || [];
|
|
44521
|
+
}
|
|
44522
|
+
};
|
|
44523
|
+
let MinItemsViolationError$1 = class MinItemsViolationError extends JsonSchemaViolationError$1 {
|
|
44524
|
+
};
|
|
44525
|
+
let MaxItemsViolationError$1 = class MaxItemsViolationError extends JsonSchemaViolationError$1 {
|
|
44526
|
+
};
|
|
44527
|
+
let IncorrectTypeError$1 = class IncorrectTypeError extends JsonSchemaViolationError$1 {
|
|
44528
|
+
};
|
|
44529
|
+
let AdditionalPropertiesError$1 = class AdditionalPropertiesError extends JsonSchemaViolationError$1 {
|
|
44530
|
+
};
|
|
44531
|
+
let MissingRequiredPropertyError$1 = class MissingRequiredPropertyError extends JsonSchemaViolationError$1 {
|
|
44532
|
+
};
|
|
44533
|
+
let InvalidRefError$1 = class InvalidRefError extends JsonSchemaViolationError$1 {
|
|
44534
|
+
};
|
|
44535
|
+
let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
|
|
44536
|
+
constructor() {
|
|
44537
|
+
this.errors = [];
|
|
44538
|
+
}
|
|
44539
|
+
add(error) {
|
|
44540
|
+
this.errors.push(error);
|
|
44541
|
+
}
|
|
44542
|
+
append(response) {
|
|
44543
|
+
if (response.isErr()) {
|
|
44544
|
+
this.errors.push(...response.error);
|
|
44545
|
+
}
|
|
44546
|
+
}
|
|
44547
|
+
hasErrors() {
|
|
44548
|
+
return this.errors.length > 0;
|
|
44549
|
+
}
|
|
44550
|
+
prepend(error) {
|
|
44551
|
+
this.errors.unshift(error);
|
|
44552
|
+
}
|
|
44553
|
+
toValidationResponse() {
|
|
44554
|
+
return !this.hasErrors() ? ok$3(true) : err$3(this.errors);
|
|
44555
|
+
}
|
|
44556
|
+
};
|
|
44557
|
+
function createThrowableError$1(errors) {
|
|
44558
|
+
if (errors[0] instanceof MinItemsViolationError$1) {
|
|
44559
|
+
return new MinItemsViolationError$1(errors[0].message, errors);
|
|
44560
|
+
}
|
|
44561
|
+
if (errors[0] instanceof MaxItemsViolationError$1) {
|
|
44562
|
+
return new MaxItemsViolationError$1(errors[0].message, errors);
|
|
44563
|
+
}
|
|
44564
|
+
if (errors[0] instanceof IncorrectTypeError$1) {
|
|
44565
|
+
return new IncorrectTypeError$1(errors[0].message, errors);
|
|
44566
|
+
}
|
|
44567
|
+
if (errors[0] instanceof AdditionalPropertiesError$1) {
|
|
44568
|
+
return new AdditionalPropertiesError$1(errors[0].message, errors);
|
|
44569
|
+
}
|
|
44570
|
+
if (errors[0] instanceof MissingRequiredPropertyError$1) {
|
|
44571
|
+
return new MissingRequiredPropertyError$1(errors[0].message, errors);
|
|
44572
|
+
}
|
|
44573
|
+
if (errors[0] instanceof InvalidRefError$1) {
|
|
44574
|
+
return new InvalidRefError$1(errors[0].message, errors);
|
|
44575
|
+
}
|
|
44576
|
+
return new JsonSchemaViolationError$1(errors[0].message, errors);
|
|
44577
|
+
}
|
|
44578
|
+
function assertIsValid$1(data, schema) {
|
|
44579
|
+
const validationResponse = validateJsonSchema$1(data, schema);
|
|
44580
|
+
if (validationResponse.isErr()) {
|
|
44581
|
+
throw createThrowableError$1(validationResponse.error);
|
|
44582
|
+
}
|
|
44583
|
+
}
|
|
44584
|
+
function incorrectTypeError$1(expected, actual, path) {
|
|
44585
|
+
return new IncorrectTypeError$1(
|
|
44586
|
+
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
44587
|
+
);
|
|
44588
|
+
}
|
|
44589
|
+
function validSchemaResponse$1() {
|
|
44590
|
+
return ok$3(true);
|
|
44591
|
+
}
|
|
44592
|
+
function invalidSchemaResponseWithError$1(error) {
|
|
44593
|
+
return err$3([error]);
|
|
44594
|
+
}
|
|
44595
|
+
function validateJsonSchema$1(data, schema, path = "$", document = schema) {
|
|
44596
|
+
if (schema === true) return validSchemaResponse$1();
|
|
44597
|
+
if (schema === false)
|
|
44598
|
+
return invalidSchemaResponseWithError$1(
|
|
44599
|
+
new JsonSchemaViolationError$1(`Data at ${path} has schema 'false'`)
|
|
44600
|
+
);
|
|
44601
|
+
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
44602
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44603
|
+
if ("anyOf" in schema) {
|
|
44604
|
+
errorCollector.append(validateAnyOf$1(data, schema, path, document));
|
|
44605
|
+
} else if ("oneOf" in schema) {
|
|
44606
|
+
errorCollector.append(validateOneOf$1(data, schema, path, document));
|
|
44607
|
+
} else if ("allOf" in schema) {
|
|
44608
|
+
errorCollector.append(validateAllOf$1(data, schema, path, document));
|
|
44609
|
+
} else if ("not" in schema) {
|
|
44610
|
+
errorCollector.append(validateNot$1(data, schema, path, document));
|
|
44611
|
+
} else if ("$ref" in schema) {
|
|
44612
|
+
errorCollector.append(validateRef$1(data, schema, path, document));
|
|
44613
|
+
} else if ("type" in schema) {
|
|
44614
|
+
if (schema.type === "object") {
|
|
44615
|
+
if (dataType !== "object") {
|
|
44616
|
+
errorCollector.add(incorrectTypeError$1("object", dataType, path));
|
|
44617
|
+
} else {
|
|
44618
|
+
errorCollector.append(
|
|
44619
|
+
validateObject$1(data, schema, path, document)
|
|
44620
|
+
);
|
|
44621
|
+
}
|
|
44622
|
+
} else if (schema.type === "array") {
|
|
44623
|
+
if (dataType !== "array") {
|
|
44624
|
+
errorCollector.add(incorrectTypeError$1("array", dataType, path));
|
|
44625
|
+
} else {
|
|
44626
|
+
errorCollector.append(
|
|
44627
|
+
validateArray$1(data, schema, path, document)
|
|
44628
|
+
);
|
|
44629
|
+
}
|
|
44630
|
+
} else {
|
|
44631
|
+
errorCollector.append(
|
|
44632
|
+
validateScalar$1(data, schema, path)
|
|
44633
|
+
);
|
|
44634
|
+
}
|
|
44635
|
+
}
|
|
44636
|
+
if (schema.enum) {
|
|
44637
|
+
errorCollector.append(validateEnum$1(data, schema.enum, path));
|
|
44638
|
+
}
|
|
44639
|
+
if (schema.const) {
|
|
44640
|
+
errorCollector.append(validateConst$1(data, schema.const, path));
|
|
44641
|
+
}
|
|
44642
|
+
return errorCollector.toValidationResponse();
|
|
44643
|
+
}
|
|
44644
|
+
function validateAnyOf$1(data, schema, path, document) {
|
|
44645
|
+
let isValid = false;
|
|
44646
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44647
|
+
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
44648
|
+
const element = schema.anyOf[i];
|
|
44649
|
+
const validationResponse = validateJsonSchema$1(
|
|
44650
|
+
data,
|
|
44651
|
+
element,
|
|
44652
|
+
`${path}.anyOf[${i}]`,
|
|
44653
|
+
document
|
|
44654
|
+
);
|
|
44655
|
+
if (validationResponse.isOk()) {
|
|
44656
|
+
isValid = true;
|
|
44657
|
+
break;
|
|
44658
|
+
} else {
|
|
44659
|
+
errorCollector.append(validationResponse);
|
|
44660
|
+
}
|
|
44661
|
+
}
|
|
44662
|
+
if (!isValid) {
|
|
44663
|
+
errorCollector.prepend(
|
|
44664
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in anyOf.`)
|
|
44665
|
+
);
|
|
44666
|
+
return errorCollector.toValidationResponse();
|
|
44667
|
+
}
|
|
44668
|
+
return validSchemaResponse$1();
|
|
44669
|
+
}
|
|
44670
|
+
function validateOneOf$1(data, schema, path, document) {
|
|
44671
|
+
let validSubShemaPaths = [];
|
|
44672
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44673
|
+
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
44674
|
+
const element = schema.oneOf[i];
|
|
44675
|
+
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
44676
|
+
const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
|
|
44677
|
+
if (validationResponse.isOk()) {
|
|
44678
|
+
validSubShemaPaths.push(oneOfPath);
|
|
44679
|
+
} else {
|
|
44680
|
+
errorCollector.append(validationResponse);
|
|
44681
|
+
}
|
|
44682
|
+
}
|
|
44683
|
+
if (validSubShemaPaths.length === 0) {
|
|
44684
|
+
errorCollector.prepend(
|
|
44685
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in oneOf.`)
|
|
44686
|
+
);
|
|
44687
|
+
return errorCollector.toValidationResponse();
|
|
44688
|
+
} else if (validSubShemaPaths.length > 1) {
|
|
44689
|
+
errorCollector.prepend(
|
|
44690
|
+
new JsonSchemaViolationError$1(
|
|
44691
|
+
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
44692
|
+
)
|
|
44693
|
+
);
|
|
44694
|
+
return errorCollector.toValidationResponse();
|
|
44695
|
+
}
|
|
44696
|
+
return validSchemaResponse$1();
|
|
44697
|
+
}
|
|
44698
|
+
function validateAllOf$1(data, schema, path, document) {
|
|
44699
|
+
let isValid = true;
|
|
44700
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44701
|
+
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
44702
|
+
const element = schema.allOf[i];
|
|
44703
|
+
const validationResponse = validateJsonSchema$1(
|
|
44704
|
+
data,
|
|
44705
|
+
element,
|
|
44706
|
+
`${path}.allOf[${i}]`,
|
|
44707
|
+
document
|
|
44708
|
+
);
|
|
44709
|
+
if (!validationResponse.isOk()) {
|
|
44710
|
+
errorCollector.append(validationResponse);
|
|
44711
|
+
isValid = false;
|
|
44712
|
+
}
|
|
44713
|
+
}
|
|
44714
|
+
if (!isValid) {
|
|
44715
|
+
errorCollector.prepend(
|
|
44716
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match some subschemas in allOf.`)
|
|
44717
|
+
);
|
|
44718
|
+
}
|
|
44719
|
+
return errorCollector.toValidationResponse();
|
|
44720
|
+
}
|
|
44721
|
+
function validateNot$1(data, schema, path, document) {
|
|
44722
|
+
const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
|
|
44723
|
+
if (validationResponse.isOk()) {
|
|
44724
|
+
return invalidSchemaResponseWithError$1(
|
|
44725
|
+
new JsonSchemaViolationError$1(
|
|
44726
|
+
`Data at ${path} validated against the schema of a not clause.`
|
|
44727
|
+
)
|
|
44728
|
+
);
|
|
44729
|
+
}
|
|
44730
|
+
return validSchemaResponse$1();
|
|
44731
|
+
}
|
|
44732
|
+
function validateObject$1(data, schema, path, document) {
|
|
44733
|
+
const schemaKeys = Object.keys(schema.properties);
|
|
44734
|
+
const requiredKeys = new Set(schema.required);
|
|
44735
|
+
const schemaKeySet = new Set(schemaKeys);
|
|
44736
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44737
|
+
Object.keys(data).forEach((key) => {
|
|
44738
|
+
if (!schemaKeySet.has(key)) {
|
|
44739
|
+
errorCollector.append(
|
|
44740
|
+
validateJsonSchema$1(
|
|
44741
|
+
data[key],
|
|
44742
|
+
schema.additionalProperties,
|
|
44743
|
+
`${path}.additionalProperties[${key}]`,
|
|
44744
|
+
document
|
|
44745
|
+
)
|
|
44746
|
+
);
|
|
44747
|
+
}
|
|
44748
|
+
});
|
|
44749
|
+
for (let i = 0, length = schemaKeys.length; i < length; i++) {
|
|
44750
|
+
const key = schemaKeys[i];
|
|
44751
|
+
const keyInData = key in data && data[key] !== void 0;
|
|
44752
|
+
if (requiredKeys.has(key) && !keyInData) {
|
|
44753
|
+
errorCollector.add(
|
|
44754
|
+
new MissingRequiredPropertyError$1(
|
|
44755
|
+
`Object at path '${path}' is missing required property '${key}'.`
|
|
44756
|
+
)
|
|
44757
|
+
);
|
|
44758
|
+
}
|
|
44759
|
+
if (keyInData) {
|
|
44760
|
+
errorCollector.append(
|
|
44761
|
+
validateJsonSchema$1(
|
|
44762
|
+
data[key],
|
|
44763
|
+
schema.properties[key],
|
|
44764
|
+
`${path}.${key}`,
|
|
44765
|
+
document
|
|
44766
|
+
)
|
|
44767
|
+
);
|
|
44768
|
+
}
|
|
44769
|
+
}
|
|
44770
|
+
return errorCollector.toValidationResponse();
|
|
44771
|
+
}
|
|
44772
|
+
function validateArray$1(data, schema, path, document) {
|
|
44773
|
+
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
44774
|
+
return invalidSchemaResponseWithError$1(
|
|
44775
|
+
new MinItemsViolationError$1(
|
|
44776
|
+
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
44777
|
+
)
|
|
44778
|
+
);
|
|
44779
|
+
}
|
|
44780
|
+
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
44781
|
+
return invalidSchemaResponseWithError$1(
|
|
44782
|
+
new MaxItemsViolationError$1(
|
|
44783
|
+
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
44784
|
+
)
|
|
44785
|
+
);
|
|
44786
|
+
}
|
|
44787
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44788
|
+
data.forEach(
|
|
44789
|
+
(element, index) => errorCollector.append(
|
|
44790
|
+
validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
|
|
44791
|
+
)
|
|
44792
|
+
);
|
|
44793
|
+
return errorCollector.toValidationResponse();
|
|
44794
|
+
}
|
|
44795
|
+
function validateScalar$1(data, schema, path) {
|
|
44796
|
+
const schemaDataType = schema.type;
|
|
44797
|
+
const dataType = typeof data;
|
|
44798
|
+
if (schemaDataType === "integer") {
|
|
44799
|
+
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
44800
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("integer", dataType, path));
|
|
44801
|
+
}
|
|
44802
|
+
} else if (schemaDataType === "number") {
|
|
44803
|
+
if (dataType !== "number") {
|
|
44804
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("number", dataType, path));
|
|
44805
|
+
}
|
|
44806
|
+
} else if (schemaDataType === "string") {
|
|
44807
|
+
if (dataType !== "string") {
|
|
44808
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("string", dataType, path));
|
|
44809
|
+
}
|
|
44810
|
+
} else if (schemaDataType === "boolean") {
|
|
44811
|
+
if (dataType !== "boolean") {
|
|
44812
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("boolean", dataType, path));
|
|
44813
|
+
}
|
|
44814
|
+
} else if (schemaDataType === "null") {
|
|
44815
|
+
if (data !== null) {
|
|
44816
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("null", dataType, path));
|
|
44817
|
+
}
|
|
44818
|
+
} else {
|
|
44819
|
+
return invalidSchemaResponseWithError$1(
|
|
44820
|
+
new IncorrectTypeError$1(`Unknown schema data type: ${schemaDataType}.`)
|
|
44821
|
+
);
|
|
44822
|
+
}
|
|
44823
|
+
return validSchemaResponse$1();
|
|
44824
|
+
}
|
|
44825
|
+
function validateRef$1(data, schema, path, document) {
|
|
44826
|
+
if (!schema.$ref.startsWith("#")) {
|
|
44827
|
+
return invalidSchemaResponseWithError$1(
|
|
44828
|
+
new InvalidRefError$1(
|
|
44829
|
+
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
44830
|
+
)
|
|
44831
|
+
);
|
|
44832
|
+
}
|
|
44833
|
+
try {
|
|
44834
|
+
const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
|
|
44835
|
+
return validateJsonSchema$1(data, schemaToValidate, path, document);
|
|
44836
|
+
} catch (e) {
|
|
44837
|
+
return invalidSchemaResponseWithError$1(e);
|
|
44838
|
+
}
|
|
44839
|
+
}
|
|
44840
|
+
function validateEnum$1(data, enumValue, path) {
|
|
44841
|
+
if (!enumValue.some((value) => deepEquals$2(value, data))) {
|
|
44842
|
+
return invalidSchemaResponseWithError$1(
|
|
44843
|
+
new JsonSchemaViolationError$1(
|
|
44844
|
+
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
|
|
44845
|
+
)
|
|
44846
|
+
);
|
|
44847
|
+
}
|
|
44848
|
+
return validSchemaResponse$1();
|
|
44849
|
+
}
|
|
44850
|
+
function validateConst$1(data, constValue, path) {
|
|
44851
|
+
if (!deepEquals$2(constValue, data)) {
|
|
44852
|
+
return invalidSchemaResponseWithError$1(
|
|
44853
|
+
new JsonSchemaViolationError$1(
|
|
44854
|
+
`Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
|
|
44855
|
+
)
|
|
44856
|
+
);
|
|
44857
|
+
}
|
|
44858
|
+
return validSchemaResponse$1();
|
|
44859
|
+
}
|
|
44860
|
+
function findSchemaAtPath$1(document, ref) {
|
|
44861
|
+
if (ref === "#") return document;
|
|
44862
|
+
const keys = ref.replace(/^#\//, "").split("/");
|
|
44863
|
+
let current = document;
|
|
44864
|
+
let path = "#";
|
|
44865
|
+
for (const key of keys) {
|
|
44866
|
+
path = `${path}/${key}`;
|
|
44867
|
+
if (current[key] === void 0) {
|
|
44868
|
+
throw new InvalidRefError$1(
|
|
44869
|
+
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
44870
|
+
);
|
|
44871
|
+
}
|
|
44872
|
+
current = current[key];
|
|
44873
|
+
}
|
|
44874
|
+
return current;
|
|
44538
44875
|
}
|
|
44539
44876
|
|
|
44540
44877
|
/*!
|
|
@@ -45381,35 +45718,6 @@ const astResolver = function(astReference) {
|
|
|
45381
45718
|
}
|
|
45382
45719
|
return referenceMap.get(astReference);
|
|
45383
45720
|
};
|
|
45384
|
-
/*!
|
|
45385
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
45386
|
-
* All rights reserved.
|
|
45387
|
-
* For full license text, see the LICENSE.txt file
|
|
45388
|
-
*/
|
|
45389
|
-
let Ok$3 = class Ok {
|
|
45390
|
-
constructor(value) {
|
|
45391
|
-
this.value = value;
|
|
45392
|
-
}
|
|
45393
|
-
isOk() {
|
|
45394
|
-
return true;
|
|
45395
|
-
}
|
|
45396
|
-
isErr() {
|
|
45397
|
-
return !this.isOk();
|
|
45398
|
-
}
|
|
45399
|
-
};
|
|
45400
|
-
let Err$3 = class Err {
|
|
45401
|
-
constructor(error) {
|
|
45402
|
-
this.error = error;
|
|
45403
|
-
}
|
|
45404
|
-
isOk() {
|
|
45405
|
-
return false;
|
|
45406
|
-
}
|
|
45407
|
-
isErr() {
|
|
45408
|
-
return !this.isOk();
|
|
45409
|
-
}
|
|
45410
|
-
};
|
|
45411
|
-
const ok$3 = (value) => new Ok$3(value);
|
|
45412
|
-
const err$3 = (err2) => new Err$3(err2);
|
|
45413
45721
|
function findExecutableOperation$2(document, operationName) {
|
|
45414
45722
|
const operations = document.definitions.filter(
|
|
45415
45723
|
(def) => def.kind === Kind$1.OPERATION_DEFINITION
|
|
@@ -45460,6 +45768,14 @@ function resolveAndValidateGraphQLConfig(config, options) {
|
|
|
45460
45768
|
query: result.value
|
|
45461
45769
|
});
|
|
45462
45770
|
}
|
|
45771
|
+
function toGraphQLErrorResponse(error) {
|
|
45772
|
+
logError$2(error);
|
|
45773
|
+
const message = error instanceof JsonSchemaViolationError$1 ? `Invalid GraphQL config: ${error.message}` : "Internal error in GraphQL adapter occurred";
|
|
45774
|
+
return {
|
|
45775
|
+
data: void 0,
|
|
45776
|
+
errors: [{ message, locations: [] }]
|
|
45777
|
+
};
|
|
45778
|
+
}
|
|
45463
45779
|
function resolveAndValidateGraphQLDocument(query, operationName, options) {
|
|
45464
45780
|
const resolved = resolveAst(query);
|
|
45465
45781
|
if (resolved === void 0) {
|
|
@@ -51198,7 +51514,6 @@ function prepareRequest$5(luvio, config) {
|
|
|
51198
51514
|
const key = keyBuilder$1M(luvio, createResourceParams$g(config));
|
|
51199
51515
|
const allTrackedFields = getTrackedFields(key, luvio.getNode(key), {
|
|
51200
51516
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
51201
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
51202
51517
|
}, config.optionalFields);
|
|
51203
51518
|
const optionalFields = fields === undefined ? allTrackedFields : difference(allTrackedFields, fields);
|
|
51204
51519
|
const resourceParams = createResourceParams$g({
|
|
@@ -51325,7 +51640,6 @@ function ingestSuccessChildResourceParams$2(luvio, childResourceParamsArray, chi
|
|
|
51325
51640
|
};
|
|
51326
51641
|
const childTrackedFields = getTrackedFields(childKey, luvio.getNode(childKey), {
|
|
51327
51642
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
51328
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
51329
51643
|
}, childResourceParams.queryParams.optionalFields);
|
|
51330
51644
|
const childSnapshot = ingestSuccess$8(luvio, {
|
|
51331
51645
|
recordId: childResourceParams.urlParams.recordId,
|
|
@@ -56295,7 +56609,6 @@ function buildNetworkSnapshot$c(luvio, config, options) {
|
|
|
56295
56609
|
const key = keyBuilder$1w$1(luvio, config);
|
|
56296
56610
|
const trackedFieldsConfig = {
|
|
56297
56611
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
56298
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
56299
56612
|
};
|
|
56300
56613
|
const optionalFieldsTrie = convertFieldsToTrie(getTrackedFields(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
|
|
56301
56614
|
const fieldsTrie = BLANK_RECORD_FIELDS_TRIE;
|
|
@@ -60167,7 +60480,6 @@ const buildNetworkSnapshot$3 = (luvio, context, config, options) => {
|
|
|
60167
60480
|
...resourceRequest.queryParams,
|
|
60168
60481
|
optionalFields: getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
60169
60482
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60170
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60171
60483
|
}, config.optionalFields),
|
|
60172
60484
|
},
|
|
60173
60485
|
});
|
|
@@ -60719,7 +61031,6 @@ function prepareRequest(luvio, context, config) {
|
|
|
60719
61031
|
...resourceRequest.queryParams,
|
|
60720
61032
|
optionalFields: getTrackedFields(recordTemplateKey, luvio.getNode(recordTemplateKey), {
|
|
60721
61033
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60722
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60723
61034
|
}, config.optionalFields),
|
|
60724
61035
|
},
|
|
60725
61036
|
});
|
|
@@ -60739,7 +61050,6 @@ function onFetchResponseSuccess$2(luvio, context, config, request, response, res
|
|
|
60739
61050
|
});
|
|
60740
61051
|
const allTrackedFields = getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
60741
61052
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60742
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60743
61053
|
}, optionalFields);
|
|
60744
61054
|
const allTrackedFieldsTrie = convertFieldsToTrie(allTrackedFields, true);
|
|
60745
61055
|
const ingest = createFieldsIngestSuccess({
|
|
@@ -80503,6 +80813,7 @@ class AbstractQuickActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
80503
80813
|
}
|
|
80504
80814
|
async buildPendingAction(request, queue) {
|
|
80505
80815
|
this.resolveResourceRequestBody(request.body);
|
|
80816
|
+
// eslint-disable-next-line no-return-await
|
|
80506
80817
|
return await super.buildPendingAction(request, queue);
|
|
80507
80818
|
}
|
|
80508
80819
|
resolveResourceRequestBody(body) {
|
|
@@ -80935,8 +81246,6 @@ function isCreateContentDocumentAndVersionDraftAdapterEvent(customEvent) {
|
|
|
80935
81246
|
return customEvent.namespace === CONTENT_DOCUMENT_AND_VERSION_NAMESPACE;
|
|
80936
81247
|
}
|
|
80937
81248
|
|
|
80938
|
-
// so eslint doesn't complain about nimbus
|
|
80939
|
-
/* global __nimbus */
|
|
80940
81249
|
function chunkToBase64(chunk) {
|
|
80941
81250
|
const bytes = new Uint8Array(chunk);
|
|
80942
81251
|
const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
|
|
@@ -87016,6 +87325,7 @@ function isPolymorphicFieldPath(path, pathToObjectApiNamesMap, objectInfos) {
|
|
|
87016
87325
|
const parentObjectInfo = objectInfos[parentObjectApiNames[0]];
|
|
87017
87326
|
// this should not be undefined, but lets catch it if we do end up in that state.
|
|
87018
87327
|
if (parentObjectInfo === undefined) {
|
|
87328
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
87019
87329
|
throw new Error(`ObjectInfo is missing for ${parentObjectApiNames[0]} for ${parentApiPath}`);
|
|
87020
87330
|
}
|
|
87021
87331
|
const relationshipField = referenceIdFieldForRelationship(lastSegment);
|
|
@@ -88388,6 +88698,7 @@ function checkForEmptyData(gqlResult) {
|
|
|
88388
88698
|
}
|
|
88389
88699
|
const query = data.uiapi.query;
|
|
88390
88700
|
// Check all entity types in the query for edges - using for...in to avoid array allocation
|
|
88701
|
+
// eslint-disable-next-line guard-for-in
|
|
88391
88702
|
for (const entityType in query) {
|
|
88392
88703
|
const entity = query[entityType];
|
|
88393
88704
|
if (entity && entity.edges && isArray$3$1(entity.edges) && entity.edges.length > 0) {
|
|
@@ -90309,7 +90620,9 @@ class NimbusSqliteStore {
|
|
|
90309
90620
|
}
|
|
90310
90621
|
instrumentation$2$1.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
|
|
90311
90622
|
}
|
|
90312
|
-
catch {
|
|
90623
|
+
catch {
|
|
90624
|
+
// intentionally do nothing
|
|
90625
|
+
}
|
|
90313
90626
|
}
|
|
90314
90627
|
}
|
|
90315
90628
|
|
|
@@ -91018,6 +91331,7 @@ class PrimingSession extends EventEmitter {
|
|
|
91018
91331
|
const userData = {
|
|
91019
91332
|
...stats,
|
|
91020
91333
|
};
|
|
91334
|
+
// eslint-disable-next-line guard-for-in
|
|
91021
91335
|
for (const error in errors) {
|
|
91022
91336
|
activity.error(error);
|
|
91023
91337
|
}
|
|
@@ -91198,6 +91512,7 @@ class PrimingSession extends EventEmitter {
|
|
|
91198
91512
|
let limitedResult = this.applyRetryLimits(result.additionalWork);
|
|
91199
91513
|
this.enqueue(limitedResult.additionalWork);
|
|
91200
91514
|
if (limitedResult.recordsNeedingRefetch.size > 0) {
|
|
91515
|
+
// eslint-disable-next-line guard-for-in
|
|
91201
91516
|
for (const key in keys$3(limitedResult.recordsNeedingRefetch)) {
|
|
91202
91517
|
const value = limitedResult.recordsNeedingRefetch.get(key);
|
|
91203
91518
|
if (result.recordsNeedingRefetch.has(key)) {
|
|
@@ -93463,6 +93778,7 @@ class DurableRecordStore {
|
|
|
93463
93778
|
async exists(key) {
|
|
93464
93779
|
const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
|
|
93465
93780
|
const exists = result.rows[0][0];
|
|
93781
|
+
// eslint-disable-next-line eqeqeq
|
|
93466
93782
|
return exists == true;
|
|
93467
93783
|
}
|
|
93468
93784
|
async getRecord(key) {
|
|
@@ -93677,7 +93993,7 @@ var CounterResult;
|
|
|
93677
93993
|
CounterResult["Error"] = "Error";
|
|
93678
93994
|
})(CounterResult || (CounterResult = {}));
|
|
93679
93995
|
function incrementCounter(name, result) {
|
|
93680
|
-
instrumentation$4.incrementCounter('SFSSideEffect', 1, result
|
|
93996
|
+
instrumentation$4.incrementCounter('SFSSideEffect', 1, result === CounterResult.Error, {
|
|
93681
93997
|
Name: name,
|
|
93682
93998
|
Result: result,
|
|
93683
93999
|
});
|
|
@@ -96249,7 +96565,7 @@ function buildServiceDescriptor$b(luvio) {
|
|
|
96249
96565
|
},
|
|
96250
96566
|
};
|
|
96251
96567
|
}
|
|
96252
|
-
// version: 1.
|
|
96568
|
+
// version: 1.434.0-6aa2dd15e3
|
|
96253
96569
|
|
|
96254
96570
|
/**
|
|
96255
96571
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96275,7 +96591,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
96275
96591
|
},
|
|
96276
96592
|
};
|
|
96277
96593
|
}
|
|
96278
|
-
// version: 1.
|
|
96594
|
+
// version: 1.434.0-6aa2dd15e3
|
|
96279
96595
|
|
|
96280
96596
|
/*!
|
|
96281
96597
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96680,26 +96996,26 @@ function buildServiceDescriptor$8() {
|
|
|
96680
96996
|
* All rights reserved.
|
|
96681
96997
|
* For full license text, see the LICENSE.txt file
|
|
96682
96998
|
*/
|
|
96683
|
-
|
|
96999
|
+
class JsonSchemaViolationError extends Error {
|
|
96684
97000
|
constructor(message, validationErrors) {
|
|
96685
97001
|
super(message);
|
|
96686
97002
|
this.validationErrors = [];
|
|
96687
97003
|
this.validationErrors = validationErrors || [];
|
|
96688
97004
|
}
|
|
96689
|
-
}
|
|
96690
|
-
|
|
96691
|
-
}
|
|
96692
|
-
|
|
96693
|
-
}
|
|
96694
|
-
|
|
96695
|
-
}
|
|
96696
|
-
|
|
96697
|
-
}
|
|
96698
|
-
|
|
96699
|
-
}
|
|
96700
|
-
|
|
96701
|
-
}
|
|
96702
|
-
|
|
97005
|
+
}
|
|
97006
|
+
class MinItemsViolationError extends JsonSchemaViolationError {
|
|
97007
|
+
}
|
|
97008
|
+
class MaxItemsViolationError extends JsonSchemaViolationError {
|
|
97009
|
+
}
|
|
97010
|
+
class IncorrectTypeError extends JsonSchemaViolationError {
|
|
97011
|
+
}
|
|
97012
|
+
class AdditionalPropertiesError extends JsonSchemaViolationError {
|
|
97013
|
+
}
|
|
97014
|
+
class MissingRequiredPropertyError extends JsonSchemaViolationError {
|
|
97015
|
+
}
|
|
97016
|
+
class InvalidRefError extends JsonSchemaViolationError {
|
|
97017
|
+
}
|
|
97018
|
+
class JsonSchemaErrorCollector {
|
|
96703
97019
|
constructor() {
|
|
96704
97020
|
this.errors = [];
|
|
96705
97021
|
}
|
|
@@ -96720,100 +97036,100 @@ let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
|
|
|
96720
97036
|
toValidationResponse() {
|
|
96721
97037
|
return !this.hasErrors() ? ok$1(true) : err$1(this.errors);
|
|
96722
97038
|
}
|
|
96723
|
-
}
|
|
96724
|
-
function createThrowableError
|
|
96725
|
-
if (errors[0] instanceof MinItemsViolationError
|
|
96726
|
-
return new MinItemsViolationError
|
|
97039
|
+
}
|
|
97040
|
+
function createThrowableError(errors) {
|
|
97041
|
+
if (errors[0] instanceof MinItemsViolationError) {
|
|
97042
|
+
return new MinItemsViolationError(errors[0].message, errors);
|
|
96727
97043
|
}
|
|
96728
|
-
if (errors[0] instanceof MaxItemsViolationError
|
|
96729
|
-
return new MaxItemsViolationError
|
|
97044
|
+
if (errors[0] instanceof MaxItemsViolationError) {
|
|
97045
|
+
return new MaxItemsViolationError(errors[0].message, errors);
|
|
96730
97046
|
}
|
|
96731
|
-
if (errors[0] instanceof IncorrectTypeError
|
|
96732
|
-
return new IncorrectTypeError
|
|
97047
|
+
if (errors[0] instanceof IncorrectTypeError) {
|
|
97048
|
+
return new IncorrectTypeError(errors[0].message, errors);
|
|
96733
97049
|
}
|
|
96734
|
-
if (errors[0] instanceof AdditionalPropertiesError
|
|
96735
|
-
return new AdditionalPropertiesError
|
|
97050
|
+
if (errors[0] instanceof AdditionalPropertiesError) {
|
|
97051
|
+
return new AdditionalPropertiesError(errors[0].message, errors);
|
|
96736
97052
|
}
|
|
96737
|
-
if (errors[0] instanceof MissingRequiredPropertyError
|
|
96738
|
-
return new MissingRequiredPropertyError
|
|
97053
|
+
if (errors[0] instanceof MissingRequiredPropertyError) {
|
|
97054
|
+
return new MissingRequiredPropertyError(errors[0].message, errors);
|
|
96739
97055
|
}
|
|
96740
|
-
if (errors[0] instanceof InvalidRefError
|
|
96741
|
-
return new InvalidRefError
|
|
97056
|
+
if (errors[0] instanceof InvalidRefError) {
|
|
97057
|
+
return new InvalidRefError(errors[0].message, errors);
|
|
96742
97058
|
}
|
|
96743
|
-
return new JsonSchemaViolationError
|
|
97059
|
+
return new JsonSchemaViolationError(errors[0].message, errors);
|
|
96744
97060
|
}
|
|
96745
|
-
function assertIsValid
|
|
96746
|
-
const validationResponse = validateJsonSchema
|
|
97061
|
+
function assertIsValid(data, schema) {
|
|
97062
|
+
const validationResponse = validateJsonSchema(data, schema);
|
|
96747
97063
|
if (validationResponse.isErr()) {
|
|
96748
|
-
throw createThrowableError
|
|
97064
|
+
throw createThrowableError(validationResponse.error);
|
|
96749
97065
|
}
|
|
96750
97066
|
}
|
|
96751
|
-
function incorrectTypeError
|
|
96752
|
-
return new IncorrectTypeError
|
|
97067
|
+
function incorrectTypeError(expected, actual, path) {
|
|
97068
|
+
return new IncorrectTypeError(
|
|
96753
97069
|
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
96754
97070
|
);
|
|
96755
97071
|
}
|
|
96756
|
-
function validSchemaResponse
|
|
97072
|
+
function validSchemaResponse() {
|
|
96757
97073
|
return ok$1(true);
|
|
96758
97074
|
}
|
|
96759
|
-
function invalidSchemaResponseWithError
|
|
97075
|
+
function invalidSchemaResponseWithError(error) {
|
|
96760
97076
|
return err$1([error]);
|
|
96761
97077
|
}
|
|
96762
|
-
function validateJsonSchema
|
|
96763
|
-
if (schema === true) return validSchemaResponse
|
|
97078
|
+
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
97079
|
+
if (schema === true) return validSchemaResponse();
|
|
96764
97080
|
if (schema === false)
|
|
96765
|
-
return invalidSchemaResponseWithError
|
|
96766
|
-
new JsonSchemaViolationError
|
|
97081
|
+
return invalidSchemaResponseWithError(
|
|
97082
|
+
new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
|
|
96767
97083
|
);
|
|
96768
97084
|
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
96769
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97085
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96770
97086
|
if ("anyOf" in schema) {
|
|
96771
|
-
errorCollector.append(validateAnyOf
|
|
97087
|
+
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
96772
97088
|
} else if ("oneOf" in schema) {
|
|
96773
|
-
errorCollector.append(validateOneOf
|
|
97089
|
+
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
96774
97090
|
} else if ("allOf" in schema) {
|
|
96775
|
-
errorCollector.append(validateAllOf
|
|
97091
|
+
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
96776
97092
|
} else if ("not" in schema) {
|
|
96777
|
-
errorCollector.append(validateNot
|
|
97093
|
+
errorCollector.append(validateNot(data, schema, path, document));
|
|
96778
97094
|
} else if ("$ref" in schema) {
|
|
96779
|
-
errorCollector.append(validateRef
|
|
97095
|
+
errorCollector.append(validateRef(data, schema, path, document));
|
|
96780
97096
|
} else if ("type" in schema) {
|
|
96781
97097
|
if (schema.type === "object") {
|
|
96782
97098
|
if (dataType !== "object") {
|
|
96783
|
-
errorCollector.add(incorrectTypeError
|
|
97099
|
+
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
96784
97100
|
} else {
|
|
96785
97101
|
errorCollector.append(
|
|
96786
|
-
validateObject
|
|
97102
|
+
validateObject(data, schema, path, document)
|
|
96787
97103
|
);
|
|
96788
97104
|
}
|
|
96789
97105
|
} else if (schema.type === "array") {
|
|
96790
97106
|
if (dataType !== "array") {
|
|
96791
|
-
errorCollector.add(incorrectTypeError
|
|
97107
|
+
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
96792
97108
|
} else {
|
|
96793
97109
|
errorCollector.append(
|
|
96794
|
-
validateArray
|
|
97110
|
+
validateArray(data, schema, path, document)
|
|
96795
97111
|
);
|
|
96796
97112
|
}
|
|
96797
97113
|
} else {
|
|
96798
97114
|
errorCollector.append(
|
|
96799
|
-
validateScalar
|
|
97115
|
+
validateScalar(data, schema, path)
|
|
96800
97116
|
);
|
|
96801
97117
|
}
|
|
96802
97118
|
}
|
|
96803
97119
|
if (schema.enum) {
|
|
96804
|
-
errorCollector.append(validateEnum
|
|
97120
|
+
errorCollector.append(validateEnum(data, schema.enum, path));
|
|
96805
97121
|
}
|
|
96806
97122
|
if (schema.const) {
|
|
96807
|
-
errorCollector.append(validateConst
|
|
97123
|
+
errorCollector.append(validateConst(data, schema.const, path));
|
|
96808
97124
|
}
|
|
96809
97125
|
return errorCollector.toValidationResponse();
|
|
96810
97126
|
}
|
|
96811
|
-
function validateAnyOf
|
|
97127
|
+
function validateAnyOf(data, schema, path, document) {
|
|
96812
97128
|
let isValid = false;
|
|
96813
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97129
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96814
97130
|
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
96815
97131
|
const element = schema.anyOf[i];
|
|
96816
|
-
const validationResponse = validateJsonSchema
|
|
97132
|
+
const validationResponse = validateJsonSchema(
|
|
96817
97133
|
data,
|
|
96818
97134
|
element,
|
|
96819
97135
|
`${path}.anyOf[${i}]`,
|
|
@@ -96828,19 +97144,19 @@ function validateAnyOf$1(data, schema, path, document) {
|
|
|
96828
97144
|
}
|
|
96829
97145
|
if (!isValid) {
|
|
96830
97146
|
errorCollector.prepend(
|
|
96831
|
-
new JsonSchemaViolationError
|
|
97147
|
+
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
|
|
96832
97148
|
);
|
|
96833
97149
|
return errorCollector.toValidationResponse();
|
|
96834
97150
|
}
|
|
96835
|
-
return validSchemaResponse
|
|
97151
|
+
return validSchemaResponse();
|
|
96836
97152
|
}
|
|
96837
|
-
function validateOneOf
|
|
97153
|
+
function validateOneOf(data, schema, path, document) {
|
|
96838
97154
|
let validSubShemaPaths = [];
|
|
96839
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97155
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96840
97156
|
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
96841
97157
|
const element = schema.oneOf[i];
|
|
96842
97158
|
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
96843
|
-
const validationResponse = validateJsonSchema
|
|
97159
|
+
const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
|
|
96844
97160
|
if (validationResponse.isOk()) {
|
|
96845
97161
|
validSubShemaPaths.push(oneOfPath);
|
|
96846
97162
|
} else {
|
|
@@ -96849,25 +97165,25 @@ function validateOneOf$1(data, schema, path, document) {
|
|
|
96849
97165
|
}
|
|
96850
97166
|
if (validSubShemaPaths.length === 0) {
|
|
96851
97167
|
errorCollector.prepend(
|
|
96852
|
-
new JsonSchemaViolationError
|
|
97168
|
+
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
|
|
96853
97169
|
);
|
|
96854
97170
|
return errorCollector.toValidationResponse();
|
|
96855
97171
|
} else if (validSubShemaPaths.length > 1) {
|
|
96856
97172
|
errorCollector.prepend(
|
|
96857
|
-
new JsonSchemaViolationError
|
|
97173
|
+
new JsonSchemaViolationError(
|
|
96858
97174
|
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
96859
97175
|
)
|
|
96860
97176
|
);
|
|
96861
97177
|
return errorCollector.toValidationResponse();
|
|
96862
97178
|
}
|
|
96863
|
-
return validSchemaResponse
|
|
97179
|
+
return validSchemaResponse();
|
|
96864
97180
|
}
|
|
96865
|
-
function validateAllOf
|
|
97181
|
+
function validateAllOf(data, schema, path, document) {
|
|
96866
97182
|
let isValid = true;
|
|
96867
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97183
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96868
97184
|
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
96869
97185
|
const element = schema.allOf[i];
|
|
96870
|
-
const validationResponse = validateJsonSchema
|
|
97186
|
+
const validationResponse = validateJsonSchema(
|
|
96871
97187
|
data,
|
|
96872
97188
|
element,
|
|
96873
97189
|
`${path}.allOf[${i}]`,
|
|
@@ -96880,31 +97196,31 @@ function validateAllOf$1(data, schema, path, document) {
|
|
|
96880
97196
|
}
|
|
96881
97197
|
if (!isValid) {
|
|
96882
97198
|
errorCollector.prepend(
|
|
96883
|
-
new JsonSchemaViolationError
|
|
97199
|
+
new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
|
|
96884
97200
|
);
|
|
96885
97201
|
}
|
|
96886
97202
|
return errorCollector.toValidationResponse();
|
|
96887
97203
|
}
|
|
96888
|
-
function validateNot
|
|
96889
|
-
const validationResponse = validateJsonSchema
|
|
97204
|
+
function validateNot(data, schema, path, document) {
|
|
97205
|
+
const validationResponse = validateJsonSchema(data, schema.not, path, document);
|
|
96890
97206
|
if (validationResponse.isOk()) {
|
|
96891
|
-
return invalidSchemaResponseWithError
|
|
96892
|
-
new JsonSchemaViolationError
|
|
97207
|
+
return invalidSchemaResponseWithError(
|
|
97208
|
+
new JsonSchemaViolationError(
|
|
96893
97209
|
`Data at ${path} validated against the schema of a not clause.`
|
|
96894
97210
|
)
|
|
96895
97211
|
);
|
|
96896
97212
|
}
|
|
96897
|
-
return validSchemaResponse
|
|
97213
|
+
return validSchemaResponse();
|
|
96898
97214
|
}
|
|
96899
|
-
function validateObject
|
|
97215
|
+
function validateObject(data, schema, path, document) {
|
|
96900
97216
|
const schemaKeys = Object.keys(schema.properties);
|
|
96901
97217
|
const requiredKeys = new Set(schema.required);
|
|
96902
97218
|
const schemaKeySet = new Set(schemaKeys);
|
|
96903
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97219
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96904
97220
|
Object.keys(data).forEach((key) => {
|
|
96905
97221
|
if (!schemaKeySet.has(key)) {
|
|
96906
97222
|
errorCollector.append(
|
|
96907
|
-
validateJsonSchema
|
|
97223
|
+
validateJsonSchema(
|
|
96908
97224
|
data[key],
|
|
96909
97225
|
schema.additionalProperties,
|
|
96910
97226
|
`${path}.additionalProperties[${key}]`,
|
|
@@ -96918,14 +97234,14 @@ function validateObject$1(data, schema, path, document) {
|
|
|
96918
97234
|
const keyInData = key in data && data[key] !== void 0;
|
|
96919
97235
|
if (requiredKeys.has(key) && !keyInData) {
|
|
96920
97236
|
errorCollector.add(
|
|
96921
|
-
new MissingRequiredPropertyError
|
|
97237
|
+
new MissingRequiredPropertyError(
|
|
96922
97238
|
`Object at path '${path}' is missing required property '${key}'.`
|
|
96923
97239
|
)
|
|
96924
97240
|
);
|
|
96925
97241
|
}
|
|
96926
97242
|
if (keyInData) {
|
|
96927
97243
|
errorCollector.append(
|
|
96928
|
-
validateJsonSchema
|
|
97244
|
+
validateJsonSchema(
|
|
96929
97245
|
data[key],
|
|
96930
97246
|
schema.properties[key],
|
|
96931
97247
|
`${path}.${key}`,
|
|
@@ -96936,95 +97252,95 @@ function validateObject$1(data, schema, path, document) {
|
|
|
96936
97252
|
}
|
|
96937
97253
|
return errorCollector.toValidationResponse();
|
|
96938
97254
|
}
|
|
96939
|
-
function validateArray
|
|
97255
|
+
function validateArray(data, schema, path, document) {
|
|
96940
97256
|
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
96941
|
-
return invalidSchemaResponseWithError
|
|
96942
|
-
new MinItemsViolationError
|
|
97257
|
+
return invalidSchemaResponseWithError(
|
|
97258
|
+
new MinItemsViolationError(
|
|
96943
97259
|
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
96944
97260
|
)
|
|
96945
97261
|
);
|
|
96946
97262
|
}
|
|
96947
97263
|
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
96948
|
-
return invalidSchemaResponseWithError
|
|
96949
|
-
new MaxItemsViolationError
|
|
97264
|
+
return invalidSchemaResponseWithError(
|
|
97265
|
+
new MaxItemsViolationError(
|
|
96950
97266
|
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
96951
97267
|
)
|
|
96952
97268
|
);
|
|
96953
97269
|
}
|
|
96954
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97270
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96955
97271
|
data.forEach(
|
|
96956
97272
|
(element, index) => errorCollector.append(
|
|
96957
|
-
validateJsonSchema
|
|
97273
|
+
validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
|
|
96958
97274
|
)
|
|
96959
97275
|
);
|
|
96960
97276
|
return errorCollector.toValidationResponse();
|
|
96961
97277
|
}
|
|
96962
|
-
function validateScalar
|
|
97278
|
+
function validateScalar(data, schema, path) {
|
|
96963
97279
|
const schemaDataType = schema.type;
|
|
96964
97280
|
const dataType = typeof data;
|
|
96965
97281
|
if (schemaDataType === "integer") {
|
|
96966
97282
|
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
96967
|
-
return invalidSchemaResponseWithError
|
|
97283
|
+
return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
|
|
96968
97284
|
}
|
|
96969
97285
|
} else if (schemaDataType === "number") {
|
|
96970
97286
|
if (dataType !== "number") {
|
|
96971
|
-
return invalidSchemaResponseWithError
|
|
97287
|
+
return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
|
|
96972
97288
|
}
|
|
96973
97289
|
} else if (schemaDataType === "string") {
|
|
96974
97290
|
if (dataType !== "string") {
|
|
96975
|
-
return invalidSchemaResponseWithError
|
|
97291
|
+
return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
|
|
96976
97292
|
}
|
|
96977
97293
|
} else if (schemaDataType === "boolean") {
|
|
96978
97294
|
if (dataType !== "boolean") {
|
|
96979
|
-
return invalidSchemaResponseWithError
|
|
97295
|
+
return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
|
|
96980
97296
|
}
|
|
96981
97297
|
} else if (schemaDataType === "null") {
|
|
96982
97298
|
if (data !== null) {
|
|
96983
|
-
return invalidSchemaResponseWithError
|
|
97299
|
+
return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
|
|
96984
97300
|
}
|
|
96985
97301
|
} else {
|
|
96986
|
-
return invalidSchemaResponseWithError
|
|
96987
|
-
new IncorrectTypeError
|
|
97302
|
+
return invalidSchemaResponseWithError(
|
|
97303
|
+
new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
|
|
96988
97304
|
);
|
|
96989
97305
|
}
|
|
96990
|
-
return validSchemaResponse
|
|
97306
|
+
return validSchemaResponse();
|
|
96991
97307
|
}
|
|
96992
|
-
function validateRef
|
|
97308
|
+
function validateRef(data, schema, path, document) {
|
|
96993
97309
|
if (!schema.$ref.startsWith("#")) {
|
|
96994
|
-
return invalidSchemaResponseWithError
|
|
96995
|
-
new InvalidRefError
|
|
97310
|
+
return invalidSchemaResponseWithError(
|
|
97311
|
+
new InvalidRefError(
|
|
96996
97312
|
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
96997
97313
|
)
|
|
96998
97314
|
);
|
|
96999
97315
|
}
|
|
97000
97316
|
try {
|
|
97001
|
-
const schemaToValidate = findSchemaAtPath
|
|
97002
|
-
return validateJsonSchema
|
|
97317
|
+
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
97318
|
+
return validateJsonSchema(data, schemaToValidate, path, document);
|
|
97003
97319
|
} catch (e) {
|
|
97004
|
-
return invalidSchemaResponseWithError
|
|
97320
|
+
return invalidSchemaResponseWithError(e);
|
|
97005
97321
|
}
|
|
97006
97322
|
}
|
|
97007
|
-
function validateEnum
|
|
97323
|
+
function validateEnum(data, enumValue, path) {
|
|
97008
97324
|
if (!enumValue.some((value) => deepEquals$1(value, data))) {
|
|
97009
|
-
return invalidSchemaResponseWithError
|
|
97010
|
-
new JsonSchemaViolationError
|
|
97325
|
+
return invalidSchemaResponseWithError(
|
|
97326
|
+
new JsonSchemaViolationError(
|
|
97011
97327
|
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$2(value)).join()}]`
|
|
97012
97328
|
)
|
|
97013
97329
|
);
|
|
97014
97330
|
}
|
|
97015
|
-
return validSchemaResponse
|
|
97331
|
+
return validSchemaResponse();
|
|
97016
97332
|
}
|
|
97017
|
-
function validateConst
|
|
97333
|
+
function validateConst(data, constValue, path) {
|
|
97018
97334
|
if (!deepEquals$1(constValue, data)) {
|
|
97019
|
-
return invalidSchemaResponseWithError
|
|
97020
|
-
new JsonSchemaViolationError
|
|
97335
|
+
return invalidSchemaResponseWithError(
|
|
97336
|
+
new JsonSchemaViolationError(
|
|
97021
97337
|
`Data at ${path} did not match const. Expected: ${stringify$2(constValue)}`
|
|
97022
97338
|
)
|
|
97023
97339
|
);
|
|
97024
97340
|
}
|
|
97025
|
-
return validSchemaResponse
|
|
97341
|
+
return validSchemaResponse();
|
|
97026
97342
|
}
|
|
97027
|
-
function findSchemaAtPath
|
|
97343
|
+
function findSchemaAtPath(document, ref) {
|
|
97028
97344
|
if (ref === "#") return document;
|
|
97029
97345
|
const keys = ref.replace(/^#\//, "").split("/");
|
|
97030
97346
|
let current = document;
|
|
@@ -97032,7 +97348,7 @@ function findSchemaAtPath$1(document, ref) {
|
|
|
97032
97348
|
for (const key of keys) {
|
|
97033
97349
|
path = `${path}/${key}`;
|
|
97034
97350
|
if (current[key] === void 0) {
|
|
97035
|
-
throw new InvalidRefError
|
|
97351
|
+
throw new InvalidRefError(
|
|
97036
97352
|
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
97037
97353
|
);
|
|
97038
97354
|
}
|
|
@@ -97077,7 +97393,7 @@ function logError(error) {
|
|
|
97077
97393
|
*/
|
|
97078
97394
|
function buildBaseImperativeInvoker(getCommand, transformResult) {
|
|
97079
97395
|
return async (...params) => {
|
|
97080
|
-
const command = getCommand({ params, assertIsValid
|
|
97396
|
+
const command = getCommand({ params, assertIsValid });
|
|
97081
97397
|
try {
|
|
97082
97398
|
return command.execute().then((result) => transformResult(result));
|
|
97083
97399
|
} catch (error) {
|
|
@@ -97217,7 +97533,7 @@ function buildServiceDescriptor$4() {
|
|
|
97217
97533
|
class LegacyImperativeBindingsService {
|
|
97218
97534
|
bind(getCommand) {
|
|
97219
97535
|
const invoke = async (config, requestContext, callback) => {
|
|
97220
|
-
const command = getCommand({ config, assertIsValid
|
|
97536
|
+
const command = getCommand({ config, assertIsValid });
|
|
97221
97537
|
try {
|
|
97222
97538
|
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97223
97539
|
const result = await command.execute(overrides);
|
|
@@ -97232,7 +97548,7 @@ class LegacyImperativeBindingsService {
|
|
|
97232
97548
|
}
|
|
97233
97549
|
};
|
|
97234
97550
|
const subscribe = (config, requestContext, callback) => {
|
|
97235
|
-
const command = getCommand({ config, assertIsValid
|
|
97551
|
+
const command = getCommand({ config, assertIsValid });
|
|
97236
97552
|
let unsubscribe = () => {
|
|
97237
97553
|
};
|
|
97238
97554
|
try {
|
|
@@ -97291,13 +97607,7 @@ class GraphQLImperativeBindingsService {
|
|
|
97291
97607
|
}
|
|
97292
97608
|
return await buildBaseImperativeInvoker(getCommand, (result) => this.transformResult(result, exposeRefresh))(...params);
|
|
97293
97609
|
} catch (error) {
|
|
97294
|
-
|
|
97295
|
-
return {
|
|
97296
|
-
data: void 0,
|
|
97297
|
-
errors: [
|
|
97298
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97299
|
-
]
|
|
97300
|
-
};
|
|
97610
|
+
return toGraphQLErrorResponse(error);
|
|
97301
97611
|
}
|
|
97302
97612
|
};
|
|
97303
97613
|
}
|
|
@@ -97391,8 +97701,8 @@ class GraphQLLegacyImperativeBindingsService {
|
|
|
97391
97701
|
config = result.value;
|
|
97392
97702
|
}
|
|
97393
97703
|
}
|
|
97394
|
-
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
97395
97704
|
try {
|
|
97705
|
+
const command = getCommand({ config, assertIsValid });
|
|
97396
97706
|
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97397
97707
|
const result = await command.execute(overrides);
|
|
97398
97708
|
const consumerEmittedData = {
|
|
@@ -97409,13 +97719,7 @@ class GraphQLLegacyImperativeBindingsService {
|
|
|
97409
97719
|
}
|
|
97410
97720
|
callback(consumerEmittedData);
|
|
97411
97721
|
} catch (error) {
|
|
97412
|
-
|
|
97413
|
-
callback({
|
|
97414
|
-
data: void 0,
|
|
97415
|
-
errors: [
|
|
97416
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97417
|
-
]
|
|
97418
|
-
});
|
|
97722
|
+
callback(toGraphQLErrorResponse(error));
|
|
97419
97723
|
}
|
|
97420
97724
|
};
|
|
97421
97725
|
const subscribe = (config, requestContext, callback) => {
|
|
@@ -97433,35 +97737,41 @@ class GraphQLLegacyImperativeBindingsService {
|
|
|
97433
97737
|
config = result.value;
|
|
97434
97738
|
}
|
|
97435
97739
|
}
|
|
97436
|
-
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
97437
97740
|
let unsubscribe = () => {
|
|
97438
97741
|
};
|
|
97439
|
-
|
|
97440
|
-
|
|
97441
|
-
const
|
|
97442
|
-
|
|
97443
|
-
|
|
97444
|
-
|
|
97445
|
-
|
|
97446
|
-
|
|
97447
|
-
|
|
97448
|
-
|
|
97449
|
-
|
|
97450
|
-
|
|
97451
|
-
|
|
97452
|
-
|
|
97453
|
-
|
|
97454
|
-
|
|
97455
|
-
|
|
97456
|
-
|
|
97457
|
-
|
|
97458
|
-
|
|
97459
|
-
|
|
97460
|
-
|
|
97461
|
-
|
|
97462
|
-
|
|
97463
|
-
|
|
97464
|
-
|
|
97742
|
+
try {
|
|
97743
|
+
const command = getCommand({ config, assertIsValid });
|
|
97744
|
+
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97745
|
+
command.execute(overrides).then((result) => {
|
|
97746
|
+
const consumerEmittedData = {
|
|
97747
|
+
data: void 0,
|
|
97748
|
+
errors: void 0
|
|
97749
|
+
};
|
|
97750
|
+
if (result.isOk()) {
|
|
97751
|
+
deepFreeze(result.value);
|
|
97752
|
+
consumerEmittedData.data = result.value.data.data;
|
|
97753
|
+
unsubscribe = result.value.subscribe(
|
|
97754
|
+
(res) => {
|
|
97755
|
+
handleEmit(res, callback);
|
|
97756
|
+
}
|
|
97757
|
+
);
|
|
97758
|
+
} else {
|
|
97759
|
+
const { data, errors } = toGraphQLResponseFromFailure$1(
|
|
97760
|
+
result.error.failure
|
|
97761
|
+
);
|
|
97762
|
+
consumerEmittedData.data = data;
|
|
97763
|
+
consumerEmittedData.errors = errors;
|
|
97764
|
+
unsubscribe = result.error.subscribe(
|
|
97765
|
+
(res) => {
|
|
97766
|
+
handleEmit(res, callback);
|
|
97767
|
+
}
|
|
97768
|
+
);
|
|
97769
|
+
}
|
|
97770
|
+
callback(consumerEmittedData);
|
|
97771
|
+
});
|
|
97772
|
+
} catch (error) {
|
|
97773
|
+
callback(toGraphQLErrorResponse(error));
|
|
97774
|
+
}
|
|
97465
97775
|
return () => {
|
|
97466
97776
|
unsubscribe();
|
|
97467
97777
|
};
|
|
@@ -97495,7 +97805,7 @@ class GraphQLMutationBindingsService {
|
|
|
97495
97805
|
params[0] = result2.value;
|
|
97496
97806
|
}
|
|
97497
97807
|
}
|
|
97498
|
-
const command = getCommand({ params, assertIsValid
|
|
97808
|
+
const command = getCommand({ params, assertIsValid });
|
|
97499
97809
|
const result = await command.execute({ cacheControlConfig: { type: "no-cache" } });
|
|
97500
97810
|
if (result.isOk()) {
|
|
97501
97811
|
deepFreeze(result.value);
|
|
@@ -97504,13 +97814,7 @@ class GraphQLMutationBindingsService {
|
|
|
97504
97814
|
return toGraphQLResponseFromFailure$1(result.error.failure);
|
|
97505
97815
|
}
|
|
97506
97816
|
} catch (error) {
|
|
97507
|
-
|
|
97508
|
-
return {
|
|
97509
|
-
data: void 0,
|
|
97510
|
-
errors: [
|
|
97511
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97512
|
-
]
|
|
97513
|
-
};
|
|
97817
|
+
return toGraphQLErrorResponse(error);
|
|
97514
97818
|
}
|
|
97515
97819
|
};
|
|
97516
97820
|
}
|
|
@@ -97578,8 +97882,8 @@ function sanitize(obj) {
|
|
|
97578
97882
|
return new Sanitizer(obj).sanitize();
|
|
97579
97883
|
}
|
|
97580
97884
|
function isIncompleteConfigError(err) {
|
|
97581
|
-
return err instanceof MissingRequiredPropertyError
|
|
97582
|
-
(validationError) => validationError instanceof MissingRequiredPropertyError
|
|
97885
|
+
return err instanceof MissingRequiredPropertyError || err instanceof JsonSchemaViolationError && err.validationErrors.find(
|
|
97886
|
+
(validationError) => validationError instanceof MissingRequiredPropertyError
|
|
97583
97887
|
) !== void 0;
|
|
97584
97888
|
}
|
|
97585
97889
|
class CommandWireAdapterConstructor {
|
|
@@ -97665,11 +97969,15 @@ class CommandWireAdapterConstructor {
|
|
|
97665
97969
|
}
|
|
97666
97970
|
if (this.configSchema) {
|
|
97667
97971
|
try {
|
|
97668
|
-
assertIsValid
|
|
97972
|
+
assertIsValid(this.config, this.configSchema);
|
|
97669
97973
|
} catch (err) {
|
|
97670
97974
|
if (isIncompleteConfigError(err)) {
|
|
97671
97975
|
return;
|
|
97672
97976
|
}
|
|
97977
|
+
if (err instanceof JsonSchemaViolationError) {
|
|
97978
|
+
this.handleConfigSchemaViolation(err);
|
|
97979
|
+
return;
|
|
97980
|
+
}
|
|
97673
97981
|
throw err;
|
|
97674
97982
|
}
|
|
97675
97983
|
}
|
|
@@ -97722,6 +98030,16 @@ class CommandWireAdapterConstructor {
|
|
|
97722
98030
|
handleExecutionThrow(error) {
|
|
97723
98031
|
emitError(this.callback, error);
|
|
97724
98032
|
}
|
|
98033
|
+
/**
|
|
98034
|
+
* Hook for subclasses to handle a JsonSchemaViolationError from the config
|
|
98035
|
+
* schema assertion. The default re-throws so legacy non-GraphQL wire
|
|
98036
|
+
* adapters keep their existing throw behavior. Overrides are expected to
|
|
98037
|
+
* either emit an error result or re-throw — silently returning will
|
|
98038
|
+
* swallow the error.
|
|
98039
|
+
*/
|
|
98040
|
+
handleConfigSchemaViolation(error) {
|
|
98041
|
+
throw error;
|
|
98042
|
+
}
|
|
97725
98043
|
unsubscribe() {
|
|
97726
98044
|
if (this.unsubscriber) {
|
|
97727
98045
|
this.unsubscriber();
|
|
@@ -97814,16 +98132,14 @@ class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor
|
|
|
97814
98132
|
this.callback(consumerEmittedData);
|
|
97815
98133
|
}
|
|
97816
98134
|
} catch (e) {
|
|
97817
|
-
logError$1(e);
|
|
97818
98135
|
this.handleExecutionThrow(e);
|
|
97819
98136
|
}
|
|
97820
98137
|
}
|
|
97821
|
-
handleExecutionThrow(
|
|
97822
|
-
|
|
97823
|
-
|
|
97824
|
-
|
|
97825
|
-
|
|
97826
|
-
});
|
|
98138
|
+
handleExecutionThrow(error) {
|
|
98139
|
+
this.callback(toGraphQLErrorResponse(error));
|
|
98140
|
+
}
|
|
98141
|
+
handleConfigSchemaViolation(error) {
|
|
98142
|
+
this.handleExecutionThrow(error);
|
|
97827
98143
|
}
|
|
97828
98144
|
update(config, _context) {
|
|
97829
98145
|
this.unsubscribe();
|
|
@@ -98475,9 +98791,11 @@ class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
|
|
|
98475
98791
|
return entries.length > 0 ? this.store.setEntries(entries) : Promise.resolve();
|
|
98476
98792
|
}
|
|
98477
98793
|
find(_query) {
|
|
98794
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
98478
98795
|
throw new Error('find not supported on the NimbusDurableCacheInclusionPolicy');
|
|
98479
98796
|
}
|
|
98480
98797
|
findAndModify(_query, _cacheUpdate) {
|
|
98798
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
98481
98799
|
throw new Error('findAndModify not supported on the NimbusDurableCacheInclusionPolicy');
|
|
98482
98800
|
}
|
|
98483
98801
|
registerListener() {
|
|
@@ -98503,7 +98821,7 @@ class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
|
|
|
98503
98821
|
});
|
|
98504
98822
|
});
|
|
98505
98823
|
}
|
|
98506
|
-
// TODO: onestore doesnt support cache eviction yet
|
|
98824
|
+
// TODO [W-19368859]: onestore doesnt support cache eviction yet
|
|
98507
98825
|
// if (evictKeys.size > 0) {
|
|
98508
98826
|
// evictKeys.forEach((key) => {
|
|
98509
98827
|
// this.services.cache.evict(key);
|
|
@@ -98598,6 +98916,7 @@ class NimbusSqliteOneStoreCache {
|
|
|
98598
98916
|
batchQuery(operations) {
|
|
98599
98917
|
return new Promise((resolve, reject) => {
|
|
98600
98918
|
this.sqlStore.batchOperations(operations, (error) => {
|
|
98919
|
+
// eslint-disable-next-line no-unused-expressions
|
|
98601
98920
|
error ? reject(error) : resolve();
|
|
98602
98921
|
});
|
|
98603
98922
|
});
|
|
@@ -98673,7 +98992,7 @@ function initializeOneStore(sqliteStore, luvio) {
|
|
|
98673
98992
|
buildServiceDescriptor$7(),
|
|
98674
98993
|
buildServiceDescriptor$1$1(),
|
|
98675
98994
|
buildServiceDescriptor$2(),
|
|
98676
|
-
// TODO[
|
|
98995
|
+
// TODO [W-18753648]: See note above.
|
|
98677
98996
|
// buildStreamingCommandServiceDescriptor(),
|
|
98678
98997
|
// buildNdJsonServiceDescriptor(),
|
|
98679
98998
|
// buildSseCommandServiceDescriptor(),
|
|
@@ -98932,378 +99251,12 @@ register$1({
|
|
|
98932
99251
|
id: '@salesforce/lds-network-adapter',
|
|
98933
99252
|
instrument: instrument$2,
|
|
98934
99253
|
});
|
|
98935
|
-
// version: 1.
|
|
99254
|
+
// version: 1.434.0-d8deb0d4ea
|
|
98936
99255
|
|
|
98937
99256
|
const { create: create$2, keys: keys$2 } = Object;
|
|
98938
99257
|
const { stringify, parse } = JSON;
|
|
98939
99258
|
const { isArray: isArray$3 } = Array;
|
|
98940
99259
|
|
|
98941
|
-
/*!
|
|
98942
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
98943
|
-
* All rights reserved.
|
|
98944
|
-
* For full license text, see the LICENSE.txt file
|
|
98945
|
-
*/
|
|
98946
|
-
class JsonSchemaViolationError extends Error {
|
|
98947
|
-
constructor(message, validationErrors) {
|
|
98948
|
-
super(message);
|
|
98949
|
-
this.validationErrors = [];
|
|
98950
|
-
this.validationErrors = validationErrors || [];
|
|
98951
|
-
}
|
|
98952
|
-
}
|
|
98953
|
-
class MinItemsViolationError extends JsonSchemaViolationError {
|
|
98954
|
-
}
|
|
98955
|
-
class MaxItemsViolationError extends JsonSchemaViolationError {
|
|
98956
|
-
}
|
|
98957
|
-
class IncorrectTypeError extends JsonSchemaViolationError {
|
|
98958
|
-
}
|
|
98959
|
-
class AdditionalPropertiesError extends JsonSchemaViolationError {
|
|
98960
|
-
}
|
|
98961
|
-
class MissingRequiredPropertyError extends JsonSchemaViolationError {
|
|
98962
|
-
}
|
|
98963
|
-
class InvalidRefError extends JsonSchemaViolationError {
|
|
98964
|
-
}
|
|
98965
|
-
class JsonSchemaErrorCollector {
|
|
98966
|
-
constructor() {
|
|
98967
|
-
this.errors = [];
|
|
98968
|
-
}
|
|
98969
|
-
add(error) {
|
|
98970
|
-
this.errors.push(error);
|
|
98971
|
-
}
|
|
98972
|
-
append(response) {
|
|
98973
|
-
if (response.isErr()) {
|
|
98974
|
-
this.errors.push(...response.error);
|
|
98975
|
-
}
|
|
98976
|
-
}
|
|
98977
|
-
hasErrors() {
|
|
98978
|
-
return this.errors.length > 0;
|
|
98979
|
-
}
|
|
98980
|
-
prepend(error) {
|
|
98981
|
-
this.errors.unshift(error);
|
|
98982
|
-
}
|
|
98983
|
-
toValidationResponse() {
|
|
98984
|
-
return !this.hasErrors() ? ok$4(true) : err$4(this.errors);
|
|
98985
|
-
}
|
|
98986
|
-
}
|
|
98987
|
-
function createThrowableError(errors) {
|
|
98988
|
-
if (errors[0] instanceof MinItemsViolationError) {
|
|
98989
|
-
return new MinItemsViolationError(errors[0].message, errors);
|
|
98990
|
-
}
|
|
98991
|
-
if (errors[0] instanceof MaxItemsViolationError) {
|
|
98992
|
-
return new MaxItemsViolationError(errors[0].message, errors);
|
|
98993
|
-
}
|
|
98994
|
-
if (errors[0] instanceof IncorrectTypeError) {
|
|
98995
|
-
return new IncorrectTypeError(errors[0].message, errors);
|
|
98996
|
-
}
|
|
98997
|
-
if (errors[0] instanceof AdditionalPropertiesError) {
|
|
98998
|
-
return new AdditionalPropertiesError(errors[0].message, errors);
|
|
98999
|
-
}
|
|
99000
|
-
if (errors[0] instanceof MissingRequiredPropertyError) {
|
|
99001
|
-
return new MissingRequiredPropertyError(errors[0].message, errors);
|
|
99002
|
-
}
|
|
99003
|
-
if (errors[0] instanceof InvalidRefError) {
|
|
99004
|
-
return new InvalidRefError(errors[0].message, errors);
|
|
99005
|
-
}
|
|
99006
|
-
return new JsonSchemaViolationError(errors[0].message, errors);
|
|
99007
|
-
}
|
|
99008
|
-
function assertIsValid(data, schema) {
|
|
99009
|
-
const validationResponse = validateJsonSchema(data, schema);
|
|
99010
|
-
if (validationResponse.isErr()) {
|
|
99011
|
-
throw createThrowableError(validationResponse.error);
|
|
99012
|
-
}
|
|
99013
|
-
}
|
|
99014
|
-
function incorrectTypeError(expected, actual, path) {
|
|
99015
|
-
return new IncorrectTypeError(
|
|
99016
|
-
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
99017
|
-
);
|
|
99018
|
-
}
|
|
99019
|
-
function validSchemaResponse() {
|
|
99020
|
-
return ok$4(true);
|
|
99021
|
-
}
|
|
99022
|
-
function invalidSchemaResponseWithError(error) {
|
|
99023
|
-
return err$4([error]);
|
|
99024
|
-
}
|
|
99025
|
-
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
99026
|
-
if (schema === true) return validSchemaResponse();
|
|
99027
|
-
if (schema === false)
|
|
99028
|
-
return invalidSchemaResponseWithError(
|
|
99029
|
-
new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
|
|
99030
|
-
);
|
|
99031
|
-
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
99032
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99033
|
-
if ("anyOf" in schema) {
|
|
99034
|
-
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
99035
|
-
} else if ("oneOf" in schema) {
|
|
99036
|
-
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
99037
|
-
} else if ("allOf" in schema) {
|
|
99038
|
-
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
99039
|
-
} else if ("not" in schema) {
|
|
99040
|
-
errorCollector.append(validateNot(data, schema, path, document));
|
|
99041
|
-
} else if ("$ref" in schema) {
|
|
99042
|
-
errorCollector.append(validateRef(data, schema, path, document));
|
|
99043
|
-
} else if ("type" in schema) {
|
|
99044
|
-
if (schema.type === "object") {
|
|
99045
|
-
if (dataType !== "object") {
|
|
99046
|
-
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
99047
|
-
} else {
|
|
99048
|
-
errorCollector.append(
|
|
99049
|
-
validateObject(data, schema, path, document)
|
|
99050
|
-
);
|
|
99051
|
-
}
|
|
99052
|
-
} else if (schema.type === "array") {
|
|
99053
|
-
if (dataType !== "array") {
|
|
99054
|
-
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
99055
|
-
} else {
|
|
99056
|
-
errorCollector.append(
|
|
99057
|
-
validateArray(data, schema, path, document)
|
|
99058
|
-
);
|
|
99059
|
-
}
|
|
99060
|
-
} else {
|
|
99061
|
-
errorCollector.append(
|
|
99062
|
-
validateScalar(data, schema, path)
|
|
99063
|
-
);
|
|
99064
|
-
}
|
|
99065
|
-
}
|
|
99066
|
-
if (schema.enum) {
|
|
99067
|
-
errorCollector.append(validateEnum(data, schema.enum, path));
|
|
99068
|
-
}
|
|
99069
|
-
if (schema.const) {
|
|
99070
|
-
errorCollector.append(validateConst(data, schema.const, path));
|
|
99071
|
-
}
|
|
99072
|
-
return errorCollector.toValidationResponse();
|
|
99073
|
-
}
|
|
99074
|
-
function validateAnyOf(data, schema, path, document) {
|
|
99075
|
-
let isValid = false;
|
|
99076
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99077
|
-
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
99078
|
-
const element = schema.anyOf[i];
|
|
99079
|
-
const validationResponse = validateJsonSchema(
|
|
99080
|
-
data,
|
|
99081
|
-
element,
|
|
99082
|
-
`${path}.anyOf[${i}]`,
|
|
99083
|
-
document
|
|
99084
|
-
);
|
|
99085
|
-
if (validationResponse.isOk()) {
|
|
99086
|
-
isValid = true;
|
|
99087
|
-
break;
|
|
99088
|
-
} else {
|
|
99089
|
-
errorCollector.append(validationResponse);
|
|
99090
|
-
}
|
|
99091
|
-
}
|
|
99092
|
-
if (!isValid) {
|
|
99093
|
-
errorCollector.prepend(
|
|
99094
|
-
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
|
|
99095
|
-
);
|
|
99096
|
-
return errorCollector.toValidationResponse();
|
|
99097
|
-
}
|
|
99098
|
-
return validSchemaResponse();
|
|
99099
|
-
}
|
|
99100
|
-
function validateOneOf(data, schema, path, document) {
|
|
99101
|
-
let validSubShemaPaths = [];
|
|
99102
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99103
|
-
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
99104
|
-
const element = schema.oneOf[i];
|
|
99105
|
-
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
99106
|
-
const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
|
|
99107
|
-
if (validationResponse.isOk()) {
|
|
99108
|
-
validSubShemaPaths.push(oneOfPath);
|
|
99109
|
-
} else {
|
|
99110
|
-
errorCollector.append(validationResponse);
|
|
99111
|
-
}
|
|
99112
|
-
}
|
|
99113
|
-
if (validSubShemaPaths.length === 0) {
|
|
99114
|
-
errorCollector.prepend(
|
|
99115
|
-
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
|
|
99116
|
-
);
|
|
99117
|
-
return errorCollector.toValidationResponse();
|
|
99118
|
-
} else if (validSubShemaPaths.length > 1) {
|
|
99119
|
-
errorCollector.prepend(
|
|
99120
|
-
new JsonSchemaViolationError(
|
|
99121
|
-
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
99122
|
-
)
|
|
99123
|
-
);
|
|
99124
|
-
return errorCollector.toValidationResponse();
|
|
99125
|
-
}
|
|
99126
|
-
return validSchemaResponse();
|
|
99127
|
-
}
|
|
99128
|
-
function validateAllOf(data, schema, path, document) {
|
|
99129
|
-
let isValid = true;
|
|
99130
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99131
|
-
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
99132
|
-
const element = schema.allOf[i];
|
|
99133
|
-
const validationResponse = validateJsonSchema(
|
|
99134
|
-
data,
|
|
99135
|
-
element,
|
|
99136
|
-
`${path}.allOf[${i}]`,
|
|
99137
|
-
document
|
|
99138
|
-
);
|
|
99139
|
-
if (!validationResponse.isOk()) {
|
|
99140
|
-
errorCollector.append(validationResponse);
|
|
99141
|
-
isValid = false;
|
|
99142
|
-
}
|
|
99143
|
-
}
|
|
99144
|
-
if (!isValid) {
|
|
99145
|
-
errorCollector.prepend(
|
|
99146
|
-
new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
|
|
99147
|
-
);
|
|
99148
|
-
}
|
|
99149
|
-
return errorCollector.toValidationResponse();
|
|
99150
|
-
}
|
|
99151
|
-
function validateNot(data, schema, path, document) {
|
|
99152
|
-
const validationResponse = validateJsonSchema(data, schema.not, path, document);
|
|
99153
|
-
if (validationResponse.isOk()) {
|
|
99154
|
-
return invalidSchemaResponseWithError(
|
|
99155
|
-
new JsonSchemaViolationError(
|
|
99156
|
-
`Data at ${path} validated against the schema of a not clause.`
|
|
99157
|
-
)
|
|
99158
|
-
);
|
|
99159
|
-
}
|
|
99160
|
-
return validSchemaResponse();
|
|
99161
|
-
}
|
|
99162
|
-
function validateObject(data, schema, path, document) {
|
|
99163
|
-
const schemaKeys = Object.keys(schema.properties);
|
|
99164
|
-
const requiredKeys = new Set(schema.required);
|
|
99165
|
-
const schemaKeySet = new Set(schemaKeys);
|
|
99166
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99167
|
-
Object.keys(data).forEach((key) => {
|
|
99168
|
-
if (!schemaKeySet.has(key)) {
|
|
99169
|
-
errorCollector.append(
|
|
99170
|
-
validateJsonSchema(
|
|
99171
|
-
data[key],
|
|
99172
|
-
schema.additionalProperties,
|
|
99173
|
-
`${path}.additionalProperties[${key}]`,
|
|
99174
|
-
document
|
|
99175
|
-
)
|
|
99176
|
-
);
|
|
99177
|
-
}
|
|
99178
|
-
});
|
|
99179
|
-
for (let i = 0, length = schemaKeys.length; i < length; i++) {
|
|
99180
|
-
const key = schemaKeys[i];
|
|
99181
|
-
const keyInData = key in data && data[key] !== void 0;
|
|
99182
|
-
if (requiredKeys.has(key) && !keyInData) {
|
|
99183
|
-
errorCollector.add(
|
|
99184
|
-
new MissingRequiredPropertyError(
|
|
99185
|
-
`Object at path '${path}' is missing required property '${key}'.`
|
|
99186
|
-
)
|
|
99187
|
-
);
|
|
99188
|
-
}
|
|
99189
|
-
if (keyInData) {
|
|
99190
|
-
errorCollector.append(
|
|
99191
|
-
validateJsonSchema(
|
|
99192
|
-
data[key],
|
|
99193
|
-
schema.properties[key],
|
|
99194
|
-
`${path}.${key}`,
|
|
99195
|
-
document
|
|
99196
|
-
)
|
|
99197
|
-
);
|
|
99198
|
-
}
|
|
99199
|
-
}
|
|
99200
|
-
return errorCollector.toValidationResponse();
|
|
99201
|
-
}
|
|
99202
|
-
function validateArray(data, schema, path, document) {
|
|
99203
|
-
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
99204
|
-
return invalidSchemaResponseWithError(
|
|
99205
|
-
new MinItemsViolationError(
|
|
99206
|
-
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
99207
|
-
)
|
|
99208
|
-
);
|
|
99209
|
-
}
|
|
99210
|
-
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
99211
|
-
return invalidSchemaResponseWithError(
|
|
99212
|
-
new MaxItemsViolationError(
|
|
99213
|
-
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
99214
|
-
)
|
|
99215
|
-
);
|
|
99216
|
-
}
|
|
99217
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99218
|
-
data.forEach(
|
|
99219
|
-
(element, index) => errorCollector.append(
|
|
99220
|
-
validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
|
|
99221
|
-
)
|
|
99222
|
-
);
|
|
99223
|
-
return errorCollector.toValidationResponse();
|
|
99224
|
-
}
|
|
99225
|
-
function validateScalar(data, schema, path) {
|
|
99226
|
-
const schemaDataType = schema.type;
|
|
99227
|
-
const dataType = typeof data;
|
|
99228
|
-
if (schemaDataType === "integer") {
|
|
99229
|
-
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
99230
|
-
return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
|
|
99231
|
-
}
|
|
99232
|
-
} else if (schemaDataType === "number") {
|
|
99233
|
-
if (dataType !== "number") {
|
|
99234
|
-
return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
|
|
99235
|
-
}
|
|
99236
|
-
} else if (schemaDataType === "string") {
|
|
99237
|
-
if (dataType !== "string") {
|
|
99238
|
-
return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
|
|
99239
|
-
}
|
|
99240
|
-
} else if (schemaDataType === "boolean") {
|
|
99241
|
-
if (dataType !== "boolean") {
|
|
99242
|
-
return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
|
|
99243
|
-
}
|
|
99244
|
-
} else if (schemaDataType === "null") {
|
|
99245
|
-
if (data !== null) {
|
|
99246
|
-
return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
|
|
99247
|
-
}
|
|
99248
|
-
} else {
|
|
99249
|
-
return invalidSchemaResponseWithError(
|
|
99250
|
-
new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
|
|
99251
|
-
);
|
|
99252
|
-
}
|
|
99253
|
-
return validSchemaResponse();
|
|
99254
|
-
}
|
|
99255
|
-
function validateRef(data, schema, path, document) {
|
|
99256
|
-
if (!schema.$ref.startsWith("#")) {
|
|
99257
|
-
return invalidSchemaResponseWithError(
|
|
99258
|
-
new InvalidRefError(
|
|
99259
|
-
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
99260
|
-
)
|
|
99261
|
-
);
|
|
99262
|
-
}
|
|
99263
|
-
try {
|
|
99264
|
-
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
99265
|
-
return validateJsonSchema(data, schemaToValidate, path, document);
|
|
99266
|
-
} catch (e) {
|
|
99267
|
-
return invalidSchemaResponseWithError(e);
|
|
99268
|
-
}
|
|
99269
|
-
}
|
|
99270
|
-
function validateEnum(data, enumValue, path) {
|
|
99271
|
-
if (!enumValue.some((value) => deepEquals$2(value, data))) {
|
|
99272
|
-
return invalidSchemaResponseWithError(
|
|
99273
|
-
new JsonSchemaViolationError(
|
|
99274
|
-
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
|
|
99275
|
-
)
|
|
99276
|
-
);
|
|
99277
|
-
}
|
|
99278
|
-
return validSchemaResponse();
|
|
99279
|
-
}
|
|
99280
|
-
function validateConst(data, constValue, path) {
|
|
99281
|
-
if (!deepEquals$2(constValue, data)) {
|
|
99282
|
-
return invalidSchemaResponseWithError(
|
|
99283
|
-
new JsonSchemaViolationError(
|
|
99284
|
-
`Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
|
|
99285
|
-
)
|
|
99286
|
-
);
|
|
99287
|
-
}
|
|
99288
|
-
return validSchemaResponse();
|
|
99289
|
-
}
|
|
99290
|
-
function findSchemaAtPath(document, ref) {
|
|
99291
|
-
if (ref === "#") return document;
|
|
99292
|
-
const keys = ref.replace(/^#\//, "").split("/");
|
|
99293
|
-
let current = document;
|
|
99294
|
-
let path = "#";
|
|
99295
|
-
for (const key of keys) {
|
|
99296
|
-
path = `${path}/${key}`;
|
|
99297
|
-
if (current[key] === void 0) {
|
|
99298
|
-
throw new InvalidRefError(
|
|
99299
|
-
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
99300
|
-
);
|
|
99301
|
-
}
|
|
99302
|
-
current = current[key];
|
|
99303
|
-
}
|
|
99304
|
-
return current;
|
|
99305
|
-
}
|
|
99306
|
-
|
|
99307
99260
|
/*!
|
|
99308
99261
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
99309
99262
|
* All rights reserved.
|
|
@@ -99352,35 +99305,35 @@ function extractValue(valueNode, variableDefinitions, expectedType) {
|
|
|
99352
99305
|
function extractVariableValue(variableName, variableDefinitions) {
|
|
99353
99306
|
const variable = variableDefinitions[variableName];
|
|
99354
99307
|
if (!variable) {
|
|
99355
|
-
return err$
|
|
99308
|
+
return err$3(
|
|
99356
99309
|
new Error(`Variable '${variableName}' was used in the query but was not defined`)
|
|
99357
99310
|
);
|
|
99358
99311
|
}
|
|
99359
99312
|
if (variable.value !== void 0) {
|
|
99360
|
-
return ok$
|
|
99313
|
+
return ok$3(variable.value);
|
|
99361
99314
|
}
|
|
99362
99315
|
if (variable.definition.defaultValue) {
|
|
99363
99316
|
return extractValue(variable.definition.defaultValue, variableDefinitions);
|
|
99364
99317
|
}
|
|
99365
|
-
return ok$
|
|
99318
|
+
return ok$3(void 0);
|
|
99366
99319
|
}
|
|
99367
99320
|
function validateExpectedType(value, expectedType) {
|
|
99368
99321
|
if (!expectedType) {
|
|
99369
|
-
return ok$
|
|
99322
|
+
return ok$3(value);
|
|
99370
99323
|
}
|
|
99371
99324
|
if (value === null) {
|
|
99372
99325
|
if (expectedType.nullable) {
|
|
99373
|
-
return ok$
|
|
99326
|
+
return ok$3(value);
|
|
99374
99327
|
} else {
|
|
99375
|
-
return err$
|
|
99328
|
+
return err$3(new Error(`Expected ${expectedType.type}, but got null`));
|
|
99376
99329
|
}
|
|
99377
99330
|
}
|
|
99378
99331
|
const actualType = typeof value;
|
|
99379
99332
|
if (actualType === expectedType.type) {
|
|
99380
|
-
return ok$
|
|
99333
|
+
return ok$3(value);
|
|
99381
99334
|
}
|
|
99382
99335
|
const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
|
|
99383
|
-
return err$
|
|
99336
|
+
return err$3(
|
|
99384
99337
|
new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
|
|
99385
99338
|
);
|
|
99386
99339
|
}
|
|
@@ -99423,10 +99376,10 @@ function findExecutableOperation(input) {
|
|
|
99423
99376
|
(def) => def.kind === Kind$1.OPERATION_DEFINITION
|
|
99424
99377
|
);
|
|
99425
99378
|
if (operations.length === 0) {
|
|
99426
|
-
return err$
|
|
99379
|
+
return err$3(new Error("No operations found in query"));
|
|
99427
99380
|
}
|
|
99428
99381
|
if (operations.length === 1 && !input.operationName) {
|
|
99429
|
-
return ok$
|
|
99382
|
+
return ok$3(operations[0]);
|
|
99430
99383
|
}
|
|
99431
99384
|
if (input.operationName) {
|
|
99432
99385
|
const specifiedOperation = operations.find((op) => {
|
|
@@ -99434,16 +99387,16 @@ function findExecutableOperation(input) {
|
|
|
99434
99387
|
return ((_a = op.name) == null ? void 0 : _a.value) === input.operationName;
|
|
99435
99388
|
});
|
|
99436
99389
|
if (specifiedOperation) {
|
|
99437
|
-
return ok$
|
|
99390
|
+
return ok$3(specifiedOperation);
|
|
99438
99391
|
}
|
|
99439
|
-
return err$
|
|
99392
|
+
return err$3(new Error(`Operation "${input.operationName}" not found in query`));
|
|
99440
99393
|
}
|
|
99441
|
-
return err$
|
|
99394
|
+
return err$3(new Error("Multiple operations found in query, and no operation name provided"));
|
|
99442
99395
|
}
|
|
99443
99396
|
function buildGraphQLInputExtension(input) {
|
|
99444
99397
|
const operationResult = findExecutableOperation(input);
|
|
99445
99398
|
if (operationResult.isErr()) {
|
|
99446
|
-
return err$
|
|
99399
|
+
return err$3(operationResult.error);
|
|
99447
99400
|
}
|
|
99448
99401
|
const operation = operationResult.value;
|
|
99449
99402
|
const selections = operation.selectionSet.selections;
|
|
@@ -99460,7 +99413,7 @@ function buildGraphQLInputExtension(input) {
|
|
|
99460
99413
|
prev[fragment.name.value] = fragment;
|
|
99461
99414
|
return prev;
|
|
99462
99415
|
}, {});
|
|
99463
|
-
return ok$
|
|
99416
|
+
return ok$3({
|
|
99464
99417
|
selections,
|
|
99465
99418
|
request: { definitions: { variables, fragments } },
|
|
99466
99419
|
parentFieldSelection: void 0
|
|
@@ -99618,13 +99571,13 @@ function collectFieldNames(selections, fragments) {
|
|
|
99618
99571
|
}
|
|
99619
99572
|
function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
|
|
99620
99573
|
if (fieldArguments === void 0 || fieldArguments.length === 0) {
|
|
99621
|
-
return ok$
|
|
99574
|
+
return ok$3(canonicalFieldName);
|
|
99622
99575
|
}
|
|
99623
99576
|
const formattedArguments = {};
|
|
99624
99577
|
for (const arg of fieldArguments) {
|
|
99625
99578
|
const result = extractValue(arg.value, variables);
|
|
99626
99579
|
if (result.isErr()) {
|
|
99627
|
-
return err$
|
|
99580
|
+
return err$3(
|
|
99628
99581
|
new Error(
|
|
99629
99582
|
`Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
|
|
99630
99583
|
)
|
|
@@ -99632,7 +99585,7 @@ function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
|
|
|
99632
99585
|
}
|
|
99633
99586
|
formattedArguments[arg.name.value] = result.value;
|
|
99634
99587
|
}
|
|
99635
|
-
return ok$
|
|
99588
|
+
return ok$3(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
|
|
99636
99589
|
}
|
|
99637
99590
|
({
|
|
99638
99591
|
kind: Kind$1.FIELD,
|
|
@@ -99657,17 +99610,17 @@ function extractIfArgument(directive, variables, directiveName) {
|
|
|
99657
99610
|
var _a;
|
|
99658
99611
|
const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
|
|
99659
99612
|
if (!ifArg) {
|
|
99660
|
-
return err$
|
|
99613
|
+
return err$3(new Error(`@${directiveName} directive requires an 'if' argument`));
|
|
99661
99614
|
}
|
|
99662
99615
|
const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
|
|
99663
99616
|
if (result.isErr()) {
|
|
99664
|
-
return err$
|
|
99617
|
+
return err$3(result.error);
|
|
99665
99618
|
}
|
|
99666
|
-
return ok$
|
|
99619
|
+
return ok$3(result.value);
|
|
99667
99620
|
}
|
|
99668
99621
|
function shouldSkip(selection, variables) {
|
|
99669
99622
|
if (!selection.directives || selection.directives.length === 0) {
|
|
99670
|
-
return ok$
|
|
99623
|
+
return ok$3(false);
|
|
99671
99624
|
}
|
|
99672
99625
|
for (const directive of selection.directives) {
|
|
99673
99626
|
if (directive.name.value === "skip") {
|
|
@@ -99676,7 +99629,7 @@ function shouldSkip(selection, variables) {
|
|
|
99676
99629
|
return ifResult;
|
|
99677
99630
|
}
|
|
99678
99631
|
if (ifResult.value === true) {
|
|
99679
|
-
return ok$
|
|
99632
|
+
return ok$3(true);
|
|
99680
99633
|
}
|
|
99681
99634
|
}
|
|
99682
99635
|
if (directive.name.value === "include") {
|
|
@@ -99685,11 +99638,11 @@ function shouldSkip(selection, variables) {
|
|
|
99685
99638
|
return ifResult;
|
|
99686
99639
|
}
|
|
99687
99640
|
if (ifResult.value === false) {
|
|
99688
|
-
return ok$
|
|
99641
|
+
return ok$3(true);
|
|
99689
99642
|
}
|
|
99690
99643
|
}
|
|
99691
99644
|
}
|
|
99692
|
-
return ok$
|
|
99645
|
+
return ok$3(false);
|
|
99693
99646
|
}
|
|
99694
99647
|
class BaseScalarFieldDef {
|
|
99695
99648
|
constructor(nullable) {
|
|
@@ -99697,11 +99650,11 @@ class BaseScalarFieldDef {
|
|
|
99697
99650
|
}
|
|
99698
99651
|
write(_cache, input) {
|
|
99699
99652
|
if (input.data === void 0) {
|
|
99700
|
-
return ok$
|
|
99653
|
+
return ok$3({ type: "missing" });
|
|
99701
99654
|
}
|
|
99702
99655
|
if (input.data === null) {
|
|
99703
99656
|
if (!this.nullable) {
|
|
99704
|
-
return err$
|
|
99657
|
+
return err$3([
|
|
99705
99658
|
{
|
|
99706
99659
|
type: "unknown",
|
|
99707
99660
|
error: new Error(
|
|
@@ -99711,14 +99664,14 @@ class BaseScalarFieldDef {
|
|
|
99711
99664
|
]);
|
|
99712
99665
|
}
|
|
99713
99666
|
}
|
|
99714
|
-
return ok$
|
|
99667
|
+
return ok$3({ type: "data", data: input.data });
|
|
99715
99668
|
}
|
|
99716
99669
|
read(_cache, input) {
|
|
99717
99670
|
const normalizedData = input.normalizedData;
|
|
99718
99671
|
if (normalizedData.type === "missing") {
|
|
99719
|
-
return ok$
|
|
99672
|
+
return ok$3(void 0);
|
|
99720
99673
|
}
|
|
99721
|
-
return ok$
|
|
99674
|
+
return ok$3(normalizedData.data);
|
|
99722
99675
|
}
|
|
99723
99676
|
augmentSelections(input) {
|
|
99724
99677
|
return input;
|
|
@@ -99740,11 +99693,11 @@ class BaseArrayFieldDef {
|
|
|
99740
99693
|
}
|
|
99741
99694
|
write(cache, input) {
|
|
99742
99695
|
if (input.data === void 0) {
|
|
99743
|
-
return ok$
|
|
99696
|
+
return ok$3({ type: "missing" });
|
|
99744
99697
|
}
|
|
99745
99698
|
if (input.data === null) {
|
|
99746
99699
|
if (!this.nullable) {
|
|
99747
|
-
return err$
|
|
99700
|
+
return err$3([
|
|
99748
99701
|
{
|
|
99749
99702
|
type: "unknown",
|
|
99750
99703
|
error: new Error(
|
|
@@ -99753,10 +99706,10 @@ class BaseArrayFieldDef {
|
|
|
99753
99706
|
}
|
|
99754
99707
|
]);
|
|
99755
99708
|
}
|
|
99756
|
-
return ok$
|
|
99709
|
+
return ok$3({ type: "data", data: input.data });
|
|
99757
99710
|
}
|
|
99758
99711
|
if (!Array.isArray(input.data)) {
|
|
99759
|
-
return err$
|
|
99712
|
+
return err$3([
|
|
99760
99713
|
{
|
|
99761
99714
|
type: "unknown",
|
|
99762
99715
|
error: new Error(
|
|
@@ -99784,18 +99737,18 @@ class BaseArrayFieldDef {
|
|
|
99784
99737
|
}
|
|
99785
99738
|
});
|
|
99786
99739
|
if (arrayNormalizationErrors.length > 0) {
|
|
99787
|
-
return err$
|
|
99740
|
+
return err$3(arrayNormalizationErrors);
|
|
99788
99741
|
}
|
|
99789
|
-
return ok$
|
|
99742
|
+
return ok$3({ type: "data", data: normalizedArray });
|
|
99790
99743
|
}
|
|
99791
99744
|
read(cache, input) {
|
|
99792
99745
|
const normalizedData = input.normalizedData;
|
|
99793
99746
|
if (normalizedData.type === "missing") {
|
|
99794
|
-
return ok$
|
|
99747
|
+
return ok$3(void 0);
|
|
99795
99748
|
}
|
|
99796
99749
|
if (normalizedData.data === null) {
|
|
99797
99750
|
if (!this.nullable) {
|
|
99798
|
-
return err$
|
|
99751
|
+
return err$3([
|
|
99799
99752
|
{
|
|
99800
99753
|
type: "unknown",
|
|
99801
99754
|
error: new Error(
|
|
@@ -99804,10 +99757,10 @@ class BaseArrayFieldDef {
|
|
|
99804
99757
|
}
|
|
99805
99758
|
]);
|
|
99806
99759
|
}
|
|
99807
|
-
return ok$
|
|
99760
|
+
return ok$3({ type: "data", data: null });
|
|
99808
99761
|
}
|
|
99809
99762
|
if (!Array.isArray(normalizedData.data)) {
|
|
99810
|
-
return err$
|
|
99763
|
+
return err$3([
|
|
99811
99764
|
{
|
|
99812
99765
|
type: "unknown",
|
|
99813
99766
|
error: new Error(
|
|
@@ -99832,9 +99785,9 @@ class BaseArrayFieldDef {
|
|
|
99832
99785
|
}
|
|
99833
99786
|
});
|
|
99834
99787
|
if (arrayDenormalizationErrors.length > 0) {
|
|
99835
|
-
return err$
|
|
99788
|
+
return err$3(arrayDenormalizationErrors);
|
|
99836
99789
|
}
|
|
99837
|
-
return ok$
|
|
99790
|
+
return ok$3(denormalizedArray);
|
|
99838
99791
|
}
|
|
99839
99792
|
}
|
|
99840
99793
|
class BaseObjectFieldDef {
|
|
@@ -99851,7 +99804,7 @@ class BaseObjectFieldDef {
|
|
|
99851
99804
|
write(cache, input) {
|
|
99852
99805
|
var _a;
|
|
99853
99806
|
if (!input.selection.selectionSet) {
|
|
99854
|
-
return err$
|
|
99807
|
+
return err$3([
|
|
99855
99808
|
{
|
|
99856
99809
|
type: "unknown",
|
|
99857
99810
|
error: new Error(
|
|
@@ -99861,11 +99814,11 @@ class BaseObjectFieldDef {
|
|
|
99861
99814
|
]);
|
|
99862
99815
|
}
|
|
99863
99816
|
if (input.data === void 0) {
|
|
99864
|
-
return ok$
|
|
99817
|
+
return ok$3({ type: "missing" });
|
|
99865
99818
|
}
|
|
99866
99819
|
if (input.data === null) {
|
|
99867
99820
|
if (!this.nullable) {
|
|
99868
|
-
return err$
|
|
99821
|
+
return err$3([
|
|
99869
99822
|
{
|
|
99870
99823
|
type: "unknown",
|
|
99871
99824
|
error: new Error(
|
|
@@ -99874,7 +99827,7 @@ class BaseObjectFieldDef {
|
|
|
99874
99827
|
}
|
|
99875
99828
|
]);
|
|
99876
99829
|
}
|
|
99877
|
-
return ok$
|
|
99830
|
+
return ok$3({ type: "data", data: null });
|
|
99878
99831
|
}
|
|
99879
99832
|
const writeResult = this.repository.write(cache, {
|
|
99880
99833
|
...input,
|
|
@@ -99887,12 +99840,12 @@ class BaseObjectFieldDef {
|
|
|
99887
99840
|
if (writeResult.isErr()) {
|
|
99888
99841
|
return writeResult;
|
|
99889
99842
|
}
|
|
99890
|
-
return ok$
|
|
99843
|
+
return ok$3({ type: "data", data: writeResult.value });
|
|
99891
99844
|
}
|
|
99892
99845
|
read(cache, input) {
|
|
99893
99846
|
var _a;
|
|
99894
99847
|
if (!input.selection.selectionSet) {
|
|
99895
|
-
return err$
|
|
99848
|
+
return err$3([
|
|
99896
99849
|
{
|
|
99897
99850
|
type: "unknown",
|
|
99898
99851
|
error: new Error(
|
|
@@ -99903,11 +99856,11 @@ class BaseObjectFieldDef {
|
|
|
99903
99856
|
}
|
|
99904
99857
|
const normalizedData = input.normalizedData;
|
|
99905
99858
|
if (normalizedData.type === "missing") {
|
|
99906
|
-
return ok$
|
|
99859
|
+
return ok$3(void 0);
|
|
99907
99860
|
}
|
|
99908
99861
|
if (normalizedData.data === null) {
|
|
99909
99862
|
if (!this.nullable) {
|
|
99910
|
-
return err$
|
|
99863
|
+
return err$3([
|
|
99911
99864
|
{
|
|
99912
99865
|
type: "unknown",
|
|
99913
99866
|
error: new Error(
|
|
@@ -99916,7 +99869,7 @@ class BaseObjectFieldDef {
|
|
|
99916
99869
|
}
|
|
99917
99870
|
]);
|
|
99918
99871
|
}
|
|
99919
|
-
return ok$
|
|
99872
|
+
return ok$3(null);
|
|
99920
99873
|
}
|
|
99921
99874
|
return this.repository.read(cache, {
|
|
99922
99875
|
...input,
|
|
@@ -100199,7 +100152,7 @@ class BaseGraphQLTypeRepository {
|
|
|
100199
100152
|
var _a;
|
|
100200
100153
|
const fieldDef = this.getFieldDef(input, selection);
|
|
100201
100154
|
if (!fieldDef) {
|
|
100202
|
-
return err$
|
|
100155
|
+
return err$3(
|
|
100203
100156
|
new Error(
|
|
100204
100157
|
`Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
|
|
100205
100158
|
)
|
|
@@ -100210,10 +100163,10 @@ class BaseGraphQLTypeRepository {
|
|
|
100210
100163
|
input.request.definitions.variables
|
|
100211
100164
|
);
|
|
100212
100165
|
if (cacheFieldKeyResult.isErr()) {
|
|
100213
|
-
return err$
|
|
100166
|
+
return err$3(cacheFieldKeyResult.error);
|
|
100214
100167
|
}
|
|
100215
100168
|
const cacheFieldKey = cacheFieldKeyResult.value;
|
|
100216
|
-
return ok$
|
|
100169
|
+
return ok$3((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
|
|
100217
100170
|
}
|
|
100218
100171
|
denormalizeFieldSelection(cache, input, selection, errorCollector) {
|
|
100219
100172
|
var _a;
|
|
@@ -100319,22 +100272,22 @@ class BaseGraphQLTypeRepository {
|
|
|
100319
100272
|
return shouldSkipResult;
|
|
100320
100273
|
}
|
|
100321
100274
|
if (shouldSkipResult.value) {
|
|
100322
|
-
return ok$
|
|
100275
|
+
return ok$3(false);
|
|
100323
100276
|
}
|
|
100324
100277
|
return this.satisfiesFragmentTypeCondition(input, fragment);
|
|
100325
100278
|
}
|
|
100326
100279
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
100327
100280
|
if (!fragment.typeCondition) {
|
|
100328
|
-
return ok$
|
|
100281
|
+
return ok$3(true);
|
|
100329
100282
|
}
|
|
100330
100283
|
const conditionalTypeName = fragment.typeCondition.name.value;
|
|
100331
100284
|
if (conditionalTypeName === this.typeName) {
|
|
100332
|
-
return ok$
|
|
100285
|
+
return ok$3(true);
|
|
100333
100286
|
}
|
|
100334
100287
|
if (this.implementedInterfaces.includes(conditionalTypeName)) {
|
|
100335
|
-
return ok$
|
|
100288
|
+
return ok$3(true);
|
|
100336
100289
|
}
|
|
100337
|
-
return ok$
|
|
100290
|
+
return ok$3(false);
|
|
100338
100291
|
}
|
|
100339
100292
|
getCacheKeyFieldArguments(selection) {
|
|
100340
100293
|
return selection.arguments;
|
|
@@ -100393,7 +100346,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
100393
100346
|
const key = this.buildKey(this.buildKeyParams(input));
|
|
100394
100347
|
const normalized = this.normalizeData(cache, input);
|
|
100395
100348
|
if (normalized.isErr()) {
|
|
100396
|
-
return err$
|
|
100349
|
+
return err$3(normalized.error);
|
|
100397
100350
|
}
|
|
100398
100351
|
const existing = cache.get(key);
|
|
100399
100352
|
if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
|
|
@@ -100402,7 +100355,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
100402
100355
|
metadata: this.cacheMetadata
|
|
100403
100356
|
});
|
|
100404
100357
|
}
|
|
100405
|
-
return ok$
|
|
100358
|
+
return ok$3({
|
|
100406
100359
|
type: "link",
|
|
100407
100360
|
linkedKey: key
|
|
100408
100361
|
});
|
|
@@ -100417,7 +100370,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
100417
100370
|
if (normalizeDataResult.isErr()) {
|
|
100418
100371
|
return normalizeDataResult;
|
|
100419
100372
|
}
|
|
100420
|
-
return ok$
|
|
100373
|
+
return ok$3(
|
|
100421
100374
|
deepMerge$2(
|
|
100422
100375
|
{},
|
|
100423
100376
|
(existingNormalizedData == null ? void 0 : existingNormalizedData.value) || {},
|
|
@@ -100487,7 +100440,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
100487
100440
|
if (result.isErr()) {
|
|
100488
100441
|
return result;
|
|
100489
100442
|
}
|
|
100490
|
-
return ok$
|
|
100443
|
+
return ok$3({
|
|
100491
100444
|
data: result.value
|
|
100492
100445
|
});
|
|
100493
100446
|
}
|
|
@@ -100495,7 +100448,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
100495
100448
|
var _a;
|
|
100496
100449
|
const operationResult = findExecutableOperation(input);
|
|
100497
100450
|
if (operationResult.isErr()) {
|
|
100498
|
-
return err$
|
|
100451
|
+
return err$3(operationResult.error);
|
|
100499
100452
|
}
|
|
100500
100453
|
const operation = operationResult.value;
|
|
100501
100454
|
const fragmentDefinitions = input.query.definitions.filter(
|
|
@@ -100518,7 +100471,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
100518
100471
|
...operation,
|
|
100519
100472
|
selectionSet: { kind: Kind$1.SELECTION_SET, selections: augmentedOperationSelections }
|
|
100520
100473
|
};
|
|
100521
|
-
return ok$
|
|
100474
|
+
return ok$3({
|
|
100522
100475
|
...input.query,
|
|
100523
100476
|
definitions: [
|
|
100524
100477
|
...input.query.definitions.filter((def) => def.kind !== Kind$1.FRAGMENT_DEFINITION).map((def) => {
|
|
@@ -100553,7 +100506,7 @@ class BaseInterfaceRepository {
|
|
|
100553
100506
|
}
|
|
100554
100507
|
write(cache, input) {
|
|
100555
100508
|
if (typeof input.data !== "object") {
|
|
100556
|
-
return err$
|
|
100509
|
+
return err$3([
|
|
100557
100510
|
{
|
|
100558
100511
|
type: "unknown",
|
|
100559
100512
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -100563,7 +100516,7 @@ class BaseInterfaceRepository {
|
|
|
100563
100516
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
100564
100517
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
100565
100518
|
if (!concreteTypeRepository) {
|
|
100566
|
-
return err$
|
|
100519
|
+
return err$3([
|
|
100567
100520
|
{
|
|
100568
100521
|
type: "unknown",
|
|
100569
100522
|
error: new Error(
|
|
@@ -100574,7 +100527,7 @@ class BaseInterfaceRepository {
|
|
|
100574
100527
|
}
|
|
100575
100528
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
100576
100529
|
if (selectionErr) {
|
|
100577
|
-
return err$
|
|
100530
|
+
return err$3(selectionErr);
|
|
100578
100531
|
}
|
|
100579
100532
|
const normalizeInput = {
|
|
100580
100533
|
...input,
|
|
@@ -100586,14 +100539,14 @@ class BaseInterfaceRepository {
|
|
|
100586
100539
|
};
|
|
100587
100540
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
100588
100541
|
if (result.isOk()) {
|
|
100589
|
-
return ok$
|
|
100542
|
+
return ok$3({ discriminator, data: result.value });
|
|
100590
100543
|
}
|
|
100591
100544
|
return result;
|
|
100592
100545
|
}
|
|
100593
100546
|
read(cache, input) {
|
|
100594
100547
|
const unionRep = input.normalizedData;
|
|
100595
100548
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
100596
|
-
return err$
|
|
100549
|
+
return err$3([
|
|
100597
100550
|
{
|
|
100598
100551
|
type: "unknown",
|
|
100599
100552
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -100603,7 +100556,7 @@ class BaseInterfaceRepository {
|
|
|
100603
100556
|
const discriminator = unionRep.discriminator;
|
|
100604
100557
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
100605
100558
|
if (!concreteRepository) {
|
|
100606
|
-
return err$
|
|
100559
|
+
return err$3([
|
|
100607
100560
|
{
|
|
100608
100561
|
type: "unknown",
|
|
100609
100562
|
error: new Error(
|
|
@@ -100614,7 +100567,7 @@ class BaseInterfaceRepository {
|
|
|
100614
100567
|
}
|
|
100615
100568
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
100616
100569
|
if (selectionErr) {
|
|
100617
|
-
return err$
|
|
100570
|
+
return err$3(selectionErr);
|
|
100618
100571
|
}
|
|
100619
100572
|
const denormalizeInput = {
|
|
100620
100573
|
...input,
|
|
@@ -100719,7 +100672,7 @@ class BaseUnionRepository {
|
|
|
100719
100672
|
}
|
|
100720
100673
|
write(cache, input) {
|
|
100721
100674
|
if (typeof input.data !== "object") {
|
|
100722
|
-
return err$
|
|
100675
|
+
return err$3([
|
|
100723
100676
|
{
|
|
100724
100677
|
type: "unknown",
|
|
100725
100678
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -100729,7 +100682,7 @@ class BaseUnionRepository {
|
|
|
100729
100682
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
100730
100683
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
100731
100684
|
if (!concreteTypeRepository) {
|
|
100732
|
-
return err$
|
|
100685
|
+
return err$3([
|
|
100733
100686
|
{
|
|
100734
100687
|
type: "unknown",
|
|
100735
100688
|
error: new Error(
|
|
@@ -100740,7 +100693,7 @@ class BaseUnionRepository {
|
|
|
100740
100693
|
}
|
|
100741
100694
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
100742
100695
|
if (selectionErr) {
|
|
100743
|
-
return err$
|
|
100696
|
+
return err$3(selectionErr);
|
|
100744
100697
|
}
|
|
100745
100698
|
const normalizeInput = {
|
|
100746
100699
|
...input,
|
|
@@ -100752,14 +100705,14 @@ class BaseUnionRepository {
|
|
|
100752
100705
|
};
|
|
100753
100706
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
100754
100707
|
if (result.isOk()) {
|
|
100755
|
-
return ok$
|
|
100708
|
+
return ok$3({ discriminator, data: result.value });
|
|
100756
100709
|
}
|
|
100757
100710
|
return result;
|
|
100758
100711
|
}
|
|
100759
100712
|
read(cache, input) {
|
|
100760
100713
|
const unionRep = input.normalizedData;
|
|
100761
100714
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
100762
|
-
return err$
|
|
100715
|
+
return err$3([
|
|
100763
100716
|
{
|
|
100764
100717
|
type: "unknown",
|
|
100765
100718
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -100769,7 +100722,7 @@ class BaseUnionRepository {
|
|
|
100769
100722
|
const discriminator = unionRep.discriminator;
|
|
100770
100723
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
100771
100724
|
if (!concreteRepository) {
|
|
100772
|
-
return err$
|
|
100725
|
+
return err$3([
|
|
100773
100726
|
{
|
|
100774
100727
|
type: "unknown",
|
|
100775
100728
|
error: new Error(
|
|
@@ -100780,7 +100733,7 @@ class BaseUnionRepository {
|
|
|
100780
100733
|
}
|
|
100781
100734
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
100782
100735
|
if (selectionErr) {
|
|
100783
|
-
return err$
|
|
100736
|
+
return err$3(selectionErr);
|
|
100784
100737
|
}
|
|
100785
100738
|
const denormalizeInput = {
|
|
100786
100739
|
...input,
|
|
@@ -105299,7 +105252,7 @@ function dataSatisfiesFragmentTypeCondition(input, fragment) {
|
|
|
105299
105252
|
* @param typeName - The repository type name for error messages
|
|
105300
105253
|
* @returns Result<boolean, Error> - true if the fragment type condition is satisfied
|
|
105301
105254
|
*/
|
|
105302
|
-
function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment,
|
|
105255
|
+
function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment, _typeName) {
|
|
105303
105256
|
// First try the base class implementation
|
|
105304
105257
|
const result = superSatisfiesFragmentTypeCondition(input, fragment);
|
|
105305
105258
|
if (result.isErr() || result.value) {
|
|
@@ -105767,7 +105720,7 @@ class SetupRecordAggregateRepository extends Setup__SetupRecordAggregateReposito
|
|
|
105767
105720
|
}
|
|
105768
105721
|
|
|
105769
105722
|
class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
|
|
105770
|
-
getTypeDiscriminator(
|
|
105723
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105771
105724
|
// Hardcoded to record representation since that's the only type of parent
|
|
105772
105725
|
// relationship possible
|
|
105773
105726
|
return 'RecordRepresentation';
|
|
@@ -105807,7 +105760,7 @@ class SetupEdgeRepository extends Setup__SetupEdgeRepository {
|
|
|
105807
105760
|
}
|
|
105808
105761
|
|
|
105809
105762
|
class PolymorphicAggregateParentRelationshipRepository extends PolymorphicAggregateParentRelationshipRepository$1 {
|
|
105810
|
-
getTypeDiscriminator(
|
|
105763
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105811
105764
|
// Hardcoded to record aggregate since that's the only type of parent
|
|
105812
105765
|
// relationship possible
|
|
105813
105766
|
return 'RecordAggregate';
|
|
@@ -105864,6 +105817,7 @@ class RecordDeletePayloadRepository extends RecordDeletePayloadRepository$1 {
|
|
|
105864
105817
|
let idFieldSelection = input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id');
|
|
105865
105818
|
// If Id exists in data but wasn't asked for, synthesize the selection like RecordRepresentation does
|
|
105866
105819
|
if (input.data.Id !== undefined && !idFieldSelection) {
|
|
105820
|
+
// eslint-disable-next-line no-param-reassign
|
|
105867
105821
|
input = {
|
|
105868
105822
|
...input,
|
|
105869
105823
|
selections: [
|
|
@@ -105911,7 +105865,7 @@ class SetupConnectionRepository extends Setup__SetupConnectionRepository {
|
|
|
105911
105865
|
}
|
|
105912
105866
|
|
|
105913
105867
|
class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__SetupPolymorphicAggregateParentRelationshipRepository {
|
|
105914
|
-
getTypeDiscriminator(
|
|
105868
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105915
105869
|
// Hardcoded to Setup__SetupRecordAggregate since that's the only type of parent
|
|
105916
105870
|
// relationship possible
|
|
105917
105871
|
return 'Setup__SetupRecordAggregate';
|
|
@@ -105919,7 +105873,7 @@ class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__Setup
|
|
|
105919
105873
|
}
|
|
105920
105874
|
|
|
105921
105875
|
class SetupPolymorphicParentRelationshipRepository extends Setup__SetupPolymorphicParentRelationshipRepository {
|
|
105922
|
-
getTypeDiscriminator(
|
|
105876
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105923
105877
|
// Hardcoded to Setup__EntityRepresentation since that's the only type of parent
|
|
105924
105878
|
// relationship possible
|
|
105925
105879
|
return 'Setup__EntityRepresentation';
|
|
@@ -106060,6 +106014,7 @@ function deepMerge$1(data, extensions) {
|
|
|
106060
106014
|
const dataType = typeof data;
|
|
106061
106015
|
const extensionsType = typeof extensions;
|
|
106062
106016
|
if (dataType === 'function' || extensionsType === 'function') {
|
|
106017
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106063
106018
|
throw new Error('Cannot merge functions');
|
|
106064
106019
|
}
|
|
106065
106020
|
if (dataType === 'undefined' || data === undefined) {
|
|
@@ -106400,7 +106355,9 @@ function buildCommandClass(baseClass) {
|
|
|
106400
106355
|
});
|
|
106401
106356
|
this.unsubscribers.push(unsubscribeFromLuvioSnapshot);
|
|
106402
106357
|
}
|
|
106403
|
-
catch (error) {
|
|
106358
|
+
catch (error) {
|
|
106359
|
+
// intentionally do nothing
|
|
106360
|
+
}
|
|
106404
106361
|
}
|
|
106405
106362
|
}
|
|
106406
106363
|
usedRecordsChanged() {
|
|
@@ -106506,6 +106463,7 @@ function defaultCheckConfig(config, requiredKeys, optionalKeys) {
|
|
|
106506
106463
|
const invalidKeys = configKeys.filter((key) => !allowedKeysSet.includes(key));
|
|
106507
106464
|
if (invalidKeys.length > 0) {
|
|
106508
106465
|
// invalid keys, so set error state
|
|
106466
|
+
// eslint-disable-next-line no-throw-literal
|
|
106509
106467
|
throw {
|
|
106510
106468
|
error: `Invalid config keys: ${invalidKeys.join(', ')}`,
|
|
106511
106469
|
errorType: 'adapterError',
|
|
@@ -106870,7 +106828,7 @@ getServices(serviceRequirements).then((services) => {
|
|
|
106870
106828
|
_(config, CONFIG_SCHEMA);
|
|
106871
106829
|
const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
|
|
106872
106830
|
return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
|
|
106873
|
-
},
|
|
106831
|
+
}, true);
|
|
106874
106832
|
graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
|
|
106875
106833
|
const _ = assertIsValid;
|
|
106876
106834
|
_(config, CONFIG_SCHEMA);
|
|
@@ -106880,6 +106838,7 @@ getServices(serviceRequirements).then((services) => {
|
|
|
106880
106838
|
services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
|
|
106881
106839
|
const validatedConfig = validateNonQueryGraphQLConfig(config);
|
|
106882
106840
|
if (validatedConfig.isErr()) {
|
|
106841
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106883
106842
|
throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
|
|
106884
106843
|
}
|
|
106885
106844
|
const _ = assertIsValid;
|
|
@@ -106891,11 +106850,12 @@ getServices(serviceRequirements).then((services) => {
|
|
|
106891
106850
|
*/
|
|
106892
106851
|
const graphql_state_manager_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_state_manager');
|
|
106893
106852
|
const factory = (config) => {
|
|
106894
|
-
assertIsValid(config, CONFIG_SCHEMA);
|
|
106853
|
+
assertIsValid$1(config, CONFIG_SCHEMA);
|
|
106895
106854
|
const validatedConfig = resolveAndValidateGraphQLConfig(config, {
|
|
106896
106855
|
acceptedOperations: ['query'],
|
|
106897
106856
|
});
|
|
106898
106857
|
if (validatedConfig === undefined || validatedConfig.isErr()) {
|
|
106858
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106899
106859
|
throw new Error('Internal error in GraphQL adapter occurred: Unable to resolve query');
|
|
106900
106860
|
}
|
|
106901
106861
|
return new graphql_state_manager_ctor(validatedConfig.value, documentRootType, services);
|
|
@@ -106923,7 +106883,7 @@ function registerCallback(cb) {
|
|
|
106923
106883
|
cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
|
|
106924
106884
|
}
|
|
106925
106885
|
}
|
|
106926
|
-
// version: 1.
|
|
106886
|
+
// version: 1.434.0-6aa2dd15e3
|
|
106927
106887
|
|
|
106928
106888
|
function createFragmentMap(documentNode) {
|
|
106929
106889
|
const fragments = {};
|
|
@@ -134952,28 +134912,23 @@ let configurableCreateContentVersion$1 = new Configurable$1();
|
|
|
134952
134912
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
134953
134913
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134954
134914
|
* be reached by following 1 relationship from the root record, etc.
|
|
134955
|
-
* @defaultValue '
|
|
134915
|
+
* @defaultValue '1'
|
|
134956
134916
|
*/
|
|
134957
|
-
let trackedFieldDepthOnCacheMiss$1 =
|
|
134917
|
+
let trackedFieldDepthOnCacheMiss$1 = 1;
|
|
134958
134918
|
/**
|
|
134959
134919
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
134960
134920
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134961
134921
|
* be reached by following 1 relationship from the root record, etc.
|
|
134962
|
-
* @defaultValue '
|
|
134922
|
+
* @defaultValue '1'
|
|
134963
134923
|
*/
|
|
134964
|
-
let trackedFieldDepthOnCacheMergeConflict$1 =
|
|
134924
|
+
let trackedFieldDepthOnCacheMergeConflict$1 = 1;
|
|
134965
134925
|
/**
|
|
134966
134926
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
134967
134927
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134968
134928
|
* be reached by following 1 relationship from the root record, etc.
|
|
134969
|
-
* @defaultValue '
|
|
134929
|
+
* @defaultValue '1'
|
|
134970
134930
|
*/
|
|
134971
|
-
let trackedFieldDepthOnNotifyChange$1 =
|
|
134972
|
-
/**
|
|
134973
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
134974
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
134975
|
-
*/
|
|
134976
|
-
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
134931
|
+
let trackedFieldDepthOnNotifyChange$1 = 1;
|
|
134977
134932
|
/**
|
|
134978
134933
|
* One store enabled Get Object Info adapter
|
|
134979
134934
|
*/
|
|
@@ -135070,12 +135025,6 @@ const configurationForRestAdapters$1 = {
|
|
|
135070
135025
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
135071
135026
|
return trackedFieldDepthOnNotifyChange$1;
|
|
135072
135027
|
},
|
|
135073
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
135074
|
-
trackedFieldLeafNodeIdAndNameOnly$1 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
135075
|
-
},
|
|
135076
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
135077
|
-
return trackedFieldLeafNodeIdAndNameOnly$1;
|
|
135078
|
-
},
|
|
135079
135028
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
135080
135029
|
recordRepresentationIngestionOverride$1 = ingest;
|
|
135081
135030
|
},
|
|
@@ -135632,6 +135581,7 @@ withDefaultLuvio((luvio) => {
|
|
|
135632
135581
|
if (typeof data?.refresh === 'function') {
|
|
135633
135582
|
return data.refresh();
|
|
135634
135583
|
}
|
|
135584
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
135635
135585
|
throw new Error('Component attempted to refresh a GraphQL result that is not refreshable');
|
|
135636
135586
|
};
|
|
135637
135587
|
}
|
|
@@ -136140,7 +136090,7 @@ register$1({
|
|
|
136140
136090
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
136141
136091
|
instrument: instrument$1,
|
|
136142
136092
|
});
|
|
136143
|
-
// version: 1.
|
|
136093
|
+
// version: 1.434.0-6aa2dd15e3
|
|
136144
136094
|
|
|
136145
136095
|
// On core the unstable adapters are re-exported with different names,
|
|
136146
136096
|
// we want to match them here.
|
|
@@ -136292,7 +136242,7 @@ withDefaultLuvio((luvio) => {
|
|
|
136292
136242
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
136293
136243
|
graphQLImperative = ldsAdapter;
|
|
136294
136244
|
});
|
|
136295
|
-
// version: 1.
|
|
136245
|
+
// version: 1.434.0-6aa2dd15e3
|
|
136296
136246
|
|
|
136297
136247
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
136298
136248
|
__proto__: null,
|
|
@@ -137091,7 +137041,7 @@ const callbacks$1 = [];
|
|
|
137091
137041
|
function register(r) {
|
|
137092
137042
|
callbacks$1.forEach((callback) => callback(r));
|
|
137093
137043
|
}
|
|
137094
|
-
// version: 1.
|
|
137044
|
+
// version: 1.434.0-d8deb0d4ea
|
|
137095
137045
|
|
|
137096
137046
|
/**
|
|
137097
137047
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -137127,28 +137077,23 @@ let configurableCreateContentVersion = new Configurable();
|
|
|
137127
137077
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
137128
137078
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137129
137079
|
* be reached by following 1 relationship from the root record, etc.
|
|
137130
|
-
* @defaultValue '
|
|
137080
|
+
* @defaultValue '1'
|
|
137131
137081
|
*/
|
|
137132
|
-
let trackedFieldDepthOnCacheMiss =
|
|
137082
|
+
let trackedFieldDepthOnCacheMiss = 1;
|
|
137133
137083
|
/**
|
|
137134
137084
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
137135
137085
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137136
137086
|
* be reached by following 1 relationship from the root record, etc.
|
|
137137
|
-
* @defaultValue '
|
|
137087
|
+
* @defaultValue '1'
|
|
137138
137088
|
*/
|
|
137139
|
-
let trackedFieldDepthOnCacheMergeConflict =
|
|
137089
|
+
let trackedFieldDepthOnCacheMergeConflict = 1;
|
|
137140
137090
|
/**
|
|
137141
137091
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
137142
137092
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137143
137093
|
* be reached by following 1 relationship from the root record, etc.
|
|
137144
|
-
* @defaultValue '
|
|
137145
|
-
*/
|
|
137146
|
-
let trackedFieldDepthOnNotifyChange = 5;
|
|
137147
|
-
/**
|
|
137148
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
137149
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
137094
|
+
* @defaultValue '1'
|
|
137150
137095
|
*/
|
|
137151
|
-
let
|
|
137096
|
+
let trackedFieldDepthOnNotifyChange = 1;
|
|
137152
137097
|
/**
|
|
137153
137098
|
* One store enabled Get Object Info adapter
|
|
137154
137099
|
*/
|
|
@@ -137245,12 +137190,6 @@ const configurationForRestAdapters = {
|
|
|
137245
137190
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
137246
137191
|
return trackedFieldDepthOnNotifyChange;
|
|
137247
137192
|
},
|
|
137248
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
137249
|
-
trackedFieldLeafNodeIdAndNameOnly = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
137250
|
-
},
|
|
137251
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
137252
|
-
return trackedFieldLeafNodeIdAndNameOnly;
|
|
137253
|
-
},
|
|
137254
137193
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
137255
137194
|
recordRepresentationIngestionOverride = ingest;
|
|
137256
137195
|
},
|
|
@@ -138145,6 +138084,7 @@ function handleInstrumentation(activity, stat, progress) {
|
|
|
138145
138084
|
const LUVIO_ADAPTER_FAMILY = /^force\/ldsAdapters/;
|
|
138146
138085
|
async function importLuvioAdapterModule(specifier) {
|
|
138147
138086
|
if (!LUVIO_ADAPTER_FAMILY.test(specifier)) {
|
|
138087
|
+
// eslint-disable-next-line no-throw-literal
|
|
138148
138088
|
throw `${specifier} is not an allowed luvio adapter module`;
|
|
138149
138089
|
}
|
|
138150
138090
|
let module;
|
|
@@ -138152,6 +138092,7 @@ async function importLuvioAdapterModule(specifier) {
|
|
|
138152
138092
|
module = await import(specifier);
|
|
138153
138093
|
}
|
|
138154
138094
|
catch {
|
|
138095
|
+
// eslint-disable-next-line no-throw-literal
|
|
138155
138096
|
throw `module not found for specifier ${specifier}`;
|
|
138156
138097
|
}
|
|
138157
138098
|
return new LuvioAdapterModule(module);
|
|
@@ -138265,6 +138206,7 @@ function buildNativeResponse(response) {
|
|
|
138265
138206
|
}
|
|
138266
138207
|
async function importOneStoreAdapterModule(specifier) {
|
|
138267
138208
|
if (!ONESTORE_ADAPTER_FAMILY.test(specifier)) {
|
|
138209
|
+
// eslint-disable-next-line no-throw-literal
|
|
138268
138210
|
throw `${specifier} is not an allowed onestore adapter module`;
|
|
138269
138211
|
}
|
|
138270
138212
|
let module;
|
|
@@ -138272,6 +138214,7 @@ async function importOneStoreAdapterModule(specifier) {
|
|
|
138272
138214
|
module = await import(specifier);
|
|
138273
138215
|
}
|
|
138274
138216
|
catch {
|
|
138217
|
+
// eslint-disable-next-line no-throw-literal
|
|
138275
138218
|
throw `module not found for specifier ${specifier}`;
|
|
138276
138219
|
}
|
|
138277
138220
|
return new OneStoreAdapterModule(module);
|
|
@@ -138387,4 +138330,4 @@ const { luvio } = getRuntime();
|
|
|
138387
138330
|
setDefaultLuvio({ luvio });
|
|
138388
138331
|
|
|
138389
138332
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
138390
|
-
// version: 1.
|
|
138333
|
+
// version: 1.434.0-d8deb0d4ea
|