@salesforce/lds-worker-api 1.432.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 +754 -808
- 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 +754 -808
- 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
|
@@ -4280,7 +4280,7 @@
|
|
|
4280
4280
|
}
|
|
4281
4281
|
callbacks.push(callback);
|
|
4282
4282
|
}
|
|
4283
|
-
// version: 1.
|
|
4283
|
+
// version: 1.434.0-d8deb0d4ea
|
|
4284
4284
|
|
|
4285
4285
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4286
4286
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5324,7 +5324,7 @@
|
|
|
5324
5324
|
const { apiFamily, name } = metadata;
|
|
5325
5325
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5326
5326
|
}
|
|
5327
|
-
// version: 1.
|
|
5327
|
+
// version: 1.434.0-d8deb0d4ea
|
|
5328
5328
|
|
|
5329
5329
|
function isSupportedEntity(_objectApiName) {
|
|
5330
5330
|
return true;
|
|
@@ -5461,28 +5461,23 @@
|
|
|
5461
5461
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
5462
5462
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5463
5463
|
* be reached by following 1 relationship from the root record, etc.
|
|
5464
|
-
* @defaultValue '
|
|
5464
|
+
* @defaultValue '1'
|
|
5465
5465
|
*/
|
|
5466
|
-
let trackedFieldDepthOnCacheMiss$3 =
|
|
5466
|
+
let trackedFieldDepthOnCacheMiss$3 = 1;
|
|
5467
5467
|
/**
|
|
5468
5468
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
5469
5469
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5470
5470
|
* be reached by following 1 relationship from the root record, etc.
|
|
5471
|
-
* @defaultValue '
|
|
5471
|
+
* @defaultValue '1'
|
|
5472
5472
|
*/
|
|
5473
|
-
let trackedFieldDepthOnCacheMergeConflict$3 =
|
|
5473
|
+
let trackedFieldDepthOnCacheMergeConflict$3 = 1;
|
|
5474
5474
|
/**
|
|
5475
5475
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
5476
5476
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5477
5477
|
* be reached by following 1 relationship from the root record, etc.
|
|
5478
|
-
* @defaultValue '
|
|
5478
|
+
* @defaultValue '1'
|
|
5479
5479
|
*/
|
|
5480
|
-
let trackedFieldDepthOnNotifyChange$3 =
|
|
5481
|
-
/**
|
|
5482
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
5483
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
5484
|
-
*/
|
|
5485
|
-
let trackedFieldLeafNodeIdAndNameOnly$3 = false;
|
|
5480
|
+
let trackedFieldDepthOnNotifyChange$3 = 1;
|
|
5486
5481
|
/**
|
|
5487
5482
|
* One store enabled Get Object Info adapter
|
|
5488
5483
|
*/
|
|
@@ -5579,12 +5574,6 @@
|
|
|
5579
5574
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
5580
5575
|
return trackedFieldDepthOnNotifyChange$3;
|
|
5581
5576
|
},
|
|
5582
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
5583
|
-
trackedFieldLeafNodeIdAndNameOnly$3 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
5584
|
-
},
|
|
5585
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
5586
|
-
return trackedFieldLeafNodeIdAndNameOnly$3;
|
|
5587
|
-
},
|
|
5588
5577
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
5589
5578
|
recordRepresentationIngestionOverride$3 = ingest;
|
|
5590
5579
|
},
|
|
@@ -5706,28 +5695,23 @@
|
|
|
5706
5695
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
5707
5696
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5708
5697
|
* be reached by following 1 relationship from the root record, etc.
|
|
5709
|
-
* @defaultValue '
|
|
5698
|
+
* @defaultValue '1'
|
|
5710
5699
|
*/
|
|
5711
|
-
let trackedFieldDepthOnCacheMiss$2 =
|
|
5700
|
+
let trackedFieldDepthOnCacheMiss$2 = 1;
|
|
5712
5701
|
/**
|
|
5713
5702
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
5714
5703
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5715
5704
|
* be reached by following 1 relationship from the root record, etc.
|
|
5716
|
-
* @defaultValue '
|
|
5705
|
+
* @defaultValue '1'
|
|
5717
5706
|
*/
|
|
5718
|
-
let trackedFieldDepthOnCacheMergeConflict$2 =
|
|
5707
|
+
let trackedFieldDepthOnCacheMergeConflict$2 = 1;
|
|
5719
5708
|
/**
|
|
5720
5709
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
5721
5710
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
5722
5711
|
* be reached by following 1 relationship from the root record, etc.
|
|
5723
|
-
* @defaultValue '
|
|
5712
|
+
* @defaultValue '1'
|
|
5724
5713
|
*/
|
|
5725
|
-
let trackedFieldDepthOnNotifyChange$2 =
|
|
5726
|
-
/**
|
|
5727
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
5728
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
5729
|
-
*/
|
|
5730
|
-
let trackedFieldLeafNodeIdAndNameOnly$2 = false;
|
|
5714
|
+
let trackedFieldDepthOnNotifyChange$2 = 1;
|
|
5731
5715
|
/**
|
|
5732
5716
|
* One store enabled Get Object Info adapter
|
|
5733
5717
|
*/
|
|
@@ -5833,12 +5817,6 @@
|
|
|
5833
5817
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
5834
5818
|
return trackedFieldDepthOnNotifyChange$2;
|
|
5835
5819
|
},
|
|
5836
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
5837
|
-
trackedFieldLeafNodeIdAndNameOnly$2 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
5838
|
-
},
|
|
5839
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
5840
|
-
return trackedFieldLeafNodeIdAndNameOnly$2;
|
|
5841
|
-
},
|
|
5842
5820
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
5843
5821
|
recordRepresentationIngestionOverride$2 = ingest;
|
|
5844
5822
|
},
|
|
@@ -7679,6 +7657,9 @@
|
|
|
7679
7657
|
return [...sel.selections, DRAFTS_SELECTION$1];
|
|
7680
7658
|
}
|
|
7681
7659
|
|
|
7660
|
+
// Unused suffixes, but leaving in as comments to avoid eslint errors
|
|
7661
|
+
// const CUSTOM_API_NAME_SUFFIX = '__c';
|
|
7662
|
+
// const DMO_API_NAME_SUFFIX = '__dlm';
|
|
7682
7663
|
const CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX$1 = '__x';
|
|
7683
7664
|
const RECORD_REPRESENTATION_ERROR_VERSION$1 = 'RECORD_REPRESENTATION_ERROR_VERSION_1';
|
|
7684
7665
|
const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS$1 = {
|
|
@@ -7742,13 +7723,11 @@
|
|
|
7742
7723
|
if (!isGraphNode$1(field)) {
|
|
7743
7724
|
continue;
|
|
7744
7725
|
}
|
|
7745
|
-
const { maxDepth
|
|
7726
|
+
const { maxDepth } = config;
|
|
7746
7727
|
if (field.isScalar('value') === false && !Array.isArray(field.data?.value)) {
|
|
7747
7728
|
if (depth + 1 > maxDepth) {
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
addScalarFieldName$1(current);
|
|
7751
|
-
}
|
|
7729
|
+
addScalarFieldId$1(current);
|
|
7730
|
+
addScalarFieldName$1(current);
|
|
7752
7731
|
continue;
|
|
7753
7732
|
}
|
|
7754
7733
|
const spanningLink = field.link('value');
|
|
@@ -7770,19 +7749,10 @@
|
|
|
7770
7749
|
current.children[key] = next;
|
|
7771
7750
|
}
|
|
7772
7751
|
else {
|
|
7773
|
-
// Skip the field, if its value is null at the max level depth.
|
|
7774
|
-
// Ideally, it should only skip relationship field. However,
|
|
7775
|
-
// on the client, there is not a reliable way to determine the
|
|
7776
|
-
// the field type.
|
|
7777
7752
|
if (depth === maxDepth) {
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
continue;
|
|
7782
|
-
}
|
|
7783
|
-
if (field.scalar('value') === null && !Array.isArray(field.data?.value)) {
|
|
7784
|
-
continue;
|
|
7785
|
-
}
|
|
7753
|
+
addScalarFieldId$1(current);
|
|
7754
|
+
addScalarFieldName$1(current);
|
|
7755
|
+
continue;
|
|
7786
7756
|
}
|
|
7787
7757
|
const state = fieldValueRep.linkData();
|
|
7788
7758
|
if (state !== undefined) {
|
|
@@ -8168,7 +8138,6 @@
|
|
|
8168
8138
|
};
|
|
8169
8139
|
const trackedFieldsConfig = {
|
|
8170
8140
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMergeConflict(),
|
|
8171
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8172
8141
|
};
|
|
8173
8142
|
extractTrackedFieldsToTrie$1(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
8174
8143
|
extractTrackedFieldsToTrie$1(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
|
|
@@ -8612,7 +8581,6 @@
|
|
|
8612
8581
|
const key = keyBuilder$28(luvio, createResourceParams$12(config));
|
|
8613
8582
|
const allTrackedFields = getTrackedFields$1(key, luvio.getNode(key), {
|
|
8614
8583
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
8615
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8616
8584
|
}, config.optionalFields);
|
|
8617
8585
|
const optionalFields = fields === undefined ? allTrackedFields : difference$1(allTrackedFields, fields);
|
|
8618
8586
|
const resourceParams = createResourceParams$12({
|
|
@@ -8739,7 +8707,6 @@
|
|
|
8739
8707
|
};
|
|
8740
8708
|
const childTrackedFields = getTrackedFields$1(childKey, luvio.getNode(childKey), {
|
|
8741
8709
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
8742
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
8743
8710
|
}, childResourceParams.queryParams.optionalFields);
|
|
8744
8711
|
const childSnapshot = ingestSuccess$S(luvio, {
|
|
8745
8712
|
recordId: childResourceParams.urlParams.recordId,
|
|
@@ -13912,7 +13879,6 @@
|
|
|
13912
13879
|
const node = luvio.wrapNormalizedGraphNode(record, key);
|
|
13913
13880
|
const optionalFields = getTrackedFields$1(key, node, {
|
|
13914
13881
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnNotifyChange(),
|
|
13915
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
13916
13882
|
});
|
|
13917
13883
|
const refreshRequest = createResourceRequestFromRepresentation(record, optionalFields);
|
|
13918
13884
|
const existingWeakEtag = record.weakEtag;
|
|
@@ -16501,7 +16467,6 @@
|
|
|
16501
16467
|
const key = keyBuilder$1w$2(luvio, config);
|
|
16502
16468
|
const trackedFieldsConfig = {
|
|
16503
16469
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
16504
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly()
|
|
16505
16470
|
};
|
|
16506
16471
|
const optionalFieldsTrie = convertFieldsToTrie$1(getTrackedFields$1(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
|
|
16507
16472
|
const fieldsTrie = BLANK_RECORD_FIELDS_TRIE$1;
|
|
@@ -30545,7 +30510,6 @@
|
|
|
30545
30510
|
...resourceRequest.queryParams,
|
|
30546
30511
|
optionalFields: getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
30547
30512
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
30548
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
30549
30513
|
}, config.optionalFields),
|
|
30550
30514
|
},
|
|
30551
30515
|
});
|
|
@@ -31080,7 +31044,6 @@
|
|
|
31080
31044
|
...resourceRequest.queryParams,
|
|
31081
31045
|
optionalFields: getTrackedFields$1(recordTemplateKey, luvio.getNode(recordTemplateKey), {
|
|
31082
31046
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
31083
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
31084
31047
|
}, config.optionalFields),
|
|
31085
31048
|
},
|
|
31086
31049
|
});
|
|
@@ -31100,7 +31063,6 @@
|
|
|
31100
31063
|
});
|
|
31101
31064
|
const allTrackedFields = getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
31102
31065
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
31103
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
31104
31066
|
}, optionalFields);
|
|
31105
31067
|
const allTrackedFieldsTrie = convertFieldsToTrie$1(allTrackedFields, true);
|
|
31106
31068
|
const ingest = createFieldsIngestSuccess$4({
|
|
@@ -32556,7 +32518,7 @@
|
|
|
32556
32518
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
32557
32519
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
32558
32520
|
});
|
|
32559
|
-
// version: 1.
|
|
32521
|
+
// version: 1.434.0-6aa2dd15e3
|
|
32560
32522
|
|
|
32561
32523
|
var allowUpdatesForNonCachedRecords = {
|
|
32562
32524
|
isOpen: function (e) {
|
|
@@ -44206,7 +44168,7 @@
|
|
|
44206
44168
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
44207
44169
|
const { isArray: isArray$7 } = Array;
|
|
44208
44170
|
const { stringify: stringify$9, parse: parse$9 } = JSON;
|
|
44209
|
-
let Ok$
|
|
44171
|
+
let Ok$3 = class Ok {
|
|
44210
44172
|
constructor(value) {
|
|
44211
44173
|
this.value = value;
|
|
44212
44174
|
}
|
|
@@ -44217,7 +44179,7 @@
|
|
|
44217
44179
|
return !this.isOk();
|
|
44218
44180
|
}
|
|
44219
44181
|
};
|
|
44220
|
-
let Err$
|
|
44182
|
+
let Err$3 = class Err {
|
|
44221
44183
|
constructor(error) {
|
|
44222
44184
|
this.error = error;
|
|
44223
44185
|
}
|
|
@@ -44228,8 +44190,8 @@
|
|
|
44228
44190
|
return !this.isOk();
|
|
44229
44191
|
}
|
|
44230
44192
|
};
|
|
44231
|
-
const ok$
|
|
44232
|
-
const err$
|
|
44193
|
+
const ok$3 = (value) => new Ok$3(value);
|
|
44194
|
+
const err$3 = (err2) => new Err$3(err2);
|
|
44233
44195
|
function resolvedPromiseLike$4(result) {
|
|
44234
44196
|
if (isPromiseLike$4(result)) {
|
|
44235
44197
|
return result.then((nextResult) => nextResult);
|
|
@@ -44372,6 +44334,15 @@
|
|
|
44372
44334
|
const requestedN = requested.split(".").map((s) => parseInt(s));
|
|
44373
44335
|
return providedN[0] === requestedN[0] && providedN[1] >= requestedN[1];
|
|
44374
44336
|
}
|
|
44337
|
+
function isUserVisibleError$3(error) {
|
|
44338
|
+
return error instanceof Error && "type" in error && error.type === "user-visible";
|
|
44339
|
+
}
|
|
44340
|
+
function logError$2(error) {
|
|
44341
|
+
if (isUserVisibleError$3(error)) {
|
|
44342
|
+
return;
|
|
44343
|
+
}
|
|
44344
|
+
console.error("OneStore Command threw an error that we did not expect", error);
|
|
44345
|
+
}
|
|
44375
44346
|
|
|
44376
44347
|
/*!
|
|
44377
44348
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -44471,20 +44442,20 @@
|
|
|
44471
44442
|
const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
|
|
44472
44443
|
const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
|
|
44473
44444
|
if (normalized.isErr()) {
|
|
44474
|
-
return err$
|
|
44445
|
+
return err$3(normalized.error);
|
|
44475
44446
|
}
|
|
44476
44447
|
cache.set(key, {
|
|
44477
44448
|
value: normalized.value,
|
|
44478
44449
|
metadata: this.cacheMetadata
|
|
44479
44450
|
});
|
|
44480
|
-
return ok$
|
|
44451
|
+
return ok$3({
|
|
44481
44452
|
type: "link",
|
|
44482
44453
|
linkedKey: key
|
|
44483
44454
|
});
|
|
44484
44455
|
}
|
|
44485
44456
|
validateEntry(entry) {
|
|
44486
44457
|
if (!isCacheEntryForType(entry, this)) {
|
|
44487
|
-
return err$
|
|
44458
|
+
return err$3([
|
|
44488
44459
|
{
|
|
44489
44460
|
type: "incorrectType",
|
|
44490
44461
|
expectedType: this.typeName,
|
|
@@ -44492,7 +44463,7 @@
|
|
|
44492
44463
|
}
|
|
44493
44464
|
]);
|
|
44494
44465
|
}
|
|
44495
|
-
return ok$
|
|
44466
|
+
return ok$3(void 0);
|
|
44496
44467
|
}
|
|
44497
44468
|
query(cache, query) {
|
|
44498
44469
|
return this.read(cache, {
|
|
@@ -44510,12 +44481,12 @@
|
|
|
44510
44481
|
if (cacheEntry) {
|
|
44511
44482
|
const validationResult = this.validateEntry(cacheEntry);
|
|
44512
44483
|
if (validationResult.isErr()) {
|
|
44513
|
-
return err$
|
|
44484
|
+
return err$3([...validationResult.error]);
|
|
44514
44485
|
}
|
|
44515
44486
|
const normalizedData = cacheEntry.value;
|
|
44516
44487
|
return this.denormalizeData(cache, { ...input, normalizedData });
|
|
44517
44488
|
}
|
|
44518
|
-
return err$
|
|
44489
|
+
return err$3([this.buildMissingDataError()]);
|
|
44519
44490
|
}
|
|
44520
44491
|
equals(x, y) {
|
|
44521
44492
|
return deepEquals$2(x, y);
|
|
@@ -44538,9 +44509,375 @@
|
|
|
44538
44509
|
}
|
|
44539
44510
|
function buildReadWriteResult(data, errors) {
|
|
44540
44511
|
if (errors.length > 0) {
|
|
44541
|
-
return err$
|
|
44512
|
+
return err$3(errors);
|
|
44513
|
+
}
|
|
44514
|
+
return ok$3(data);
|
|
44515
|
+
}
|
|
44516
|
+
|
|
44517
|
+
/*!
|
|
44518
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
44519
|
+
* All rights reserved.
|
|
44520
|
+
* For full license text, see the LICENSE.txt file
|
|
44521
|
+
*/
|
|
44522
|
+
let JsonSchemaViolationError$1 = class JsonSchemaViolationError extends Error {
|
|
44523
|
+
constructor(message, validationErrors) {
|
|
44524
|
+
super(message);
|
|
44525
|
+
this.validationErrors = [];
|
|
44526
|
+
this.validationErrors = validationErrors || [];
|
|
44527
|
+
}
|
|
44528
|
+
};
|
|
44529
|
+
let MinItemsViolationError$1 = class MinItemsViolationError extends JsonSchemaViolationError$1 {
|
|
44530
|
+
};
|
|
44531
|
+
let MaxItemsViolationError$1 = class MaxItemsViolationError extends JsonSchemaViolationError$1 {
|
|
44532
|
+
};
|
|
44533
|
+
let IncorrectTypeError$1 = class IncorrectTypeError extends JsonSchemaViolationError$1 {
|
|
44534
|
+
};
|
|
44535
|
+
let AdditionalPropertiesError$1 = class AdditionalPropertiesError extends JsonSchemaViolationError$1 {
|
|
44536
|
+
};
|
|
44537
|
+
let MissingRequiredPropertyError$1 = class MissingRequiredPropertyError extends JsonSchemaViolationError$1 {
|
|
44538
|
+
};
|
|
44539
|
+
let InvalidRefError$1 = class InvalidRefError extends JsonSchemaViolationError$1 {
|
|
44540
|
+
};
|
|
44541
|
+
let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
|
|
44542
|
+
constructor() {
|
|
44543
|
+
this.errors = [];
|
|
44544
|
+
}
|
|
44545
|
+
add(error) {
|
|
44546
|
+
this.errors.push(error);
|
|
44547
|
+
}
|
|
44548
|
+
append(response) {
|
|
44549
|
+
if (response.isErr()) {
|
|
44550
|
+
this.errors.push(...response.error);
|
|
44551
|
+
}
|
|
44552
|
+
}
|
|
44553
|
+
hasErrors() {
|
|
44554
|
+
return this.errors.length > 0;
|
|
44555
|
+
}
|
|
44556
|
+
prepend(error) {
|
|
44557
|
+
this.errors.unshift(error);
|
|
44558
|
+
}
|
|
44559
|
+
toValidationResponse() {
|
|
44560
|
+
return !this.hasErrors() ? ok$3(true) : err$3(this.errors);
|
|
44561
|
+
}
|
|
44562
|
+
};
|
|
44563
|
+
function createThrowableError$1(errors) {
|
|
44564
|
+
if (errors[0] instanceof MinItemsViolationError$1) {
|
|
44565
|
+
return new MinItemsViolationError$1(errors[0].message, errors);
|
|
44566
|
+
}
|
|
44567
|
+
if (errors[0] instanceof MaxItemsViolationError$1) {
|
|
44568
|
+
return new MaxItemsViolationError$1(errors[0].message, errors);
|
|
44569
|
+
}
|
|
44570
|
+
if (errors[0] instanceof IncorrectTypeError$1) {
|
|
44571
|
+
return new IncorrectTypeError$1(errors[0].message, errors);
|
|
44572
|
+
}
|
|
44573
|
+
if (errors[0] instanceof AdditionalPropertiesError$1) {
|
|
44574
|
+
return new AdditionalPropertiesError$1(errors[0].message, errors);
|
|
44575
|
+
}
|
|
44576
|
+
if (errors[0] instanceof MissingRequiredPropertyError$1) {
|
|
44577
|
+
return new MissingRequiredPropertyError$1(errors[0].message, errors);
|
|
44578
|
+
}
|
|
44579
|
+
if (errors[0] instanceof InvalidRefError$1) {
|
|
44580
|
+
return new InvalidRefError$1(errors[0].message, errors);
|
|
44581
|
+
}
|
|
44582
|
+
return new JsonSchemaViolationError$1(errors[0].message, errors);
|
|
44583
|
+
}
|
|
44584
|
+
function assertIsValid$1(data, schema) {
|
|
44585
|
+
const validationResponse = validateJsonSchema$1(data, schema);
|
|
44586
|
+
if (validationResponse.isErr()) {
|
|
44587
|
+
throw createThrowableError$1(validationResponse.error);
|
|
44588
|
+
}
|
|
44589
|
+
}
|
|
44590
|
+
function incorrectTypeError$1(expected, actual, path) {
|
|
44591
|
+
return new IncorrectTypeError$1(
|
|
44592
|
+
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
44593
|
+
);
|
|
44594
|
+
}
|
|
44595
|
+
function validSchemaResponse$1() {
|
|
44596
|
+
return ok$3(true);
|
|
44597
|
+
}
|
|
44598
|
+
function invalidSchemaResponseWithError$1(error) {
|
|
44599
|
+
return err$3([error]);
|
|
44600
|
+
}
|
|
44601
|
+
function validateJsonSchema$1(data, schema, path = "$", document = schema) {
|
|
44602
|
+
if (schema === true) return validSchemaResponse$1();
|
|
44603
|
+
if (schema === false)
|
|
44604
|
+
return invalidSchemaResponseWithError$1(
|
|
44605
|
+
new JsonSchemaViolationError$1(`Data at ${path} has schema 'false'`)
|
|
44606
|
+
);
|
|
44607
|
+
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
44608
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44609
|
+
if ("anyOf" in schema) {
|
|
44610
|
+
errorCollector.append(validateAnyOf$1(data, schema, path, document));
|
|
44611
|
+
} else if ("oneOf" in schema) {
|
|
44612
|
+
errorCollector.append(validateOneOf$1(data, schema, path, document));
|
|
44613
|
+
} else if ("allOf" in schema) {
|
|
44614
|
+
errorCollector.append(validateAllOf$1(data, schema, path, document));
|
|
44615
|
+
} else if ("not" in schema) {
|
|
44616
|
+
errorCollector.append(validateNot$1(data, schema, path, document));
|
|
44617
|
+
} else if ("$ref" in schema) {
|
|
44618
|
+
errorCollector.append(validateRef$1(data, schema, path, document));
|
|
44619
|
+
} else if ("type" in schema) {
|
|
44620
|
+
if (schema.type === "object") {
|
|
44621
|
+
if (dataType !== "object") {
|
|
44622
|
+
errorCollector.add(incorrectTypeError$1("object", dataType, path));
|
|
44623
|
+
} else {
|
|
44624
|
+
errorCollector.append(
|
|
44625
|
+
validateObject$1(data, schema, path, document)
|
|
44626
|
+
);
|
|
44627
|
+
}
|
|
44628
|
+
} else if (schema.type === "array") {
|
|
44629
|
+
if (dataType !== "array") {
|
|
44630
|
+
errorCollector.add(incorrectTypeError$1("array", dataType, path));
|
|
44631
|
+
} else {
|
|
44632
|
+
errorCollector.append(
|
|
44633
|
+
validateArray$1(data, schema, path, document)
|
|
44634
|
+
);
|
|
44635
|
+
}
|
|
44636
|
+
} else {
|
|
44637
|
+
errorCollector.append(
|
|
44638
|
+
validateScalar$1(data, schema, path)
|
|
44639
|
+
);
|
|
44640
|
+
}
|
|
44641
|
+
}
|
|
44642
|
+
if (schema.enum) {
|
|
44643
|
+
errorCollector.append(validateEnum$1(data, schema.enum, path));
|
|
44644
|
+
}
|
|
44645
|
+
if (schema.const) {
|
|
44646
|
+
errorCollector.append(validateConst$1(data, schema.const, path));
|
|
44647
|
+
}
|
|
44648
|
+
return errorCollector.toValidationResponse();
|
|
44649
|
+
}
|
|
44650
|
+
function validateAnyOf$1(data, schema, path, document) {
|
|
44651
|
+
let isValid = false;
|
|
44652
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44653
|
+
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
44654
|
+
const element = schema.anyOf[i];
|
|
44655
|
+
const validationResponse = validateJsonSchema$1(
|
|
44656
|
+
data,
|
|
44657
|
+
element,
|
|
44658
|
+
`${path}.anyOf[${i}]`,
|
|
44659
|
+
document
|
|
44660
|
+
);
|
|
44661
|
+
if (validationResponse.isOk()) {
|
|
44662
|
+
isValid = true;
|
|
44663
|
+
break;
|
|
44664
|
+
} else {
|
|
44665
|
+
errorCollector.append(validationResponse);
|
|
44666
|
+
}
|
|
44667
|
+
}
|
|
44668
|
+
if (!isValid) {
|
|
44669
|
+
errorCollector.prepend(
|
|
44670
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in anyOf.`)
|
|
44671
|
+
);
|
|
44672
|
+
return errorCollector.toValidationResponse();
|
|
44673
|
+
}
|
|
44674
|
+
return validSchemaResponse$1();
|
|
44675
|
+
}
|
|
44676
|
+
function validateOneOf$1(data, schema, path, document) {
|
|
44677
|
+
let validSubShemaPaths = [];
|
|
44678
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44679
|
+
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
44680
|
+
const element = schema.oneOf[i];
|
|
44681
|
+
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
44682
|
+
const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
|
|
44683
|
+
if (validationResponse.isOk()) {
|
|
44684
|
+
validSubShemaPaths.push(oneOfPath);
|
|
44685
|
+
} else {
|
|
44686
|
+
errorCollector.append(validationResponse);
|
|
44687
|
+
}
|
|
44688
|
+
}
|
|
44689
|
+
if (validSubShemaPaths.length === 0) {
|
|
44690
|
+
errorCollector.prepend(
|
|
44691
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in oneOf.`)
|
|
44692
|
+
);
|
|
44693
|
+
return errorCollector.toValidationResponse();
|
|
44694
|
+
} else if (validSubShemaPaths.length > 1) {
|
|
44695
|
+
errorCollector.prepend(
|
|
44696
|
+
new JsonSchemaViolationError$1(
|
|
44697
|
+
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
44698
|
+
)
|
|
44699
|
+
);
|
|
44700
|
+
return errorCollector.toValidationResponse();
|
|
44701
|
+
}
|
|
44702
|
+
return validSchemaResponse$1();
|
|
44703
|
+
}
|
|
44704
|
+
function validateAllOf$1(data, schema, path, document) {
|
|
44705
|
+
let isValid = true;
|
|
44706
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44707
|
+
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
44708
|
+
const element = schema.allOf[i];
|
|
44709
|
+
const validationResponse = validateJsonSchema$1(
|
|
44710
|
+
data,
|
|
44711
|
+
element,
|
|
44712
|
+
`${path}.allOf[${i}]`,
|
|
44713
|
+
document
|
|
44714
|
+
);
|
|
44715
|
+
if (!validationResponse.isOk()) {
|
|
44716
|
+
errorCollector.append(validationResponse);
|
|
44717
|
+
isValid = false;
|
|
44718
|
+
}
|
|
44719
|
+
}
|
|
44720
|
+
if (!isValid) {
|
|
44721
|
+
errorCollector.prepend(
|
|
44722
|
+
new JsonSchemaViolationError$1(`Data at ${path} did not match some subschemas in allOf.`)
|
|
44723
|
+
);
|
|
44724
|
+
}
|
|
44725
|
+
return errorCollector.toValidationResponse();
|
|
44726
|
+
}
|
|
44727
|
+
function validateNot$1(data, schema, path, document) {
|
|
44728
|
+
const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
|
|
44729
|
+
if (validationResponse.isOk()) {
|
|
44730
|
+
return invalidSchemaResponseWithError$1(
|
|
44731
|
+
new JsonSchemaViolationError$1(
|
|
44732
|
+
`Data at ${path} validated against the schema of a not clause.`
|
|
44733
|
+
)
|
|
44734
|
+
);
|
|
44735
|
+
}
|
|
44736
|
+
return validSchemaResponse$1();
|
|
44737
|
+
}
|
|
44738
|
+
function validateObject$1(data, schema, path, document) {
|
|
44739
|
+
const schemaKeys = Object.keys(schema.properties);
|
|
44740
|
+
const requiredKeys = new Set(schema.required);
|
|
44741
|
+
const schemaKeySet = new Set(schemaKeys);
|
|
44742
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44743
|
+
Object.keys(data).forEach((key) => {
|
|
44744
|
+
if (!schemaKeySet.has(key)) {
|
|
44745
|
+
errorCollector.append(
|
|
44746
|
+
validateJsonSchema$1(
|
|
44747
|
+
data[key],
|
|
44748
|
+
schema.additionalProperties,
|
|
44749
|
+
`${path}.additionalProperties[${key}]`,
|
|
44750
|
+
document
|
|
44751
|
+
)
|
|
44752
|
+
);
|
|
44753
|
+
}
|
|
44754
|
+
});
|
|
44755
|
+
for (let i = 0, length = schemaKeys.length; i < length; i++) {
|
|
44756
|
+
const key = schemaKeys[i];
|
|
44757
|
+
const keyInData = key in data && data[key] !== void 0;
|
|
44758
|
+
if (requiredKeys.has(key) && !keyInData) {
|
|
44759
|
+
errorCollector.add(
|
|
44760
|
+
new MissingRequiredPropertyError$1(
|
|
44761
|
+
`Object at path '${path}' is missing required property '${key}'.`
|
|
44762
|
+
)
|
|
44763
|
+
);
|
|
44764
|
+
}
|
|
44765
|
+
if (keyInData) {
|
|
44766
|
+
errorCollector.append(
|
|
44767
|
+
validateJsonSchema$1(
|
|
44768
|
+
data[key],
|
|
44769
|
+
schema.properties[key],
|
|
44770
|
+
`${path}.${key}`,
|
|
44771
|
+
document
|
|
44772
|
+
)
|
|
44773
|
+
);
|
|
44774
|
+
}
|
|
44775
|
+
}
|
|
44776
|
+
return errorCollector.toValidationResponse();
|
|
44777
|
+
}
|
|
44778
|
+
function validateArray$1(data, schema, path, document) {
|
|
44779
|
+
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
44780
|
+
return invalidSchemaResponseWithError$1(
|
|
44781
|
+
new MinItemsViolationError$1(
|
|
44782
|
+
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
44783
|
+
)
|
|
44784
|
+
);
|
|
44785
|
+
}
|
|
44786
|
+
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
44787
|
+
return invalidSchemaResponseWithError$1(
|
|
44788
|
+
new MaxItemsViolationError$1(
|
|
44789
|
+
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
44790
|
+
)
|
|
44791
|
+
);
|
|
44792
|
+
}
|
|
44793
|
+
const errorCollector = new JsonSchemaErrorCollector$1();
|
|
44794
|
+
data.forEach(
|
|
44795
|
+
(element, index) => errorCollector.append(
|
|
44796
|
+
validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
|
|
44797
|
+
)
|
|
44798
|
+
);
|
|
44799
|
+
return errorCollector.toValidationResponse();
|
|
44800
|
+
}
|
|
44801
|
+
function validateScalar$1(data, schema, path) {
|
|
44802
|
+
const schemaDataType = schema.type;
|
|
44803
|
+
const dataType = typeof data;
|
|
44804
|
+
if (schemaDataType === "integer") {
|
|
44805
|
+
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
44806
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("integer", dataType, path));
|
|
44807
|
+
}
|
|
44808
|
+
} else if (schemaDataType === "number") {
|
|
44809
|
+
if (dataType !== "number") {
|
|
44810
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("number", dataType, path));
|
|
44811
|
+
}
|
|
44812
|
+
} else if (schemaDataType === "string") {
|
|
44813
|
+
if (dataType !== "string") {
|
|
44814
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("string", dataType, path));
|
|
44815
|
+
}
|
|
44816
|
+
} else if (schemaDataType === "boolean") {
|
|
44817
|
+
if (dataType !== "boolean") {
|
|
44818
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("boolean", dataType, path));
|
|
44819
|
+
}
|
|
44820
|
+
} else if (schemaDataType === "null") {
|
|
44821
|
+
if (data !== null) {
|
|
44822
|
+
return invalidSchemaResponseWithError$1(incorrectTypeError$1("null", dataType, path));
|
|
44823
|
+
}
|
|
44824
|
+
} else {
|
|
44825
|
+
return invalidSchemaResponseWithError$1(
|
|
44826
|
+
new IncorrectTypeError$1(`Unknown schema data type: ${schemaDataType}.`)
|
|
44827
|
+
);
|
|
44828
|
+
}
|
|
44829
|
+
return validSchemaResponse$1();
|
|
44830
|
+
}
|
|
44831
|
+
function validateRef$1(data, schema, path, document) {
|
|
44832
|
+
if (!schema.$ref.startsWith("#")) {
|
|
44833
|
+
return invalidSchemaResponseWithError$1(
|
|
44834
|
+
new InvalidRefError$1(
|
|
44835
|
+
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
44836
|
+
)
|
|
44837
|
+
);
|
|
44838
|
+
}
|
|
44839
|
+
try {
|
|
44840
|
+
const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
|
|
44841
|
+
return validateJsonSchema$1(data, schemaToValidate, path, document);
|
|
44842
|
+
} catch (e) {
|
|
44843
|
+
return invalidSchemaResponseWithError$1(e);
|
|
44844
|
+
}
|
|
44845
|
+
}
|
|
44846
|
+
function validateEnum$1(data, enumValue, path) {
|
|
44847
|
+
if (!enumValue.some((value) => deepEquals$2(value, data))) {
|
|
44848
|
+
return invalidSchemaResponseWithError$1(
|
|
44849
|
+
new JsonSchemaViolationError$1(
|
|
44850
|
+
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
|
|
44851
|
+
)
|
|
44852
|
+
);
|
|
44853
|
+
}
|
|
44854
|
+
return validSchemaResponse$1();
|
|
44855
|
+
}
|
|
44856
|
+
function validateConst$1(data, constValue, path) {
|
|
44857
|
+
if (!deepEquals$2(constValue, data)) {
|
|
44858
|
+
return invalidSchemaResponseWithError$1(
|
|
44859
|
+
new JsonSchemaViolationError$1(
|
|
44860
|
+
`Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
|
|
44861
|
+
)
|
|
44862
|
+
);
|
|
44863
|
+
}
|
|
44864
|
+
return validSchemaResponse$1();
|
|
44865
|
+
}
|
|
44866
|
+
function findSchemaAtPath$1(document, ref) {
|
|
44867
|
+
if (ref === "#") return document;
|
|
44868
|
+
const keys = ref.replace(/^#\//, "").split("/");
|
|
44869
|
+
let current = document;
|
|
44870
|
+
let path = "#";
|
|
44871
|
+
for (const key of keys) {
|
|
44872
|
+
path = `${path}/${key}`;
|
|
44873
|
+
if (current[key] === void 0) {
|
|
44874
|
+
throw new InvalidRefError$1(
|
|
44875
|
+
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
44876
|
+
);
|
|
44877
|
+
}
|
|
44878
|
+
current = current[key];
|
|
44542
44879
|
}
|
|
44543
|
-
return
|
|
44880
|
+
return current;
|
|
44544
44881
|
}
|
|
44545
44882
|
|
|
44546
44883
|
/*!
|
|
@@ -45387,35 +45724,6 @@
|
|
|
45387
45724
|
}
|
|
45388
45725
|
return referenceMap.get(astReference);
|
|
45389
45726
|
};
|
|
45390
|
-
/*!
|
|
45391
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
45392
|
-
* All rights reserved.
|
|
45393
|
-
* For full license text, see the LICENSE.txt file
|
|
45394
|
-
*/
|
|
45395
|
-
let Ok$3 = class Ok {
|
|
45396
|
-
constructor(value) {
|
|
45397
|
-
this.value = value;
|
|
45398
|
-
}
|
|
45399
|
-
isOk() {
|
|
45400
|
-
return true;
|
|
45401
|
-
}
|
|
45402
|
-
isErr() {
|
|
45403
|
-
return !this.isOk();
|
|
45404
|
-
}
|
|
45405
|
-
};
|
|
45406
|
-
let Err$3 = class Err {
|
|
45407
|
-
constructor(error) {
|
|
45408
|
-
this.error = error;
|
|
45409
|
-
}
|
|
45410
|
-
isOk() {
|
|
45411
|
-
return false;
|
|
45412
|
-
}
|
|
45413
|
-
isErr() {
|
|
45414
|
-
return !this.isOk();
|
|
45415
|
-
}
|
|
45416
|
-
};
|
|
45417
|
-
const ok$3 = (value) => new Ok$3(value);
|
|
45418
|
-
const err$3 = (err2) => new Err$3(err2);
|
|
45419
45727
|
function findExecutableOperation$2(document, operationName) {
|
|
45420
45728
|
const operations = document.definitions.filter(
|
|
45421
45729
|
(def) => def.kind === Kind$1.OPERATION_DEFINITION
|
|
@@ -45466,6 +45774,14 @@
|
|
|
45466
45774
|
query: result.value
|
|
45467
45775
|
});
|
|
45468
45776
|
}
|
|
45777
|
+
function toGraphQLErrorResponse(error) {
|
|
45778
|
+
logError$2(error);
|
|
45779
|
+
const message = error instanceof JsonSchemaViolationError$1 ? `Invalid GraphQL config: ${error.message}` : "Internal error in GraphQL adapter occurred";
|
|
45780
|
+
return {
|
|
45781
|
+
data: void 0,
|
|
45782
|
+
errors: [{ message, locations: [] }]
|
|
45783
|
+
};
|
|
45784
|
+
}
|
|
45469
45785
|
function resolveAndValidateGraphQLDocument(query, operationName, options) {
|
|
45470
45786
|
const resolved = resolveAst(query);
|
|
45471
45787
|
if (resolved === void 0) {
|
|
@@ -51204,7 +51520,6 @@
|
|
|
51204
51520
|
const key = keyBuilder$1M(luvio, createResourceParams$g(config));
|
|
51205
51521
|
const allTrackedFields = getTrackedFields(key, luvio.getNode(key), {
|
|
51206
51522
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
51207
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
51208
51523
|
}, config.optionalFields);
|
|
51209
51524
|
const optionalFields = fields === undefined ? allTrackedFields : difference(allTrackedFields, fields);
|
|
51210
51525
|
const resourceParams = createResourceParams$g({
|
|
@@ -51331,7 +51646,6 @@
|
|
|
51331
51646
|
};
|
|
51332
51647
|
const childTrackedFields = getTrackedFields(childKey, luvio.getNode(childKey), {
|
|
51333
51648
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
51334
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
51335
51649
|
}, childResourceParams.queryParams.optionalFields);
|
|
51336
51650
|
const childSnapshot = ingestSuccess$8(luvio, {
|
|
51337
51651
|
recordId: childResourceParams.urlParams.recordId,
|
|
@@ -56301,7 +56615,6 @@
|
|
|
56301
56615
|
const key = keyBuilder$1w$1(luvio, config);
|
|
56302
56616
|
const trackedFieldsConfig = {
|
|
56303
56617
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
56304
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
56305
56618
|
};
|
|
56306
56619
|
const optionalFieldsTrie = convertFieldsToTrie(getTrackedFields(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
|
|
56307
56620
|
const fieldsTrie = BLANK_RECORD_FIELDS_TRIE;
|
|
@@ -60173,7 +60486,6 @@
|
|
|
60173
60486
|
...resourceRequest.queryParams,
|
|
60174
60487
|
optionalFields: getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
60175
60488
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60176
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60177
60489
|
}, config.optionalFields),
|
|
60178
60490
|
},
|
|
60179
60491
|
});
|
|
@@ -60725,7 +61037,6 @@
|
|
|
60725
61037
|
...resourceRequest.queryParams,
|
|
60726
61038
|
optionalFields: getTrackedFields(recordTemplateKey, luvio.getNode(recordTemplateKey), {
|
|
60727
61039
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60728
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60729
61040
|
}, config.optionalFields),
|
|
60730
61041
|
},
|
|
60731
61042
|
});
|
|
@@ -60745,7 +61056,6 @@
|
|
|
60745
61056
|
});
|
|
60746
61057
|
const allTrackedFields = getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
|
|
60747
61058
|
maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
|
|
60748
|
-
onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
|
|
60749
61059
|
}, optionalFields);
|
|
60750
61060
|
const allTrackedFieldsTrie = convertFieldsToTrie(allTrackedFields, true);
|
|
60751
61061
|
const ingest = createFieldsIngestSuccess({
|
|
@@ -80509,6 +80819,7 @@
|
|
|
80509
80819
|
}
|
|
80510
80820
|
async buildPendingAction(request, queue) {
|
|
80511
80821
|
this.resolveResourceRequestBody(request.body);
|
|
80822
|
+
// eslint-disable-next-line no-return-await
|
|
80512
80823
|
return await super.buildPendingAction(request, queue);
|
|
80513
80824
|
}
|
|
80514
80825
|
resolveResourceRequestBody(body) {
|
|
@@ -80941,8 +81252,6 @@
|
|
|
80941
81252
|
return customEvent.namespace === CONTENT_DOCUMENT_AND_VERSION_NAMESPACE;
|
|
80942
81253
|
}
|
|
80943
81254
|
|
|
80944
|
-
// so eslint doesn't complain about nimbus
|
|
80945
|
-
/* global __nimbus */
|
|
80946
81255
|
function chunkToBase64(chunk) {
|
|
80947
81256
|
const bytes = new Uint8Array(chunk);
|
|
80948
81257
|
const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
|
|
@@ -87022,6 +87331,7 @@
|
|
|
87022
87331
|
const parentObjectInfo = objectInfos[parentObjectApiNames[0]];
|
|
87023
87332
|
// this should not be undefined, but lets catch it if we do end up in that state.
|
|
87024
87333
|
if (parentObjectInfo === undefined) {
|
|
87334
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
87025
87335
|
throw new Error(`ObjectInfo is missing for ${parentObjectApiNames[0]} for ${parentApiPath}`);
|
|
87026
87336
|
}
|
|
87027
87337
|
const relationshipField = referenceIdFieldForRelationship(lastSegment);
|
|
@@ -88394,6 +88704,7 @@
|
|
|
88394
88704
|
}
|
|
88395
88705
|
const query = data.uiapi.query;
|
|
88396
88706
|
// Check all entity types in the query for edges - using for...in to avoid array allocation
|
|
88707
|
+
// eslint-disable-next-line guard-for-in
|
|
88397
88708
|
for (const entityType in query) {
|
|
88398
88709
|
const entity = query[entityType];
|
|
88399
88710
|
if (entity && entity.edges && isArray$3$1(entity.edges) && entity.edges.length > 0) {
|
|
@@ -90315,7 +90626,9 @@
|
|
|
90315
90626
|
}
|
|
90316
90627
|
instrumentation$2$1.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
|
|
90317
90628
|
}
|
|
90318
|
-
catch {
|
|
90629
|
+
catch {
|
|
90630
|
+
// intentionally do nothing
|
|
90631
|
+
}
|
|
90319
90632
|
}
|
|
90320
90633
|
}
|
|
90321
90634
|
|
|
@@ -91024,6 +91337,7 @@
|
|
|
91024
91337
|
const userData = {
|
|
91025
91338
|
...stats,
|
|
91026
91339
|
};
|
|
91340
|
+
// eslint-disable-next-line guard-for-in
|
|
91027
91341
|
for (const error in errors) {
|
|
91028
91342
|
activity.error(error);
|
|
91029
91343
|
}
|
|
@@ -91204,6 +91518,7 @@
|
|
|
91204
91518
|
let limitedResult = this.applyRetryLimits(result.additionalWork);
|
|
91205
91519
|
this.enqueue(limitedResult.additionalWork);
|
|
91206
91520
|
if (limitedResult.recordsNeedingRefetch.size > 0) {
|
|
91521
|
+
// eslint-disable-next-line guard-for-in
|
|
91207
91522
|
for (const key in keys$3(limitedResult.recordsNeedingRefetch)) {
|
|
91208
91523
|
const value = limitedResult.recordsNeedingRefetch.get(key);
|
|
91209
91524
|
if (result.recordsNeedingRefetch.has(key)) {
|
|
@@ -93469,6 +93784,7 @@
|
|
|
93469
93784
|
async exists(key) {
|
|
93470
93785
|
const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
|
|
93471
93786
|
const exists = result.rows[0][0];
|
|
93787
|
+
// eslint-disable-next-line eqeqeq
|
|
93472
93788
|
return exists == true;
|
|
93473
93789
|
}
|
|
93474
93790
|
async getRecord(key) {
|
|
@@ -93683,7 +93999,7 @@
|
|
|
93683
93999
|
CounterResult["Error"] = "Error";
|
|
93684
94000
|
})(CounterResult || (CounterResult = {}));
|
|
93685
94001
|
function incrementCounter(name, result) {
|
|
93686
|
-
instrumentation$4.incrementCounter('SFSSideEffect', 1, result
|
|
94002
|
+
instrumentation$4.incrementCounter('SFSSideEffect', 1, result === CounterResult.Error, {
|
|
93687
94003
|
Name: name,
|
|
93688
94004
|
Result: result,
|
|
93689
94005
|
});
|
|
@@ -94096,16 +94412,17 @@
|
|
|
94096
94412
|
}
|
|
94097
94413
|
return ok$1(auraReturnValue);
|
|
94098
94414
|
}).catch((error) => {
|
|
94099
|
-
if (!error
|
|
94415
|
+
if (!error) {
|
|
94100
94416
|
return err$1(toError("Failed to get error from response"));
|
|
94101
|
-
} else {
|
|
94102
|
-
const actionErrors = error.getError();
|
|
94103
|
-
if (actionErrors.length > 0) {
|
|
94104
|
-
return err$1(coerceError(actionErrors));
|
|
94105
|
-
} else {
|
|
94106
|
-
return err$1(toError("Error fetching component"));
|
|
94107
|
-
}
|
|
94108
94417
|
}
|
|
94418
|
+
if (!error.getError) {
|
|
94419
|
+
return err$1(toError(error));
|
|
94420
|
+
}
|
|
94421
|
+
const actionErrors = error.getError();
|
|
94422
|
+
if (actionErrors.length > 0) {
|
|
94423
|
+
return err$1(coerceError(actionErrors));
|
|
94424
|
+
}
|
|
94425
|
+
return err$1(toError("Error fetching component"));
|
|
94109
94426
|
});
|
|
94110
94427
|
}
|
|
94111
94428
|
convertFetchResponseToData(response) {
|
|
@@ -94788,16 +95105,17 @@
|
|
|
94788
95105
|
} catch {
|
|
94789
95106
|
}
|
|
94790
95107
|
}).catch((error) => {
|
|
94791
|
-
if (!error
|
|
95108
|
+
if (!error) {
|
|
94792
95109
|
return err$1(toError("Failed to get error from response"));
|
|
94793
|
-
} else {
|
|
94794
|
-
const actionErrors = error.getError();
|
|
94795
|
-
if (actionErrors.length > 0) {
|
|
94796
|
-
return err$1(coerceError(actionErrors));
|
|
94797
|
-
} else {
|
|
94798
|
-
return err$1(toError("Error fetching component"));
|
|
94799
|
-
}
|
|
94800
95110
|
}
|
|
95111
|
+
if (!error.getError) {
|
|
95112
|
+
return err$1(toError(error));
|
|
95113
|
+
}
|
|
95114
|
+
const actionErrors = error.getError();
|
|
95115
|
+
if (actionErrors.length > 0) {
|
|
95116
|
+
return err$1(coerceError(actionErrors));
|
|
95117
|
+
}
|
|
95118
|
+
return err$1(toError("Error fetching component"));
|
|
94801
95119
|
});
|
|
94802
95120
|
}
|
|
94803
95121
|
convertFetchResponseToData(response) {
|
|
@@ -94932,16 +95250,17 @@
|
|
|
94932
95250
|
} catch {
|
|
94933
95251
|
}
|
|
94934
95252
|
}).catch((error) => {
|
|
94935
|
-
if (!error
|
|
95253
|
+
if (!error) {
|
|
94936
95254
|
return err$1(toError("Failed to get error from response"));
|
|
94937
|
-
} else {
|
|
94938
|
-
const actionErrors = error.getError();
|
|
94939
|
-
if (actionErrors.length > 0) {
|
|
94940
|
-
return err$1(coerceError(actionErrors));
|
|
94941
|
-
} else {
|
|
94942
|
-
return err$1(toError("Error fetching component"));
|
|
94943
|
-
}
|
|
94944
95255
|
}
|
|
95256
|
+
if (!error.getError) {
|
|
95257
|
+
return err$1(toError(error));
|
|
95258
|
+
}
|
|
95259
|
+
const actionErrors = error.getError();
|
|
95260
|
+
if (actionErrors.length > 0) {
|
|
95261
|
+
return err$1(coerceError(actionErrors));
|
|
95262
|
+
}
|
|
95263
|
+
return err$1(toError("Error fetching component"));
|
|
94945
95264
|
});
|
|
94946
95265
|
}
|
|
94947
95266
|
convertFetchResponseToData(response) {
|
|
@@ -96252,7 +96571,7 @@
|
|
|
96252
96571
|
},
|
|
96253
96572
|
};
|
|
96254
96573
|
}
|
|
96255
|
-
// version: 1.
|
|
96574
|
+
// version: 1.434.0-6aa2dd15e3
|
|
96256
96575
|
|
|
96257
96576
|
/**
|
|
96258
96577
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96278,7 +96597,7 @@
|
|
|
96278
96597
|
},
|
|
96279
96598
|
};
|
|
96280
96599
|
}
|
|
96281
|
-
// version: 1.
|
|
96600
|
+
// version: 1.434.0-6aa2dd15e3
|
|
96282
96601
|
|
|
96283
96602
|
/*!
|
|
96284
96603
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96683,26 +97002,26 @@
|
|
|
96683
97002
|
* All rights reserved.
|
|
96684
97003
|
* For full license text, see the LICENSE.txt file
|
|
96685
97004
|
*/
|
|
96686
|
-
|
|
97005
|
+
class JsonSchemaViolationError extends Error {
|
|
96687
97006
|
constructor(message, validationErrors) {
|
|
96688
97007
|
super(message);
|
|
96689
97008
|
this.validationErrors = [];
|
|
96690
97009
|
this.validationErrors = validationErrors || [];
|
|
96691
97010
|
}
|
|
96692
|
-
}
|
|
96693
|
-
|
|
96694
|
-
}
|
|
96695
|
-
|
|
96696
|
-
}
|
|
96697
|
-
|
|
96698
|
-
}
|
|
96699
|
-
|
|
96700
|
-
}
|
|
96701
|
-
|
|
96702
|
-
}
|
|
96703
|
-
|
|
96704
|
-
}
|
|
96705
|
-
|
|
97011
|
+
}
|
|
97012
|
+
class MinItemsViolationError extends JsonSchemaViolationError {
|
|
97013
|
+
}
|
|
97014
|
+
class MaxItemsViolationError extends JsonSchemaViolationError {
|
|
97015
|
+
}
|
|
97016
|
+
class IncorrectTypeError extends JsonSchemaViolationError {
|
|
97017
|
+
}
|
|
97018
|
+
class AdditionalPropertiesError extends JsonSchemaViolationError {
|
|
97019
|
+
}
|
|
97020
|
+
class MissingRequiredPropertyError extends JsonSchemaViolationError {
|
|
97021
|
+
}
|
|
97022
|
+
class InvalidRefError extends JsonSchemaViolationError {
|
|
97023
|
+
}
|
|
97024
|
+
class JsonSchemaErrorCollector {
|
|
96706
97025
|
constructor() {
|
|
96707
97026
|
this.errors = [];
|
|
96708
97027
|
}
|
|
@@ -96723,100 +97042,100 @@
|
|
|
96723
97042
|
toValidationResponse() {
|
|
96724
97043
|
return !this.hasErrors() ? ok$1(true) : err$1(this.errors);
|
|
96725
97044
|
}
|
|
96726
|
-
}
|
|
96727
|
-
function createThrowableError
|
|
96728
|
-
if (errors[0] instanceof MinItemsViolationError
|
|
96729
|
-
return new MinItemsViolationError
|
|
97045
|
+
}
|
|
97046
|
+
function createThrowableError(errors) {
|
|
97047
|
+
if (errors[0] instanceof MinItemsViolationError) {
|
|
97048
|
+
return new MinItemsViolationError(errors[0].message, errors);
|
|
96730
97049
|
}
|
|
96731
|
-
if (errors[0] instanceof MaxItemsViolationError
|
|
96732
|
-
return new MaxItemsViolationError
|
|
97050
|
+
if (errors[0] instanceof MaxItemsViolationError) {
|
|
97051
|
+
return new MaxItemsViolationError(errors[0].message, errors);
|
|
96733
97052
|
}
|
|
96734
|
-
if (errors[0] instanceof IncorrectTypeError
|
|
96735
|
-
return new IncorrectTypeError
|
|
97053
|
+
if (errors[0] instanceof IncorrectTypeError) {
|
|
97054
|
+
return new IncorrectTypeError(errors[0].message, errors);
|
|
96736
97055
|
}
|
|
96737
|
-
if (errors[0] instanceof AdditionalPropertiesError
|
|
96738
|
-
return new AdditionalPropertiesError
|
|
97056
|
+
if (errors[0] instanceof AdditionalPropertiesError) {
|
|
97057
|
+
return new AdditionalPropertiesError(errors[0].message, errors);
|
|
96739
97058
|
}
|
|
96740
|
-
if (errors[0] instanceof MissingRequiredPropertyError
|
|
96741
|
-
return new MissingRequiredPropertyError
|
|
97059
|
+
if (errors[0] instanceof MissingRequiredPropertyError) {
|
|
97060
|
+
return new MissingRequiredPropertyError(errors[0].message, errors);
|
|
96742
97061
|
}
|
|
96743
|
-
if (errors[0] instanceof InvalidRefError
|
|
96744
|
-
return new InvalidRefError
|
|
97062
|
+
if (errors[0] instanceof InvalidRefError) {
|
|
97063
|
+
return new InvalidRefError(errors[0].message, errors);
|
|
96745
97064
|
}
|
|
96746
|
-
return new JsonSchemaViolationError
|
|
97065
|
+
return new JsonSchemaViolationError(errors[0].message, errors);
|
|
96747
97066
|
}
|
|
96748
|
-
function assertIsValid
|
|
96749
|
-
const validationResponse = validateJsonSchema
|
|
97067
|
+
function assertIsValid(data, schema) {
|
|
97068
|
+
const validationResponse = validateJsonSchema(data, schema);
|
|
96750
97069
|
if (validationResponse.isErr()) {
|
|
96751
|
-
throw createThrowableError
|
|
97070
|
+
throw createThrowableError(validationResponse.error);
|
|
96752
97071
|
}
|
|
96753
97072
|
}
|
|
96754
|
-
function incorrectTypeError
|
|
96755
|
-
return new IncorrectTypeError
|
|
97073
|
+
function incorrectTypeError(expected, actual, path) {
|
|
97074
|
+
return new IncorrectTypeError(
|
|
96756
97075
|
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
96757
97076
|
);
|
|
96758
97077
|
}
|
|
96759
|
-
function validSchemaResponse
|
|
97078
|
+
function validSchemaResponse() {
|
|
96760
97079
|
return ok$1(true);
|
|
96761
97080
|
}
|
|
96762
|
-
function invalidSchemaResponseWithError
|
|
97081
|
+
function invalidSchemaResponseWithError(error) {
|
|
96763
97082
|
return err$1([error]);
|
|
96764
97083
|
}
|
|
96765
|
-
function validateJsonSchema
|
|
96766
|
-
if (schema === true) return validSchemaResponse
|
|
97084
|
+
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
97085
|
+
if (schema === true) return validSchemaResponse();
|
|
96767
97086
|
if (schema === false)
|
|
96768
|
-
return invalidSchemaResponseWithError
|
|
96769
|
-
new JsonSchemaViolationError
|
|
97087
|
+
return invalidSchemaResponseWithError(
|
|
97088
|
+
new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
|
|
96770
97089
|
);
|
|
96771
97090
|
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
96772
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97091
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96773
97092
|
if ("anyOf" in schema) {
|
|
96774
|
-
errorCollector.append(validateAnyOf
|
|
97093
|
+
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
96775
97094
|
} else if ("oneOf" in schema) {
|
|
96776
|
-
errorCollector.append(validateOneOf
|
|
97095
|
+
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
96777
97096
|
} else if ("allOf" in schema) {
|
|
96778
|
-
errorCollector.append(validateAllOf
|
|
97097
|
+
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
96779
97098
|
} else if ("not" in schema) {
|
|
96780
|
-
errorCollector.append(validateNot
|
|
97099
|
+
errorCollector.append(validateNot(data, schema, path, document));
|
|
96781
97100
|
} else if ("$ref" in schema) {
|
|
96782
|
-
errorCollector.append(validateRef
|
|
97101
|
+
errorCollector.append(validateRef(data, schema, path, document));
|
|
96783
97102
|
} else if ("type" in schema) {
|
|
96784
97103
|
if (schema.type === "object") {
|
|
96785
97104
|
if (dataType !== "object") {
|
|
96786
|
-
errorCollector.add(incorrectTypeError
|
|
97105
|
+
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
96787
97106
|
} else {
|
|
96788
97107
|
errorCollector.append(
|
|
96789
|
-
validateObject
|
|
97108
|
+
validateObject(data, schema, path, document)
|
|
96790
97109
|
);
|
|
96791
97110
|
}
|
|
96792
97111
|
} else if (schema.type === "array") {
|
|
96793
97112
|
if (dataType !== "array") {
|
|
96794
|
-
errorCollector.add(incorrectTypeError
|
|
97113
|
+
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
96795
97114
|
} else {
|
|
96796
97115
|
errorCollector.append(
|
|
96797
|
-
validateArray
|
|
97116
|
+
validateArray(data, schema, path, document)
|
|
96798
97117
|
);
|
|
96799
97118
|
}
|
|
96800
97119
|
} else {
|
|
96801
97120
|
errorCollector.append(
|
|
96802
|
-
validateScalar
|
|
97121
|
+
validateScalar(data, schema, path)
|
|
96803
97122
|
);
|
|
96804
97123
|
}
|
|
96805
97124
|
}
|
|
96806
97125
|
if (schema.enum) {
|
|
96807
|
-
errorCollector.append(validateEnum
|
|
97126
|
+
errorCollector.append(validateEnum(data, schema.enum, path));
|
|
96808
97127
|
}
|
|
96809
97128
|
if (schema.const) {
|
|
96810
|
-
errorCollector.append(validateConst
|
|
97129
|
+
errorCollector.append(validateConst(data, schema.const, path));
|
|
96811
97130
|
}
|
|
96812
97131
|
return errorCollector.toValidationResponse();
|
|
96813
97132
|
}
|
|
96814
|
-
function validateAnyOf
|
|
97133
|
+
function validateAnyOf(data, schema, path, document) {
|
|
96815
97134
|
let isValid = false;
|
|
96816
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97135
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96817
97136
|
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
96818
97137
|
const element = schema.anyOf[i];
|
|
96819
|
-
const validationResponse = validateJsonSchema
|
|
97138
|
+
const validationResponse = validateJsonSchema(
|
|
96820
97139
|
data,
|
|
96821
97140
|
element,
|
|
96822
97141
|
`${path}.anyOf[${i}]`,
|
|
@@ -96831,19 +97150,19 @@
|
|
|
96831
97150
|
}
|
|
96832
97151
|
if (!isValid) {
|
|
96833
97152
|
errorCollector.prepend(
|
|
96834
|
-
new JsonSchemaViolationError
|
|
97153
|
+
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
|
|
96835
97154
|
);
|
|
96836
97155
|
return errorCollector.toValidationResponse();
|
|
96837
97156
|
}
|
|
96838
|
-
return validSchemaResponse
|
|
97157
|
+
return validSchemaResponse();
|
|
96839
97158
|
}
|
|
96840
|
-
function validateOneOf
|
|
97159
|
+
function validateOneOf(data, schema, path, document) {
|
|
96841
97160
|
let validSubShemaPaths = [];
|
|
96842
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97161
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96843
97162
|
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
96844
97163
|
const element = schema.oneOf[i];
|
|
96845
97164
|
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
96846
|
-
const validationResponse = validateJsonSchema
|
|
97165
|
+
const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
|
|
96847
97166
|
if (validationResponse.isOk()) {
|
|
96848
97167
|
validSubShemaPaths.push(oneOfPath);
|
|
96849
97168
|
} else {
|
|
@@ -96852,25 +97171,25 @@
|
|
|
96852
97171
|
}
|
|
96853
97172
|
if (validSubShemaPaths.length === 0) {
|
|
96854
97173
|
errorCollector.prepend(
|
|
96855
|
-
new JsonSchemaViolationError
|
|
97174
|
+
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
|
|
96856
97175
|
);
|
|
96857
97176
|
return errorCollector.toValidationResponse();
|
|
96858
97177
|
} else if (validSubShemaPaths.length > 1) {
|
|
96859
97178
|
errorCollector.prepend(
|
|
96860
|
-
new JsonSchemaViolationError
|
|
97179
|
+
new JsonSchemaViolationError(
|
|
96861
97180
|
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
96862
97181
|
)
|
|
96863
97182
|
);
|
|
96864
97183
|
return errorCollector.toValidationResponse();
|
|
96865
97184
|
}
|
|
96866
|
-
return validSchemaResponse
|
|
97185
|
+
return validSchemaResponse();
|
|
96867
97186
|
}
|
|
96868
|
-
function validateAllOf
|
|
97187
|
+
function validateAllOf(data, schema, path, document) {
|
|
96869
97188
|
let isValid = true;
|
|
96870
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97189
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96871
97190
|
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
96872
97191
|
const element = schema.allOf[i];
|
|
96873
|
-
const validationResponse = validateJsonSchema
|
|
97192
|
+
const validationResponse = validateJsonSchema(
|
|
96874
97193
|
data,
|
|
96875
97194
|
element,
|
|
96876
97195
|
`${path}.allOf[${i}]`,
|
|
@@ -96883,31 +97202,31 @@
|
|
|
96883
97202
|
}
|
|
96884
97203
|
if (!isValid) {
|
|
96885
97204
|
errorCollector.prepend(
|
|
96886
|
-
new JsonSchemaViolationError
|
|
97205
|
+
new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
|
|
96887
97206
|
);
|
|
96888
97207
|
}
|
|
96889
97208
|
return errorCollector.toValidationResponse();
|
|
96890
97209
|
}
|
|
96891
|
-
function validateNot
|
|
96892
|
-
const validationResponse = validateJsonSchema
|
|
97210
|
+
function validateNot(data, schema, path, document) {
|
|
97211
|
+
const validationResponse = validateJsonSchema(data, schema.not, path, document);
|
|
96893
97212
|
if (validationResponse.isOk()) {
|
|
96894
|
-
return invalidSchemaResponseWithError
|
|
96895
|
-
new JsonSchemaViolationError
|
|
97213
|
+
return invalidSchemaResponseWithError(
|
|
97214
|
+
new JsonSchemaViolationError(
|
|
96896
97215
|
`Data at ${path} validated against the schema of a not clause.`
|
|
96897
97216
|
)
|
|
96898
97217
|
);
|
|
96899
97218
|
}
|
|
96900
|
-
return validSchemaResponse
|
|
97219
|
+
return validSchemaResponse();
|
|
96901
97220
|
}
|
|
96902
|
-
function validateObject
|
|
97221
|
+
function validateObject(data, schema, path, document) {
|
|
96903
97222
|
const schemaKeys = Object.keys(schema.properties);
|
|
96904
97223
|
const requiredKeys = new Set(schema.required);
|
|
96905
97224
|
const schemaKeySet = new Set(schemaKeys);
|
|
96906
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97225
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96907
97226
|
Object.keys(data).forEach((key) => {
|
|
96908
97227
|
if (!schemaKeySet.has(key)) {
|
|
96909
97228
|
errorCollector.append(
|
|
96910
|
-
validateJsonSchema
|
|
97229
|
+
validateJsonSchema(
|
|
96911
97230
|
data[key],
|
|
96912
97231
|
schema.additionalProperties,
|
|
96913
97232
|
`${path}.additionalProperties[${key}]`,
|
|
@@ -96921,14 +97240,14 @@
|
|
|
96921
97240
|
const keyInData = key in data && data[key] !== void 0;
|
|
96922
97241
|
if (requiredKeys.has(key) && !keyInData) {
|
|
96923
97242
|
errorCollector.add(
|
|
96924
|
-
new MissingRequiredPropertyError
|
|
97243
|
+
new MissingRequiredPropertyError(
|
|
96925
97244
|
`Object at path '${path}' is missing required property '${key}'.`
|
|
96926
97245
|
)
|
|
96927
97246
|
);
|
|
96928
97247
|
}
|
|
96929
97248
|
if (keyInData) {
|
|
96930
97249
|
errorCollector.append(
|
|
96931
|
-
validateJsonSchema
|
|
97250
|
+
validateJsonSchema(
|
|
96932
97251
|
data[key],
|
|
96933
97252
|
schema.properties[key],
|
|
96934
97253
|
`${path}.${key}`,
|
|
@@ -96939,95 +97258,95 @@
|
|
|
96939
97258
|
}
|
|
96940
97259
|
return errorCollector.toValidationResponse();
|
|
96941
97260
|
}
|
|
96942
|
-
function validateArray
|
|
97261
|
+
function validateArray(data, schema, path, document) {
|
|
96943
97262
|
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
96944
|
-
return invalidSchemaResponseWithError
|
|
96945
|
-
new MinItemsViolationError
|
|
97263
|
+
return invalidSchemaResponseWithError(
|
|
97264
|
+
new MinItemsViolationError(
|
|
96946
97265
|
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
96947
97266
|
)
|
|
96948
97267
|
);
|
|
96949
97268
|
}
|
|
96950
97269
|
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
96951
|
-
return invalidSchemaResponseWithError
|
|
96952
|
-
new MaxItemsViolationError
|
|
97270
|
+
return invalidSchemaResponseWithError(
|
|
97271
|
+
new MaxItemsViolationError(
|
|
96953
97272
|
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
96954
97273
|
)
|
|
96955
97274
|
);
|
|
96956
97275
|
}
|
|
96957
|
-
const errorCollector = new JsonSchemaErrorCollector
|
|
97276
|
+
const errorCollector = new JsonSchemaErrorCollector();
|
|
96958
97277
|
data.forEach(
|
|
96959
97278
|
(element, index) => errorCollector.append(
|
|
96960
|
-
validateJsonSchema
|
|
97279
|
+
validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
|
|
96961
97280
|
)
|
|
96962
97281
|
);
|
|
96963
97282
|
return errorCollector.toValidationResponse();
|
|
96964
97283
|
}
|
|
96965
|
-
function validateScalar
|
|
97284
|
+
function validateScalar(data, schema, path) {
|
|
96966
97285
|
const schemaDataType = schema.type;
|
|
96967
97286
|
const dataType = typeof data;
|
|
96968
97287
|
if (schemaDataType === "integer") {
|
|
96969
97288
|
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
96970
|
-
return invalidSchemaResponseWithError
|
|
97289
|
+
return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
|
|
96971
97290
|
}
|
|
96972
97291
|
} else if (schemaDataType === "number") {
|
|
96973
97292
|
if (dataType !== "number") {
|
|
96974
|
-
return invalidSchemaResponseWithError
|
|
97293
|
+
return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
|
|
96975
97294
|
}
|
|
96976
97295
|
} else if (schemaDataType === "string") {
|
|
96977
97296
|
if (dataType !== "string") {
|
|
96978
|
-
return invalidSchemaResponseWithError
|
|
97297
|
+
return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
|
|
96979
97298
|
}
|
|
96980
97299
|
} else if (schemaDataType === "boolean") {
|
|
96981
97300
|
if (dataType !== "boolean") {
|
|
96982
|
-
return invalidSchemaResponseWithError
|
|
97301
|
+
return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
|
|
96983
97302
|
}
|
|
96984
97303
|
} else if (schemaDataType === "null") {
|
|
96985
97304
|
if (data !== null) {
|
|
96986
|
-
return invalidSchemaResponseWithError
|
|
97305
|
+
return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
|
|
96987
97306
|
}
|
|
96988
97307
|
} else {
|
|
96989
|
-
return invalidSchemaResponseWithError
|
|
96990
|
-
new IncorrectTypeError
|
|
97308
|
+
return invalidSchemaResponseWithError(
|
|
97309
|
+
new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
|
|
96991
97310
|
);
|
|
96992
97311
|
}
|
|
96993
|
-
return validSchemaResponse
|
|
97312
|
+
return validSchemaResponse();
|
|
96994
97313
|
}
|
|
96995
|
-
function validateRef
|
|
97314
|
+
function validateRef(data, schema, path, document) {
|
|
96996
97315
|
if (!schema.$ref.startsWith("#")) {
|
|
96997
|
-
return invalidSchemaResponseWithError
|
|
96998
|
-
new InvalidRefError
|
|
97316
|
+
return invalidSchemaResponseWithError(
|
|
97317
|
+
new InvalidRefError(
|
|
96999
97318
|
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
97000
97319
|
)
|
|
97001
97320
|
);
|
|
97002
97321
|
}
|
|
97003
97322
|
try {
|
|
97004
|
-
const schemaToValidate = findSchemaAtPath
|
|
97005
|
-
return validateJsonSchema
|
|
97323
|
+
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
97324
|
+
return validateJsonSchema(data, schemaToValidate, path, document);
|
|
97006
97325
|
} catch (e) {
|
|
97007
|
-
return invalidSchemaResponseWithError
|
|
97326
|
+
return invalidSchemaResponseWithError(e);
|
|
97008
97327
|
}
|
|
97009
97328
|
}
|
|
97010
|
-
function validateEnum
|
|
97329
|
+
function validateEnum(data, enumValue, path) {
|
|
97011
97330
|
if (!enumValue.some((value) => deepEquals$1(value, data))) {
|
|
97012
|
-
return invalidSchemaResponseWithError
|
|
97013
|
-
new JsonSchemaViolationError
|
|
97331
|
+
return invalidSchemaResponseWithError(
|
|
97332
|
+
new JsonSchemaViolationError(
|
|
97014
97333
|
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$2(value)).join()}]`
|
|
97015
97334
|
)
|
|
97016
97335
|
);
|
|
97017
97336
|
}
|
|
97018
|
-
return validSchemaResponse
|
|
97337
|
+
return validSchemaResponse();
|
|
97019
97338
|
}
|
|
97020
|
-
function validateConst
|
|
97339
|
+
function validateConst(data, constValue, path) {
|
|
97021
97340
|
if (!deepEquals$1(constValue, data)) {
|
|
97022
|
-
return invalidSchemaResponseWithError
|
|
97023
|
-
new JsonSchemaViolationError
|
|
97341
|
+
return invalidSchemaResponseWithError(
|
|
97342
|
+
new JsonSchemaViolationError(
|
|
97024
97343
|
`Data at ${path} did not match const. Expected: ${stringify$2(constValue)}`
|
|
97025
97344
|
)
|
|
97026
97345
|
);
|
|
97027
97346
|
}
|
|
97028
|
-
return validSchemaResponse
|
|
97347
|
+
return validSchemaResponse();
|
|
97029
97348
|
}
|
|
97030
|
-
function findSchemaAtPath
|
|
97349
|
+
function findSchemaAtPath(document, ref) {
|
|
97031
97350
|
if (ref === "#") return document;
|
|
97032
97351
|
const keys = ref.replace(/^#\//, "").split("/");
|
|
97033
97352
|
let current = document;
|
|
@@ -97035,7 +97354,7 @@
|
|
|
97035
97354
|
for (const key of keys) {
|
|
97036
97355
|
path = `${path}/${key}`;
|
|
97037
97356
|
if (current[key] === void 0) {
|
|
97038
|
-
throw new InvalidRefError
|
|
97357
|
+
throw new InvalidRefError(
|
|
97039
97358
|
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
97040
97359
|
);
|
|
97041
97360
|
}
|
|
@@ -97080,7 +97399,7 @@
|
|
|
97080
97399
|
*/
|
|
97081
97400
|
function buildBaseImperativeInvoker(getCommand, transformResult) {
|
|
97082
97401
|
return async (...params) => {
|
|
97083
|
-
const command = getCommand({ params, assertIsValid
|
|
97402
|
+
const command = getCommand({ params, assertIsValid });
|
|
97084
97403
|
try {
|
|
97085
97404
|
return command.execute().then((result) => transformResult(result));
|
|
97086
97405
|
} catch (error) {
|
|
@@ -97220,7 +97539,7 @@
|
|
|
97220
97539
|
class LegacyImperativeBindingsService {
|
|
97221
97540
|
bind(getCommand) {
|
|
97222
97541
|
const invoke = async (config, requestContext, callback) => {
|
|
97223
|
-
const command = getCommand({ config, assertIsValid
|
|
97542
|
+
const command = getCommand({ config, assertIsValid });
|
|
97224
97543
|
try {
|
|
97225
97544
|
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97226
97545
|
const result = await command.execute(overrides);
|
|
@@ -97235,7 +97554,7 @@
|
|
|
97235
97554
|
}
|
|
97236
97555
|
};
|
|
97237
97556
|
const subscribe = (config, requestContext, callback) => {
|
|
97238
|
-
const command = getCommand({ config, assertIsValid
|
|
97557
|
+
const command = getCommand({ config, assertIsValid });
|
|
97239
97558
|
let unsubscribe = () => {
|
|
97240
97559
|
};
|
|
97241
97560
|
try {
|
|
@@ -97294,13 +97613,7 @@
|
|
|
97294
97613
|
}
|
|
97295
97614
|
return await buildBaseImperativeInvoker(getCommand, (result) => this.transformResult(result, exposeRefresh))(...params);
|
|
97296
97615
|
} catch (error) {
|
|
97297
|
-
|
|
97298
|
-
return {
|
|
97299
|
-
data: void 0,
|
|
97300
|
-
errors: [
|
|
97301
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97302
|
-
]
|
|
97303
|
-
};
|
|
97616
|
+
return toGraphQLErrorResponse(error);
|
|
97304
97617
|
}
|
|
97305
97618
|
};
|
|
97306
97619
|
}
|
|
@@ -97394,8 +97707,8 @@
|
|
|
97394
97707
|
config = result.value;
|
|
97395
97708
|
}
|
|
97396
97709
|
}
|
|
97397
|
-
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
97398
97710
|
try {
|
|
97711
|
+
const command = getCommand({ config, assertIsValid });
|
|
97399
97712
|
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97400
97713
|
const result = await command.execute(overrides);
|
|
97401
97714
|
const consumerEmittedData = {
|
|
@@ -97412,13 +97725,7 @@
|
|
|
97412
97725
|
}
|
|
97413
97726
|
callback(consumerEmittedData);
|
|
97414
97727
|
} catch (error) {
|
|
97415
|
-
|
|
97416
|
-
callback({
|
|
97417
|
-
data: void 0,
|
|
97418
|
-
errors: [
|
|
97419
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97420
|
-
]
|
|
97421
|
-
});
|
|
97728
|
+
callback(toGraphQLErrorResponse(error));
|
|
97422
97729
|
}
|
|
97423
97730
|
};
|
|
97424
97731
|
const subscribe = (config, requestContext, callback) => {
|
|
@@ -97436,35 +97743,41 @@
|
|
|
97436
97743
|
config = result.value;
|
|
97437
97744
|
}
|
|
97438
97745
|
}
|
|
97439
|
-
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
97440
97746
|
let unsubscribe = () => {
|
|
97441
97747
|
};
|
|
97442
|
-
|
|
97443
|
-
|
|
97444
|
-
const
|
|
97445
|
-
|
|
97446
|
-
|
|
97447
|
-
|
|
97448
|
-
|
|
97449
|
-
|
|
97450
|
-
|
|
97451
|
-
|
|
97452
|
-
|
|
97453
|
-
|
|
97454
|
-
|
|
97455
|
-
|
|
97456
|
-
|
|
97457
|
-
|
|
97458
|
-
|
|
97459
|
-
|
|
97460
|
-
|
|
97461
|
-
|
|
97462
|
-
|
|
97463
|
-
|
|
97464
|
-
|
|
97465
|
-
|
|
97466
|
-
|
|
97467
|
-
|
|
97748
|
+
try {
|
|
97749
|
+
const command = getCommand({ config, assertIsValid });
|
|
97750
|
+
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
97751
|
+
command.execute(overrides).then((result) => {
|
|
97752
|
+
const consumerEmittedData = {
|
|
97753
|
+
data: void 0,
|
|
97754
|
+
errors: void 0
|
|
97755
|
+
};
|
|
97756
|
+
if (result.isOk()) {
|
|
97757
|
+
deepFreeze(result.value);
|
|
97758
|
+
consumerEmittedData.data = result.value.data.data;
|
|
97759
|
+
unsubscribe = result.value.subscribe(
|
|
97760
|
+
(res) => {
|
|
97761
|
+
handleEmit(res, callback);
|
|
97762
|
+
}
|
|
97763
|
+
);
|
|
97764
|
+
} else {
|
|
97765
|
+
const { data, errors } = toGraphQLResponseFromFailure$1(
|
|
97766
|
+
result.error.failure
|
|
97767
|
+
);
|
|
97768
|
+
consumerEmittedData.data = data;
|
|
97769
|
+
consumerEmittedData.errors = errors;
|
|
97770
|
+
unsubscribe = result.error.subscribe(
|
|
97771
|
+
(res) => {
|
|
97772
|
+
handleEmit(res, callback);
|
|
97773
|
+
}
|
|
97774
|
+
);
|
|
97775
|
+
}
|
|
97776
|
+
callback(consumerEmittedData);
|
|
97777
|
+
});
|
|
97778
|
+
} catch (error) {
|
|
97779
|
+
callback(toGraphQLErrorResponse(error));
|
|
97780
|
+
}
|
|
97468
97781
|
return () => {
|
|
97469
97782
|
unsubscribe();
|
|
97470
97783
|
};
|
|
@@ -97498,7 +97811,7 @@
|
|
|
97498
97811
|
params[0] = result2.value;
|
|
97499
97812
|
}
|
|
97500
97813
|
}
|
|
97501
|
-
const command = getCommand({ params, assertIsValid
|
|
97814
|
+
const command = getCommand({ params, assertIsValid });
|
|
97502
97815
|
const result = await command.execute({ cacheControlConfig: { type: "no-cache" } });
|
|
97503
97816
|
if (result.isOk()) {
|
|
97504
97817
|
deepFreeze(result.value);
|
|
@@ -97507,13 +97820,7 @@
|
|
|
97507
97820
|
return toGraphQLResponseFromFailure$1(result.error.failure);
|
|
97508
97821
|
}
|
|
97509
97822
|
} catch (error) {
|
|
97510
|
-
|
|
97511
|
-
return {
|
|
97512
|
-
data: void 0,
|
|
97513
|
-
errors: [
|
|
97514
|
-
{ message: "Internal error in GraphQL adapter occurred", locations: [] }
|
|
97515
|
-
]
|
|
97516
|
-
};
|
|
97823
|
+
return toGraphQLErrorResponse(error);
|
|
97517
97824
|
}
|
|
97518
97825
|
};
|
|
97519
97826
|
}
|
|
@@ -97581,8 +97888,8 @@
|
|
|
97581
97888
|
return new Sanitizer(obj).sanitize();
|
|
97582
97889
|
}
|
|
97583
97890
|
function isIncompleteConfigError(err) {
|
|
97584
|
-
return err instanceof MissingRequiredPropertyError
|
|
97585
|
-
(validationError) => validationError instanceof MissingRequiredPropertyError
|
|
97891
|
+
return err instanceof MissingRequiredPropertyError || err instanceof JsonSchemaViolationError && err.validationErrors.find(
|
|
97892
|
+
(validationError) => validationError instanceof MissingRequiredPropertyError
|
|
97586
97893
|
) !== void 0;
|
|
97587
97894
|
}
|
|
97588
97895
|
class CommandWireAdapterConstructor {
|
|
@@ -97668,11 +97975,15 @@
|
|
|
97668
97975
|
}
|
|
97669
97976
|
if (this.configSchema) {
|
|
97670
97977
|
try {
|
|
97671
|
-
assertIsValid
|
|
97978
|
+
assertIsValid(this.config, this.configSchema);
|
|
97672
97979
|
} catch (err) {
|
|
97673
97980
|
if (isIncompleteConfigError(err)) {
|
|
97674
97981
|
return;
|
|
97675
97982
|
}
|
|
97983
|
+
if (err instanceof JsonSchemaViolationError) {
|
|
97984
|
+
this.handleConfigSchemaViolation(err);
|
|
97985
|
+
return;
|
|
97986
|
+
}
|
|
97676
97987
|
throw err;
|
|
97677
97988
|
}
|
|
97678
97989
|
}
|
|
@@ -97725,6 +98036,16 @@
|
|
|
97725
98036
|
handleExecutionThrow(error) {
|
|
97726
98037
|
emitError(this.callback, error);
|
|
97727
98038
|
}
|
|
98039
|
+
/**
|
|
98040
|
+
* Hook for subclasses to handle a JsonSchemaViolationError from the config
|
|
98041
|
+
* schema assertion. The default re-throws so legacy non-GraphQL wire
|
|
98042
|
+
* adapters keep their existing throw behavior. Overrides are expected to
|
|
98043
|
+
* either emit an error result or re-throw — silently returning will
|
|
98044
|
+
* swallow the error.
|
|
98045
|
+
*/
|
|
98046
|
+
handleConfigSchemaViolation(error) {
|
|
98047
|
+
throw error;
|
|
98048
|
+
}
|
|
97728
98049
|
unsubscribe() {
|
|
97729
98050
|
if (this.unsubscriber) {
|
|
97730
98051
|
this.unsubscriber();
|
|
@@ -97817,16 +98138,14 @@
|
|
|
97817
98138
|
this.callback(consumerEmittedData);
|
|
97818
98139
|
}
|
|
97819
98140
|
} catch (e) {
|
|
97820
|
-
logError$1(e);
|
|
97821
98141
|
this.handleExecutionThrow(e);
|
|
97822
98142
|
}
|
|
97823
98143
|
}
|
|
97824
|
-
handleExecutionThrow(
|
|
97825
|
-
|
|
97826
|
-
|
|
97827
|
-
|
|
97828
|
-
|
|
97829
|
-
});
|
|
98144
|
+
handleExecutionThrow(error) {
|
|
98145
|
+
this.callback(toGraphQLErrorResponse(error));
|
|
98146
|
+
}
|
|
98147
|
+
handleConfigSchemaViolation(error) {
|
|
98148
|
+
this.handleExecutionThrow(error);
|
|
97830
98149
|
}
|
|
97831
98150
|
update(config, _context) {
|
|
97832
98151
|
this.unsubscribe();
|
|
@@ -98478,9 +98797,11 @@
|
|
|
98478
98797
|
return entries.length > 0 ? this.store.setEntries(entries) : Promise.resolve();
|
|
98479
98798
|
}
|
|
98480
98799
|
find(_query) {
|
|
98800
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
98481
98801
|
throw new Error('find not supported on the NimbusDurableCacheInclusionPolicy');
|
|
98482
98802
|
}
|
|
98483
98803
|
findAndModify(_query, _cacheUpdate) {
|
|
98804
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
98484
98805
|
throw new Error('findAndModify not supported on the NimbusDurableCacheInclusionPolicy');
|
|
98485
98806
|
}
|
|
98486
98807
|
registerListener() {
|
|
@@ -98506,7 +98827,7 @@
|
|
|
98506
98827
|
});
|
|
98507
98828
|
});
|
|
98508
98829
|
}
|
|
98509
|
-
// TODO: onestore doesnt support cache eviction yet
|
|
98830
|
+
// TODO [W-19368859]: onestore doesnt support cache eviction yet
|
|
98510
98831
|
// if (evictKeys.size > 0) {
|
|
98511
98832
|
// evictKeys.forEach((key) => {
|
|
98512
98833
|
// this.services.cache.evict(key);
|
|
@@ -98601,6 +98922,7 @@
|
|
|
98601
98922
|
batchQuery(operations) {
|
|
98602
98923
|
return new Promise((resolve, reject) => {
|
|
98603
98924
|
this.sqlStore.batchOperations(operations, (error) => {
|
|
98925
|
+
// eslint-disable-next-line no-unused-expressions
|
|
98604
98926
|
error ? reject(error) : resolve();
|
|
98605
98927
|
});
|
|
98606
98928
|
});
|
|
@@ -98676,7 +98998,7 @@
|
|
|
98676
98998
|
buildServiceDescriptor$7(),
|
|
98677
98999
|
buildServiceDescriptor$1$1(),
|
|
98678
99000
|
buildServiceDescriptor$2(),
|
|
98679
|
-
// TODO[
|
|
99001
|
+
// TODO [W-18753648]: See note above.
|
|
98680
99002
|
// buildStreamingCommandServiceDescriptor(),
|
|
98681
99003
|
// buildNdJsonServiceDescriptor(),
|
|
98682
99004
|
// buildSseCommandServiceDescriptor(),
|
|
@@ -98935,378 +99257,12 @@
|
|
|
98935
99257
|
id: '@salesforce/lds-network-adapter',
|
|
98936
99258
|
instrument: instrument$2,
|
|
98937
99259
|
});
|
|
98938
|
-
// version: 1.
|
|
99260
|
+
// version: 1.434.0-d8deb0d4ea
|
|
98939
99261
|
|
|
98940
99262
|
const { create: create$2, keys: keys$2 } = Object;
|
|
98941
99263
|
const { stringify, parse } = JSON;
|
|
98942
99264
|
const { isArray: isArray$3 } = Array;
|
|
98943
99265
|
|
|
98944
|
-
/*!
|
|
98945
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
98946
|
-
* All rights reserved.
|
|
98947
|
-
* For full license text, see the LICENSE.txt file
|
|
98948
|
-
*/
|
|
98949
|
-
class JsonSchemaViolationError extends Error {
|
|
98950
|
-
constructor(message, validationErrors) {
|
|
98951
|
-
super(message);
|
|
98952
|
-
this.validationErrors = [];
|
|
98953
|
-
this.validationErrors = validationErrors || [];
|
|
98954
|
-
}
|
|
98955
|
-
}
|
|
98956
|
-
class MinItemsViolationError extends JsonSchemaViolationError {
|
|
98957
|
-
}
|
|
98958
|
-
class MaxItemsViolationError extends JsonSchemaViolationError {
|
|
98959
|
-
}
|
|
98960
|
-
class IncorrectTypeError extends JsonSchemaViolationError {
|
|
98961
|
-
}
|
|
98962
|
-
class AdditionalPropertiesError extends JsonSchemaViolationError {
|
|
98963
|
-
}
|
|
98964
|
-
class MissingRequiredPropertyError extends JsonSchemaViolationError {
|
|
98965
|
-
}
|
|
98966
|
-
class InvalidRefError extends JsonSchemaViolationError {
|
|
98967
|
-
}
|
|
98968
|
-
class JsonSchemaErrorCollector {
|
|
98969
|
-
constructor() {
|
|
98970
|
-
this.errors = [];
|
|
98971
|
-
}
|
|
98972
|
-
add(error) {
|
|
98973
|
-
this.errors.push(error);
|
|
98974
|
-
}
|
|
98975
|
-
append(response) {
|
|
98976
|
-
if (response.isErr()) {
|
|
98977
|
-
this.errors.push(...response.error);
|
|
98978
|
-
}
|
|
98979
|
-
}
|
|
98980
|
-
hasErrors() {
|
|
98981
|
-
return this.errors.length > 0;
|
|
98982
|
-
}
|
|
98983
|
-
prepend(error) {
|
|
98984
|
-
this.errors.unshift(error);
|
|
98985
|
-
}
|
|
98986
|
-
toValidationResponse() {
|
|
98987
|
-
return !this.hasErrors() ? ok$4(true) : err$4(this.errors);
|
|
98988
|
-
}
|
|
98989
|
-
}
|
|
98990
|
-
function createThrowableError(errors) {
|
|
98991
|
-
if (errors[0] instanceof MinItemsViolationError) {
|
|
98992
|
-
return new MinItemsViolationError(errors[0].message, errors);
|
|
98993
|
-
}
|
|
98994
|
-
if (errors[0] instanceof MaxItemsViolationError) {
|
|
98995
|
-
return new MaxItemsViolationError(errors[0].message, errors);
|
|
98996
|
-
}
|
|
98997
|
-
if (errors[0] instanceof IncorrectTypeError) {
|
|
98998
|
-
return new IncorrectTypeError(errors[0].message, errors);
|
|
98999
|
-
}
|
|
99000
|
-
if (errors[0] instanceof AdditionalPropertiesError) {
|
|
99001
|
-
return new AdditionalPropertiesError(errors[0].message, errors);
|
|
99002
|
-
}
|
|
99003
|
-
if (errors[0] instanceof MissingRequiredPropertyError) {
|
|
99004
|
-
return new MissingRequiredPropertyError(errors[0].message, errors);
|
|
99005
|
-
}
|
|
99006
|
-
if (errors[0] instanceof InvalidRefError) {
|
|
99007
|
-
return new InvalidRefError(errors[0].message, errors);
|
|
99008
|
-
}
|
|
99009
|
-
return new JsonSchemaViolationError(errors[0].message, errors);
|
|
99010
|
-
}
|
|
99011
|
-
function assertIsValid(data, schema) {
|
|
99012
|
-
const validationResponse = validateJsonSchema(data, schema);
|
|
99013
|
-
if (validationResponse.isErr()) {
|
|
99014
|
-
throw createThrowableError(validationResponse.error);
|
|
99015
|
-
}
|
|
99016
|
-
}
|
|
99017
|
-
function incorrectTypeError(expected, actual, path) {
|
|
99018
|
-
return new IncorrectTypeError(
|
|
99019
|
-
`Expected type ${expected} at path '${path}', found type ${actual}.`
|
|
99020
|
-
);
|
|
99021
|
-
}
|
|
99022
|
-
function validSchemaResponse() {
|
|
99023
|
-
return ok$4(true);
|
|
99024
|
-
}
|
|
99025
|
-
function invalidSchemaResponseWithError(error) {
|
|
99026
|
-
return err$4([error]);
|
|
99027
|
-
}
|
|
99028
|
-
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
99029
|
-
if (schema === true) return validSchemaResponse();
|
|
99030
|
-
if (schema === false)
|
|
99031
|
-
return invalidSchemaResponseWithError(
|
|
99032
|
-
new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
|
|
99033
|
-
);
|
|
99034
|
-
const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
|
|
99035
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99036
|
-
if ("anyOf" in schema) {
|
|
99037
|
-
errorCollector.append(validateAnyOf(data, schema, path, document));
|
|
99038
|
-
} else if ("oneOf" in schema) {
|
|
99039
|
-
errorCollector.append(validateOneOf(data, schema, path, document));
|
|
99040
|
-
} else if ("allOf" in schema) {
|
|
99041
|
-
errorCollector.append(validateAllOf(data, schema, path, document));
|
|
99042
|
-
} else if ("not" in schema) {
|
|
99043
|
-
errorCollector.append(validateNot(data, schema, path, document));
|
|
99044
|
-
} else if ("$ref" in schema) {
|
|
99045
|
-
errorCollector.append(validateRef(data, schema, path, document));
|
|
99046
|
-
} else if ("type" in schema) {
|
|
99047
|
-
if (schema.type === "object") {
|
|
99048
|
-
if (dataType !== "object") {
|
|
99049
|
-
errorCollector.add(incorrectTypeError("object", dataType, path));
|
|
99050
|
-
} else {
|
|
99051
|
-
errorCollector.append(
|
|
99052
|
-
validateObject(data, schema, path, document)
|
|
99053
|
-
);
|
|
99054
|
-
}
|
|
99055
|
-
} else if (schema.type === "array") {
|
|
99056
|
-
if (dataType !== "array") {
|
|
99057
|
-
errorCollector.add(incorrectTypeError("array", dataType, path));
|
|
99058
|
-
} else {
|
|
99059
|
-
errorCollector.append(
|
|
99060
|
-
validateArray(data, schema, path, document)
|
|
99061
|
-
);
|
|
99062
|
-
}
|
|
99063
|
-
} else {
|
|
99064
|
-
errorCollector.append(
|
|
99065
|
-
validateScalar(data, schema, path)
|
|
99066
|
-
);
|
|
99067
|
-
}
|
|
99068
|
-
}
|
|
99069
|
-
if (schema.enum) {
|
|
99070
|
-
errorCollector.append(validateEnum(data, schema.enum, path));
|
|
99071
|
-
}
|
|
99072
|
-
if (schema.const) {
|
|
99073
|
-
errorCollector.append(validateConst(data, schema.const, path));
|
|
99074
|
-
}
|
|
99075
|
-
return errorCollector.toValidationResponse();
|
|
99076
|
-
}
|
|
99077
|
-
function validateAnyOf(data, schema, path, document) {
|
|
99078
|
-
let isValid = false;
|
|
99079
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99080
|
-
for (let i = 0, { length } = schema.anyOf; i < length; i++) {
|
|
99081
|
-
const element = schema.anyOf[i];
|
|
99082
|
-
const validationResponse = validateJsonSchema(
|
|
99083
|
-
data,
|
|
99084
|
-
element,
|
|
99085
|
-
`${path}.anyOf[${i}]`,
|
|
99086
|
-
document
|
|
99087
|
-
);
|
|
99088
|
-
if (validationResponse.isOk()) {
|
|
99089
|
-
isValid = true;
|
|
99090
|
-
break;
|
|
99091
|
-
} else {
|
|
99092
|
-
errorCollector.append(validationResponse);
|
|
99093
|
-
}
|
|
99094
|
-
}
|
|
99095
|
-
if (!isValid) {
|
|
99096
|
-
errorCollector.prepend(
|
|
99097
|
-
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
|
|
99098
|
-
);
|
|
99099
|
-
return errorCollector.toValidationResponse();
|
|
99100
|
-
}
|
|
99101
|
-
return validSchemaResponse();
|
|
99102
|
-
}
|
|
99103
|
-
function validateOneOf(data, schema, path, document) {
|
|
99104
|
-
let validSubShemaPaths = [];
|
|
99105
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99106
|
-
for (let i = 0, { length } = schema.oneOf; i < length; i++) {
|
|
99107
|
-
const element = schema.oneOf[i];
|
|
99108
|
-
const oneOfPath = `${path}.oneOf[${i}]`;
|
|
99109
|
-
const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
|
|
99110
|
-
if (validationResponse.isOk()) {
|
|
99111
|
-
validSubShemaPaths.push(oneOfPath);
|
|
99112
|
-
} else {
|
|
99113
|
-
errorCollector.append(validationResponse);
|
|
99114
|
-
}
|
|
99115
|
-
}
|
|
99116
|
-
if (validSubShemaPaths.length === 0) {
|
|
99117
|
-
errorCollector.prepend(
|
|
99118
|
-
new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
|
|
99119
|
-
);
|
|
99120
|
-
return errorCollector.toValidationResponse();
|
|
99121
|
-
} else if (validSubShemaPaths.length > 1) {
|
|
99122
|
-
errorCollector.prepend(
|
|
99123
|
-
new JsonSchemaViolationError(
|
|
99124
|
-
`Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
|
|
99125
|
-
)
|
|
99126
|
-
);
|
|
99127
|
-
return errorCollector.toValidationResponse();
|
|
99128
|
-
}
|
|
99129
|
-
return validSchemaResponse();
|
|
99130
|
-
}
|
|
99131
|
-
function validateAllOf(data, schema, path, document) {
|
|
99132
|
-
let isValid = true;
|
|
99133
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99134
|
-
for (let i = 0, { length } = schema.allOf; i < length; i++) {
|
|
99135
|
-
const element = schema.allOf[i];
|
|
99136
|
-
const validationResponse = validateJsonSchema(
|
|
99137
|
-
data,
|
|
99138
|
-
element,
|
|
99139
|
-
`${path}.allOf[${i}]`,
|
|
99140
|
-
document
|
|
99141
|
-
);
|
|
99142
|
-
if (!validationResponse.isOk()) {
|
|
99143
|
-
errorCollector.append(validationResponse);
|
|
99144
|
-
isValid = false;
|
|
99145
|
-
}
|
|
99146
|
-
}
|
|
99147
|
-
if (!isValid) {
|
|
99148
|
-
errorCollector.prepend(
|
|
99149
|
-
new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
|
|
99150
|
-
);
|
|
99151
|
-
}
|
|
99152
|
-
return errorCollector.toValidationResponse();
|
|
99153
|
-
}
|
|
99154
|
-
function validateNot(data, schema, path, document) {
|
|
99155
|
-
const validationResponse = validateJsonSchema(data, schema.not, path, document);
|
|
99156
|
-
if (validationResponse.isOk()) {
|
|
99157
|
-
return invalidSchemaResponseWithError(
|
|
99158
|
-
new JsonSchemaViolationError(
|
|
99159
|
-
`Data at ${path} validated against the schema of a not clause.`
|
|
99160
|
-
)
|
|
99161
|
-
);
|
|
99162
|
-
}
|
|
99163
|
-
return validSchemaResponse();
|
|
99164
|
-
}
|
|
99165
|
-
function validateObject(data, schema, path, document) {
|
|
99166
|
-
const schemaKeys = Object.keys(schema.properties);
|
|
99167
|
-
const requiredKeys = new Set(schema.required);
|
|
99168
|
-
const schemaKeySet = new Set(schemaKeys);
|
|
99169
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99170
|
-
Object.keys(data).forEach((key) => {
|
|
99171
|
-
if (!schemaKeySet.has(key)) {
|
|
99172
|
-
errorCollector.append(
|
|
99173
|
-
validateJsonSchema(
|
|
99174
|
-
data[key],
|
|
99175
|
-
schema.additionalProperties,
|
|
99176
|
-
`${path}.additionalProperties[${key}]`,
|
|
99177
|
-
document
|
|
99178
|
-
)
|
|
99179
|
-
);
|
|
99180
|
-
}
|
|
99181
|
-
});
|
|
99182
|
-
for (let i = 0, length = schemaKeys.length; i < length; i++) {
|
|
99183
|
-
const key = schemaKeys[i];
|
|
99184
|
-
const keyInData = key in data && data[key] !== void 0;
|
|
99185
|
-
if (requiredKeys.has(key) && !keyInData) {
|
|
99186
|
-
errorCollector.add(
|
|
99187
|
-
new MissingRequiredPropertyError(
|
|
99188
|
-
`Object at path '${path}' is missing required property '${key}'.`
|
|
99189
|
-
)
|
|
99190
|
-
);
|
|
99191
|
-
}
|
|
99192
|
-
if (keyInData) {
|
|
99193
|
-
errorCollector.append(
|
|
99194
|
-
validateJsonSchema(
|
|
99195
|
-
data[key],
|
|
99196
|
-
schema.properties[key],
|
|
99197
|
-
`${path}.${key}`,
|
|
99198
|
-
document
|
|
99199
|
-
)
|
|
99200
|
-
);
|
|
99201
|
-
}
|
|
99202
|
-
}
|
|
99203
|
-
return errorCollector.toValidationResponse();
|
|
99204
|
-
}
|
|
99205
|
-
function validateArray(data, schema, path, document) {
|
|
99206
|
-
if (schema.minItems !== void 0 && data.length < schema.minItems) {
|
|
99207
|
-
return invalidSchemaResponseWithError(
|
|
99208
|
-
new MinItemsViolationError(
|
|
99209
|
-
`Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
|
|
99210
|
-
)
|
|
99211
|
-
);
|
|
99212
|
-
}
|
|
99213
|
-
if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
|
|
99214
|
-
return invalidSchemaResponseWithError(
|
|
99215
|
-
new MaxItemsViolationError(
|
|
99216
|
-
`Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
|
|
99217
|
-
)
|
|
99218
|
-
);
|
|
99219
|
-
}
|
|
99220
|
-
const errorCollector = new JsonSchemaErrorCollector();
|
|
99221
|
-
data.forEach(
|
|
99222
|
-
(element, index) => errorCollector.append(
|
|
99223
|
-
validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
|
|
99224
|
-
)
|
|
99225
|
-
);
|
|
99226
|
-
return errorCollector.toValidationResponse();
|
|
99227
|
-
}
|
|
99228
|
-
function validateScalar(data, schema, path) {
|
|
99229
|
-
const schemaDataType = schema.type;
|
|
99230
|
-
const dataType = typeof data;
|
|
99231
|
-
if (schemaDataType === "integer") {
|
|
99232
|
-
if (dataType !== "number" || !Number.isInteger(data)) {
|
|
99233
|
-
return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
|
|
99234
|
-
}
|
|
99235
|
-
} else if (schemaDataType === "number") {
|
|
99236
|
-
if (dataType !== "number") {
|
|
99237
|
-
return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
|
|
99238
|
-
}
|
|
99239
|
-
} else if (schemaDataType === "string") {
|
|
99240
|
-
if (dataType !== "string") {
|
|
99241
|
-
return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
|
|
99242
|
-
}
|
|
99243
|
-
} else if (schemaDataType === "boolean") {
|
|
99244
|
-
if (dataType !== "boolean") {
|
|
99245
|
-
return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
|
|
99246
|
-
}
|
|
99247
|
-
} else if (schemaDataType === "null") {
|
|
99248
|
-
if (data !== null) {
|
|
99249
|
-
return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
|
|
99250
|
-
}
|
|
99251
|
-
} else {
|
|
99252
|
-
return invalidSchemaResponseWithError(
|
|
99253
|
-
new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
|
|
99254
|
-
);
|
|
99255
|
-
}
|
|
99256
|
-
return validSchemaResponse();
|
|
99257
|
-
}
|
|
99258
|
-
function validateRef(data, schema, path, document) {
|
|
99259
|
-
if (!schema.$ref.startsWith("#")) {
|
|
99260
|
-
return invalidSchemaResponseWithError(
|
|
99261
|
-
new InvalidRefError(
|
|
99262
|
-
`$ref values that do not refer to the current document are unsupported (must start with '#')`
|
|
99263
|
-
)
|
|
99264
|
-
);
|
|
99265
|
-
}
|
|
99266
|
-
try {
|
|
99267
|
-
const schemaToValidate = findSchemaAtPath(document, schema.$ref);
|
|
99268
|
-
return validateJsonSchema(data, schemaToValidate, path, document);
|
|
99269
|
-
} catch (e) {
|
|
99270
|
-
return invalidSchemaResponseWithError(e);
|
|
99271
|
-
}
|
|
99272
|
-
}
|
|
99273
|
-
function validateEnum(data, enumValue, path) {
|
|
99274
|
-
if (!enumValue.some((value) => deepEquals$2(value, data))) {
|
|
99275
|
-
return invalidSchemaResponseWithError(
|
|
99276
|
-
new JsonSchemaViolationError(
|
|
99277
|
-
`Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
|
|
99278
|
-
)
|
|
99279
|
-
);
|
|
99280
|
-
}
|
|
99281
|
-
return validSchemaResponse();
|
|
99282
|
-
}
|
|
99283
|
-
function validateConst(data, constValue, path) {
|
|
99284
|
-
if (!deepEquals$2(constValue, data)) {
|
|
99285
|
-
return invalidSchemaResponseWithError(
|
|
99286
|
-
new JsonSchemaViolationError(
|
|
99287
|
-
`Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
|
|
99288
|
-
)
|
|
99289
|
-
);
|
|
99290
|
-
}
|
|
99291
|
-
return validSchemaResponse();
|
|
99292
|
-
}
|
|
99293
|
-
function findSchemaAtPath(document, ref) {
|
|
99294
|
-
if (ref === "#") return document;
|
|
99295
|
-
const keys = ref.replace(/^#\//, "").split("/");
|
|
99296
|
-
let current = document;
|
|
99297
|
-
let path = "#";
|
|
99298
|
-
for (const key of keys) {
|
|
99299
|
-
path = `${path}/${key}`;
|
|
99300
|
-
if (current[key] === void 0) {
|
|
99301
|
-
throw new InvalidRefError(
|
|
99302
|
-
`Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
|
|
99303
|
-
);
|
|
99304
|
-
}
|
|
99305
|
-
current = current[key];
|
|
99306
|
-
}
|
|
99307
|
-
return current;
|
|
99308
|
-
}
|
|
99309
|
-
|
|
99310
99266
|
/*!
|
|
99311
99267
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
99312
99268
|
* All rights reserved.
|
|
@@ -99355,35 +99311,35 @@
|
|
|
99355
99311
|
function extractVariableValue(variableName, variableDefinitions) {
|
|
99356
99312
|
const variable = variableDefinitions[variableName];
|
|
99357
99313
|
if (!variable) {
|
|
99358
|
-
return err$
|
|
99314
|
+
return err$3(
|
|
99359
99315
|
new Error(`Variable '${variableName}' was used in the query but was not defined`)
|
|
99360
99316
|
);
|
|
99361
99317
|
}
|
|
99362
99318
|
if (variable.value !== void 0) {
|
|
99363
|
-
return ok$
|
|
99319
|
+
return ok$3(variable.value);
|
|
99364
99320
|
}
|
|
99365
99321
|
if (variable.definition.defaultValue) {
|
|
99366
99322
|
return extractValue(variable.definition.defaultValue, variableDefinitions);
|
|
99367
99323
|
}
|
|
99368
|
-
return ok$
|
|
99324
|
+
return ok$3(void 0);
|
|
99369
99325
|
}
|
|
99370
99326
|
function validateExpectedType(value, expectedType) {
|
|
99371
99327
|
if (!expectedType) {
|
|
99372
|
-
return ok$
|
|
99328
|
+
return ok$3(value);
|
|
99373
99329
|
}
|
|
99374
99330
|
if (value === null) {
|
|
99375
99331
|
if (expectedType.nullable) {
|
|
99376
|
-
return ok$
|
|
99332
|
+
return ok$3(value);
|
|
99377
99333
|
} else {
|
|
99378
|
-
return err$
|
|
99334
|
+
return err$3(new Error(`Expected ${expectedType.type}, but got null`));
|
|
99379
99335
|
}
|
|
99380
99336
|
}
|
|
99381
99337
|
const actualType = typeof value;
|
|
99382
99338
|
if (actualType === expectedType.type) {
|
|
99383
|
-
return ok$
|
|
99339
|
+
return ok$3(value);
|
|
99384
99340
|
}
|
|
99385
99341
|
const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
|
|
99386
|
-
return err$
|
|
99342
|
+
return err$3(
|
|
99387
99343
|
new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
|
|
99388
99344
|
);
|
|
99389
99345
|
}
|
|
@@ -99426,10 +99382,10 @@
|
|
|
99426
99382
|
(def) => def.kind === Kind$1.OPERATION_DEFINITION
|
|
99427
99383
|
);
|
|
99428
99384
|
if (operations.length === 0) {
|
|
99429
|
-
return err$
|
|
99385
|
+
return err$3(new Error("No operations found in query"));
|
|
99430
99386
|
}
|
|
99431
99387
|
if (operations.length === 1 && !input.operationName) {
|
|
99432
|
-
return ok$
|
|
99388
|
+
return ok$3(operations[0]);
|
|
99433
99389
|
}
|
|
99434
99390
|
if (input.operationName) {
|
|
99435
99391
|
const specifiedOperation = operations.find((op) => {
|
|
@@ -99437,16 +99393,16 @@
|
|
|
99437
99393
|
return ((_a = op.name) == null ? void 0 : _a.value) === input.operationName;
|
|
99438
99394
|
});
|
|
99439
99395
|
if (specifiedOperation) {
|
|
99440
|
-
return ok$
|
|
99396
|
+
return ok$3(specifiedOperation);
|
|
99441
99397
|
}
|
|
99442
|
-
return err$
|
|
99398
|
+
return err$3(new Error(`Operation "${input.operationName}" not found in query`));
|
|
99443
99399
|
}
|
|
99444
|
-
return err$
|
|
99400
|
+
return err$3(new Error("Multiple operations found in query, and no operation name provided"));
|
|
99445
99401
|
}
|
|
99446
99402
|
function buildGraphQLInputExtension(input) {
|
|
99447
99403
|
const operationResult = findExecutableOperation(input);
|
|
99448
99404
|
if (operationResult.isErr()) {
|
|
99449
|
-
return err$
|
|
99405
|
+
return err$3(operationResult.error);
|
|
99450
99406
|
}
|
|
99451
99407
|
const operation = operationResult.value;
|
|
99452
99408
|
const selections = operation.selectionSet.selections;
|
|
@@ -99463,7 +99419,7 @@
|
|
|
99463
99419
|
prev[fragment.name.value] = fragment;
|
|
99464
99420
|
return prev;
|
|
99465
99421
|
}, {});
|
|
99466
|
-
return ok$
|
|
99422
|
+
return ok$3({
|
|
99467
99423
|
selections,
|
|
99468
99424
|
request: { definitions: { variables, fragments } },
|
|
99469
99425
|
parentFieldSelection: void 0
|
|
@@ -99621,13 +99577,13 @@
|
|
|
99621
99577
|
}
|
|
99622
99578
|
function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
|
|
99623
99579
|
if (fieldArguments === void 0 || fieldArguments.length === 0) {
|
|
99624
|
-
return ok$
|
|
99580
|
+
return ok$3(canonicalFieldName);
|
|
99625
99581
|
}
|
|
99626
99582
|
const formattedArguments = {};
|
|
99627
99583
|
for (const arg of fieldArguments) {
|
|
99628
99584
|
const result = extractValue(arg.value, variables);
|
|
99629
99585
|
if (result.isErr()) {
|
|
99630
|
-
return err$
|
|
99586
|
+
return err$3(
|
|
99631
99587
|
new Error(
|
|
99632
99588
|
`Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
|
|
99633
99589
|
)
|
|
@@ -99635,7 +99591,7 @@
|
|
|
99635
99591
|
}
|
|
99636
99592
|
formattedArguments[arg.name.value] = result.value;
|
|
99637
99593
|
}
|
|
99638
|
-
return ok$
|
|
99594
|
+
return ok$3(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
|
|
99639
99595
|
}
|
|
99640
99596
|
({
|
|
99641
99597
|
kind: Kind$1.FIELD,
|
|
@@ -99660,17 +99616,17 @@
|
|
|
99660
99616
|
var _a;
|
|
99661
99617
|
const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
|
|
99662
99618
|
if (!ifArg) {
|
|
99663
|
-
return err$
|
|
99619
|
+
return err$3(new Error(`@${directiveName} directive requires an 'if' argument`));
|
|
99664
99620
|
}
|
|
99665
99621
|
const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
|
|
99666
99622
|
if (result.isErr()) {
|
|
99667
|
-
return err$
|
|
99623
|
+
return err$3(result.error);
|
|
99668
99624
|
}
|
|
99669
|
-
return ok$
|
|
99625
|
+
return ok$3(result.value);
|
|
99670
99626
|
}
|
|
99671
99627
|
function shouldSkip(selection, variables) {
|
|
99672
99628
|
if (!selection.directives || selection.directives.length === 0) {
|
|
99673
|
-
return ok$
|
|
99629
|
+
return ok$3(false);
|
|
99674
99630
|
}
|
|
99675
99631
|
for (const directive of selection.directives) {
|
|
99676
99632
|
if (directive.name.value === "skip") {
|
|
@@ -99679,7 +99635,7 @@
|
|
|
99679
99635
|
return ifResult;
|
|
99680
99636
|
}
|
|
99681
99637
|
if (ifResult.value === true) {
|
|
99682
|
-
return ok$
|
|
99638
|
+
return ok$3(true);
|
|
99683
99639
|
}
|
|
99684
99640
|
}
|
|
99685
99641
|
if (directive.name.value === "include") {
|
|
@@ -99688,11 +99644,11 @@
|
|
|
99688
99644
|
return ifResult;
|
|
99689
99645
|
}
|
|
99690
99646
|
if (ifResult.value === false) {
|
|
99691
|
-
return ok$
|
|
99647
|
+
return ok$3(true);
|
|
99692
99648
|
}
|
|
99693
99649
|
}
|
|
99694
99650
|
}
|
|
99695
|
-
return ok$
|
|
99651
|
+
return ok$3(false);
|
|
99696
99652
|
}
|
|
99697
99653
|
class BaseScalarFieldDef {
|
|
99698
99654
|
constructor(nullable) {
|
|
@@ -99700,11 +99656,11 @@
|
|
|
99700
99656
|
}
|
|
99701
99657
|
write(_cache, input) {
|
|
99702
99658
|
if (input.data === void 0) {
|
|
99703
|
-
return ok$
|
|
99659
|
+
return ok$3({ type: "missing" });
|
|
99704
99660
|
}
|
|
99705
99661
|
if (input.data === null) {
|
|
99706
99662
|
if (!this.nullable) {
|
|
99707
|
-
return err$
|
|
99663
|
+
return err$3([
|
|
99708
99664
|
{
|
|
99709
99665
|
type: "unknown",
|
|
99710
99666
|
error: new Error(
|
|
@@ -99714,14 +99670,14 @@
|
|
|
99714
99670
|
]);
|
|
99715
99671
|
}
|
|
99716
99672
|
}
|
|
99717
|
-
return ok$
|
|
99673
|
+
return ok$3({ type: "data", data: input.data });
|
|
99718
99674
|
}
|
|
99719
99675
|
read(_cache, input) {
|
|
99720
99676
|
const normalizedData = input.normalizedData;
|
|
99721
99677
|
if (normalizedData.type === "missing") {
|
|
99722
|
-
return ok$
|
|
99678
|
+
return ok$3(void 0);
|
|
99723
99679
|
}
|
|
99724
|
-
return ok$
|
|
99680
|
+
return ok$3(normalizedData.data);
|
|
99725
99681
|
}
|
|
99726
99682
|
augmentSelections(input) {
|
|
99727
99683
|
return input;
|
|
@@ -99743,11 +99699,11 @@
|
|
|
99743
99699
|
}
|
|
99744
99700
|
write(cache, input) {
|
|
99745
99701
|
if (input.data === void 0) {
|
|
99746
|
-
return ok$
|
|
99702
|
+
return ok$3({ type: "missing" });
|
|
99747
99703
|
}
|
|
99748
99704
|
if (input.data === null) {
|
|
99749
99705
|
if (!this.nullable) {
|
|
99750
|
-
return err$
|
|
99706
|
+
return err$3([
|
|
99751
99707
|
{
|
|
99752
99708
|
type: "unknown",
|
|
99753
99709
|
error: new Error(
|
|
@@ -99756,10 +99712,10 @@
|
|
|
99756
99712
|
}
|
|
99757
99713
|
]);
|
|
99758
99714
|
}
|
|
99759
|
-
return ok$
|
|
99715
|
+
return ok$3({ type: "data", data: input.data });
|
|
99760
99716
|
}
|
|
99761
99717
|
if (!Array.isArray(input.data)) {
|
|
99762
|
-
return err$
|
|
99718
|
+
return err$3([
|
|
99763
99719
|
{
|
|
99764
99720
|
type: "unknown",
|
|
99765
99721
|
error: new Error(
|
|
@@ -99787,18 +99743,18 @@
|
|
|
99787
99743
|
}
|
|
99788
99744
|
});
|
|
99789
99745
|
if (arrayNormalizationErrors.length > 0) {
|
|
99790
|
-
return err$
|
|
99746
|
+
return err$3(arrayNormalizationErrors);
|
|
99791
99747
|
}
|
|
99792
|
-
return ok$
|
|
99748
|
+
return ok$3({ type: "data", data: normalizedArray });
|
|
99793
99749
|
}
|
|
99794
99750
|
read(cache, input) {
|
|
99795
99751
|
const normalizedData = input.normalizedData;
|
|
99796
99752
|
if (normalizedData.type === "missing") {
|
|
99797
|
-
return ok$
|
|
99753
|
+
return ok$3(void 0);
|
|
99798
99754
|
}
|
|
99799
99755
|
if (normalizedData.data === null) {
|
|
99800
99756
|
if (!this.nullable) {
|
|
99801
|
-
return err$
|
|
99757
|
+
return err$3([
|
|
99802
99758
|
{
|
|
99803
99759
|
type: "unknown",
|
|
99804
99760
|
error: new Error(
|
|
@@ -99807,10 +99763,10 @@
|
|
|
99807
99763
|
}
|
|
99808
99764
|
]);
|
|
99809
99765
|
}
|
|
99810
|
-
return ok$
|
|
99766
|
+
return ok$3({ type: "data", data: null });
|
|
99811
99767
|
}
|
|
99812
99768
|
if (!Array.isArray(normalizedData.data)) {
|
|
99813
|
-
return err$
|
|
99769
|
+
return err$3([
|
|
99814
99770
|
{
|
|
99815
99771
|
type: "unknown",
|
|
99816
99772
|
error: new Error(
|
|
@@ -99835,9 +99791,9 @@
|
|
|
99835
99791
|
}
|
|
99836
99792
|
});
|
|
99837
99793
|
if (arrayDenormalizationErrors.length > 0) {
|
|
99838
|
-
return err$
|
|
99794
|
+
return err$3(arrayDenormalizationErrors);
|
|
99839
99795
|
}
|
|
99840
|
-
return ok$
|
|
99796
|
+
return ok$3(denormalizedArray);
|
|
99841
99797
|
}
|
|
99842
99798
|
}
|
|
99843
99799
|
class BaseObjectFieldDef {
|
|
@@ -99854,7 +99810,7 @@
|
|
|
99854
99810
|
write(cache, input) {
|
|
99855
99811
|
var _a;
|
|
99856
99812
|
if (!input.selection.selectionSet) {
|
|
99857
|
-
return err$
|
|
99813
|
+
return err$3([
|
|
99858
99814
|
{
|
|
99859
99815
|
type: "unknown",
|
|
99860
99816
|
error: new Error(
|
|
@@ -99864,11 +99820,11 @@
|
|
|
99864
99820
|
]);
|
|
99865
99821
|
}
|
|
99866
99822
|
if (input.data === void 0) {
|
|
99867
|
-
return ok$
|
|
99823
|
+
return ok$3({ type: "missing" });
|
|
99868
99824
|
}
|
|
99869
99825
|
if (input.data === null) {
|
|
99870
99826
|
if (!this.nullable) {
|
|
99871
|
-
return err$
|
|
99827
|
+
return err$3([
|
|
99872
99828
|
{
|
|
99873
99829
|
type: "unknown",
|
|
99874
99830
|
error: new Error(
|
|
@@ -99877,7 +99833,7 @@
|
|
|
99877
99833
|
}
|
|
99878
99834
|
]);
|
|
99879
99835
|
}
|
|
99880
|
-
return ok$
|
|
99836
|
+
return ok$3({ type: "data", data: null });
|
|
99881
99837
|
}
|
|
99882
99838
|
const writeResult = this.repository.write(cache, {
|
|
99883
99839
|
...input,
|
|
@@ -99890,12 +99846,12 @@
|
|
|
99890
99846
|
if (writeResult.isErr()) {
|
|
99891
99847
|
return writeResult;
|
|
99892
99848
|
}
|
|
99893
|
-
return ok$
|
|
99849
|
+
return ok$3({ type: "data", data: writeResult.value });
|
|
99894
99850
|
}
|
|
99895
99851
|
read(cache, input) {
|
|
99896
99852
|
var _a;
|
|
99897
99853
|
if (!input.selection.selectionSet) {
|
|
99898
|
-
return err$
|
|
99854
|
+
return err$3([
|
|
99899
99855
|
{
|
|
99900
99856
|
type: "unknown",
|
|
99901
99857
|
error: new Error(
|
|
@@ -99906,11 +99862,11 @@
|
|
|
99906
99862
|
}
|
|
99907
99863
|
const normalizedData = input.normalizedData;
|
|
99908
99864
|
if (normalizedData.type === "missing") {
|
|
99909
|
-
return ok$
|
|
99865
|
+
return ok$3(void 0);
|
|
99910
99866
|
}
|
|
99911
99867
|
if (normalizedData.data === null) {
|
|
99912
99868
|
if (!this.nullable) {
|
|
99913
|
-
return err$
|
|
99869
|
+
return err$3([
|
|
99914
99870
|
{
|
|
99915
99871
|
type: "unknown",
|
|
99916
99872
|
error: new Error(
|
|
@@ -99919,7 +99875,7 @@
|
|
|
99919
99875
|
}
|
|
99920
99876
|
]);
|
|
99921
99877
|
}
|
|
99922
|
-
return ok$
|
|
99878
|
+
return ok$3(null);
|
|
99923
99879
|
}
|
|
99924
99880
|
return this.repository.read(cache, {
|
|
99925
99881
|
...input,
|
|
@@ -100202,7 +100158,7 @@
|
|
|
100202
100158
|
var _a;
|
|
100203
100159
|
const fieldDef = this.getFieldDef(input, selection);
|
|
100204
100160
|
if (!fieldDef) {
|
|
100205
|
-
return err$
|
|
100161
|
+
return err$3(
|
|
100206
100162
|
new Error(
|
|
100207
100163
|
`Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
|
|
100208
100164
|
)
|
|
@@ -100213,10 +100169,10 @@
|
|
|
100213
100169
|
input.request.definitions.variables
|
|
100214
100170
|
);
|
|
100215
100171
|
if (cacheFieldKeyResult.isErr()) {
|
|
100216
|
-
return err$
|
|
100172
|
+
return err$3(cacheFieldKeyResult.error);
|
|
100217
100173
|
}
|
|
100218
100174
|
const cacheFieldKey = cacheFieldKeyResult.value;
|
|
100219
|
-
return ok$
|
|
100175
|
+
return ok$3((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
|
|
100220
100176
|
}
|
|
100221
100177
|
denormalizeFieldSelection(cache, input, selection, errorCollector) {
|
|
100222
100178
|
var _a;
|
|
@@ -100322,22 +100278,22 @@
|
|
|
100322
100278
|
return shouldSkipResult;
|
|
100323
100279
|
}
|
|
100324
100280
|
if (shouldSkipResult.value) {
|
|
100325
|
-
return ok$
|
|
100281
|
+
return ok$3(false);
|
|
100326
100282
|
}
|
|
100327
100283
|
return this.satisfiesFragmentTypeCondition(input, fragment);
|
|
100328
100284
|
}
|
|
100329
100285
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
100330
100286
|
if (!fragment.typeCondition) {
|
|
100331
|
-
return ok$
|
|
100287
|
+
return ok$3(true);
|
|
100332
100288
|
}
|
|
100333
100289
|
const conditionalTypeName = fragment.typeCondition.name.value;
|
|
100334
100290
|
if (conditionalTypeName === this.typeName) {
|
|
100335
|
-
return ok$
|
|
100291
|
+
return ok$3(true);
|
|
100336
100292
|
}
|
|
100337
100293
|
if (this.implementedInterfaces.includes(conditionalTypeName)) {
|
|
100338
|
-
return ok$
|
|
100294
|
+
return ok$3(true);
|
|
100339
100295
|
}
|
|
100340
|
-
return ok$
|
|
100296
|
+
return ok$3(false);
|
|
100341
100297
|
}
|
|
100342
100298
|
getCacheKeyFieldArguments(selection) {
|
|
100343
100299
|
return selection.arguments;
|
|
@@ -100396,7 +100352,7 @@
|
|
|
100396
100352
|
const key = this.buildKey(this.buildKeyParams(input));
|
|
100397
100353
|
const normalized = this.normalizeData(cache, input);
|
|
100398
100354
|
if (normalized.isErr()) {
|
|
100399
|
-
return err$
|
|
100355
|
+
return err$3(normalized.error);
|
|
100400
100356
|
}
|
|
100401
100357
|
const existing = cache.get(key);
|
|
100402
100358
|
if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
|
|
@@ -100405,7 +100361,7 @@
|
|
|
100405
100361
|
metadata: this.cacheMetadata
|
|
100406
100362
|
});
|
|
100407
100363
|
}
|
|
100408
|
-
return ok$
|
|
100364
|
+
return ok$3({
|
|
100409
100365
|
type: "link",
|
|
100410
100366
|
linkedKey: key
|
|
100411
100367
|
});
|
|
@@ -100420,7 +100376,7 @@
|
|
|
100420
100376
|
if (normalizeDataResult.isErr()) {
|
|
100421
100377
|
return normalizeDataResult;
|
|
100422
100378
|
}
|
|
100423
|
-
return ok$
|
|
100379
|
+
return ok$3(
|
|
100424
100380
|
deepMerge$2(
|
|
100425
100381
|
{},
|
|
100426
100382
|
(existingNormalizedData == null ? void 0 : existingNormalizedData.value) || {},
|
|
@@ -100490,7 +100446,7 @@
|
|
|
100490
100446
|
if (result.isErr()) {
|
|
100491
100447
|
return result;
|
|
100492
100448
|
}
|
|
100493
|
-
return ok$
|
|
100449
|
+
return ok$3({
|
|
100494
100450
|
data: result.value
|
|
100495
100451
|
});
|
|
100496
100452
|
}
|
|
@@ -100498,7 +100454,7 @@
|
|
|
100498
100454
|
var _a;
|
|
100499
100455
|
const operationResult = findExecutableOperation(input);
|
|
100500
100456
|
if (operationResult.isErr()) {
|
|
100501
|
-
return err$
|
|
100457
|
+
return err$3(operationResult.error);
|
|
100502
100458
|
}
|
|
100503
100459
|
const operation = operationResult.value;
|
|
100504
100460
|
const fragmentDefinitions = input.query.definitions.filter(
|
|
@@ -100521,7 +100477,7 @@
|
|
|
100521
100477
|
...operation,
|
|
100522
100478
|
selectionSet: { kind: Kind$1.SELECTION_SET, selections: augmentedOperationSelections }
|
|
100523
100479
|
};
|
|
100524
|
-
return ok$
|
|
100480
|
+
return ok$3({
|
|
100525
100481
|
...input.query,
|
|
100526
100482
|
definitions: [
|
|
100527
100483
|
...input.query.definitions.filter((def) => def.kind !== Kind$1.FRAGMENT_DEFINITION).map((def) => {
|
|
@@ -100556,7 +100512,7 @@
|
|
|
100556
100512
|
}
|
|
100557
100513
|
write(cache, input) {
|
|
100558
100514
|
if (typeof input.data !== "object") {
|
|
100559
|
-
return err$
|
|
100515
|
+
return err$3([
|
|
100560
100516
|
{
|
|
100561
100517
|
type: "unknown",
|
|
100562
100518
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -100566,7 +100522,7 @@
|
|
|
100566
100522
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
100567
100523
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
100568
100524
|
if (!concreteTypeRepository) {
|
|
100569
|
-
return err$
|
|
100525
|
+
return err$3([
|
|
100570
100526
|
{
|
|
100571
100527
|
type: "unknown",
|
|
100572
100528
|
error: new Error(
|
|
@@ -100577,7 +100533,7 @@
|
|
|
100577
100533
|
}
|
|
100578
100534
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
100579
100535
|
if (selectionErr) {
|
|
100580
|
-
return err$
|
|
100536
|
+
return err$3(selectionErr);
|
|
100581
100537
|
}
|
|
100582
100538
|
const normalizeInput = {
|
|
100583
100539
|
...input,
|
|
@@ -100589,14 +100545,14 @@
|
|
|
100589
100545
|
};
|
|
100590
100546
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
100591
100547
|
if (result.isOk()) {
|
|
100592
|
-
return ok$
|
|
100548
|
+
return ok$3({ discriminator, data: result.value });
|
|
100593
100549
|
}
|
|
100594
100550
|
return result;
|
|
100595
100551
|
}
|
|
100596
100552
|
read(cache, input) {
|
|
100597
100553
|
const unionRep = input.normalizedData;
|
|
100598
100554
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
100599
|
-
return err$
|
|
100555
|
+
return err$3([
|
|
100600
100556
|
{
|
|
100601
100557
|
type: "unknown",
|
|
100602
100558
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -100606,7 +100562,7 @@
|
|
|
100606
100562
|
const discriminator = unionRep.discriminator;
|
|
100607
100563
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
100608
100564
|
if (!concreteRepository) {
|
|
100609
|
-
return err$
|
|
100565
|
+
return err$3([
|
|
100610
100566
|
{
|
|
100611
100567
|
type: "unknown",
|
|
100612
100568
|
error: new Error(
|
|
@@ -100617,7 +100573,7 @@
|
|
|
100617
100573
|
}
|
|
100618
100574
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
100619
100575
|
if (selectionErr) {
|
|
100620
|
-
return err$
|
|
100576
|
+
return err$3(selectionErr);
|
|
100621
100577
|
}
|
|
100622
100578
|
const denormalizeInput = {
|
|
100623
100579
|
...input,
|
|
@@ -100722,7 +100678,7 @@
|
|
|
100722
100678
|
}
|
|
100723
100679
|
write(cache, input) {
|
|
100724
100680
|
if (typeof input.data !== "object") {
|
|
100725
|
-
return err$
|
|
100681
|
+
return err$3([
|
|
100726
100682
|
{
|
|
100727
100683
|
type: "unknown",
|
|
100728
100684
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -100732,7 +100688,7 @@
|
|
|
100732
100688
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
100733
100689
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
100734
100690
|
if (!concreteTypeRepository) {
|
|
100735
|
-
return err$
|
|
100691
|
+
return err$3([
|
|
100736
100692
|
{
|
|
100737
100693
|
type: "unknown",
|
|
100738
100694
|
error: new Error(
|
|
@@ -100743,7 +100699,7 @@
|
|
|
100743
100699
|
}
|
|
100744
100700
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
100745
100701
|
if (selectionErr) {
|
|
100746
|
-
return err$
|
|
100702
|
+
return err$3(selectionErr);
|
|
100747
100703
|
}
|
|
100748
100704
|
const normalizeInput = {
|
|
100749
100705
|
...input,
|
|
@@ -100755,14 +100711,14 @@
|
|
|
100755
100711
|
};
|
|
100756
100712
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
100757
100713
|
if (result.isOk()) {
|
|
100758
|
-
return ok$
|
|
100714
|
+
return ok$3({ discriminator, data: result.value });
|
|
100759
100715
|
}
|
|
100760
100716
|
return result;
|
|
100761
100717
|
}
|
|
100762
100718
|
read(cache, input) {
|
|
100763
100719
|
const unionRep = input.normalizedData;
|
|
100764
100720
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
100765
|
-
return err$
|
|
100721
|
+
return err$3([
|
|
100766
100722
|
{
|
|
100767
100723
|
type: "unknown",
|
|
100768
100724
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -100772,7 +100728,7 @@
|
|
|
100772
100728
|
const discriminator = unionRep.discriminator;
|
|
100773
100729
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
100774
100730
|
if (!concreteRepository) {
|
|
100775
|
-
return err$
|
|
100731
|
+
return err$3([
|
|
100776
100732
|
{
|
|
100777
100733
|
type: "unknown",
|
|
100778
100734
|
error: new Error(
|
|
@@ -100783,7 +100739,7 @@
|
|
|
100783
100739
|
}
|
|
100784
100740
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
100785
100741
|
if (selectionErr) {
|
|
100786
|
-
return err$
|
|
100742
|
+
return err$3(selectionErr);
|
|
100787
100743
|
}
|
|
100788
100744
|
const denormalizeInput = {
|
|
100789
100745
|
...input,
|
|
@@ -105302,7 +105258,7 @@
|
|
|
105302
105258
|
* @param typeName - The repository type name for error messages
|
|
105303
105259
|
* @returns Result<boolean, Error> - true if the fragment type condition is satisfied
|
|
105304
105260
|
*/
|
|
105305
|
-
function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment,
|
|
105261
|
+
function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment, _typeName) {
|
|
105306
105262
|
// First try the base class implementation
|
|
105307
105263
|
const result = superSatisfiesFragmentTypeCondition(input, fragment);
|
|
105308
105264
|
if (result.isErr() || result.value) {
|
|
@@ -105770,7 +105726,7 @@
|
|
|
105770
105726
|
}
|
|
105771
105727
|
|
|
105772
105728
|
class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
|
|
105773
|
-
getTypeDiscriminator(
|
|
105729
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105774
105730
|
// Hardcoded to record representation since that's the only type of parent
|
|
105775
105731
|
// relationship possible
|
|
105776
105732
|
return 'RecordRepresentation';
|
|
@@ -105810,7 +105766,7 @@
|
|
|
105810
105766
|
}
|
|
105811
105767
|
|
|
105812
105768
|
class PolymorphicAggregateParentRelationshipRepository extends PolymorphicAggregateParentRelationshipRepository$1 {
|
|
105813
|
-
getTypeDiscriminator(
|
|
105769
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105814
105770
|
// Hardcoded to record aggregate since that's the only type of parent
|
|
105815
105771
|
// relationship possible
|
|
105816
105772
|
return 'RecordAggregate';
|
|
@@ -105867,6 +105823,7 @@
|
|
|
105867
105823
|
let idFieldSelection = input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id');
|
|
105868
105824
|
// If Id exists in data but wasn't asked for, synthesize the selection like RecordRepresentation does
|
|
105869
105825
|
if (input.data.Id !== undefined && !idFieldSelection) {
|
|
105826
|
+
// eslint-disable-next-line no-param-reassign
|
|
105870
105827
|
input = {
|
|
105871
105828
|
...input,
|
|
105872
105829
|
selections: [
|
|
@@ -105914,7 +105871,7 @@
|
|
|
105914
105871
|
}
|
|
105915
105872
|
|
|
105916
105873
|
class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__SetupPolymorphicAggregateParentRelationshipRepository {
|
|
105917
|
-
getTypeDiscriminator(
|
|
105874
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105918
105875
|
// Hardcoded to Setup__SetupRecordAggregate since that's the only type of parent
|
|
105919
105876
|
// relationship possible
|
|
105920
105877
|
return 'Setup__SetupRecordAggregate';
|
|
@@ -105922,7 +105879,7 @@
|
|
|
105922
105879
|
}
|
|
105923
105880
|
|
|
105924
105881
|
class SetupPolymorphicParentRelationshipRepository extends Setup__SetupPolymorphicParentRelationshipRepository {
|
|
105925
|
-
getTypeDiscriminator(
|
|
105882
|
+
getTypeDiscriminator(_data, _selections) {
|
|
105926
105883
|
// Hardcoded to Setup__EntityRepresentation since that's the only type of parent
|
|
105927
105884
|
// relationship possible
|
|
105928
105885
|
return 'Setup__EntityRepresentation';
|
|
@@ -106063,6 +106020,7 @@
|
|
|
106063
106020
|
const dataType = typeof data;
|
|
106064
106021
|
const extensionsType = typeof extensions;
|
|
106065
106022
|
if (dataType === 'function' || extensionsType === 'function') {
|
|
106023
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106066
106024
|
throw new Error('Cannot merge functions');
|
|
106067
106025
|
}
|
|
106068
106026
|
if (dataType === 'undefined' || data === undefined) {
|
|
@@ -106403,7 +106361,9 @@
|
|
|
106403
106361
|
});
|
|
106404
106362
|
this.unsubscribers.push(unsubscribeFromLuvioSnapshot);
|
|
106405
106363
|
}
|
|
106406
|
-
catch (error) {
|
|
106364
|
+
catch (error) {
|
|
106365
|
+
// intentionally do nothing
|
|
106366
|
+
}
|
|
106407
106367
|
}
|
|
106408
106368
|
}
|
|
106409
106369
|
usedRecordsChanged() {
|
|
@@ -106509,6 +106469,7 @@
|
|
|
106509
106469
|
const invalidKeys = configKeys.filter((key) => !allowedKeysSet.includes(key));
|
|
106510
106470
|
if (invalidKeys.length > 0) {
|
|
106511
106471
|
// invalid keys, so set error state
|
|
106472
|
+
// eslint-disable-next-line no-throw-literal
|
|
106512
106473
|
throw {
|
|
106513
106474
|
error: `Invalid config keys: ${invalidKeys.join(', ')}`,
|
|
106514
106475
|
errorType: 'adapterError',
|
|
@@ -106873,7 +106834,7 @@
|
|
|
106873
106834
|
_(config, CONFIG_SCHEMA);
|
|
106874
106835
|
const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
|
|
106875
106836
|
return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
|
|
106876
|
-
},
|
|
106837
|
+
}, true);
|
|
106877
106838
|
graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
|
|
106878
106839
|
const _ = assertIsValid;
|
|
106879
106840
|
_(config, CONFIG_SCHEMA);
|
|
@@ -106883,6 +106844,7 @@
|
|
|
106883
106844
|
services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
|
|
106884
106845
|
const validatedConfig = validateNonQueryGraphQLConfig(config);
|
|
106885
106846
|
if (validatedConfig.isErr()) {
|
|
106847
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106886
106848
|
throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
|
|
106887
106849
|
}
|
|
106888
106850
|
const _ = assertIsValid;
|
|
@@ -106894,11 +106856,12 @@
|
|
|
106894
106856
|
*/
|
|
106895
106857
|
const graphql_state_manager_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_state_manager');
|
|
106896
106858
|
const factory = (config) => {
|
|
106897
|
-
assertIsValid(config, CONFIG_SCHEMA);
|
|
106859
|
+
assertIsValid$1(config, CONFIG_SCHEMA);
|
|
106898
106860
|
const validatedConfig = resolveAndValidateGraphQLConfig(config, {
|
|
106899
106861
|
acceptedOperations: ['query'],
|
|
106900
106862
|
});
|
|
106901
106863
|
if (validatedConfig === undefined || validatedConfig.isErr()) {
|
|
106864
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
106902
106865
|
throw new Error('Internal error in GraphQL adapter occurred: Unable to resolve query');
|
|
106903
106866
|
}
|
|
106904
106867
|
return new graphql_state_manager_ctor(validatedConfig.value, documentRootType, services);
|
|
@@ -106926,7 +106889,7 @@
|
|
|
106926
106889
|
cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
|
|
106927
106890
|
}
|
|
106928
106891
|
}
|
|
106929
|
-
// version: 1.
|
|
106892
|
+
// version: 1.434.0-6aa2dd15e3
|
|
106930
106893
|
|
|
106931
106894
|
function createFragmentMap(documentNode) {
|
|
106932
106895
|
const fragments = {};
|
|
@@ -134955,28 +134918,23 @@
|
|
|
134955
134918
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
134956
134919
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134957
134920
|
* be reached by following 1 relationship from the root record, etc.
|
|
134958
|
-
* @defaultValue '
|
|
134921
|
+
* @defaultValue '1'
|
|
134959
134922
|
*/
|
|
134960
|
-
let trackedFieldDepthOnCacheMiss$1 =
|
|
134923
|
+
let trackedFieldDepthOnCacheMiss$1 = 1;
|
|
134961
134924
|
/**
|
|
134962
134925
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
134963
134926
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134964
134927
|
* be reached by following 1 relationship from the root record, etc.
|
|
134965
|
-
* @defaultValue '
|
|
134928
|
+
* @defaultValue '1'
|
|
134966
134929
|
*/
|
|
134967
|
-
let trackedFieldDepthOnCacheMergeConflict$1 =
|
|
134930
|
+
let trackedFieldDepthOnCacheMergeConflict$1 = 1;
|
|
134968
134931
|
/**
|
|
134969
134932
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
134970
134933
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
134971
134934
|
* be reached by following 1 relationship from the root record, etc.
|
|
134972
|
-
* @defaultValue '
|
|
134935
|
+
* @defaultValue '1'
|
|
134973
134936
|
*/
|
|
134974
|
-
let trackedFieldDepthOnNotifyChange$1 =
|
|
134975
|
-
/**
|
|
134976
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
134977
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
134978
|
-
*/
|
|
134979
|
-
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
134937
|
+
let trackedFieldDepthOnNotifyChange$1 = 1;
|
|
134980
134938
|
/**
|
|
134981
134939
|
* One store enabled Get Object Info adapter
|
|
134982
134940
|
*/
|
|
@@ -135073,12 +135031,6 @@
|
|
|
135073
135031
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
135074
135032
|
return trackedFieldDepthOnNotifyChange$1;
|
|
135075
135033
|
},
|
|
135076
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
135077
|
-
trackedFieldLeafNodeIdAndNameOnly$1 = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
135078
|
-
},
|
|
135079
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
135080
|
-
return trackedFieldLeafNodeIdAndNameOnly$1;
|
|
135081
|
-
},
|
|
135082
135034
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
135083
135035
|
recordRepresentationIngestionOverride$1 = ingest;
|
|
135084
135036
|
},
|
|
@@ -135635,6 +135587,7 @@
|
|
|
135635
135587
|
if (typeof data?.refresh === 'function') {
|
|
135636
135588
|
return data.refresh();
|
|
135637
135589
|
}
|
|
135590
|
+
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
135638
135591
|
throw new Error('Component attempted to refresh a GraphQL result that is not refreshable');
|
|
135639
135592
|
};
|
|
135640
135593
|
}
|
|
@@ -136143,7 +136096,7 @@
|
|
|
136143
136096
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
136144
136097
|
instrument: instrument$1,
|
|
136145
136098
|
});
|
|
136146
|
-
// version: 1.
|
|
136099
|
+
// version: 1.434.0-6aa2dd15e3
|
|
136147
136100
|
|
|
136148
136101
|
// On core the unstable adapters are re-exported with different names,
|
|
136149
136102
|
// we want to match them here.
|
|
@@ -136295,7 +136248,7 @@
|
|
|
136295
136248
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
136296
136249
|
graphQLImperative = ldsAdapter;
|
|
136297
136250
|
});
|
|
136298
|
-
// version: 1.
|
|
136251
|
+
// version: 1.434.0-6aa2dd15e3
|
|
136299
136252
|
|
|
136300
136253
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
136301
136254
|
__proto__: null,
|
|
@@ -137094,7 +137047,7 @@
|
|
|
137094
137047
|
function register(r) {
|
|
137095
137048
|
callbacks$1.forEach((callback) => callback(r));
|
|
137096
137049
|
}
|
|
137097
|
-
// version: 1.
|
|
137050
|
+
// version: 1.434.0-d8deb0d4ea
|
|
137098
137051
|
|
|
137099
137052
|
/**
|
|
137100
137053
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -137130,28 +137083,23 @@
|
|
|
137130
137083
|
* Depth to which tracked fields will be added to a request that results from a cache miss.
|
|
137131
137084
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137132
137085
|
* be reached by following 1 relationship from the root record, etc.
|
|
137133
|
-
* @defaultValue '
|
|
137086
|
+
* @defaultValue '1'
|
|
137134
137087
|
*/
|
|
137135
|
-
let trackedFieldDepthOnCacheMiss =
|
|
137088
|
+
let trackedFieldDepthOnCacheMiss = 1;
|
|
137136
137089
|
/**
|
|
137137
137090
|
* Depth to which tracked fields will be added to a request that results from a merge conflict
|
|
137138
137091
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137139
137092
|
* be reached by following 1 relationship from the root record, etc.
|
|
137140
|
-
* @defaultValue '
|
|
137093
|
+
* @defaultValue '1'
|
|
137141
137094
|
*/
|
|
137142
|
-
let trackedFieldDepthOnCacheMergeConflict =
|
|
137095
|
+
let trackedFieldDepthOnCacheMergeConflict = 1;
|
|
137143
137096
|
/**
|
|
137144
137097
|
* Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
|
|
137145
137098
|
* A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
|
|
137146
137099
|
* be reached by following 1 relationship from the root record, etc.
|
|
137147
|
-
* @defaultValue '
|
|
137148
|
-
*/
|
|
137149
|
-
let trackedFieldDepthOnNotifyChange = 5;
|
|
137150
|
-
/**
|
|
137151
|
-
* Determines if we will only fetch the 'Id' field for the leaf relationship record
|
|
137152
|
-
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
137100
|
+
* @defaultValue '1'
|
|
137153
137101
|
*/
|
|
137154
|
-
let
|
|
137102
|
+
let trackedFieldDepthOnNotifyChange = 1;
|
|
137155
137103
|
/**
|
|
137156
137104
|
* One store enabled Get Object Info adapter
|
|
137157
137105
|
*/
|
|
@@ -137248,12 +137196,6 @@
|
|
|
137248
137196
|
getTrackedFieldDepthOnNotifyChange: function () {
|
|
137249
137197
|
return trackedFieldDepthOnNotifyChange;
|
|
137250
137198
|
},
|
|
137251
|
-
setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
|
|
137252
|
-
trackedFieldLeafNodeIdAndNameOnly = trackedFieldLeafNodeIdAndNameOnlyParam;
|
|
137253
|
-
},
|
|
137254
|
-
getTrackedFieldLeafNodeIdAndNameOnly: function () {
|
|
137255
|
-
return trackedFieldLeafNodeIdAndNameOnly;
|
|
137256
|
-
},
|
|
137257
137199
|
setRecordRepresentationIngestionOverride: function (ingest) {
|
|
137258
137200
|
recordRepresentationIngestionOverride = ingest;
|
|
137259
137201
|
},
|
|
@@ -138148,6 +138090,7 @@
|
|
|
138148
138090
|
const LUVIO_ADAPTER_FAMILY = /^force\/ldsAdapters/;
|
|
138149
138091
|
async function importLuvioAdapterModule(specifier) {
|
|
138150
138092
|
if (!LUVIO_ADAPTER_FAMILY.test(specifier)) {
|
|
138093
|
+
// eslint-disable-next-line no-throw-literal
|
|
138151
138094
|
throw `${specifier} is not an allowed luvio adapter module`;
|
|
138152
138095
|
}
|
|
138153
138096
|
let module;
|
|
@@ -138155,6 +138098,7 @@
|
|
|
138155
138098
|
module = await import(specifier);
|
|
138156
138099
|
}
|
|
138157
138100
|
catch {
|
|
138101
|
+
// eslint-disable-next-line no-throw-literal
|
|
138158
138102
|
throw `module not found for specifier ${specifier}`;
|
|
138159
138103
|
}
|
|
138160
138104
|
return new LuvioAdapterModule(module);
|
|
@@ -138268,6 +138212,7 @@
|
|
|
138268
138212
|
}
|
|
138269
138213
|
async function importOneStoreAdapterModule(specifier) {
|
|
138270
138214
|
if (!ONESTORE_ADAPTER_FAMILY.test(specifier)) {
|
|
138215
|
+
// eslint-disable-next-line no-throw-literal
|
|
138271
138216
|
throw `${specifier} is not an allowed onestore adapter module`;
|
|
138272
138217
|
}
|
|
138273
138218
|
let module;
|
|
@@ -138275,6 +138220,7 @@
|
|
|
138275
138220
|
module = await import(specifier);
|
|
138276
138221
|
}
|
|
138277
138222
|
catch {
|
|
138223
|
+
// eslint-disable-next-line no-throw-literal
|
|
138278
138224
|
throw `module not found for specifier ${specifier}`;
|
|
138279
138225
|
}
|
|
138280
138226
|
return new OneStoreAdapterModule(module);
|
|
@@ -138411,4 +138357,4 @@
|
|
|
138411
138357
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
138412
138358
|
|
|
138413
138359
|
}));
|
|
138414
|
-
// version: 1.
|
|
138360
|
+
// version: 1.434.0-d8deb0d4ea
|