@salesforce/lds-worker-api 1.413.0 → 1.414.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.
|
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
callbacks.push(callback);
|
|
4276
4276
|
}
|
|
4277
|
-
// version: 1.
|
|
4277
|
+
// version: 1.414.0-ff06871479
|
|
4278
4278
|
|
|
4279
4279
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4280
4280
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5318,7 +5318,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5318
5318
|
const { apiFamily, name } = metadata;
|
|
5319
5319
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5320
5320
|
}
|
|
5321
|
-
// version: 1.
|
|
5321
|
+
// version: 1.414.0-ff06871479
|
|
5322
5322
|
|
|
5323
5323
|
/**
|
|
5324
5324
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -35473,7 +35473,7 @@ withDefaultLuvio((luvio) => {
|
|
|
35473
35473
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
35474
35474
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
35475
35475
|
});
|
|
35476
|
-
// version: 1.
|
|
35476
|
+
// version: 1.414.0-3d95b40524
|
|
35477
35477
|
|
|
35478
35478
|
var allowUpdatesForNonCachedRecords = {
|
|
35479
35479
|
isOpen: function (e) {
|
|
@@ -47119,7 +47119,7 @@ const { create: create$7, freeze: freeze$4, keys: keys$8, entries: entries$6 } =
|
|
|
47119
47119
|
const { hasOwnProperty: hasOwnProperty$5 } = Object.prototype;
|
|
47120
47120
|
const { isArray: isArray$7 } = Array;
|
|
47121
47121
|
const { stringify: stringify$9, parse: parse$9 } = JSON;
|
|
47122
|
-
let Ok$
|
|
47122
|
+
let Ok$4 = class Ok {
|
|
47123
47123
|
constructor(value) {
|
|
47124
47124
|
this.value = value;
|
|
47125
47125
|
}
|
|
@@ -47130,7 +47130,7 @@ let Ok$3 = class Ok {
|
|
|
47130
47130
|
return !this.isOk();
|
|
47131
47131
|
}
|
|
47132
47132
|
};
|
|
47133
|
-
let Err$
|
|
47133
|
+
let Err$4 = class Err {
|
|
47134
47134
|
constructor(error) {
|
|
47135
47135
|
this.error = error;
|
|
47136
47136
|
}
|
|
@@ -47141,8 +47141,8 @@ let Err$3 = class Err {
|
|
|
47141
47141
|
return !this.isOk();
|
|
47142
47142
|
}
|
|
47143
47143
|
};
|
|
47144
|
-
const ok$
|
|
47145
|
-
const err$
|
|
47144
|
+
const ok$4 = (value) => new Ok$4(value);
|
|
47145
|
+
const err$4 = (err2) => new Err$4(err2);
|
|
47146
47146
|
function resolvedPromiseLike$4(result) {
|
|
47147
47147
|
if (isPromiseLike$4(result)) {
|
|
47148
47148
|
return result.then((nextResult) => nextResult);
|
|
@@ -47384,20 +47384,20 @@ class IdentifiableTypeRepository {
|
|
|
47384
47384
|
const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
|
|
47385
47385
|
const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
|
|
47386
47386
|
if (normalized.isErr()) {
|
|
47387
|
-
return err$
|
|
47387
|
+
return err$4(normalized.error);
|
|
47388
47388
|
}
|
|
47389
47389
|
cache.set(key, {
|
|
47390
47390
|
value: normalized.value,
|
|
47391
47391
|
metadata: this.cacheMetadata
|
|
47392
47392
|
});
|
|
47393
|
-
return ok$
|
|
47393
|
+
return ok$4({
|
|
47394
47394
|
type: "link",
|
|
47395
47395
|
linkedKey: key
|
|
47396
47396
|
});
|
|
47397
47397
|
}
|
|
47398
47398
|
validateEntry(entry) {
|
|
47399
47399
|
if (!isCacheEntryForType(entry, this)) {
|
|
47400
|
-
return err$
|
|
47400
|
+
return err$4([
|
|
47401
47401
|
{
|
|
47402
47402
|
type: "incorrectType",
|
|
47403
47403
|
expectedType: this.typeName,
|
|
@@ -47405,7 +47405,7 @@ class IdentifiableTypeRepository {
|
|
|
47405
47405
|
}
|
|
47406
47406
|
]);
|
|
47407
47407
|
}
|
|
47408
|
-
return ok$
|
|
47408
|
+
return ok$4(void 0);
|
|
47409
47409
|
}
|
|
47410
47410
|
query(cache, query) {
|
|
47411
47411
|
return this.read(cache, {
|
|
@@ -47423,12 +47423,12 @@ class IdentifiableTypeRepository {
|
|
|
47423
47423
|
if (cacheEntry) {
|
|
47424
47424
|
const validationResult = this.validateEntry(cacheEntry);
|
|
47425
47425
|
if (validationResult.isErr()) {
|
|
47426
|
-
return err$
|
|
47426
|
+
return err$4([...validationResult.error]);
|
|
47427
47427
|
}
|
|
47428
47428
|
const normalizedData = cacheEntry.value;
|
|
47429
47429
|
return this.denormalizeData(cache, { ...input, normalizedData });
|
|
47430
47430
|
}
|
|
47431
|
-
return err$
|
|
47431
|
+
return err$4([this.buildMissingDataError()]);
|
|
47432
47432
|
}
|
|
47433
47433
|
equals(x, y) {
|
|
47434
47434
|
return deepEquals$2(x, y);
|
|
@@ -47451,9 +47451,9 @@ function extractReadWriteData(result, errorCollector) {
|
|
|
47451
47451
|
}
|
|
47452
47452
|
function buildReadWriteResult(data, errors) {
|
|
47453
47453
|
if (errors.length > 0) {
|
|
47454
|
-
return err$
|
|
47454
|
+
return err$4(errors);
|
|
47455
47455
|
}
|
|
47456
|
-
return ok$
|
|
47456
|
+
return ok$4(data);
|
|
47457
47457
|
}
|
|
47458
47458
|
|
|
47459
47459
|
/**
|
|
@@ -48301,8 +48301,40 @@ function hasMultilineItems(maybeArray) {
|
|
|
48301
48301
|
}
|
|
48302
48302
|
const referenceMap = /* @__PURE__ */ new WeakMap();
|
|
48303
48303
|
const astResolver = function(astReference) {
|
|
48304
|
+
if (typeof astReference !== "object" || astReference === null) {
|
|
48305
|
+
return void 0;
|
|
48306
|
+
}
|
|
48304
48307
|
return referenceMap.get(astReference);
|
|
48305
48308
|
};
|
|
48309
|
+
/*!
|
|
48310
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
48311
|
+
* All rights reserved.
|
|
48312
|
+
* For full license text, see the LICENSE.txt file
|
|
48313
|
+
*/
|
|
48314
|
+
let Ok$3 = class Ok {
|
|
48315
|
+
constructor(value) {
|
|
48316
|
+
this.value = value;
|
|
48317
|
+
}
|
|
48318
|
+
isOk() {
|
|
48319
|
+
return true;
|
|
48320
|
+
}
|
|
48321
|
+
isErr() {
|
|
48322
|
+
return !this.isOk();
|
|
48323
|
+
}
|
|
48324
|
+
};
|
|
48325
|
+
let Err$3 = class Err {
|
|
48326
|
+
constructor(error) {
|
|
48327
|
+
this.error = error;
|
|
48328
|
+
}
|
|
48329
|
+
isOk() {
|
|
48330
|
+
return false;
|
|
48331
|
+
}
|
|
48332
|
+
isErr() {
|
|
48333
|
+
return !this.isOk();
|
|
48334
|
+
}
|
|
48335
|
+
};
|
|
48336
|
+
const ok$3 = (value) => new Ok$3(value);
|
|
48337
|
+
const err$3 = (err2) => new Err$3(err2);
|
|
48306
48338
|
function findExecutableOperation$2(document, operationName) {
|
|
48307
48339
|
const operations = document.definitions.filter(
|
|
48308
48340
|
(def) => def.kind === Kind$2.OPERATION_DEFINITION
|
|
@@ -48335,25 +48367,40 @@ function validateGraphQLOperations(config, options) {
|
|
|
48335
48367
|
}
|
|
48336
48368
|
function resolveAst(ast) {
|
|
48337
48369
|
if (ast === null || ast === void 0) {
|
|
48338
|
-
return;
|
|
48370
|
+
return void 0;
|
|
48339
48371
|
}
|
|
48340
|
-
|
|
48341
|
-
|
|
48342
|
-
|
|
48372
|
+
return astResolver(ast);
|
|
48373
|
+
}
|
|
48374
|
+
function resolveAndValidateGraphQLConfig(config, options) {
|
|
48375
|
+
const query = config.query;
|
|
48376
|
+
if (query === null || query === void 0) {
|
|
48377
|
+
return void 0;
|
|
48343
48378
|
}
|
|
48344
|
-
|
|
48379
|
+
const result = resolveAndValidateGraphQLDocument(query, config.operationName, options);
|
|
48380
|
+
if (result.isErr()) {
|
|
48381
|
+
return err$3(result.error);
|
|
48382
|
+
}
|
|
48383
|
+
return ok$3({
|
|
48384
|
+
...config,
|
|
48385
|
+
query: result.value
|
|
48386
|
+
});
|
|
48345
48387
|
}
|
|
48346
|
-
function
|
|
48347
|
-
|
|
48348
|
-
|
|
48349
|
-
|
|
48350
|
-
|
|
48351
|
-
|
|
48352
|
-
|
|
48353
|
-
acceptedOperations: (options == null ? void 0 : options.acceptedOperations) ?? ["query"]
|
|
48354
|
-
});
|
|
48388
|
+
function resolveAndValidateGraphQLDocument(query, operationName, options) {
|
|
48389
|
+
const resolved = resolveAst(query);
|
|
48390
|
+
if (resolved === void 0) {
|
|
48391
|
+
throw new Error("Could not resolve AST. Did you parse the query with gql?");
|
|
48392
|
+
}
|
|
48393
|
+
if (resolved.type === "error") {
|
|
48394
|
+
return err$3(resolved.error);
|
|
48355
48395
|
}
|
|
48356
|
-
|
|
48396
|
+
const document = resolved.document;
|
|
48397
|
+
validateGraphQLOperations(
|
|
48398
|
+
{ query: document, operationName },
|
|
48399
|
+
{
|
|
48400
|
+
acceptedOperations: (options == null ? void 0 : options.acceptedOperations) ?? ["query"]
|
|
48401
|
+
}
|
|
48402
|
+
);
|
|
48403
|
+
return ok$3(document);
|
|
48357
48404
|
}
|
|
48358
48405
|
|
|
48359
48406
|
var productConsumedSideEffects = {
|
|
@@ -98644,7 +98691,7 @@ function buildServiceDescriptor$b(luvio) {
|
|
|
98644
98691
|
},
|
|
98645
98692
|
};
|
|
98646
98693
|
}
|
|
98647
|
-
// version: 1.
|
|
98694
|
+
// version: 1.414.0-3d95b40524
|
|
98648
98695
|
|
|
98649
98696
|
/**
|
|
98650
98697
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -98670,7 +98717,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
98670
98717
|
},
|
|
98671
98718
|
};
|
|
98672
98719
|
}
|
|
98673
|
-
// version: 1.
|
|
98720
|
+
// version: 1.414.0-3d95b40524
|
|
98674
98721
|
|
|
98675
98722
|
/*!
|
|
98676
98723
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -99673,7 +99720,16 @@ class GraphQLImperativeBindingsService {
|
|
|
99673
99720
|
return async (...params) => {
|
|
99674
99721
|
try {
|
|
99675
99722
|
if (params.length) {
|
|
99676
|
-
|
|
99723
|
+
const options = {
|
|
99724
|
+
acceptedOperations: ["query"]
|
|
99725
|
+
};
|
|
99726
|
+
const result = resolveAndValidateGraphQLConfig(params[0], options);
|
|
99727
|
+
if (result == null ? void 0 : result.isErr()) {
|
|
99728
|
+
return result.error;
|
|
99729
|
+
}
|
|
99730
|
+
if (result == null ? void 0 : result.isOk()) {
|
|
99731
|
+
params[0] = result.value;
|
|
99732
|
+
}
|
|
99677
99733
|
}
|
|
99678
99734
|
return await buildBaseImperativeInvoker(getCommand, (result) => this.transformResult(result, exposeRefresh))(...params);
|
|
99679
99735
|
} catch (error) {
|
|
@@ -99764,7 +99820,19 @@ function buildServiceDescriptor$2$1() {
|
|
|
99764
99820
|
class GraphQLLegacyImperativeBindingsService {
|
|
99765
99821
|
bind(getCommand) {
|
|
99766
99822
|
const invoke = async (config, requestContext, callback) => {
|
|
99767
|
-
|
|
99823
|
+
if (config) {
|
|
99824
|
+
const options = {
|
|
99825
|
+
acceptedOperations: ["query"]
|
|
99826
|
+
};
|
|
99827
|
+
const result = resolveAndValidateGraphQLConfig(config, options);
|
|
99828
|
+
if (result == null ? void 0 : result.isErr()) {
|
|
99829
|
+
callback(result.error);
|
|
99830
|
+
return;
|
|
99831
|
+
}
|
|
99832
|
+
if (result == null ? void 0 : result.isOk()) {
|
|
99833
|
+
config = result.value;
|
|
99834
|
+
}
|
|
99835
|
+
}
|
|
99768
99836
|
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
99769
99837
|
try {
|
|
99770
99838
|
const overrides = getOverridesForLegacyRequestContext(requestContext);
|
|
@@ -99793,7 +99861,20 @@ class GraphQLLegacyImperativeBindingsService {
|
|
|
99793
99861
|
}
|
|
99794
99862
|
};
|
|
99795
99863
|
const subscribe = (config, requestContext, callback) => {
|
|
99796
|
-
|
|
99864
|
+
if (config) {
|
|
99865
|
+
const options = {
|
|
99866
|
+
acceptedOperations: ["query"]
|
|
99867
|
+
};
|
|
99868
|
+
const result = resolveAndValidateGraphQLConfig(config, options);
|
|
99869
|
+
if (result == null ? void 0 : result.isErr()) {
|
|
99870
|
+
callback(result.error);
|
|
99871
|
+
return () => {
|
|
99872
|
+
};
|
|
99873
|
+
}
|
|
99874
|
+
if (result == null ? void 0 : result.isOk()) {
|
|
99875
|
+
config = result.value;
|
|
99876
|
+
}
|
|
99877
|
+
}
|
|
99797
99878
|
const command = getCommand({ config, assertIsValid: assertIsValid$1 });
|
|
99798
99879
|
let unsubscribe = () => {
|
|
99799
99880
|
};
|
|
@@ -99842,9 +99923,19 @@ class GraphQLMutationBindingsService {
|
|
|
99842
99923
|
return async (...params) => {
|
|
99843
99924
|
try {
|
|
99844
99925
|
if (params.length) {
|
|
99845
|
-
|
|
99926
|
+
const options = {
|
|
99846
99927
|
acceptedOperations: ["mutation"]
|
|
99847
|
-
}
|
|
99928
|
+
};
|
|
99929
|
+
const result2 = resolveAndValidateGraphQLConfig(params[0], options);
|
|
99930
|
+
if (result2 == null ? void 0 : result2.isErr()) {
|
|
99931
|
+
return {
|
|
99932
|
+
data: void 0,
|
|
99933
|
+
errors: result2.error.errors
|
|
99934
|
+
};
|
|
99935
|
+
}
|
|
99936
|
+
if (result2 == null ? void 0 : result2.isOk()) {
|
|
99937
|
+
params[0] = result2.value;
|
|
99938
|
+
}
|
|
99848
99939
|
}
|
|
99849
99940
|
const command = getCommand({ params, assertIsValid: assertIsValid$1 });
|
|
99850
99941
|
const result = await command.execute({ cacheControlConfig: { type: "no-cache" } });
|
|
@@ -100174,16 +100265,25 @@ class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor
|
|
|
100174
100265
|
}
|
|
100175
100266
|
update(config, _context) {
|
|
100176
100267
|
this.unsubscribe();
|
|
100177
|
-
const
|
|
100178
|
-
|
|
100179
|
-
|
|
100180
|
-
|
|
100181
|
-
|
|
100182
|
-
|
|
100268
|
+
const options = {
|
|
100269
|
+
acceptedOperations: ["query"]
|
|
100270
|
+
};
|
|
100271
|
+
const result = resolveAndValidateGraphQLConfig(config, options);
|
|
100272
|
+
if (!result) {
|
|
100273
|
+
return;
|
|
100274
|
+
}
|
|
100275
|
+
if (result.isErr()) {
|
|
100276
|
+
const error = result.error;
|
|
100277
|
+
this.callback({
|
|
100278
|
+
data: void 0,
|
|
100279
|
+
errors: error.errors
|
|
100280
|
+
});
|
|
100281
|
+
return;
|
|
100183
100282
|
}
|
|
100283
|
+
const { query, ...rest } = result.value;
|
|
100184
100284
|
this.config = {
|
|
100185
|
-
|
|
100186
|
-
|
|
100285
|
+
query,
|
|
100286
|
+
...sanitize(rest)
|
|
100187
100287
|
};
|
|
100188
100288
|
this.invokeAdapter();
|
|
100189
100289
|
}
|
|
@@ -101255,7 +101355,7 @@ register$1({
|
|
|
101255
101355
|
id: '@salesforce/lds-network-adapter',
|
|
101256
101356
|
instrument: instrument$2,
|
|
101257
101357
|
});
|
|
101258
|
-
// version: 1.
|
|
101358
|
+
// version: 1.414.0-ff06871479
|
|
101259
101359
|
|
|
101260
101360
|
const { create: create$3, keys: keys$3 } = Object;
|
|
101261
101361
|
const { stringify, parse } = JSON;
|
|
@@ -101304,7 +101404,7 @@ class JsonSchemaErrorCollector {
|
|
|
101304
101404
|
this.errors.unshift(error);
|
|
101305
101405
|
}
|
|
101306
101406
|
toValidationResponse() {
|
|
101307
|
-
return !this.hasErrors() ? ok$
|
|
101407
|
+
return !this.hasErrors() ? ok$4(true) : err$4(this.errors);
|
|
101308
101408
|
}
|
|
101309
101409
|
}
|
|
101310
101410
|
function createThrowableError(errors) {
|
|
@@ -101340,10 +101440,10 @@ function incorrectTypeError(expected, actual, path) {
|
|
|
101340
101440
|
);
|
|
101341
101441
|
}
|
|
101342
101442
|
function validSchemaResponse() {
|
|
101343
|
-
return ok$
|
|
101443
|
+
return ok$4(true);
|
|
101344
101444
|
}
|
|
101345
101445
|
function invalidSchemaResponseWithError(error) {
|
|
101346
|
-
return err$
|
|
101446
|
+
return err$4([error]);
|
|
101347
101447
|
}
|
|
101348
101448
|
function validateJsonSchema(data, schema, path = "$", document = schema) {
|
|
101349
101449
|
if (schema === true) return validSchemaResponse();
|
|
@@ -101856,35 +101956,35 @@ function extractValue(valueNode, variableDefinitions, expectedType) {
|
|
|
101856
101956
|
function extractVariableValue(variableName, variableDefinitions) {
|
|
101857
101957
|
const variable = variableDefinitions[variableName];
|
|
101858
101958
|
if (!variable) {
|
|
101859
|
-
return err$
|
|
101959
|
+
return err$4(
|
|
101860
101960
|
new Error(`Variable '${variableName}' was used in the query but was not defined`)
|
|
101861
101961
|
);
|
|
101862
101962
|
}
|
|
101863
101963
|
if (variable.value !== void 0) {
|
|
101864
|
-
return ok$
|
|
101964
|
+
return ok$4(variable.value);
|
|
101865
101965
|
}
|
|
101866
101966
|
if (variable.definition.defaultValue) {
|
|
101867
101967
|
return extractValue(variable.definition.defaultValue, variableDefinitions);
|
|
101868
101968
|
}
|
|
101869
|
-
return ok$
|
|
101969
|
+
return ok$4(void 0);
|
|
101870
101970
|
}
|
|
101871
101971
|
function validateExpectedType(value, expectedType) {
|
|
101872
101972
|
if (!expectedType) {
|
|
101873
|
-
return ok$
|
|
101973
|
+
return ok$4(value);
|
|
101874
101974
|
}
|
|
101875
101975
|
if (value === null) {
|
|
101876
101976
|
if (expectedType.nullable) {
|
|
101877
|
-
return ok$
|
|
101977
|
+
return ok$4(value);
|
|
101878
101978
|
} else {
|
|
101879
|
-
return err$
|
|
101979
|
+
return err$4(new Error(`Expected ${expectedType.type}, but got null`));
|
|
101880
101980
|
}
|
|
101881
101981
|
}
|
|
101882
101982
|
const actualType = typeof value;
|
|
101883
101983
|
if (actualType === expectedType.type) {
|
|
101884
|
-
return ok$
|
|
101984
|
+
return ok$4(value);
|
|
101885
101985
|
}
|
|
101886
101986
|
const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
|
|
101887
|
-
return err$
|
|
101987
|
+
return err$4(
|
|
101888
101988
|
new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
|
|
101889
101989
|
);
|
|
101890
101990
|
}
|
|
@@ -101927,10 +102027,10 @@ function findExecutableOperation(input) {
|
|
|
101927
102027
|
(def) => def.kind === Kind.OPERATION_DEFINITION
|
|
101928
102028
|
);
|
|
101929
102029
|
if (operations.length === 0) {
|
|
101930
|
-
return err$
|
|
102030
|
+
return err$4(new Error("No operations found in query"));
|
|
101931
102031
|
}
|
|
101932
102032
|
if (operations.length === 1 && !input.operationName) {
|
|
101933
|
-
return ok$
|
|
102033
|
+
return ok$4(operations[0]);
|
|
101934
102034
|
}
|
|
101935
102035
|
if (input.operationName) {
|
|
101936
102036
|
const specifiedOperation = operations.find((op) => {
|
|
@@ -101938,16 +102038,16 @@ function findExecutableOperation(input) {
|
|
|
101938
102038
|
return ((_a = op.name) == null ? void 0 : _a.value) === input.operationName;
|
|
101939
102039
|
});
|
|
101940
102040
|
if (specifiedOperation) {
|
|
101941
|
-
return ok$
|
|
102041
|
+
return ok$4(specifiedOperation);
|
|
101942
102042
|
}
|
|
101943
|
-
return err$
|
|
102043
|
+
return err$4(new Error(`Operation "${input.operationName}" not found in query`));
|
|
101944
102044
|
}
|
|
101945
|
-
return err$
|
|
102045
|
+
return err$4(new Error("Multiple operations found in query, and no operation name provided"));
|
|
101946
102046
|
}
|
|
101947
102047
|
function buildGraphQLInputExtension(input) {
|
|
101948
102048
|
const operationResult = findExecutableOperation(input);
|
|
101949
102049
|
if (operationResult.isErr()) {
|
|
101950
|
-
return err$
|
|
102050
|
+
return err$4(operationResult.error);
|
|
101951
102051
|
}
|
|
101952
102052
|
const operation = operationResult.value;
|
|
101953
102053
|
const selections = operation.selectionSet.selections;
|
|
@@ -101964,7 +102064,7 @@ function buildGraphQLInputExtension(input) {
|
|
|
101964
102064
|
prev[fragment.name.value] = fragment;
|
|
101965
102065
|
return prev;
|
|
101966
102066
|
}, {});
|
|
101967
|
-
return ok$
|
|
102067
|
+
return ok$4({
|
|
101968
102068
|
selections,
|
|
101969
102069
|
request: { definitions: { variables, fragments } },
|
|
101970
102070
|
parentFieldSelection: void 0
|
|
@@ -102120,13 +102220,13 @@ function collectFieldNames(selections, fragments) {
|
|
|
102120
102220
|
}
|
|
102121
102221
|
function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
|
|
102122
102222
|
if (fieldArguments === void 0 || fieldArguments.length === 0) {
|
|
102123
|
-
return ok$
|
|
102223
|
+
return ok$4(canonicalFieldName);
|
|
102124
102224
|
}
|
|
102125
102225
|
const formattedArguments = {};
|
|
102126
102226
|
for (const arg of fieldArguments) {
|
|
102127
102227
|
const result = extractValue(arg.value, variables);
|
|
102128
102228
|
if (result.isErr()) {
|
|
102129
|
-
return err$
|
|
102229
|
+
return err$4(
|
|
102130
102230
|
new Error(
|
|
102131
102231
|
`Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
|
|
102132
102232
|
)
|
|
@@ -102134,7 +102234,7 @@ function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
|
|
|
102134
102234
|
}
|
|
102135
102235
|
formattedArguments[arg.name.value] = result.value;
|
|
102136
102236
|
}
|
|
102137
|
-
return ok$
|
|
102237
|
+
return ok$4(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
|
|
102138
102238
|
}
|
|
102139
102239
|
({
|
|
102140
102240
|
kind: Kind.FIELD,
|
|
@@ -102159,17 +102259,17 @@ function extractIfArgument(directive, variables, directiveName) {
|
|
|
102159
102259
|
var _a;
|
|
102160
102260
|
const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
|
|
102161
102261
|
if (!ifArg) {
|
|
102162
|
-
return err$
|
|
102262
|
+
return err$4(new Error(`@${directiveName} directive requires an 'if' argument`));
|
|
102163
102263
|
}
|
|
102164
102264
|
const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
|
|
102165
102265
|
if (result.isErr()) {
|
|
102166
|
-
return err$
|
|
102266
|
+
return err$4(result.error);
|
|
102167
102267
|
}
|
|
102168
|
-
return ok$
|
|
102268
|
+
return ok$4(result.value);
|
|
102169
102269
|
}
|
|
102170
102270
|
function shouldSkip(selection, variables) {
|
|
102171
102271
|
if (!selection.directives || selection.directives.length === 0) {
|
|
102172
|
-
return ok$
|
|
102272
|
+
return ok$4(false);
|
|
102173
102273
|
}
|
|
102174
102274
|
for (const directive of selection.directives) {
|
|
102175
102275
|
if (directive.name.value === "skip") {
|
|
@@ -102178,7 +102278,7 @@ function shouldSkip(selection, variables) {
|
|
|
102178
102278
|
return ifResult;
|
|
102179
102279
|
}
|
|
102180
102280
|
if (ifResult.value === true) {
|
|
102181
|
-
return ok$
|
|
102281
|
+
return ok$4(true);
|
|
102182
102282
|
}
|
|
102183
102283
|
}
|
|
102184
102284
|
if (directive.name.value === "include") {
|
|
@@ -102187,11 +102287,11 @@ function shouldSkip(selection, variables) {
|
|
|
102187
102287
|
return ifResult;
|
|
102188
102288
|
}
|
|
102189
102289
|
if (ifResult.value === false) {
|
|
102190
|
-
return ok$
|
|
102290
|
+
return ok$4(true);
|
|
102191
102291
|
}
|
|
102192
102292
|
}
|
|
102193
102293
|
}
|
|
102194
|
-
return ok$
|
|
102294
|
+
return ok$4(false);
|
|
102195
102295
|
}
|
|
102196
102296
|
class BaseScalarFieldDef {
|
|
102197
102297
|
constructor(nullable) {
|
|
@@ -102199,11 +102299,11 @@ class BaseScalarFieldDef {
|
|
|
102199
102299
|
}
|
|
102200
102300
|
write(_cache, input) {
|
|
102201
102301
|
if (input.data === void 0) {
|
|
102202
|
-
return ok$
|
|
102302
|
+
return ok$4({ type: "missing" });
|
|
102203
102303
|
}
|
|
102204
102304
|
if (input.data === null) {
|
|
102205
102305
|
if (!this.nullable) {
|
|
102206
|
-
return err$
|
|
102306
|
+
return err$4([
|
|
102207
102307
|
{
|
|
102208
102308
|
type: "unknown",
|
|
102209
102309
|
error: new Error(
|
|
@@ -102213,14 +102313,14 @@ class BaseScalarFieldDef {
|
|
|
102213
102313
|
]);
|
|
102214
102314
|
}
|
|
102215
102315
|
}
|
|
102216
|
-
return ok$
|
|
102316
|
+
return ok$4({ type: "data", data: input.data });
|
|
102217
102317
|
}
|
|
102218
102318
|
read(_cache, input) {
|
|
102219
102319
|
const normalizedData = input.normalizedData;
|
|
102220
102320
|
if (normalizedData.type === "missing") {
|
|
102221
|
-
return ok$
|
|
102321
|
+
return ok$4(void 0);
|
|
102222
102322
|
}
|
|
102223
|
-
return ok$
|
|
102323
|
+
return ok$4(normalizedData.data);
|
|
102224
102324
|
}
|
|
102225
102325
|
augmentSelections(input) {
|
|
102226
102326
|
return input;
|
|
@@ -102242,11 +102342,11 @@ class BaseArrayFieldDef {
|
|
|
102242
102342
|
}
|
|
102243
102343
|
write(cache, input) {
|
|
102244
102344
|
if (input.data === void 0) {
|
|
102245
|
-
return ok$
|
|
102345
|
+
return ok$4({ type: "missing" });
|
|
102246
102346
|
}
|
|
102247
102347
|
if (input.data === null) {
|
|
102248
102348
|
if (!this.nullable) {
|
|
102249
|
-
return err$
|
|
102349
|
+
return err$4([
|
|
102250
102350
|
{
|
|
102251
102351
|
type: "unknown",
|
|
102252
102352
|
error: new Error(
|
|
@@ -102255,10 +102355,10 @@ class BaseArrayFieldDef {
|
|
|
102255
102355
|
}
|
|
102256
102356
|
]);
|
|
102257
102357
|
}
|
|
102258
|
-
return ok$
|
|
102358
|
+
return ok$4({ type: "data", data: input.data });
|
|
102259
102359
|
}
|
|
102260
102360
|
if (!Array.isArray(input.data)) {
|
|
102261
|
-
return err$
|
|
102361
|
+
return err$4([
|
|
102262
102362
|
{
|
|
102263
102363
|
type: "unknown",
|
|
102264
102364
|
error: new Error(
|
|
@@ -102286,18 +102386,18 @@ class BaseArrayFieldDef {
|
|
|
102286
102386
|
}
|
|
102287
102387
|
});
|
|
102288
102388
|
if (arrayNormalizationErrors.length > 0) {
|
|
102289
|
-
return err$
|
|
102389
|
+
return err$4(arrayNormalizationErrors);
|
|
102290
102390
|
}
|
|
102291
|
-
return ok$
|
|
102391
|
+
return ok$4({ type: "data", data: normalizedArray });
|
|
102292
102392
|
}
|
|
102293
102393
|
read(cache, input) {
|
|
102294
102394
|
const normalizedData = input.normalizedData;
|
|
102295
102395
|
if (normalizedData.type === "missing") {
|
|
102296
|
-
return ok$
|
|
102396
|
+
return ok$4(void 0);
|
|
102297
102397
|
}
|
|
102298
102398
|
if (normalizedData.data === null) {
|
|
102299
102399
|
if (!this.nullable) {
|
|
102300
|
-
return err$
|
|
102400
|
+
return err$4([
|
|
102301
102401
|
{
|
|
102302
102402
|
type: "unknown",
|
|
102303
102403
|
error: new Error(
|
|
@@ -102306,10 +102406,10 @@ class BaseArrayFieldDef {
|
|
|
102306
102406
|
}
|
|
102307
102407
|
]);
|
|
102308
102408
|
}
|
|
102309
|
-
return ok$
|
|
102409
|
+
return ok$4({ type: "data", data: null });
|
|
102310
102410
|
}
|
|
102311
102411
|
if (!Array.isArray(normalizedData.data)) {
|
|
102312
|
-
return err$
|
|
102412
|
+
return err$4([
|
|
102313
102413
|
{
|
|
102314
102414
|
type: "unknown",
|
|
102315
102415
|
error: new Error(
|
|
@@ -102334,9 +102434,9 @@ class BaseArrayFieldDef {
|
|
|
102334
102434
|
}
|
|
102335
102435
|
});
|
|
102336
102436
|
if (arrayDenormalizationErrors.length > 0) {
|
|
102337
|
-
return err$
|
|
102437
|
+
return err$4(arrayDenormalizationErrors);
|
|
102338
102438
|
}
|
|
102339
|
-
return ok$
|
|
102439
|
+
return ok$4(denormalizedArray);
|
|
102340
102440
|
}
|
|
102341
102441
|
}
|
|
102342
102442
|
class BaseObjectFieldDef {
|
|
@@ -102353,7 +102453,7 @@ class BaseObjectFieldDef {
|
|
|
102353
102453
|
write(cache, input) {
|
|
102354
102454
|
var _a;
|
|
102355
102455
|
if (!input.selection.selectionSet) {
|
|
102356
|
-
return err$
|
|
102456
|
+
return err$4([
|
|
102357
102457
|
{
|
|
102358
102458
|
type: "unknown",
|
|
102359
102459
|
error: new Error(
|
|
@@ -102363,11 +102463,11 @@ class BaseObjectFieldDef {
|
|
|
102363
102463
|
]);
|
|
102364
102464
|
}
|
|
102365
102465
|
if (input.data === void 0) {
|
|
102366
|
-
return ok$
|
|
102466
|
+
return ok$4({ type: "missing" });
|
|
102367
102467
|
}
|
|
102368
102468
|
if (input.data === null) {
|
|
102369
102469
|
if (!this.nullable) {
|
|
102370
|
-
return err$
|
|
102470
|
+
return err$4([
|
|
102371
102471
|
{
|
|
102372
102472
|
type: "unknown",
|
|
102373
102473
|
error: new Error(
|
|
@@ -102376,7 +102476,7 @@ class BaseObjectFieldDef {
|
|
|
102376
102476
|
}
|
|
102377
102477
|
]);
|
|
102378
102478
|
}
|
|
102379
|
-
return ok$
|
|
102479
|
+
return ok$4({ type: "data", data: null });
|
|
102380
102480
|
}
|
|
102381
102481
|
const writeResult = this.repository.write(cache, {
|
|
102382
102482
|
...input,
|
|
@@ -102389,12 +102489,12 @@ class BaseObjectFieldDef {
|
|
|
102389
102489
|
if (writeResult.isErr()) {
|
|
102390
102490
|
return writeResult;
|
|
102391
102491
|
}
|
|
102392
|
-
return ok$
|
|
102492
|
+
return ok$4({ type: "data", data: writeResult.value });
|
|
102393
102493
|
}
|
|
102394
102494
|
read(cache, input) {
|
|
102395
102495
|
var _a;
|
|
102396
102496
|
if (!input.selection.selectionSet) {
|
|
102397
|
-
return err$
|
|
102497
|
+
return err$4([
|
|
102398
102498
|
{
|
|
102399
102499
|
type: "unknown",
|
|
102400
102500
|
error: new Error(
|
|
@@ -102405,11 +102505,11 @@ class BaseObjectFieldDef {
|
|
|
102405
102505
|
}
|
|
102406
102506
|
const normalizedData = input.normalizedData;
|
|
102407
102507
|
if (normalizedData.type === "missing") {
|
|
102408
|
-
return ok$
|
|
102508
|
+
return ok$4(void 0);
|
|
102409
102509
|
}
|
|
102410
102510
|
if (normalizedData.data === null) {
|
|
102411
102511
|
if (!this.nullable) {
|
|
102412
|
-
return err$
|
|
102512
|
+
return err$4([
|
|
102413
102513
|
{
|
|
102414
102514
|
type: "unknown",
|
|
102415
102515
|
error: new Error(
|
|
@@ -102418,7 +102518,7 @@ class BaseObjectFieldDef {
|
|
|
102418
102518
|
}
|
|
102419
102519
|
]);
|
|
102420
102520
|
}
|
|
102421
|
-
return ok$
|
|
102521
|
+
return ok$4(null);
|
|
102422
102522
|
}
|
|
102423
102523
|
return this.repository.read(cache, {
|
|
102424
102524
|
...input,
|
|
@@ -102701,7 +102801,7 @@ class BaseGraphQLTypeRepository {
|
|
|
102701
102801
|
var _a;
|
|
102702
102802
|
const fieldDef = this.getFieldDef(input, selection);
|
|
102703
102803
|
if (!fieldDef) {
|
|
102704
|
-
return err$
|
|
102804
|
+
return err$4(
|
|
102705
102805
|
new Error(
|
|
102706
102806
|
`Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
|
|
102707
102807
|
)
|
|
@@ -102712,10 +102812,10 @@ class BaseGraphQLTypeRepository {
|
|
|
102712
102812
|
input.request.definitions.variables
|
|
102713
102813
|
);
|
|
102714
102814
|
if (cacheFieldKeyResult.isErr()) {
|
|
102715
|
-
return err$
|
|
102815
|
+
return err$4(cacheFieldKeyResult.error);
|
|
102716
102816
|
}
|
|
102717
102817
|
const cacheFieldKey = cacheFieldKeyResult.value;
|
|
102718
|
-
return ok$
|
|
102818
|
+
return ok$4((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
|
|
102719
102819
|
}
|
|
102720
102820
|
denormalizeFieldSelection(cache, input, selection, errorCollector) {
|
|
102721
102821
|
var _a;
|
|
@@ -102821,22 +102921,22 @@ class BaseGraphQLTypeRepository {
|
|
|
102821
102921
|
return shouldSkipResult;
|
|
102822
102922
|
}
|
|
102823
102923
|
if (shouldSkipResult.value) {
|
|
102824
|
-
return ok$
|
|
102924
|
+
return ok$4(false);
|
|
102825
102925
|
}
|
|
102826
102926
|
return this.satisfiesFragmentTypeCondition(input, fragment);
|
|
102827
102927
|
}
|
|
102828
102928
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
102829
102929
|
if (!fragment.typeCondition) {
|
|
102830
|
-
return ok$
|
|
102930
|
+
return ok$4(true);
|
|
102831
102931
|
}
|
|
102832
102932
|
const conditionalTypeName = fragment.typeCondition.name.value;
|
|
102833
102933
|
if (conditionalTypeName === this.typeName) {
|
|
102834
|
-
return ok$
|
|
102934
|
+
return ok$4(true);
|
|
102835
102935
|
}
|
|
102836
102936
|
if (this.implementedInterfaces.includes(conditionalTypeName)) {
|
|
102837
|
-
return ok$
|
|
102937
|
+
return ok$4(true);
|
|
102838
102938
|
}
|
|
102839
|
-
return ok$
|
|
102939
|
+
return ok$4(false);
|
|
102840
102940
|
}
|
|
102841
102941
|
getCacheKeyFieldArguments(selection) {
|
|
102842
102942
|
return selection.arguments;
|
|
@@ -102895,7 +102995,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
102895
102995
|
const key = this.buildKey(this.buildKeyParams(input));
|
|
102896
102996
|
const normalized = this.normalizeData(cache, input);
|
|
102897
102997
|
if (normalized.isErr()) {
|
|
102898
|
-
return err$
|
|
102998
|
+
return err$4(normalized.error);
|
|
102899
102999
|
}
|
|
102900
103000
|
const existing = cache.get(key);
|
|
102901
103001
|
if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
|
|
@@ -102904,7 +103004,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
102904
103004
|
metadata: this.cacheMetadata
|
|
102905
103005
|
});
|
|
102906
103006
|
}
|
|
102907
|
-
return ok$
|
|
103007
|
+
return ok$4({
|
|
102908
103008
|
type: "link",
|
|
102909
103009
|
linkedKey: key
|
|
102910
103010
|
});
|
|
@@ -102919,7 +103019,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
|
|
|
102919
103019
|
if (normalizeDataResult.isErr()) {
|
|
102920
103020
|
return normalizeDataResult;
|
|
102921
103021
|
}
|
|
102922
|
-
return ok$
|
|
103022
|
+
return ok$4(
|
|
102923
103023
|
deepMerge$2(
|
|
102924
103024
|
{},
|
|
102925
103025
|
(existingNormalizedData == null ? void 0 : existingNormalizedData.value) || {},
|
|
@@ -102989,7 +103089,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
102989
103089
|
if (result.isErr()) {
|
|
102990
103090
|
return result;
|
|
102991
103091
|
}
|
|
102992
|
-
return ok$
|
|
103092
|
+
return ok$4({
|
|
102993
103093
|
data: result.value
|
|
102994
103094
|
});
|
|
102995
103095
|
}
|
|
@@ -102997,7 +103097,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
102997
103097
|
var _a;
|
|
102998
103098
|
const operationResult = findExecutableOperation(input);
|
|
102999
103099
|
if (operationResult.isErr()) {
|
|
103000
|
-
return err$
|
|
103100
|
+
return err$4(operationResult.error);
|
|
103001
103101
|
}
|
|
103002
103102
|
const operation = operationResult.value;
|
|
103003
103103
|
const fragmentDefinitions = input.query.definitions.filter(
|
|
@@ -103020,7 +103120,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
|
|
|
103020
103120
|
...operation,
|
|
103021
103121
|
selectionSet: { kind: Kind.SELECTION_SET, selections: augmentedOperationSelections }
|
|
103022
103122
|
};
|
|
103023
|
-
return ok$
|
|
103123
|
+
return ok$4({
|
|
103024
103124
|
...input.query,
|
|
103025
103125
|
definitions: [
|
|
103026
103126
|
...input.query.definitions.filter((def) => def.kind !== Kind.FRAGMENT_DEFINITION).map((def) => {
|
|
@@ -103055,7 +103155,7 @@ class BaseInterfaceRepository {
|
|
|
103055
103155
|
}
|
|
103056
103156
|
write(cache, input) {
|
|
103057
103157
|
if (typeof input.data !== "object") {
|
|
103058
|
-
return err$
|
|
103158
|
+
return err$4([
|
|
103059
103159
|
{
|
|
103060
103160
|
type: "unknown",
|
|
103061
103161
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -103065,7 +103165,7 @@ class BaseInterfaceRepository {
|
|
|
103065
103165
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
103066
103166
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
103067
103167
|
if (!concreteTypeRepository) {
|
|
103068
|
-
return err$
|
|
103168
|
+
return err$4([
|
|
103069
103169
|
{
|
|
103070
103170
|
type: "unknown",
|
|
103071
103171
|
error: new Error(
|
|
@@ -103076,7 +103176,7 @@ class BaseInterfaceRepository {
|
|
|
103076
103176
|
}
|
|
103077
103177
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
103078
103178
|
if (selectionErr) {
|
|
103079
|
-
return err$
|
|
103179
|
+
return err$4(selectionErr);
|
|
103080
103180
|
}
|
|
103081
103181
|
const normalizeInput = {
|
|
103082
103182
|
...input,
|
|
@@ -103088,14 +103188,14 @@ class BaseInterfaceRepository {
|
|
|
103088
103188
|
};
|
|
103089
103189
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
103090
103190
|
if (result.isOk()) {
|
|
103091
|
-
return ok$
|
|
103191
|
+
return ok$4({ discriminator, data: result.value });
|
|
103092
103192
|
}
|
|
103093
103193
|
return result;
|
|
103094
103194
|
}
|
|
103095
103195
|
read(cache, input) {
|
|
103096
103196
|
const unionRep = input.normalizedData;
|
|
103097
103197
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
103098
|
-
return err$
|
|
103198
|
+
return err$4([
|
|
103099
103199
|
{
|
|
103100
103200
|
type: "unknown",
|
|
103101
103201
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -103105,7 +103205,7 @@ class BaseInterfaceRepository {
|
|
|
103105
103205
|
const discriminator = unionRep.discriminator;
|
|
103106
103206
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
103107
103207
|
if (!concreteRepository) {
|
|
103108
|
-
return err$
|
|
103208
|
+
return err$4([
|
|
103109
103209
|
{
|
|
103110
103210
|
type: "unknown",
|
|
103111
103211
|
error: new Error(
|
|
@@ -103116,7 +103216,7 @@ class BaseInterfaceRepository {
|
|
|
103116
103216
|
}
|
|
103117
103217
|
const selectionErr = this.verifyInterfaceFields(input.selections);
|
|
103118
103218
|
if (selectionErr) {
|
|
103119
|
-
return err$
|
|
103219
|
+
return err$4(selectionErr);
|
|
103120
103220
|
}
|
|
103121
103221
|
const denormalizeInput = {
|
|
103122
103222
|
...input,
|
|
@@ -103221,7 +103321,7 @@ class BaseUnionRepository {
|
|
|
103221
103321
|
}
|
|
103222
103322
|
write(cache, input) {
|
|
103223
103323
|
if (typeof input.data !== "object") {
|
|
103224
|
-
return err$
|
|
103324
|
+
return err$4([
|
|
103225
103325
|
{
|
|
103226
103326
|
type: "unknown",
|
|
103227
103327
|
error: new Error(`Got a non-object value for ${this.typeName} field"`)
|
|
@@ -103231,7 +103331,7 @@ class BaseUnionRepository {
|
|
|
103231
103331
|
const discriminator = this.getTypeDiscriminator(input.data, input.selections);
|
|
103232
103332
|
const concreteTypeRepository = this.possibleTypes[discriminator];
|
|
103233
103333
|
if (!concreteTypeRepository) {
|
|
103234
|
-
return err$
|
|
103334
|
+
return err$4([
|
|
103235
103335
|
{
|
|
103236
103336
|
type: "unknown",
|
|
103237
103337
|
error: new Error(
|
|
@@ -103242,7 +103342,7 @@ class BaseUnionRepository {
|
|
|
103242
103342
|
}
|
|
103243
103343
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
103244
103344
|
if (selectionErr) {
|
|
103245
|
-
return err$
|
|
103345
|
+
return err$4(selectionErr);
|
|
103246
103346
|
}
|
|
103247
103347
|
const normalizeInput = {
|
|
103248
103348
|
...input,
|
|
@@ -103254,14 +103354,14 @@ class BaseUnionRepository {
|
|
|
103254
103354
|
};
|
|
103255
103355
|
const result = concreteTypeRepository.write(cache, normalizeInput);
|
|
103256
103356
|
if (result.isOk()) {
|
|
103257
|
-
return ok$
|
|
103357
|
+
return ok$4({ discriminator, data: result.value });
|
|
103258
103358
|
}
|
|
103259
103359
|
return result;
|
|
103260
103360
|
}
|
|
103261
103361
|
read(cache, input) {
|
|
103262
103362
|
const unionRep = input.normalizedData;
|
|
103263
103363
|
if (typeof unionRep.data !== "object" || unionRep.data === null) {
|
|
103264
|
-
return err$
|
|
103364
|
+
return err$4([
|
|
103265
103365
|
{
|
|
103266
103366
|
type: "unknown",
|
|
103267
103367
|
error: new Error(`Got a non-object value for ${this.typeName} field.`)
|
|
@@ -103271,7 +103371,7 @@ class BaseUnionRepository {
|
|
|
103271
103371
|
const discriminator = unionRep.discriminator;
|
|
103272
103372
|
const concreteRepository = this.possibleTypes[discriminator];
|
|
103273
103373
|
if (!concreteRepository) {
|
|
103274
|
-
return err$
|
|
103374
|
+
return err$4([
|
|
103275
103375
|
{
|
|
103276
103376
|
type: "unknown",
|
|
103277
103377
|
error: new Error(
|
|
@@ -103282,7 +103382,7 @@ class BaseUnionRepository {
|
|
|
103282
103382
|
}
|
|
103283
103383
|
const selectionErr = this.verifyUnionFields(input.selections);
|
|
103284
103384
|
if (selectionErr) {
|
|
103285
|
-
return err$
|
|
103385
|
+
return err$4(selectionErr);
|
|
103286
103386
|
}
|
|
103287
103387
|
const denormalizeInput = {
|
|
103288
103388
|
...input,
|
|
@@ -115035,15 +115135,13 @@ getServices(serviceRequirements).then((services) => {
|
|
|
115035
115135
|
const graphql_state_manager_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_state_manager');
|
|
115036
115136
|
const factory = (config) => {
|
|
115037
115137
|
assertIsValid(config, CONFIG_SCHEMA);
|
|
115038
|
-
|
|
115039
|
-
|
|
115040
|
-
|
|
115041
|
-
|
|
115042
|
-
|
|
115043
|
-
}
|
|
115044
|
-
config = { ...config, query };
|
|
115138
|
+
const validatedConfig = resolveAndValidateGraphQLConfig(config, {
|
|
115139
|
+
acceptedOperations: ['query'],
|
|
115140
|
+
});
|
|
115141
|
+
if (validatedConfig === undefined || validatedConfig.isErr()) {
|
|
115142
|
+
throw new Error('Internal error in GraphQL adapter occurred: Unable to resolve query');
|
|
115045
115143
|
}
|
|
115046
|
-
return new graphql_state_manager_ctor(
|
|
115144
|
+
return new graphql_state_manager_ctor(validatedConfig.value, documentRootType, services);
|
|
115047
115145
|
};
|
|
115048
115146
|
graphql_state_manager = createStateManager(factory, ['query'], ['variables', 'operationName']);
|
|
115049
115147
|
const executeMutation_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphqlCommand');
|
|
@@ -115068,7 +115166,7 @@ function registerCallback(cb) {
|
|
|
115068
115166
|
cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
|
|
115069
115167
|
}
|
|
115070
115168
|
}
|
|
115071
|
-
// version: 1.
|
|
115169
|
+
// version: 1.414.0-3d95b40524
|
|
115072
115170
|
|
|
115073
115171
|
function createFragmentMap(documentNode) {
|
|
115074
115172
|
const fragments = {};
|
|
@@ -144293,7 +144391,7 @@ register$1({
|
|
|
144293
144391
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
144294
144392
|
instrument: instrument$1,
|
|
144295
144393
|
});
|
|
144296
|
-
// version: 1.
|
|
144394
|
+
// version: 1.414.0-3d95b40524
|
|
144297
144395
|
|
|
144298
144396
|
// On core the unstable adapters are re-exported with different names,
|
|
144299
144397
|
// we want to match them here.
|
|
@@ -144445,7 +144543,7 @@ withDefaultLuvio((luvio) => {
|
|
|
144445
144543
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
144446
144544
|
graphQLImperative = ldsAdapter;
|
|
144447
144545
|
});
|
|
144448
|
-
// version: 1.
|
|
144546
|
+
// version: 1.414.0-3d95b40524
|
|
144449
144547
|
|
|
144450
144548
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
144451
144549
|
__proto__: null,
|
|
@@ -145244,7 +145342,7 @@ const callbacks$1 = [];
|
|
|
145244
145342
|
function register(r) {
|
|
145245
145343
|
callbacks$1.forEach((callback) => callback(r));
|
|
145246
145344
|
}
|
|
145247
|
-
// version: 1.
|
|
145345
|
+
// version: 1.414.0-ff06871479
|
|
145248
145346
|
|
|
145249
145347
|
/**
|
|
145250
145348
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -146560,4 +146658,4 @@ const { luvio } = getRuntime();
|
|
|
146560
146658
|
setDefaultLuvio({ luvio });
|
|
146561
146659
|
|
|
146562
146660
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
146563
|
-
// version: 1.
|
|
146661
|
+
// version: 1.414.0-ff06871479
|