@salesforce/lds-worker-api 1.377.0 → 1.378.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.
|
@@ -4280,7 +4280,7 @@
|
|
|
4280
4280
|
}
|
|
4281
4281
|
callbacks.push(callback);
|
|
4282
4282
|
}
|
|
4283
|
-
// version: 1.
|
|
4283
|
+
// version: 1.378.0-0ab3d40d29
|
|
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.378.0-0ab3d40d29
|
|
5328
5328
|
|
|
5329
5329
|
/**
|
|
5330
5330
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -34160,7 +34160,7 @@
|
|
|
34160
34160
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
34161
34161
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
34162
34162
|
});
|
|
34163
|
-
// version: 1.
|
|
34163
|
+
// version: 1.378.0-63d7c07562
|
|
34164
34164
|
|
|
34165
34165
|
function requestIdleDetectedCallback(_callback) { }
|
|
34166
34166
|
function declareNotifierTaskSingle(_name) {
|
|
@@ -45665,6 +45665,15 @@
|
|
|
45665
45665
|
},
|
|
45666
45666
|
};
|
|
45667
45667
|
|
|
45668
|
+
var graphqlPartialEmitParity = {
|
|
45669
|
+
isOpen: function (e) {
|
|
45670
|
+
return e.fallback;
|
|
45671
|
+
},
|
|
45672
|
+
hasError: function () {
|
|
45673
|
+
return !0;
|
|
45674
|
+
},
|
|
45675
|
+
};
|
|
45676
|
+
|
|
45668
45677
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
45669
45678
|
|
|
45670
45679
|
var ldsAdapterO11yLoggingGate = {
|
|
@@ -45812,47 +45821,47 @@
|
|
|
45812
45821
|
};
|
|
45813
45822
|
const ok$4 = (value) => new Ok$4(value);
|
|
45814
45823
|
const err$4 = (err2) => new Err$4(err2);
|
|
45815
|
-
function resolvedPromiseLike$
|
|
45816
|
-
if (isPromiseLike$
|
|
45824
|
+
function resolvedPromiseLike$5(result) {
|
|
45825
|
+
if (isPromiseLike$5(result)) {
|
|
45817
45826
|
return result.then((nextResult) => nextResult);
|
|
45818
45827
|
}
|
|
45819
45828
|
return {
|
|
45820
45829
|
then: (onFulfilled, _onRejected) => {
|
|
45821
45830
|
try {
|
|
45822
|
-
return resolvedPromiseLike$
|
|
45831
|
+
return resolvedPromiseLike$5(onFulfilled(result));
|
|
45823
45832
|
} catch (e) {
|
|
45824
45833
|
if (onFulfilled === void 0) {
|
|
45825
|
-
return resolvedPromiseLike$
|
|
45834
|
+
return resolvedPromiseLike$5(result);
|
|
45826
45835
|
}
|
|
45827
|
-
return rejectedPromiseLike$
|
|
45836
|
+
return rejectedPromiseLike$5(e);
|
|
45828
45837
|
}
|
|
45829
45838
|
}
|
|
45830
45839
|
};
|
|
45831
45840
|
}
|
|
45832
|
-
function rejectedPromiseLike$
|
|
45833
|
-
if (isPromiseLike$
|
|
45841
|
+
function rejectedPromiseLike$5(reason) {
|
|
45842
|
+
if (isPromiseLike$5(reason)) {
|
|
45834
45843
|
return reason.then((nextResult) => nextResult);
|
|
45835
45844
|
}
|
|
45836
45845
|
return {
|
|
45837
45846
|
then: (_onFulfilled, onRejected) => {
|
|
45838
45847
|
if (typeof onRejected === "function") {
|
|
45839
45848
|
try {
|
|
45840
|
-
return resolvedPromiseLike$
|
|
45849
|
+
return resolvedPromiseLike$5(onRejected(reason));
|
|
45841
45850
|
} catch (e) {
|
|
45842
|
-
return rejectedPromiseLike$
|
|
45851
|
+
return rejectedPromiseLike$5(e);
|
|
45843
45852
|
}
|
|
45844
45853
|
}
|
|
45845
|
-
return rejectedPromiseLike$
|
|
45854
|
+
return rejectedPromiseLike$5(reason);
|
|
45846
45855
|
}
|
|
45847
45856
|
};
|
|
45848
45857
|
}
|
|
45849
|
-
function isPromiseLike$
|
|
45858
|
+
function isPromiseLike$5(x) {
|
|
45850
45859
|
return typeof (x == null ? void 0 : x.then) === "function";
|
|
45851
45860
|
}
|
|
45852
45861
|
function racesync(values) {
|
|
45853
45862
|
for (const value of values) {
|
|
45854
45863
|
let settled = void 0;
|
|
45855
|
-
if (isPromiseLike$
|
|
45864
|
+
if (isPromiseLike$5(value)) {
|
|
45856
45865
|
value.then(
|
|
45857
45866
|
(_) => {
|
|
45858
45867
|
settled = value;
|
|
@@ -45862,7 +45871,7 @@
|
|
|
45862
45871
|
}
|
|
45863
45872
|
);
|
|
45864
45873
|
} else {
|
|
45865
|
-
settled = resolvedPromiseLike$
|
|
45874
|
+
settled = resolvedPromiseLike$5(value);
|
|
45866
45875
|
}
|
|
45867
45876
|
if (settled !== void 0) {
|
|
45868
45877
|
return settled;
|
|
@@ -46011,7 +46020,7 @@
|
|
|
46011
46020
|
);
|
|
46012
46021
|
}
|
|
46013
46022
|
function setServices(services) {
|
|
46014
|
-
waitForServices = resolvedPromiseLike$
|
|
46023
|
+
waitForServices = resolvedPromiseLike$5(services);
|
|
46015
46024
|
servicesAvailable(services);
|
|
46016
46025
|
}
|
|
46017
46026
|
|
|
@@ -61599,7 +61608,7 @@
|
|
|
61599
61608
|
// Deep merge that works on GraphQL data. It:
|
|
61600
61609
|
// - recursively merges any Object properties that are present in both
|
|
61601
61610
|
// - recursively merges arrays by deepMerging each Object item in the array (by index).
|
|
61602
|
-
function deepMerge$
|
|
61611
|
+
function deepMerge$3(target, ...sources) {
|
|
61603
61612
|
for (const source of sources) {
|
|
61604
61613
|
for (const key in source) {
|
|
61605
61614
|
if (ObjectPrototypeHasOwnProperty$2.call(source, key)) {
|
|
@@ -61620,7 +61629,7 @@
|
|
|
61620
61629
|
!Array.isArray(targetItem) &&
|
|
61621
61630
|
sourceItem instanceof Object &&
|
|
61622
61631
|
!Array.isArray(sourceItem)) {
|
|
61623
|
-
return deepMerge$
|
|
61632
|
+
return deepMerge$3({}, targetItem, sourceItem);
|
|
61624
61633
|
}
|
|
61625
61634
|
else {
|
|
61626
61635
|
return sourceItem;
|
|
@@ -61631,7 +61640,7 @@
|
|
|
61631
61640
|
!Array.isArray(targetValue) &&
|
|
61632
61641
|
sourceValue instanceof Object &&
|
|
61633
61642
|
!Array.isArray(sourceValue)) {
|
|
61634
|
-
deepMerge$
|
|
61643
|
+
deepMerge$3(targetValue, sourceValue);
|
|
61635
61644
|
}
|
|
61636
61645
|
else {
|
|
61637
61646
|
target[key] = sourceValue;
|
|
@@ -79249,7 +79258,7 @@
|
|
|
79249
79258
|
field.selectionSet?.selections.forEach((sel) => {
|
|
79250
79259
|
const builtSelection = buildSelectionForNodeFn(source, reader, field, sel, variables, fragments, parentRecordId);
|
|
79251
79260
|
if (builtSelection !== undefined) {
|
|
79252
|
-
deepMerge$
|
|
79261
|
+
deepMerge$3(sink, builtSelection);
|
|
79253
79262
|
}
|
|
79254
79263
|
});
|
|
79255
79264
|
return sink;
|
|
@@ -81995,6 +82004,7 @@
|
|
|
81995
82004
|
possibleStaleRecordMap: new Map(),
|
|
81996
82005
|
draftFunctions,
|
|
81997
82006
|
mappedCursors,
|
|
82007
|
+
missingFieldsMap: new Map(),
|
|
81998
82008
|
};
|
|
81999
82009
|
}
|
|
82000
82010
|
|
|
@@ -85596,8 +85606,17 @@
|
|
|
85596
85606
|
field.resolve = connectionResolver;
|
|
85597
85607
|
}
|
|
85598
85608
|
else {
|
|
85599
|
-
field.resolve = function recordFieldResolver({ recordRepresentation: record, }) {
|
|
85600
|
-
|
|
85609
|
+
field.resolve = function recordFieldResolver({ recordRepresentation: record }, _args, { missingFieldsMap }) {
|
|
85610
|
+
const { id, fields } = record;
|
|
85611
|
+
const recordField = fields[field.name];
|
|
85612
|
+
// If the field is not present, add it to the missing fields map
|
|
85613
|
+
if (!recordField) {
|
|
85614
|
+
let missingFieldsSet = missingFieldsMap.get(id) ?? new Set();
|
|
85615
|
+
missingFieldsSet.add(field.name);
|
|
85616
|
+
missingFieldsMap.set(id, missingFieldsSet);
|
|
85617
|
+
return null;
|
|
85618
|
+
}
|
|
85619
|
+
return recordField;
|
|
85601
85620
|
};
|
|
85602
85621
|
}
|
|
85603
85622
|
}
|
|
@@ -86188,6 +86207,7 @@
|
|
|
86188
86207
|
result,
|
|
86189
86208
|
seenRecordIds,
|
|
86190
86209
|
possibleStaleRecordMap: contextValue.possibleStaleRecordMap,
|
|
86210
|
+
missingFieldsMap: contextValue.missingFieldsMap,
|
|
86191
86211
|
};
|
|
86192
86212
|
}
|
|
86193
86213
|
finally {
|
|
@@ -88354,11 +88374,13 @@
|
|
|
88354
88374
|
let gqlResult;
|
|
88355
88375
|
let seenRecordIds;
|
|
88356
88376
|
let possibleStaleRecordMap;
|
|
88377
|
+
let missingFieldsMap;
|
|
88357
88378
|
try {
|
|
88358
88379
|
({
|
|
88359
88380
|
result: gqlResult,
|
|
88360
88381
|
seenRecordIds,
|
|
88361
88382
|
possibleStaleRecordMap,
|
|
88383
|
+
missingFieldsMap,
|
|
88362
88384
|
} = await evaluate({
|
|
88363
88385
|
...config,
|
|
88364
88386
|
//need to create another copy of the ast for future writes
|
|
@@ -88388,13 +88410,23 @@
|
|
|
88388
88410
|
const seenRecords = createSeenRecords(seenRecordIds, nonEvaluatedSnapshot);
|
|
88389
88411
|
const recordId = generateUniqueRecordId();
|
|
88390
88412
|
const rebuildWithLocalEval = async (originalSnapshot) => {
|
|
88391
|
-
let { result: rebuildResult, seenRecordIds, possibleStaleRecordMap, } = await evaluate({
|
|
88413
|
+
let { result: rebuildResult, seenRecordIds, possibleStaleRecordMap, missingFieldsMap: rebuildMissingFieldsMap, } = await evaluate({
|
|
88392
88414
|
...config,
|
|
88393
88415
|
query: injectedAST,
|
|
88394
88416
|
}, observers, { userId }, objectInfoNeeded, store, originalSnapshot, graphqlSchemaCache, draftFunctions, mappedCursors);
|
|
88395
88417
|
if (!rebuildResult.errors) {
|
|
88396
88418
|
rebuildResult = removeSyntheticFields(rebuildResult, config.query);
|
|
88397
88419
|
}
|
|
88420
|
+
// If the query includes any missing fields, we return an ErrorSnapshot
|
|
88421
|
+
// with a message that contains the missing fields for each record.
|
|
88422
|
+
if (graphqlPartialEmitParity.isOpen({ fallback: false }) &&
|
|
88423
|
+
rebuildMissingFieldsMap.size > 0) {
|
|
88424
|
+
const missingFieldsErrorSnapshot = createMissingFieldsErrorSnapshot(originalSnapshot, rebuildMissingFieldsMap);
|
|
88425
|
+
return {
|
|
88426
|
+
...missingFieldsErrorSnapshot,
|
|
88427
|
+
rebuildWithLocalEval,
|
|
88428
|
+
};
|
|
88429
|
+
}
|
|
88398
88430
|
let snapshotState = 'Fulfilled';
|
|
88399
88431
|
if (possibleStaleRecordMap.size > 0) {
|
|
88400
88432
|
initiateStaleRecordRefresh(luvio, possibleStaleRecordMap);
|
|
@@ -88429,6 +88461,10 @@
|
|
|
88429
88461
|
},
|
|
88430
88462
|
};
|
|
88431
88463
|
}
|
|
88464
|
+
// If the query includes any missing fields, we return an ErrorSnapshot
|
|
88465
|
+
if (graphqlPartialEmitParity.isOpen({ fallback: false }) && missingFieldsMap.size > 0) {
|
|
88466
|
+
return createMissingFieldsErrorSnapshot(nonEvaluatedSnapshot, missingFieldsMap);
|
|
88467
|
+
}
|
|
88432
88468
|
// if the non-eval'ed snapshot was an error then we return a synthetic
|
|
88433
88469
|
// Fulfilled snapshot (this only happens in this code path if
|
|
88434
88470
|
// the error is network error or 504), otherwise we spread over
|
|
@@ -88485,6 +88521,30 @@
|
|
|
88485
88521
|
records,
|
|
88486
88522
|
};
|
|
88487
88523
|
}
|
|
88524
|
+
/**
|
|
88525
|
+
* Creates an ErrorSnapshot with a message that contains the missing fields for each record.
|
|
88526
|
+
* @param originalSnapshot The original snapshot that is being rebuilt.
|
|
88527
|
+
* @param missingFieldsMap A map of record ids to the fields that are missing.
|
|
88528
|
+
* @returns An ErrorSnapshot with a message that contains the missing fields for each record.
|
|
88529
|
+
*/
|
|
88530
|
+
function createMissingFieldsErrorSnapshot(originalSnapshot, missingFieldsMap) {
|
|
88531
|
+
const message = Array.from(missingFieldsMap)
|
|
88532
|
+
.map(([id, fields]) => `Missing fields for record ${id}: ${Array.from(fields).join(', ')}`)
|
|
88533
|
+
.join('; ');
|
|
88534
|
+
return {
|
|
88535
|
+
...originalSnapshot,
|
|
88536
|
+
data: undefined,
|
|
88537
|
+
state: 'Error',
|
|
88538
|
+
error: {
|
|
88539
|
+
errorType: 'adapterError',
|
|
88540
|
+
error: [
|
|
88541
|
+
{
|
|
88542
|
+
message,
|
|
88543
|
+
},
|
|
88544
|
+
],
|
|
88545
|
+
},
|
|
88546
|
+
};
|
|
88547
|
+
}
|
|
88488
88548
|
|
|
88489
88549
|
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio, isDraftId, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy) {
|
|
88490
88550
|
return async function environmentAwareGraphQLBatchAdapter(config, requestContext = {}) {
|
|
@@ -93884,13 +93944,13 @@
|
|
|
93884
93944
|
}
|
|
93885
93945
|
return new Error(typeof x === "string" ? x : JSON.stringify(x));
|
|
93886
93946
|
}
|
|
93887
|
-
class InternalError extends Error {
|
|
93947
|
+
let InternalError$1 = class InternalError extends Error {
|
|
93888
93948
|
constructor(data) {
|
|
93889
93949
|
super();
|
|
93890
93950
|
this.data = data;
|
|
93891
93951
|
this.type = "internal";
|
|
93892
93952
|
}
|
|
93893
|
-
}
|
|
93953
|
+
};
|
|
93894
93954
|
class UserVisibleError extends Error {
|
|
93895
93955
|
constructor(data) {
|
|
93896
93956
|
super();
|
|
@@ -93962,7 +94022,7 @@
|
|
|
93962
94022
|
async afterRequestHooks(_options) {
|
|
93963
94023
|
}
|
|
93964
94024
|
};
|
|
93965
|
-
function buildServiceDescriptor$
|
|
94025
|
+
function buildServiceDescriptor$h() {
|
|
93966
94026
|
return {
|
|
93967
94027
|
type: "networkCommandBaseClass",
|
|
93968
94028
|
version: "1.0",
|
|
@@ -94064,7 +94124,7 @@
|
|
|
94064
94124
|
return resolvedPromiseLike$3(err$1$1(toError("Aura/Fetch network services not found")));
|
|
94065
94125
|
}
|
|
94066
94126
|
}
|
|
94067
|
-
function buildServiceDescriptor$
|
|
94127
|
+
function buildServiceDescriptor$g() {
|
|
94068
94128
|
return {
|
|
94069
94129
|
type: "auraNetworkCommandBaseClass",
|
|
94070
94130
|
version: "1.0",
|
|
@@ -94564,7 +94624,7 @@
|
|
|
94564
94624
|
return resolvedPromiseLike$3(void 0);
|
|
94565
94625
|
}
|
|
94566
94626
|
}
|
|
94567
|
-
function buildServiceDescriptor$
|
|
94627
|
+
function buildServiceDescriptor$f() {
|
|
94568
94628
|
return {
|
|
94569
94629
|
type: "auraNormalizedCacheControlCommand",
|
|
94570
94630
|
version: "1.0",
|
|
@@ -94710,7 +94770,7 @@
|
|
|
94710
94770
|
return `{"endpoint":${this.endpoint},"params":${stableJSONStringify$2(this.auraParams)}}`;
|
|
94711
94771
|
}
|
|
94712
94772
|
}
|
|
94713
|
-
function buildServiceDescriptor$
|
|
94773
|
+
function buildServiceDescriptor$e() {
|
|
94714
94774
|
return {
|
|
94715
94775
|
type: "auraResourceCacheControlCommand",
|
|
94716
94776
|
version: "1.0",
|
|
@@ -94817,7 +94877,7 @@
|
|
|
94817
94877
|
);
|
|
94818
94878
|
}
|
|
94819
94879
|
}
|
|
94820
|
-
function buildServiceDescriptor$
|
|
94880
|
+
function buildServiceDescriptor$d() {
|
|
94821
94881
|
return {
|
|
94822
94882
|
type: "fetchNetworkCommandBaseClass",
|
|
94823
94883
|
version: "1.0",
|
|
@@ -94906,7 +94966,7 @@
|
|
|
94906
94966
|
return resolvedPromiseLike$3(void 0);
|
|
94907
94967
|
}
|
|
94908
94968
|
}
|
|
94909
|
-
function buildServiceDescriptor$
|
|
94969
|
+
function buildServiceDescriptor$c() {
|
|
94910
94970
|
return {
|
|
94911
94971
|
type: "httpNormalizedCacheControlCommand",
|
|
94912
94972
|
version: "1.0",
|
|
@@ -95159,7 +95219,7 @@
|
|
|
95159
95219
|
return new FixedTimeWritableCache$1(this, generatedTime);
|
|
95160
95220
|
}
|
|
95161
95221
|
};
|
|
95162
|
-
function buildServiceDescriptor$
|
|
95222
|
+
function buildServiceDescriptor$b() {
|
|
95163
95223
|
return {
|
|
95164
95224
|
type: "cache",
|
|
95165
95225
|
version: "1.0",
|
|
@@ -95327,7 +95387,7 @@
|
|
|
95327
95387
|
yield* this.services.cacheInclusionPolicy.findAndModify(query, cacheUpdate);
|
|
95328
95388
|
}
|
|
95329
95389
|
}
|
|
95330
|
-
function buildServiceDescriptor$
|
|
95390
|
+
function buildServiceDescriptor$a(cache, cacheInclusionPolicy) {
|
|
95331
95391
|
return {
|
|
95332
95392
|
type: "cacheController",
|
|
95333
95393
|
version: "1.0",
|
|
@@ -95373,7 +95433,7 @@
|
|
|
95373
95433
|
};
|
|
95374
95434
|
};
|
|
95375
95435
|
}
|
|
95376
|
-
function buildServiceDescriptor$
|
|
95436
|
+
function buildServiceDescriptor$9(instrumentation) {
|
|
95377
95437
|
return {
|
|
95378
95438
|
type: "instrumentCommand",
|
|
95379
95439
|
version: "1.0",
|
|
@@ -95643,7 +95703,7 @@
|
|
|
95643
95703
|
this.metrics = new O11yOTelMetricsAPI(this.services);
|
|
95644
95704
|
}
|
|
95645
95705
|
}
|
|
95646
|
-
function buildServiceDescriptor$
|
|
95706
|
+
function buildServiceDescriptor$8(logger) {
|
|
95647
95707
|
return {
|
|
95648
95708
|
type: "instrumentation",
|
|
95649
95709
|
version: "1.0",
|
|
@@ -95753,7 +95813,7 @@
|
|
|
95753
95813
|
return matchingSubscriptions;
|
|
95754
95814
|
}
|
|
95755
95815
|
}
|
|
95756
|
-
function buildServiceDescriptor$
|
|
95816
|
+
function buildServiceDescriptor$7() {
|
|
95757
95817
|
return {
|
|
95758
95818
|
type: "pubSub",
|
|
95759
95819
|
version: "1.0",
|
|
@@ -95777,7 +95837,7 @@
|
|
|
95777
95837
|
return this.flags.get(flagName) || defaultValue;
|
|
95778
95838
|
}
|
|
95779
95839
|
}
|
|
95780
|
-
function buildServiceDescriptor$
|
|
95840
|
+
function buildServiceDescriptor$6() {
|
|
95781
95841
|
return {
|
|
95782
95842
|
version: "1.0",
|
|
95783
95843
|
service: new FeatureFlagsService(),
|
|
@@ -95818,7 +95878,7 @@
|
|
|
95818
95878
|
* };
|
|
95819
95879
|
* ```
|
|
95820
95880
|
*/
|
|
95821
|
-
function buildServiceDescriptor$
|
|
95881
|
+
function buildServiceDescriptor$5(luvio) {
|
|
95822
95882
|
return {
|
|
95823
95883
|
type: 'luvio',
|
|
95824
95884
|
version: '1.0',
|
|
@@ -95827,7 +95887,33 @@
|
|
|
95827
95887
|
},
|
|
95828
95888
|
};
|
|
95829
95889
|
}
|
|
95830
|
-
// version: 1.
|
|
95890
|
+
// version: 1.378.0-63d7c07562
|
|
95891
|
+
|
|
95892
|
+
/**
|
|
95893
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
95894
|
+
* All rights reserved.
|
|
95895
|
+
* For full license text, see the LICENSE.txt file
|
|
95896
|
+
*/
|
|
95897
|
+
|
|
95898
|
+
/*
|
|
95899
|
+
* ATTENTION!
|
|
95900
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
95901
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
95902
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
95903
|
+
* *******************************************************************************************
|
|
95904
|
+
*/
|
|
95905
|
+
/* proxy-compat-disable */
|
|
95906
|
+
function buildServiceDescriptor$4(notifyRecordUpdateAvailable, getNormalizedLuvioRecord) {
|
|
95907
|
+
return {
|
|
95908
|
+
type: 'luvioUiapiRecords',
|
|
95909
|
+
version: '1.0',
|
|
95910
|
+
service: {
|
|
95911
|
+
notifyRecordUpdateAvailable,
|
|
95912
|
+
getNormalizedLuvioRecord,
|
|
95913
|
+
},
|
|
95914
|
+
};
|
|
95915
|
+
}
|
|
95916
|
+
// version: 1.378.0-63d7c07562
|
|
95831
95917
|
|
|
95832
95918
|
/*!
|
|
95833
95919
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96694,7 +96780,7 @@
|
|
|
96694
96780
|
}
|
|
96695
96781
|
return err$1$1(new Error("Multiple operations found in query, and no operation name provided"));
|
|
96696
96782
|
}
|
|
96697
|
-
function buildGraphQLInputExtension(input) {
|
|
96783
|
+
function buildGraphQLInputExtension$1(input) {
|
|
96698
96784
|
const operationResult = findExecutableOperation$1(input);
|
|
96699
96785
|
if (operationResult.isErr()) {
|
|
96700
96786
|
return err$1$1(operationResult.error);
|
|
@@ -96737,7 +96823,7 @@
|
|
|
96737
96823
|
return this.documentRootType;
|
|
96738
96824
|
}
|
|
96739
96825
|
buildQuery() {
|
|
96740
|
-
const extensionResult = buildGraphQLInputExtension(this.config);
|
|
96826
|
+
const extensionResult = buildGraphQLInputExtension$1(this.config);
|
|
96741
96827
|
if (extensionResult.isErr()) {
|
|
96742
96828
|
throw extensionResult.error;
|
|
96743
96829
|
}
|
|
@@ -96846,12 +96932,12 @@
|
|
|
96846
96932
|
return augmentedQueryResult.value;
|
|
96847
96933
|
}
|
|
96848
96934
|
buildWriteInput(data) {
|
|
96849
|
-
const extensionResult = buildGraphQLInputExtension({
|
|
96935
|
+
const extensionResult = buildGraphQLInputExtension$1({
|
|
96850
96936
|
...this.config,
|
|
96851
96937
|
query: this.buildRequestQuery()
|
|
96852
96938
|
});
|
|
96853
96939
|
if (extensionResult.isErr()) {
|
|
96854
|
-
throw new InternalError(extensionResult.error);
|
|
96940
|
+
throw new InternalError$1(extensionResult.error);
|
|
96855
96941
|
}
|
|
96856
96942
|
return { data: data.data, ...extensionResult.value };
|
|
96857
96943
|
}
|
|
@@ -96896,7 +96982,7 @@
|
|
|
96896
96982
|
return this.documentRootType;
|
|
96897
96983
|
}
|
|
96898
96984
|
buildQuery() {
|
|
96899
|
-
const extensionResult = buildGraphQLInputExtension(this.config);
|
|
96985
|
+
const extensionResult = buildGraphQLInputExtension$1(this.config);
|
|
96900
96986
|
if (extensionResult.isErr()) {
|
|
96901
96987
|
throw extensionResult.error;
|
|
96902
96988
|
}
|
|
@@ -96940,12 +97026,12 @@
|
|
|
96940
97026
|
return augmentedQueryResult.value;
|
|
96941
97027
|
}
|
|
96942
97028
|
buildWriteInput(data) {
|
|
96943
|
-
const extensionResult = buildGraphQLInputExtension({
|
|
97029
|
+
const extensionResult = buildGraphQLInputExtension$1({
|
|
96944
97030
|
...this.config,
|
|
96945
97031
|
query: this.buildRequestQuery()
|
|
96946
97032
|
});
|
|
96947
97033
|
if (extensionResult.isErr()) {
|
|
96948
|
-
throw new InternalError(extensionResult.error);
|
|
97034
|
+
throw new InternalError$1(extensionResult.error);
|
|
96949
97035
|
}
|
|
96950
97036
|
return { data: data.data, ...extensionResult.value };
|
|
96951
97037
|
}
|
|
@@ -97188,41 +97274,41 @@
|
|
|
97188
97274
|
}
|
|
97189
97275
|
return differenceSet;
|
|
97190
97276
|
}
|
|
97191
|
-
function resolvedPromiseLike(result) {
|
|
97192
|
-
if (isPromiseLike(result)) {
|
|
97277
|
+
function resolvedPromiseLike$4(result) {
|
|
97278
|
+
if (isPromiseLike$4(result)) {
|
|
97193
97279
|
return result.then((nextResult) => nextResult);
|
|
97194
97280
|
}
|
|
97195
97281
|
return {
|
|
97196
97282
|
then: (onFulfilled, _onRejected) => {
|
|
97197
97283
|
try {
|
|
97198
|
-
return resolvedPromiseLike(onFulfilled(result));
|
|
97284
|
+
return resolvedPromiseLike$4(onFulfilled(result));
|
|
97199
97285
|
} catch (e) {
|
|
97200
97286
|
if (onFulfilled === void 0) {
|
|
97201
|
-
return resolvedPromiseLike(result);
|
|
97287
|
+
return resolvedPromiseLike$4(result);
|
|
97202
97288
|
}
|
|
97203
|
-
return rejectedPromiseLike(e);
|
|
97289
|
+
return rejectedPromiseLike$4(e);
|
|
97204
97290
|
}
|
|
97205
97291
|
}
|
|
97206
97292
|
};
|
|
97207
97293
|
}
|
|
97208
|
-
function rejectedPromiseLike(reason) {
|
|
97209
|
-
if (isPromiseLike(reason)) {
|
|
97294
|
+
function rejectedPromiseLike$4(reason) {
|
|
97295
|
+
if (isPromiseLike$4(reason)) {
|
|
97210
97296
|
return reason.then((nextResult) => nextResult);
|
|
97211
97297
|
}
|
|
97212
97298
|
return {
|
|
97213
97299
|
then: (_onFulfilled, onRejected) => {
|
|
97214
97300
|
if (typeof onRejected === "function") {
|
|
97215
97301
|
try {
|
|
97216
|
-
return resolvedPromiseLike(onRejected(reason));
|
|
97302
|
+
return resolvedPromiseLike$4(onRejected(reason));
|
|
97217
97303
|
} catch (e) {
|
|
97218
|
-
return rejectedPromiseLike(e);
|
|
97304
|
+
return rejectedPromiseLike$4(e);
|
|
97219
97305
|
}
|
|
97220
97306
|
}
|
|
97221
|
-
return rejectedPromiseLike(reason);
|
|
97307
|
+
return rejectedPromiseLike$4(reason);
|
|
97222
97308
|
}
|
|
97223
97309
|
};
|
|
97224
97310
|
}
|
|
97225
|
-
function isPromiseLike(x) {
|
|
97311
|
+
function isPromiseLike$4(x) {
|
|
97226
97312
|
return typeof (x == null ? void 0 : x.then) === "function";
|
|
97227
97313
|
}
|
|
97228
97314
|
/*!
|
|
@@ -97511,7 +97597,7 @@
|
|
|
97511
97597
|
tempL1.keysUpdated.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
97512
97598
|
tempL1.missingKeysRead.forEach((key) => keysToReviveRecordableCache.get(key));
|
|
97513
97599
|
const missingKeys = keysToReviveRecordableCache.missingKeysRead;
|
|
97514
|
-
const revivePromiseLike = missingKeys.size > 0 ? this.revive(missingKeys, l1).then(() => void 0) : resolvedPromiseLike(void 0);
|
|
97600
|
+
const revivePromiseLike = missingKeys.size > 0 ? this.revive(missingKeys, l1).then(() => void 0) : resolvedPromiseLike$4(void 0);
|
|
97515
97601
|
return revivePromiseLike.then(() => {
|
|
97516
97602
|
const recordableCache = l1.record();
|
|
97517
97603
|
return writeToL1(recordableCache).then((result) => {
|
|
@@ -97704,10 +97790,10 @@
|
|
|
97704
97790
|
globalThis.performance = { now: () => Date.now() };
|
|
97705
97791
|
}
|
|
97706
97792
|
const loggerService = new ConsoleLogger('ERROR');
|
|
97707
|
-
const cacheServiceDescriptor = buildServiceDescriptor$
|
|
97708
|
-
const instrumentationServiceDescriptor = buildServiceDescriptor$
|
|
97793
|
+
const cacheServiceDescriptor = buildServiceDescriptor$b();
|
|
97794
|
+
const instrumentationServiceDescriptor = buildServiceDescriptor$8(loggerService);
|
|
97709
97795
|
const nimbusSqliteOneStoreCacheServiceDescriptor = buildNimbusDurableCacheInclusionPolicyService(cacheServiceDescriptor.service, new NimbusSqliteOneStoreCache(sqliteStore));
|
|
97710
|
-
const featureFlagsServiceDescriptor = buildServiceDescriptor$
|
|
97796
|
+
const featureFlagsServiceDescriptor = buildServiceDescriptor$6();
|
|
97711
97797
|
const featureFlagsService = featureFlagsServiceDescriptor.service;
|
|
97712
97798
|
// This disables the OneStore GraphQL in this runtime
|
|
97713
97799
|
// We made the decision to continue using the Luvio based version in Mobile
|
|
@@ -97717,21 +97803,22 @@
|
|
|
97717
97803
|
const services = [
|
|
97718
97804
|
instrumentationServiceDescriptor,
|
|
97719
97805
|
buildNimbusFetchServiceDescriptor(),
|
|
97720
|
-
buildServiceDescriptor$
|
|
97806
|
+
buildServiceDescriptor$9(instrumentationServiceDescriptor.service),
|
|
97721
97807
|
// NOTE: These do not directly depend on Aura, and are necessary for HTTP fallback support.
|
|
97808
|
+
buildServiceDescriptor$g(),
|
|
97722
97809
|
buildServiceDescriptor$f(),
|
|
97723
97810
|
buildServiceDescriptor$e(),
|
|
97811
|
+
buildServiceDescriptor$a(cacheServiceDescriptor.service, nimbusSqliteOneStoreCacheServiceDescriptor.service),
|
|
97724
97812
|
buildServiceDescriptor$d(),
|
|
97725
|
-
buildServiceDescriptor$
|
|
97813
|
+
buildServiceDescriptor$h(),
|
|
97726
97814
|
buildServiceDescriptor$c(),
|
|
97727
|
-
buildServiceDescriptor$
|
|
97728
|
-
buildServiceDescriptor$b(),
|
|
97729
|
-
buildServiceDescriptor$6(),
|
|
97815
|
+
buildServiceDescriptor$7(),
|
|
97730
97816
|
buildServiceDescriptor$3(),
|
|
97731
97817
|
buildServiceDescriptor$2(),
|
|
97732
97818
|
featureFlagsServiceDescriptor,
|
|
97733
97819
|
// Luvio service won't be used since we set the useOneStoreGraphQL flag to false
|
|
97734
|
-
buildServiceDescriptor$
|
|
97820
|
+
buildServiceDescriptor$5({}),
|
|
97821
|
+
buildServiceDescriptor$4({}, {}),
|
|
97735
97822
|
// TODO[@W-18753648]: See note above.
|
|
97736
97823
|
// buildStreamingCommandServiceDescriptor(),
|
|
97737
97824
|
// buildNdJsonServiceDescriptor(),
|
|
@@ -97942,7 +98029,7 @@
|
|
|
97942
98029
|
id: '@salesforce/lds-network-adapter',
|
|
97943
98030
|
instrument: instrument$2,
|
|
97944
98031
|
});
|
|
97945
|
-
// version: 1.
|
|
98032
|
+
// version: 1.378.0-0ab3d40d29
|
|
97946
98033
|
|
|
97947
98034
|
const { create: create$3, keys: keys$3 } = Object;
|
|
97948
98035
|
const { stringify: stringify$1, parse } = JSON;
|
|
@@ -98806,11 +98893,7 @@
|
|
|
98806
98893
|
if (variable.definition.defaultValue) {
|
|
98807
98894
|
return extractValue(variable.definition.defaultValue, variableDefinitions);
|
|
98808
98895
|
}
|
|
98809
|
-
return
|
|
98810
|
-
new Error(
|
|
98811
|
-
`Variable '${variableName}' was defined but no value was provided and no default value exists`
|
|
98812
|
-
)
|
|
98813
|
-
);
|
|
98896
|
+
return ok$4(void 0);
|
|
98814
98897
|
}
|
|
98815
98898
|
function validateExpectedType(value, expectedType) {
|
|
98816
98899
|
if (!expectedType) {
|
|
@@ -98832,7 +98915,7 @@
|
|
|
98832
98915
|
new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
|
|
98833
98916
|
);
|
|
98834
98917
|
}
|
|
98835
|
-
function deepMerge$
|
|
98918
|
+
function deepMerge$2(target, ...sources) {
|
|
98836
98919
|
for (const source of sources) {
|
|
98837
98920
|
for (const key in source) {
|
|
98838
98921
|
if (hasOwnProperty$2.call(source, key)) {
|
|
@@ -98848,13 +98931,13 @@
|
|
|
98848
98931
|
} else if (sourceItem === void 0) {
|
|
98849
98932
|
return targetItem;
|
|
98850
98933
|
} else if (targetItem instanceof Object && !Array.isArray(targetItem) && sourceItem instanceof Object && !Array.isArray(sourceItem)) {
|
|
98851
|
-
return deepMerge$
|
|
98934
|
+
return deepMerge$2({}, targetItem, sourceItem);
|
|
98852
98935
|
} else {
|
|
98853
98936
|
return sourceItem;
|
|
98854
98937
|
}
|
|
98855
98938
|
});
|
|
98856
98939
|
} else if (targetValue instanceof Object && !Array.isArray(targetValue) && sourceValue instanceof Object && !Array.isArray(sourceValue)) {
|
|
98857
|
-
deepMerge$
|
|
98940
|
+
deepMerge$2(
|
|
98858
98941
|
targetValue,
|
|
98859
98942
|
sourceValue
|
|
98860
98943
|
);
|
|
@@ -98888,6 +98971,32 @@
|
|
|
98888
98971
|
}
|
|
98889
98972
|
return err$4(new Error("Multiple operations found in query, and no operation name provided"));
|
|
98890
98973
|
}
|
|
98974
|
+
function buildGraphQLInputExtension(input) {
|
|
98975
|
+
const operationResult = findExecutableOperation(input);
|
|
98976
|
+
if (operationResult.isErr()) {
|
|
98977
|
+
return err$4(operationResult.error);
|
|
98978
|
+
}
|
|
98979
|
+
const operation = operationResult.value;
|
|
98980
|
+
const selections = operation.selectionSet.selections;
|
|
98981
|
+
const variableDefinitions = operation.variableDefinitions;
|
|
98982
|
+
const variables = (variableDefinitions == null ? void 0 : variableDefinitions.reduce((prev, def) => {
|
|
98983
|
+
var _a;
|
|
98984
|
+
prev[def.variable.name.value] = {
|
|
98985
|
+
definition: def,
|
|
98986
|
+
value: (_a = input.variables) == null ? void 0 : _a[def.variable.name.value]
|
|
98987
|
+
};
|
|
98988
|
+
return prev;
|
|
98989
|
+
}, {})) || {};
|
|
98990
|
+
const fragments = input.query.definitions.filter((def) => def.kind === "FragmentDefinition").reduce((prev, fragment) => {
|
|
98991
|
+
prev[fragment.name.value] = fragment;
|
|
98992
|
+
return prev;
|
|
98993
|
+
}, {});
|
|
98994
|
+
return ok$4({
|
|
98995
|
+
selections,
|
|
98996
|
+
request: { definitions: { variables, fragments } },
|
|
98997
|
+
parentFieldSelection: void 0
|
|
98998
|
+
});
|
|
98999
|
+
}
|
|
98891
99000
|
function buildUniqueAugmentedFieldSelection(newSelection, selections, fragments) {
|
|
98892
99001
|
var _a;
|
|
98893
99002
|
const baseAlias = ((_a = newSelection.alias) == null ? void 0 : _a.value) || newSelection.name.value;
|
|
@@ -98994,6 +99103,243 @@
|
|
|
98994
99103
|
}
|
|
98995
99104
|
return ok$4(false);
|
|
98996
99105
|
}
|
|
99106
|
+
class BaseScalarFieldDef {
|
|
99107
|
+
constructor(nullable) {
|
|
99108
|
+
this.nullable = nullable;
|
|
99109
|
+
}
|
|
99110
|
+
write(_cache, input) {
|
|
99111
|
+
if (input.data === void 0) {
|
|
99112
|
+
return ok$4({ type: "missing" });
|
|
99113
|
+
}
|
|
99114
|
+
if (input.data === null) {
|
|
99115
|
+
if (!this.nullable) {
|
|
99116
|
+
return err$4([
|
|
99117
|
+
{
|
|
99118
|
+
type: "unknown",
|
|
99119
|
+
error: new Error(
|
|
99120
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99121
|
+
)
|
|
99122
|
+
}
|
|
99123
|
+
]);
|
|
99124
|
+
}
|
|
99125
|
+
}
|
|
99126
|
+
return ok$4({ type: "data", data: input.data });
|
|
99127
|
+
}
|
|
99128
|
+
read(_cache, input) {
|
|
99129
|
+
const normalizedData = input.normalizedData;
|
|
99130
|
+
if (normalizedData.type === "missing") {
|
|
99131
|
+
return ok$4(void 0);
|
|
99132
|
+
}
|
|
99133
|
+
return ok$4(normalizedData.data);
|
|
99134
|
+
}
|
|
99135
|
+
augmentSelections(input) {
|
|
99136
|
+
return input;
|
|
99137
|
+
}
|
|
99138
|
+
buildFieldKey(selection, variables) {
|
|
99139
|
+
return buildFieldKey(selection.name.value, selection.arguments, variables);
|
|
99140
|
+
}
|
|
99141
|
+
}
|
|
99142
|
+
class BaseArrayFieldDef {
|
|
99143
|
+
constructor(items, nullable) {
|
|
99144
|
+
this.items = items;
|
|
99145
|
+
this.nullable = nullable;
|
|
99146
|
+
}
|
|
99147
|
+
augmentSelections(input) {
|
|
99148
|
+
return this.items.augmentSelections(input);
|
|
99149
|
+
}
|
|
99150
|
+
buildFieldKey(selection, variables) {
|
|
99151
|
+
return this.items.buildFieldKey(selection, variables);
|
|
99152
|
+
}
|
|
99153
|
+
write(cache, input) {
|
|
99154
|
+
if (input.data === void 0) {
|
|
99155
|
+
return ok$4({ type: "missing" });
|
|
99156
|
+
}
|
|
99157
|
+
if (input.data === null) {
|
|
99158
|
+
if (!this.nullable) {
|
|
99159
|
+
return err$4([
|
|
99160
|
+
{
|
|
99161
|
+
type: "unknown",
|
|
99162
|
+
error: new Error(
|
|
99163
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99164
|
+
)
|
|
99165
|
+
}
|
|
99166
|
+
]);
|
|
99167
|
+
}
|
|
99168
|
+
return ok$4({ type: "data", data: input.data });
|
|
99169
|
+
}
|
|
99170
|
+
if (!Array.isArray(input.data)) {
|
|
99171
|
+
return err$4([
|
|
99172
|
+
{
|
|
99173
|
+
type: "unknown",
|
|
99174
|
+
error: new Error(
|
|
99175
|
+
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99176
|
+
)
|
|
99177
|
+
}
|
|
99178
|
+
]);
|
|
99179
|
+
}
|
|
99180
|
+
const arrayNormalizationErrors = [];
|
|
99181
|
+
const normalizedArray = [];
|
|
99182
|
+
input.data.forEach((item, index) => {
|
|
99183
|
+
var _a;
|
|
99184
|
+
const existingItemData = (_a = input.existingNormalizedData) == null ? void 0 : _a[index];
|
|
99185
|
+
const normalizedItemResult = this.items.write(cache, {
|
|
99186
|
+
...input,
|
|
99187
|
+
data: item,
|
|
99188
|
+
existingNormalizedData: existingItemData,
|
|
99189
|
+
request: input.request,
|
|
99190
|
+
selection: input.selection
|
|
99191
|
+
});
|
|
99192
|
+
if (normalizedItemResult.isOk()) {
|
|
99193
|
+
normalizedArray.push(normalizedItemResult.value);
|
|
99194
|
+
} else {
|
|
99195
|
+
arrayNormalizationErrors.push(...normalizedItemResult.error);
|
|
99196
|
+
}
|
|
99197
|
+
});
|
|
99198
|
+
if (arrayNormalizationErrors.length > 0) {
|
|
99199
|
+
return err$4(arrayNormalizationErrors);
|
|
99200
|
+
}
|
|
99201
|
+
return ok$4({ type: "data", data: normalizedArray });
|
|
99202
|
+
}
|
|
99203
|
+
read(cache, input) {
|
|
99204
|
+
const normalizedData = input.normalizedData;
|
|
99205
|
+
if (normalizedData.type === "missing") {
|
|
99206
|
+
return ok$4(void 0);
|
|
99207
|
+
}
|
|
99208
|
+
if (normalizedData.data === null) {
|
|
99209
|
+
if (!this.nullable) {
|
|
99210
|
+
return err$4([
|
|
99211
|
+
{
|
|
99212
|
+
type: "unknown",
|
|
99213
|
+
error: new Error(
|
|
99214
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99215
|
+
)
|
|
99216
|
+
}
|
|
99217
|
+
]);
|
|
99218
|
+
}
|
|
99219
|
+
return ok$4({ type: "data", data: null });
|
|
99220
|
+
}
|
|
99221
|
+
if (!Array.isArray(normalizedData.data)) {
|
|
99222
|
+
return err$4([
|
|
99223
|
+
{
|
|
99224
|
+
type: "unknown",
|
|
99225
|
+
error: new Error(
|
|
99226
|
+
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99227
|
+
)
|
|
99228
|
+
}
|
|
99229
|
+
]);
|
|
99230
|
+
}
|
|
99231
|
+
const arrayDenormalizationErrors = [];
|
|
99232
|
+
const denormalizedArray = [];
|
|
99233
|
+
normalizedData.data.forEach((item) => {
|
|
99234
|
+
const denormalizedItemResult = this.items.read(cache, {
|
|
99235
|
+
...input,
|
|
99236
|
+
normalizedData: item,
|
|
99237
|
+
request: input.request,
|
|
99238
|
+
selection: input.selection
|
|
99239
|
+
});
|
|
99240
|
+
if (denormalizedItemResult.isOk()) {
|
|
99241
|
+
denormalizedArray.push(denormalizedItemResult.value);
|
|
99242
|
+
} else {
|
|
99243
|
+
arrayDenormalizationErrors.push(...denormalizedItemResult.error);
|
|
99244
|
+
}
|
|
99245
|
+
});
|
|
99246
|
+
if (arrayDenormalizationErrors.length > 0) {
|
|
99247
|
+
return err$4(arrayDenormalizationErrors);
|
|
99248
|
+
}
|
|
99249
|
+
return ok$4(denormalizedArray);
|
|
99250
|
+
}
|
|
99251
|
+
}
|
|
99252
|
+
class BaseObjectFieldDef {
|
|
99253
|
+
constructor(repository, nullable) {
|
|
99254
|
+
this.repository = repository;
|
|
99255
|
+
this.nullable = nullable;
|
|
99256
|
+
}
|
|
99257
|
+
augmentSelections(input) {
|
|
99258
|
+
return this.repository.augmentSelections(input);
|
|
99259
|
+
}
|
|
99260
|
+
buildFieldKey(selection, variables) {
|
|
99261
|
+
return this.repository.buildFieldKey(selection, variables);
|
|
99262
|
+
}
|
|
99263
|
+
write(cache, input) {
|
|
99264
|
+
var _a;
|
|
99265
|
+
if (!input.selection.selectionSet) {
|
|
99266
|
+
return err$4([
|
|
99267
|
+
{
|
|
99268
|
+
type: "unknown",
|
|
99269
|
+
error: new Error(
|
|
99270
|
+
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99271
|
+
)
|
|
99272
|
+
}
|
|
99273
|
+
]);
|
|
99274
|
+
}
|
|
99275
|
+
if (input.data === void 0) {
|
|
99276
|
+
return ok$4({ type: "missing" });
|
|
99277
|
+
}
|
|
99278
|
+
if (input.data === null) {
|
|
99279
|
+
if (!this.nullable) {
|
|
99280
|
+
return err$4([
|
|
99281
|
+
{
|
|
99282
|
+
type: "unknown",
|
|
99283
|
+
error: new Error(
|
|
99284
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99285
|
+
)
|
|
99286
|
+
}
|
|
99287
|
+
]);
|
|
99288
|
+
}
|
|
99289
|
+
return ok$4({ type: "data", data: null });
|
|
99290
|
+
}
|
|
99291
|
+
const writeResult = this.repository.write(cache, {
|
|
99292
|
+
...input,
|
|
99293
|
+
data: input.data,
|
|
99294
|
+
existingNormalizedData: (_a = input.existingNormalizedData) == null ? void 0 : _a.data,
|
|
99295
|
+
request: input.request,
|
|
99296
|
+
selections: input.selection.selectionSet.selections,
|
|
99297
|
+
parentFieldSelection: input.selection
|
|
99298
|
+
});
|
|
99299
|
+
if (writeResult.isErr()) {
|
|
99300
|
+
return writeResult;
|
|
99301
|
+
}
|
|
99302
|
+
return ok$4({ type: "data", data: writeResult.value });
|
|
99303
|
+
}
|
|
99304
|
+
read(cache, input) {
|
|
99305
|
+
var _a;
|
|
99306
|
+
if (!input.selection.selectionSet) {
|
|
99307
|
+
return err$4([
|
|
99308
|
+
{
|
|
99309
|
+
type: "unknown",
|
|
99310
|
+
error: new Error(
|
|
99311
|
+
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99312
|
+
)
|
|
99313
|
+
}
|
|
99314
|
+
]);
|
|
99315
|
+
}
|
|
99316
|
+
const normalizedData = input.normalizedData;
|
|
99317
|
+
if (normalizedData.type === "missing") {
|
|
99318
|
+
return ok$4(void 0);
|
|
99319
|
+
}
|
|
99320
|
+
if (normalizedData.data === null) {
|
|
99321
|
+
if (!this.nullable) {
|
|
99322
|
+
return err$4([
|
|
99323
|
+
{
|
|
99324
|
+
type: "unknown",
|
|
99325
|
+
error: new Error(
|
|
99326
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99327
|
+
)
|
|
99328
|
+
}
|
|
99329
|
+
]);
|
|
99330
|
+
}
|
|
99331
|
+
return ok$4(null);
|
|
99332
|
+
}
|
|
99333
|
+
return this.repository.read(cache, {
|
|
99334
|
+
...input,
|
|
99335
|
+
normalizedData: normalizedData.data,
|
|
99336
|
+
request: input.request,
|
|
99337
|
+
selections: (_a = input.selection.selectionSet) == null ? void 0 : _a.selections,
|
|
99338
|
+
parentFieldSelection: input.selection
|
|
99339
|
+
});
|
|
99340
|
+
}
|
|
99341
|
+
}
|
|
99342
|
+
const missingFieldDef = new BaseScalarFieldDef(false);
|
|
98997
99343
|
class BaseGraphQLTypeRepository {
|
|
98998
99344
|
equals(x, y) {
|
|
98999
99345
|
return deepEquals$2(x, y);
|
|
@@ -99114,7 +99460,7 @@
|
|
|
99114
99460
|
const errors = [];
|
|
99115
99461
|
for (const selection of input.selections) {
|
|
99116
99462
|
if (selection.kind === Kind.FIELD) {
|
|
99117
|
-
deepMerge$
|
|
99463
|
+
deepMerge$2(
|
|
99118
99464
|
normalized,
|
|
99119
99465
|
this.normalizeFieldSelection(cache, input, selection, errors)
|
|
99120
99466
|
);
|
|
@@ -99135,7 +99481,7 @@
|
|
|
99135
99481
|
]
|
|
99136
99482
|
};
|
|
99137
99483
|
}
|
|
99138
|
-
deepMerge$
|
|
99484
|
+
deepMerge$2(normalized, this.normalizeFragment(cache, input, fragment, errors));
|
|
99139
99485
|
}
|
|
99140
99486
|
}
|
|
99141
99487
|
return buildReadWriteResult(normalized, errors);
|
|
@@ -99229,7 +99575,7 @@
|
|
|
99229
99575
|
const denormalized = {};
|
|
99230
99576
|
for (const selection of input.selections) {
|
|
99231
99577
|
if (selection.kind === Kind.FIELD) {
|
|
99232
|
-
deepMerge$
|
|
99578
|
+
deepMerge$2(
|
|
99233
99579
|
denormalized,
|
|
99234
99580
|
this.denormalizeFieldSelection(cache, input, selection, errors)
|
|
99235
99581
|
);
|
|
@@ -99250,7 +99596,7 @@
|
|
|
99250
99596
|
]
|
|
99251
99597
|
};
|
|
99252
99598
|
}
|
|
99253
|
-
deepMerge$
|
|
99599
|
+
deepMerge$2(denormalized, this.denormalizeFragment(cache, input, fragment, errors));
|
|
99254
99600
|
}
|
|
99255
99601
|
}
|
|
99256
99602
|
return buildReadWriteResult(denormalized, errors);
|
|
@@ -99358,9 +99704,23 @@
|
|
|
99358
99704
|
}
|
|
99359
99705
|
return {};
|
|
99360
99706
|
}
|
|
99361
|
-
getFieldDef(
|
|
99707
|
+
getFieldDef(input, selection) {
|
|
99708
|
+
var _a, _b, _c;
|
|
99362
99709
|
const canonicalFieldName = selection.name.value;
|
|
99363
|
-
|
|
99710
|
+
const fieldDef = this.fields[canonicalFieldName];
|
|
99711
|
+
if (fieldDef) {
|
|
99712
|
+
return fieldDef;
|
|
99713
|
+
}
|
|
99714
|
+
const dataInstanceFieldName = ((_a = selection.alias) == null ? void 0 : _a.value) ?? selection.name.value;
|
|
99715
|
+
if (input === void 0) {
|
|
99716
|
+
return void 0;
|
|
99717
|
+
}
|
|
99718
|
+
if ("data" in input && input.data[dataInstanceFieldName] === void 0) {
|
|
99719
|
+
return missingFieldDef;
|
|
99720
|
+
} else if ("normalizedData" in input && ((_c = (_b = input.normalizedData) == null ? void 0 : _b[dataInstanceFieldName]) == null ? void 0 : _c.type) === "missing") {
|
|
99721
|
+
return missingFieldDef;
|
|
99722
|
+
}
|
|
99723
|
+
return void 0;
|
|
99364
99724
|
}
|
|
99365
99725
|
shouldProcessFragment(fragment, variables) {
|
|
99366
99726
|
const shouldSkipResult = shouldSkip(fragment, variables);
|
|
@@ -99466,7 +99826,7 @@
|
|
|
99466
99826
|
return normalizeDataResult;
|
|
99467
99827
|
}
|
|
99468
99828
|
return ok$4(
|
|
99469
|
-
deepMerge$
|
|
99829
|
+
deepMerge$2(
|
|
99470
99830
|
{},
|
|
99471
99831
|
(existingNormalizedData == null ? void 0 : existingNormalizedData.value) || {},
|
|
99472
99832
|
normalizeDataResult.value
|
|
@@ -99742,245 +100102,6 @@
|
|
|
99742
100102
|
});
|
|
99743
100103
|
return { selections: augmentedSelections, fragments: augmentedFragments };
|
|
99744
100104
|
}
|
|
99745
|
-
class BaseScalarFieldDef {
|
|
99746
|
-
constructor(nullable) {
|
|
99747
|
-
this.nullable = nullable;
|
|
99748
|
-
this.type = "scalar";
|
|
99749
|
-
}
|
|
99750
|
-
write(_cache, input) {
|
|
99751
|
-
if (input.data === void 0) {
|
|
99752
|
-
return ok$4({ type: "missing" });
|
|
99753
|
-
}
|
|
99754
|
-
if (input.data === null) {
|
|
99755
|
-
if (!this.nullable) {
|
|
99756
|
-
return err$4([
|
|
99757
|
-
{
|
|
99758
|
-
type: "unknown",
|
|
99759
|
-
error: new Error(
|
|
99760
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99761
|
-
)
|
|
99762
|
-
}
|
|
99763
|
-
]);
|
|
99764
|
-
}
|
|
99765
|
-
}
|
|
99766
|
-
return ok$4({ type: "data", data: input.data });
|
|
99767
|
-
}
|
|
99768
|
-
read(_cache, input) {
|
|
99769
|
-
const normalizedData = input.normalizedData;
|
|
99770
|
-
if (normalizedData.type === "missing") {
|
|
99771
|
-
return ok$4(void 0);
|
|
99772
|
-
}
|
|
99773
|
-
return ok$4(normalizedData.data);
|
|
99774
|
-
}
|
|
99775
|
-
augmentSelections(input) {
|
|
99776
|
-
return input;
|
|
99777
|
-
}
|
|
99778
|
-
buildFieldKey(selection, variables) {
|
|
99779
|
-
return buildFieldKey(selection.name.value, selection.arguments, variables);
|
|
99780
|
-
}
|
|
99781
|
-
}
|
|
99782
|
-
class BaseArrayFieldDef {
|
|
99783
|
-
constructor(items, nullable) {
|
|
99784
|
-
this.items = items;
|
|
99785
|
-
this.nullable = nullable;
|
|
99786
|
-
this.type = "array";
|
|
99787
|
-
}
|
|
99788
|
-
augmentSelections(input) {
|
|
99789
|
-
return this.items.augmentSelections(input);
|
|
99790
|
-
}
|
|
99791
|
-
buildFieldKey(selection, variables) {
|
|
99792
|
-
return this.items.buildFieldKey(selection, variables);
|
|
99793
|
-
}
|
|
99794
|
-
write(cache, input) {
|
|
99795
|
-
if (input.data === void 0) {
|
|
99796
|
-
return ok$4({ type: "missing" });
|
|
99797
|
-
}
|
|
99798
|
-
if (input.data === null) {
|
|
99799
|
-
if (!this.nullable) {
|
|
99800
|
-
return err$4([
|
|
99801
|
-
{
|
|
99802
|
-
type: "unknown",
|
|
99803
|
-
error: new Error(
|
|
99804
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99805
|
-
)
|
|
99806
|
-
}
|
|
99807
|
-
]);
|
|
99808
|
-
}
|
|
99809
|
-
return ok$4({ type: "data", data: input.data });
|
|
99810
|
-
}
|
|
99811
|
-
if (!Array.isArray(input.data)) {
|
|
99812
|
-
return err$4([
|
|
99813
|
-
{
|
|
99814
|
-
type: "unknown",
|
|
99815
|
-
error: new Error(
|
|
99816
|
-
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99817
|
-
)
|
|
99818
|
-
}
|
|
99819
|
-
]);
|
|
99820
|
-
}
|
|
99821
|
-
const arrayNormalizationErrors = [];
|
|
99822
|
-
const normalizedArray = [];
|
|
99823
|
-
input.data.forEach((item, index) => {
|
|
99824
|
-
var _a;
|
|
99825
|
-
const existingItemData = (_a = input.existingNormalizedData) == null ? void 0 : _a[index];
|
|
99826
|
-
const normalizedItemResult = this.items.write(cache, {
|
|
99827
|
-
...input,
|
|
99828
|
-
data: item,
|
|
99829
|
-
existingNormalizedData: existingItemData,
|
|
99830
|
-
request: input.request,
|
|
99831
|
-
selection: input.selection
|
|
99832
|
-
});
|
|
99833
|
-
if (normalizedItemResult.isOk()) {
|
|
99834
|
-
normalizedArray.push(normalizedItemResult.value);
|
|
99835
|
-
} else {
|
|
99836
|
-
arrayNormalizationErrors.push(...normalizedItemResult.error);
|
|
99837
|
-
}
|
|
99838
|
-
});
|
|
99839
|
-
if (arrayNormalizationErrors.length > 0) {
|
|
99840
|
-
return err$4(arrayNormalizationErrors);
|
|
99841
|
-
}
|
|
99842
|
-
return ok$4({ type: "data", data: normalizedArray });
|
|
99843
|
-
}
|
|
99844
|
-
read(cache, input) {
|
|
99845
|
-
const normalizedData = input.normalizedData;
|
|
99846
|
-
if (normalizedData.type === "missing") {
|
|
99847
|
-
return ok$4(void 0);
|
|
99848
|
-
}
|
|
99849
|
-
if (normalizedData.data === null) {
|
|
99850
|
-
if (!this.nullable) {
|
|
99851
|
-
return err$4([
|
|
99852
|
-
{
|
|
99853
|
-
type: "unknown",
|
|
99854
|
-
error: new Error(
|
|
99855
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99856
|
-
)
|
|
99857
|
-
}
|
|
99858
|
-
]);
|
|
99859
|
-
}
|
|
99860
|
-
return ok$4({ type: "data", data: null });
|
|
99861
|
-
}
|
|
99862
|
-
if (!Array.isArray(normalizedData.data)) {
|
|
99863
|
-
return err$4([
|
|
99864
|
-
{
|
|
99865
|
-
type: "unknown",
|
|
99866
|
-
error: new Error(
|
|
99867
|
-
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99868
|
-
)
|
|
99869
|
-
}
|
|
99870
|
-
]);
|
|
99871
|
-
}
|
|
99872
|
-
const arrayDenormalizationErrors = [];
|
|
99873
|
-
const denormalizedArray = [];
|
|
99874
|
-
normalizedData.data.forEach((item) => {
|
|
99875
|
-
const denormalizedItemResult = this.items.read(cache, {
|
|
99876
|
-
...input,
|
|
99877
|
-
normalizedData: item,
|
|
99878
|
-
request: input.request,
|
|
99879
|
-
selection: input.selection
|
|
99880
|
-
});
|
|
99881
|
-
if (denormalizedItemResult.isOk()) {
|
|
99882
|
-
denormalizedArray.push(denormalizedItemResult.value);
|
|
99883
|
-
} else {
|
|
99884
|
-
arrayDenormalizationErrors.push(...denormalizedItemResult.error);
|
|
99885
|
-
}
|
|
99886
|
-
});
|
|
99887
|
-
if (arrayDenormalizationErrors.length > 0) {
|
|
99888
|
-
return err$4(arrayDenormalizationErrors);
|
|
99889
|
-
}
|
|
99890
|
-
return ok$4(denormalizedArray);
|
|
99891
|
-
}
|
|
99892
|
-
}
|
|
99893
|
-
class BaseObjectFieldDef {
|
|
99894
|
-
constructor(repository, nullable) {
|
|
99895
|
-
this.repository = repository;
|
|
99896
|
-
this.nullable = nullable;
|
|
99897
|
-
this.type = "object";
|
|
99898
|
-
}
|
|
99899
|
-
augmentSelections(input) {
|
|
99900
|
-
return this.repository.augmentSelections(input);
|
|
99901
|
-
}
|
|
99902
|
-
buildFieldKey(selection, variables) {
|
|
99903
|
-
return this.repository.buildFieldKey(selection, variables);
|
|
99904
|
-
}
|
|
99905
|
-
write(cache, input) {
|
|
99906
|
-
var _a;
|
|
99907
|
-
if (!input.selection.selectionSet) {
|
|
99908
|
-
return err$4([
|
|
99909
|
-
{
|
|
99910
|
-
type: "unknown",
|
|
99911
|
-
error: new Error(
|
|
99912
|
-
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99913
|
-
)
|
|
99914
|
-
}
|
|
99915
|
-
]);
|
|
99916
|
-
}
|
|
99917
|
-
if (input.data === void 0) {
|
|
99918
|
-
return ok$4({ type: "missing" });
|
|
99919
|
-
}
|
|
99920
|
-
if (input.data === null) {
|
|
99921
|
-
if (!this.nullable) {
|
|
99922
|
-
return err$4([
|
|
99923
|
-
{
|
|
99924
|
-
type: "unknown",
|
|
99925
|
-
error: new Error(
|
|
99926
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99927
|
-
)
|
|
99928
|
-
}
|
|
99929
|
-
]);
|
|
99930
|
-
}
|
|
99931
|
-
return ok$4({ type: "data", data: null });
|
|
99932
|
-
}
|
|
99933
|
-
const writeResult = this.repository.write(cache, {
|
|
99934
|
-
...input,
|
|
99935
|
-
data: input.data,
|
|
99936
|
-
existingNormalizedData: (_a = input.existingNormalizedData) == null ? void 0 : _a.data,
|
|
99937
|
-
request: input.request,
|
|
99938
|
-
selections: input.selection.selectionSet.selections,
|
|
99939
|
-
parentFieldSelection: input.selection
|
|
99940
|
-
});
|
|
99941
|
-
if (writeResult.isErr()) {
|
|
99942
|
-
return writeResult;
|
|
99943
|
-
}
|
|
99944
|
-
return ok$4({ type: "data", data: writeResult.value });
|
|
99945
|
-
}
|
|
99946
|
-
read(cache, input) {
|
|
99947
|
-
var _a;
|
|
99948
|
-
if (!input.selection.selectionSet) {
|
|
99949
|
-
return err$4([
|
|
99950
|
-
{
|
|
99951
|
-
type: "unknown",
|
|
99952
|
-
error: new Error(
|
|
99953
|
-
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99954
|
-
)
|
|
99955
|
-
}
|
|
99956
|
-
]);
|
|
99957
|
-
}
|
|
99958
|
-
const normalizedData = input.normalizedData;
|
|
99959
|
-
if (normalizedData.type === "missing") {
|
|
99960
|
-
return ok$4(void 0);
|
|
99961
|
-
}
|
|
99962
|
-
if (normalizedData.data === null) {
|
|
99963
|
-
if (!this.nullable) {
|
|
99964
|
-
return err$4([
|
|
99965
|
-
{
|
|
99966
|
-
type: "unknown",
|
|
99967
|
-
error: new Error(
|
|
99968
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99969
|
-
)
|
|
99970
|
-
}
|
|
99971
|
-
]);
|
|
99972
|
-
}
|
|
99973
|
-
return ok$4(null);
|
|
99974
|
-
}
|
|
99975
|
-
return this.repository.read(cache, {
|
|
99976
|
-
...input,
|
|
99977
|
-
normalizedData: normalizedData.data,
|
|
99978
|
-
request: input.request,
|
|
99979
|
-
selections: (_a = input.selection.selectionSet) == null ? void 0 : _a.selections,
|
|
99980
|
-
parentFieldSelection: input.selection
|
|
99981
|
-
});
|
|
99982
|
-
}
|
|
99983
|
-
}
|
|
99984
100105
|
const GraphQLQueryJsonSchema = {
|
|
99985
100106
|
type: "object",
|
|
99986
100107
|
properties: {
|
|
@@ -100281,10 +100402,10 @@
|
|
|
100281
100402
|
return;
|
|
100282
100403
|
}
|
|
100283
100404
|
if ("subscribe" in result.value) {
|
|
100284
|
-
callback(result.value.data);
|
|
100405
|
+
callback(formatGraphQLData(result.value.data));
|
|
100285
100406
|
return;
|
|
100286
100407
|
}
|
|
100287
|
-
callback(result.value);
|
|
100408
|
+
callback(formatGraphQLData(result.value));
|
|
100288
100409
|
}
|
|
100289
100410
|
function resolveAst(ast) {
|
|
100290
100411
|
const result = astResolver(ast);
|
|
@@ -100293,6 +100414,18 @@
|
|
|
100293
100414
|
}
|
|
100294
100415
|
return result;
|
|
100295
100416
|
}
|
|
100417
|
+
function formatGraphQLData(data) {
|
|
100418
|
+
if (data.errors === void 0 || data.errors.length === 0) {
|
|
100419
|
+
return {
|
|
100420
|
+
data: data.data,
|
|
100421
|
+
errors: void 0
|
|
100422
|
+
};
|
|
100423
|
+
}
|
|
100424
|
+
return {
|
|
100425
|
+
data: data.data,
|
|
100426
|
+
errors: data.errors
|
|
100427
|
+
};
|
|
100428
|
+
}
|
|
100296
100429
|
class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor {
|
|
100297
100430
|
emit(result) {
|
|
100298
100431
|
try {
|
|
@@ -100371,7 +100504,7 @@
|
|
|
100371
100504
|
};
|
|
100372
100505
|
return { invoke, subscribe };
|
|
100373
100506
|
}
|
|
100374
|
-
// version: 1.
|
|
100507
|
+
// version: 1.378.0-63d7c07562
|
|
100375
100508
|
|
|
100376
100509
|
class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
|
|
100377
100510
|
constructor(services, typeRegistry) {
|
|
@@ -101547,7 +101680,7 @@
|
|
|
101547
101680
|
}
|
|
101548
101681
|
}
|
|
101549
101682
|
|
|
101550
|
-
class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
|
|
101683
|
+
let PolymorphicParentRelationshipRepository$1 = class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
|
|
101551
101684
|
constructor(services, typeRegistry) {
|
|
101552
101685
|
super(services);
|
|
101553
101686
|
this.services = services;
|
|
@@ -101564,7 +101697,7 @@
|
|
|
101564
101697
|
__typename: new BaseScalarFieldDef(false),
|
|
101565
101698
|
};
|
|
101566
101699
|
}
|
|
101567
|
-
}
|
|
101700
|
+
};
|
|
101568
101701
|
|
|
101569
101702
|
class QueryRepository extends GraphQLDocumentRootTypeRepository {
|
|
101570
101703
|
constructor(services, typeRegistry) {
|
|
@@ -102602,7 +102735,7 @@
|
|
|
102602
102735
|
this._Base64Value = new Base64ValueRepository(this.services, this);
|
|
102603
102736
|
this._JSONValue = new JSONValueRepository(this.services, this);
|
|
102604
102737
|
this._PolymorphicParentRelationship =
|
|
102605
|
-
new PolymorphicParentRelationshipRepository(this.services, this);
|
|
102738
|
+
new PolymorphicParentRelationshipRepository$1(this.services, this);
|
|
102606
102739
|
this._CompoundField = new CompoundFieldRepository$1(this.services, this);
|
|
102607
102740
|
this._AnyType = new AnyTypeRepository(this.services, this);
|
|
102608
102741
|
this._RecordRepresentation =
|
|
@@ -103055,6 +103188,50 @@
|
|
|
103055
103188
|
}
|
|
103056
103189
|
const ok = (value) => new Ok(value);
|
|
103057
103190
|
const err = (err2) => new Err(err2);
|
|
103191
|
+
function resolvedPromiseLike(result) {
|
|
103192
|
+
if (isPromiseLike(result)) {
|
|
103193
|
+
return result.then((nextResult) => nextResult);
|
|
103194
|
+
}
|
|
103195
|
+
return {
|
|
103196
|
+
then: (onFulfilled, _onRejected) => {
|
|
103197
|
+
try {
|
|
103198
|
+
return resolvedPromiseLike(onFulfilled(result));
|
|
103199
|
+
} catch (e) {
|
|
103200
|
+
if (onFulfilled === void 0) {
|
|
103201
|
+
return resolvedPromiseLike(result);
|
|
103202
|
+
}
|
|
103203
|
+
return rejectedPromiseLike(e);
|
|
103204
|
+
}
|
|
103205
|
+
}
|
|
103206
|
+
};
|
|
103207
|
+
}
|
|
103208
|
+
function rejectedPromiseLike(reason) {
|
|
103209
|
+
if (isPromiseLike(reason)) {
|
|
103210
|
+
return reason.then((nextResult) => nextResult);
|
|
103211
|
+
}
|
|
103212
|
+
return {
|
|
103213
|
+
then: (_onFulfilled, onRejected) => {
|
|
103214
|
+
if (typeof onRejected === "function") {
|
|
103215
|
+
try {
|
|
103216
|
+
return resolvedPromiseLike(onRejected(reason));
|
|
103217
|
+
} catch (e) {
|
|
103218
|
+
return rejectedPromiseLike(e);
|
|
103219
|
+
}
|
|
103220
|
+
}
|
|
103221
|
+
return rejectedPromiseLike(reason);
|
|
103222
|
+
}
|
|
103223
|
+
};
|
|
103224
|
+
}
|
|
103225
|
+
function isPromiseLike(x) {
|
|
103226
|
+
return typeof (x == null ? void 0 : x.then) === "function";
|
|
103227
|
+
}
|
|
103228
|
+
class InternalError extends Error {
|
|
103229
|
+
constructor(data) {
|
|
103230
|
+
super();
|
|
103231
|
+
this.data = data;
|
|
103232
|
+
this.type = "internal";
|
|
103233
|
+
}
|
|
103234
|
+
}
|
|
103058
103235
|
|
|
103059
103236
|
function buildGenericTypeFieldDef(selection, fields, staticFieldNames, typename) {
|
|
103060
103237
|
// If the field is not a category field, return the base field def for the field
|
|
@@ -103062,8 +103239,6 @@
|
|
|
103062
103239
|
return fields[selection.name.value];
|
|
103063
103240
|
}
|
|
103064
103241
|
return {
|
|
103065
|
-
type: 'object',
|
|
103066
|
-
nullable: true,
|
|
103067
103242
|
read: (cache, input) => {
|
|
103068
103243
|
if (!input.selection.selectionSet) {
|
|
103069
103244
|
return err([
|
|
@@ -103077,6 +103252,9 @@
|
|
|
103077
103252
|
if (normalizedData.type === 'missing') {
|
|
103078
103253
|
return ok(undefined);
|
|
103079
103254
|
}
|
|
103255
|
+
if (normalizedData.data === null) {
|
|
103256
|
+
return ok(null);
|
|
103257
|
+
}
|
|
103080
103258
|
const fieldCategory = normalizedData.fieldCategory;
|
|
103081
103259
|
const fieldDef = fields[fieldCategory];
|
|
103082
103260
|
if (!fieldDef) {
|
|
@@ -103101,6 +103279,9 @@
|
|
|
103101
103279
|
if (input.data === undefined) {
|
|
103102
103280
|
return ok({ type: 'missing' });
|
|
103103
103281
|
}
|
|
103282
|
+
if (input.data === null) {
|
|
103283
|
+
return ok({ type: 'data', data: null });
|
|
103284
|
+
}
|
|
103104
103285
|
const fieldCategory = getFieldCategoryFromData(input.data);
|
|
103105
103286
|
const fieldDef = fields[fieldCategory];
|
|
103106
103287
|
if (!fieldDef) {
|
|
@@ -103119,7 +103300,6 @@
|
|
|
103119
103300
|
},
|
|
103120
103301
|
buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
|
|
103121
103302
|
augmentSelections: (input) => input,
|
|
103122
|
-
repository: {}, // This shouldn't be part of the interface
|
|
103123
103303
|
};
|
|
103124
103304
|
}
|
|
103125
103305
|
function getFieldCategoryFromData(data) {
|
|
@@ -103171,13 +103351,38 @@
|
|
|
103171
103351
|
return this._graphqlRepositoryOverride;
|
|
103172
103352
|
}
|
|
103173
103353
|
write(cache, input) {
|
|
103174
|
-
|
|
103175
|
-
|
|
103354
|
+
let overridenInput = input;
|
|
103355
|
+
// If ID exists in the data but wasn't asked for, its from the extensions, and we should normalize it
|
|
103356
|
+
if (input.data.Id !== undefined &&
|
|
103357
|
+
input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
|
|
103358
|
+
overridenInput = {
|
|
103359
|
+
...input,
|
|
103360
|
+
selections: [
|
|
103361
|
+
...input.selections,
|
|
103362
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'Id' } },
|
|
103363
|
+
],
|
|
103364
|
+
};
|
|
103365
|
+
}
|
|
103366
|
+
const result = super.write(cache, overridenInput);
|
|
103367
|
+
const recordId = input.data.Id;
|
|
103368
|
+
const luvioRecord = input.getNormalizedLuvioRecord(recordId, input.reader);
|
|
103369
|
+
if (luvioRecord?.weakEtag &&
|
|
103370
|
+
input.data?.WeakEtag &&
|
|
103371
|
+
luvioRecord.weakEtag !== input.data.WeakEtag) {
|
|
103372
|
+
input.luvioRecordIdsToInvalidate.push(recordId);
|
|
103373
|
+
}
|
|
103176
103374
|
return result;
|
|
103177
103375
|
}
|
|
103178
103376
|
read(cache, input) {
|
|
103179
103377
|
const result = super.read(cache, input);
|
|
103180
|
-
|
|
103378
|
+
const idData = super.read(cache, {
|
|
103379
|
+
...input,
|
|
103380
|
+
selections: [{ kind: 'Field', name: { kind: 'Name', value: 'Id' } }],
|
|
103381
|
+
});
|
|
103382
|
+
if (idData.isOk()) {
|
|
103383
|
+
// Read the record to track subscription
|
|
103384
|
+
input.getNormalizedLuvioRecord(idData.value.Id, input.reader);
|
|
103385
|
+
}
|
|
103181
103386
|
return result;
|
|
103182
103387
|
}
|
|
103183
103388
|
}
|
|
@@ -103305,8 +103510,6 @@
|
|
|
103305
103510
|
}
|
|
103306
103511
|
|
|
103307
103512
|
const blobTypeDef = {
|
|
103308
|
-
type: 'scalar',
|
|
103309
|
-
nullable: true,
|
|
103310
103513
|
read: (_cache, input) => {
|
|
103311
103514
|
return ok({
|
|
103312
103515
|
data: input.data,
|
|
@@ -103416,6 +103619,14 @@
|
|
|
103416
103619
|
}
|
|
103417
103620
|
}
|
|
103418
103621
|
|
|
103622
|
+
class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
|
|
103623
|
+
getTypeDiscriminator(data, _selections) {
|
|
103624
|
+
// Hardcoded to record representation since that's the only type of parent
|
|
103625
|
+
// relationship possible
|
|
103626
|
+
return 'RecordRepresentation';
|
|
103627
|
+
}
|
|
103628
|
+
}
|
|
103629
|
+
|
|
103419
103630
|
class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
|
|
103420
103631
|
constructor(services) {
|
|
103421
103632
|
super(services);
|
|
@@ -103428,6 +103639,7 @@
|
|
|
103428
103639
|
this._SetupQueryAggregate = new SetupQueryAggregateRepository(services, this);
|
|
103429
103640
|
this._SetupQuery = new SetupQueryRepository(services, this);
|
|
103430
103641
|
this._SetupRecordAggregate = new SetupRecordAggregateRepository(services, this);
|
|
103642
|
+
this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
|
|
103431
103643
|
}
|
|
103432
103644
|
get CompoundField() {
|
|
103433
103645
|
return this._CompoundField;
|
|
@@ -103456,9 +103668,78 @@
|
|
|
103456
103668
|
get SetupRecordAggregate() {
|
|
103457
103669
|
return this._SetupRecordAggregate;
|
|
103458
103670
|
}
|
|
103671
|
+
get PolymorphicParentRelationship() {
|
|
103672
|
+
return this._PolymorphicParentRelationship;
|
|
103673
|
+
}
|
|
103459
103674
|
}
|
|
103460
103675
|
|
|
103461
103676
|
const CONFIG_SCHEMA = GraphQLQueryJsonSchema;
|
|
103677
|
+
|
|
103678
|
+
function mergeResponseWithExtensions(response) {
|
|
103679
|
+
return {
|
|
103680
|
+
data: deepMerge$1(response.data, response.extensions?.lds || {}),
|
|
103681
|
+
...(response.errors && { errors: response.errors }),
|
|
103682
|
+
};
|
|
103683
|
+
}
|
|
103684
|
+
function deepMerge$1(data, extensions) {
|
|
103685
|
+
const dataType = typeof data;
|
|
103686
|
+
const extensionsType = typeof extensions;
|
|
103687
|
+
if (dataType === 'function' || extensionsType === 'function') {
|
|
103688
|
+
throw new Error('Cannot merge functions');
|
|
103689
|
+
}
|
|
103690
|
+
if (dataType === 'undefined' || data === undefined) {
|
|
103691
|
+
return extensions;
|
|
103692
|
+
}
|
|
103693
|
+
if (extensionsType === 'undefined' || extensions === undefined) {
|
|
103694
|
+
return data;
|
|
103695
|
+
}
|
|
103696
|
+
if (dataType === 'string' ||
|
|
103697
|
+
dataType === 'number' ||
|
|
103698
|
+
dataType === 'boolean' ||
|
|
103699
|
+
dataType === 'bigint' ||
|
|
103700
|
+
dataType === 'symbol' ||
|
|
103701
|
+
extensionsType === 'string' ||
|
|
103702
|
+
extensionsType === 'number' ||
|
|
103703
|
+
extensionsType === 'boolean' ||
|
|
103704
|
+
extensionsType === 'bigint' ||
|
|
103705
|
+
extensionsType === 'symbol' ||
|
|
103706
|
+
data === null ||
|
|
103707
|
+
extensions === null) {
|
|
103708
|
+
// if either is a scalar, prefer data
|
|
103709
|
+
return data;
|
|
103710
|
+
}
|
|
103711
|
+
// data and extensions are both objects or arrays
|
|
103712
|
+
// if data is an array but extensions is not, prefer data
|
|
103713
|
+
const dataIsArray = Array.isArray(data);
|
|
103714
|
+
const extensionsIsArray = Array.isArray(extensions);
|
|
103715
|
+
// if one is an array and the other is not, prefer data
|
|
103716
|
+
if ((dataIsArray && !extensionsIsArray) || (!dataIsArray && extensionsIsArray)) {
|
|
103717
|
+
return data;
|
|
103718
|
+
}
|
|
103719
|
+
// if both are arrays, merge them, maintaining the length of data
|
|
103720
|
+
if (dataIsArray && extensionsIsArray) {
|
|
103721
|
+
return data.map((item, index) => deepMerge$1(item, extensions[index]));
|
|
103722
|
+
}
|
|
103723
|
+
// if both are objects, merge them
|
|
103724
|
+
// get the keys of both objects
|
|
103725
|
+
const dataKeys = Object.keys(data);
|
|
103726
|
+
const extensionsKeys = Object.keys(extensions);
|
|
103727
|
+
// get the keys that are in both objects
|
|
103728
|
+
const commonKeys = dataKeys.filter((key) => extensionsKeys.includes(key));
|
|
103729
|
+
// get the keys that are in data but not in extensions
|
|
103730
|
+
const dataKeysNotInExtensions = dataKeys.filter((key) => !extensionsKeys.includes(key));
|
|
103731
|
+
// get the keys that are in extensions but not in data
|
|
103732
|
+
const extensionsKeysNotInData = extensionsKeys.filter((key) => !dataKeys.includes(key));
|
|
103733
|
+
return {
|
|
103734
|
+
...Object.fromEntries(commonKeys.map((key) => [
|
|
103735
|
+
key,
|
|
103736
|
+
deepMerge$1(data[key], extensions[key]),
|
|
103737
|
+
])),
|
|
103738
|
+
...Object.fromEntries(dataKeysNotInExtensions.map((key) => [key, data[key]])),
|
|
103739
|
+
...Object.fromEntries(extensionsKeysNotInData.map((key) => [key, extensions[key]])),
|
|
103740
|
+
};
|
|
103741
|
+
}
|
|
103742
|
+
|
|
103462
103743
|
function buildCommandClass(baseClass) {
|
|
103463
103744
|
return class extends baseClass {
|
|
103464
103745
|
constructor(config, documentRootType, services) {
|
|
@@ -103466,21 +103747,167 @@
|
|
|
103466
103747
|
this.config = config;
|
|
103467
103748
|
this.documentRootType = documentRootType;
|
|
103468
103749
|
this.services = services;
|
|
103469
|
-
this.endpoint =
|
|
103470
|
-
|
|
103750
|
+
this.endpoint = 'RecordUiController.executeGraphQL';
|
|
103751
|
+
}
|
|
103752
|
+
get url() {
|
|
103753
|
+
return '/graphql';
|
|
103471
103754
|
}
|
|
103472
103755
|
get cacheControlStrategyConfig() {
|
|
103473
103756
|
return {
|
|
103474
|
-
type:
|
|
103757
|
+
type: 'max-age',
|
|
103475
103758
|
requestMaxAge: 60,
|
|
103476
103759
|
now: Date.now() / 1000,
|
|
103477
103760
|
};
|
|
103478
103761
|
}
|
|
103479
|
-
get url() {
|
|
103480
|
-
return "/graphql";
|
|
103481
|
-
}
|
|
103482
103762
|
get auraBodyWrapperName() {
|
|
103483
|
-
return
|
|
103763
|
+
return 'queryInput';
|
|
103764
|
+
}
|
|
103765
|
+
get auraParams() {
|
|
103766
|
+
const params = super.auraParams;
|
|
103767
|
+
const body = params[this.auraBodyWrapperName];
|
|
103768
|
+
return {
|
|
103769
|
+
...params,
|
|
103770
|
+
[this.auraBodyWrapperName]: {
|
|
103771
|
+
...body,
|
|
103772
|
+
extensions: {
|
|
103773
|
+
ldsRequiredFields: true,
|
|
103774
|
+
},
|
|
103775
|
+
},
|
|
103776
|
+
};
|
|
103777
|
+
}
|
|
103778
|
+
get fetchParams() {
|
|
103779
|
+
const [url, params] = super.fetchParams;
|
|
103780
|
+
const body = JSON.parse(params.body);
|
|
103781
|
+
const modifiedBody = {
|
|
103782
|
+
...body,
|
|
103783
|
+
extensions: {
|
|
103784
|
+
ldsRequiredFields: true,
|
|
103785
|
+
},
|
|
103786
|
+
};
|
|
103787
|
+
return [
|
|
103788
|
+
url,
|
|
103789
|
+
{
|
|
103790
|
+
...params,
|
|
103791
|
+
body: JSON.stringify(modifiedBody),
|
|
103792
|
+
},
|
|
103793
|
+
];
|
|
103794
|
+
}
|
|
103795
|
+
buildWriteInput(data) {
|
|
103796
|
+
this.latestLuvioRecordIdsToInvalidate = [];
|
|
103797
|
+
const augmentedResponse = mergeResponseWithExtensions(data);
|
|
103798
|
+
const extensionResult = buildGraphQLInputExtension({
|
|
103799
|
+
...this.config,
|
|
103800
|
+
query: this.buildRequestQuery(),
|
|
103801
|
+
});
|
|
103802
|
+
if (extensionResult.isErr()) {
|
|
103803
|
+
throw new InternalError(extensionResult.error);
|
|
103804
|
+
}
|
|
103805
|
+
return {
|
|
103806
|
+
data: augmentedResponse.data,
|
|
103807
|
+
...extensionResult.value,
|
|
103808
|
+
luvioRecordIdsToInvalidate: this.latestLuvioRecordIdsToInvalidate,
|
|
103809
|
+
};
|
|
103810
|
+
}
|
|
103811
|
+
readFromCache(cache) {
|
|
103812
|
+
let readFromCacheResult = undefined;
|
|
103813
|
+
try {
|
|
103814
|
+
const luvioService = this.services.luvio;
|
|
103815
|
+
const luvioInstance = luvioService.luvio;
|
|
103816
|
+
// Create a Luvio reader and get the latest snapshot
|
|
103817
|
+
this.latestLuvioSnapshot = luvioInstance.storeLookup({
|
|
103818
|
+
recordId: 'onestore-graphql',
|
|
103819
|
+
node: {
|
|
103820
|
+
kind: 'Fragment',
|
|
103821
|
+
reader: true,
|
|
103822
|
+
synthetic: true,
|
|
103823
|
+
read: (reader) => {
|
|
103824
|
+
readFromCacheResult = this.buildResultType().query(cache, {
|
|
103825
|
+
...this.buildQuery(),
|
|
103826
|
+
reader,
|
|
103827
|
+
getNormalizedLuvioRecord: this.services.luvioUiapiRecords.getNormalizedLuvioRecord,
|
|
103828
|
+
});
|
|
103829
|
+
return readFromCacheResult;
|
|
103830
|
+
},
|
|
103831
|
+
},
|
|
103832
|
+
variables: {},
|
|
103833
|
+
});
|
|
103834
|
+
}
|
|
103835
|
+
catch (error) {
|
|
103836
|
+
return resolvedPromiseLike(err(error));
|
|
103837
|
+
}
|
|
103838
|
+
const readResult = readFromCacheResult;
|
|
103839
|
+
if (readResult === undefined) {
|
|
103840
|
+
return resolvedPromiseLike(err(new Error('No result from query')));
|
|
103841
|
+
}
|
|
103842
|
+
// Convert ReadResult to Result<any, Error>
|
|
103843
|
+
if (readResult.isErr()) {
|
|
103844
|
+
return resolvedPromiseLike(err(new Error('Failed to find data in cache')));
|
|
103845
|
+
}
|
|
103846
|
+
return resolvedPromiseLike(ok(readResult.value));
|
|
103847
|
+
}
|
|
103848
|
+
writeToCache(cache, networkResult) {
|
|
103849
|
+
try {
|
|
103850
|
+
const luvioService = this.services.luvio;
|
|
103851
|
+
const luvioInstance = luvioService.luvio;
|
|
103852
|
+
// Create a Luvio reader to allow the record representation type to lookup records in luvio
|
|
103853
|
+
// and mark them as needing invalidation when necessary
|
|
103854
|
+
luvioInstance.storeLookup({
|
|
103855
|
+
recordId: 'onestore-graphql',
|
|
103856
|
+
node: {
|
|
103857
|
+
kind: 'Fragment',
|
|
103858
|
+
reader: true,
|
|
103859
|
+
synthetic: true,
|
|
103860
|
+
read: (reader) => {
|
|
103861
|
+
if (networkResult.isOk()) {
|
|
103862
|
+
return this.buildResultType().write(cache.buildFixedTimeWritableCache(Date.now() / 1000), {
|
|
103863
|
+
...this.buildWriteInput(networkResult.value),
|
|
103864
|
+
reader,
|
|
103865
|
+
getNormalizedLuvioRecord: this.services.luvioUiapiRecords
|
|
103866
|
+
.getNormalizedLuvioRecord,
|
|
103867
|
+
});
|
|
103868
|
+
}
|
|
103869
|
+
},
|
|
103870
|
+
},
|
|
103871
|
+
variables: {},
|
|
103872
|
+
});
|
|
103873
|
+
}
|
|
103874
|
+
catch (error) {
|
|
103875
|
+
// swallow error
|
|
103876
|
+
}
|
|
103877
|
+
return resolvedPromiseLike(undefined);
|
|
103878
|
+
}
|
|
103879
|
+
execute() {
|
|
103880
|
+
// Clear snapshot and unsubscribe from any existing subscriptions at the beginning of execute calls
|
|
103881
|
+
this.latestLuvioSnapshot = undefined;
|
|
103882
|
+
this.latestLuvioRecordIdsToInvalidate = undefined;
|
|
103883
|
+
if (this.unsubscribeFromLuvioSnapshot) {
|
|
103884
|
+
this.unsubscribeFromLuvioSnapshot();
|
|
103885
|
+
this.unsubscribeFromLuvioSnapshot = undefined;
|
|
103886
|
+
}
|
|
103887
|
+
const result = super.execute();
|
|
103888
|
+
result.then((_) => {
|
|
103889
|
+
if (this.latestLuvioRecordIdsToInvalidate &&
|
|
103890
|
+
this.latestLuvioRecordIdsToInvalidate.length > 0) {
|
|
103891
|
+
return this.services.luvioUiapiRecords.notifyRecordUpdateAvailable(this.latestLuvioRecordIdsToInvalidate.map((recordId) => ({ recordId })));
|
|
103892
|
+
}
|
|
103893
|
+
});
|
|
103894
|
+
return result;
|
|
103895
|
+
}
|
|
103896
|
+
subscribeToKeysUsed() {
|
|
103897
|
+
super.subscribeToKeysUsed();
|
|
103898
|
+
// Subscribe to luvio cache changes using the stored snapshot
|
|
103899
|
+
if (this.latestLuvioSnapshot) {
|
|
103900
|
+
try {
|
|
103901
|
+
const luvioService = this.services.luvio;
|
|
103902
|
+
const luvioInstance = luvioService.luvio;
|
|
103903
|
+
// Subscribe to changes using the stored snapshot
|
|
103904
|
+
this.unsubscribeFromLuvioSnapshot = luvioInstance.storeSubscribe(this.latestLuvioSnapshot, (_) => {
|
|
103905
|
+
// If any records used change at the top level, refresh all the data
|
|
103906
|
+
this.refresh();
|
|
103907
|
+
});
|
|
103908
|
+
}
|
|
103909
|
+
catch (error) { }
|
|
103910
|
+
}
|
|
103484
103911
|
}
|
|
103485
103912
|
};
|
|
103486
103913
|
}
|
|
@@ -103524,6 +103951,10 @@
|
|
|
103524
103951
|
version: '1.0',
|
|
103525
103952
|
optional: true,
|
|
103526
103953
|
},
|
|
103954
|
+
luvioUiapiRecords: {
|
|
103955
|
+
type: 'luvioUiapiRecords',
|
|
103956
|
+
version: '1.0',
|
|
103957
|
+
},
|
|
103527
103958
|
};
|
|
103528
103959
|
let provisionedCallback;
|
|
103529
103960
|
getServices(serviceRequirements).then((services) => {
|
|
@@ -103559,7 +103990,7 @@
|
|
|
103559
103990
|
cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
|
|
103560
103991
|
}
|
|
103561
103992
|
}
|
|
103562
|
-
// version: 1.
|
|
103993
|
+
// version: 1.378.0-63d7c07562
|
|
103563
103994
|
|
|
103564
103995
|
function createFragmentMap(documentNode) {
|
|
103565
103996
|
const fragments = {};
|
|
@@ -130054,7 +130485,7 @@
|
|
|
130054
130485
|
}
|
|
130055
130486
|
return refresh$3(data, 'refreshUiApi');
|
|
130056
130487
|
}
|
|
130057
|
-
// version: 1.
|
|
130488
|
+
// version: 1.378.0-63d7c07562
|
|
130058
130489
|
|
|
130059
130490
|
// On core the unstable adapters are re-exported with different names,
|
|
130060
130491
|
// we want to match them here.
|
|
@@ -130206,7 +130637,7 @@
|
|
|
130206
130637
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
130207
130638
|
graphQLImperative = ldsAdapter;
|
|
130208
130639
|
});
|
|
130209
|
-
// version: 1.
|
|
130640
|
+
// version: 1.378.0-63d7c07562
|
|
130210
130641
|
|
|
130211
130642
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
130212
130643
|
__proto__: null,
|
|
@@ -131005,7 +131436,7 @@
|
|
|
131005
131436
|
function register(r) {
|
|
131006
131437
|
callbacks$1.forEach((callback) => callback(r));
|
|
131007
131438
|
}
|
|
131008
|
-
// version: 1.
|
|
131439
|
+
// version: 1.378.0-0ab3d40d29
|
|
131009
131440
|
|
|
131010
131441
|
/**
|
|
131011
131442
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -132342,4 +132773,4 @@
|
|
|
132342
132773
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
132343
132774
|
|
|
132344
132775
|
}));
|
|
132345
|
-
// version: 1.
|
|
132776
|
+
// version: 1.378.0-0ab3d40d29
|