@salesforce/lds-worker-api 1.380.0-dev1 → 1.380.0-dev2
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.380.0-
|
|
4283
|
+
// version: 1.380.0-dev2-40594334e8
|
|
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.380.0-
|
|
5327
|
+
// version: 1.380.0-dev2-40594334e8
|
|
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.380.0-
|
|
34163
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
34164
34164
|
|
|
34165
34165
|
function requestIdleDetectedCallback(_callback) { }
|
|
34166
34166
|
function declareNotifierTaskSingle(_name) {
|
|
@@ -95887,7 +95887,7 @@
|
|
|
95887
95887
|
},
|
|
95888
95888
|
};
|
|
95889
95889
|
}
|
|
95890
|
-
// version: 1.380.0-
|
|
95890
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
95891
95891
|
|
|
95892
95892
|
/**
|
|
95893
95893
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -95913,7 +95913,7 @@
|
|
|
95913
95913
|
},
|
|
95914
95914
|
};
|
|
95915
95915
|
}
|
|
95916
|
-
// version: 1.380.0-
|
|
95916
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
95917
95917
|
|
|
95918
95918
|
/*!
|
|
95919
95919
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96796,7 +96796,7 @@
|
|
|
96796
96796
|
};
|
|
96797
96797
|
return prev;
|
|
96798
96798
|
}, {})) || {};
|
|
96799
|
-
const fragments = input.query.definitions.filter(
|
|
96799
|
+
const fragments = input.query.definitions.filter(isFragmentDefinition$1).reduce((prev, fragment) => {
|
|
96800
96800
|
prev[fragment.name.value] = fragment;
|
|
96801
96801
|
return prev;
|
|
96802
96802
|
}, {});
|
|
@@ -96806,6 +96806,47 @@
|
|
|
96806
96806
|
parentFieldSelection: void 0
|
|
96807
96807
|
});
|
|
96808
96808
|
}
|
|
96809
|
+
const TYPENAME_FIELD = {
|
|
96810
|
+
kind: Kind$2.FIELD,
|
|
96811
|
+
name: {
|
|
96812
|
+
kind: Kind$2.NAME,
|
|
96813
|
+
value: "__typename"
|
|
96814
|
+
}
|
|
96815
|
+
};
|
|
96816
|
+
function addTypenameToDocument(doc) {
|
|
96817
|
+
return visit(doc, {
|
|
96818
|
+
SelectionSet: {
|
|
96819
|
+
enter(node, _key, parent) {
|
|
96820
|
+
if (isOperationDefinition(parent)) {
|
|
96821
|
+
return;
|
|
96822
|
+
}
|
|
96823
|
+
const { selections } = node;
|
|
96824
|
+
if (!selections || selections.length === 0) {
|
|
96825
|
+
return;
|
|
96826
|
+
}
|
|
96827
|
+
const skip = selections.some((selection) => {
|
|
96828
|
+
return isField$1(selection) && (selection.name.value === "__typename" || selection.name.value.lastIndexOf("__", 0) === 0);
|
|
96829
|
+
});
|
|
96830
|
+
if (skip) {
|
|
96831
|
+
return;
|
|
96832
|
+
}
|
|
96833
|
+
return {
|
|
96834
|
+
...node,
|
|
96835
|
+
selections: [...selections, TYPENAME_FIELD]
|
|
96836
|
+
};
|
|
96837
|
+
}
|
|
96838
|
+
}
|
|
96839
|
+
});
|
|
96840
|
+
}
|
|
96841
|
+
function isOperationDefinition(parent) {
|
|
96842
|
+
return !!parent && !Array.isArray(parent) && parent.kind === Kind$2.OPERATION_DEFINITION;
|
|
96843
|
+
}
|
|
96844
|
+
function isField$1(node) {
|
|
96845
|
+
return node.kind === Kind$2.FIELD;
|
|
96846
|
+
}
|
|
96847
|
+
function isFragmentDefinition$1(node) {
|
|
96848
|
+
return node.kind === Kind$2.FRAGMENT_DEFINITION;
|
|
96849
|
+
}
|
|
96809
96850
|
|
|
96810
96851
|
/*!
|
|
96811
96852
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -96929,7 +96970,7 @@
|
|
|
96929
96970
|
if (augmentedQueryResult.isErr()) {
|
|
96930
96971
|
throw augmentedQueryResult.error;
|
|
96931
96972
|
}
|
|
96932
|
-
return augmentedQueryResult.value;
|
|
96973
|
+
return addTypenameToDocument(augmentedQueryResult.value);
|
|
96933
96974
|
}
|
|
96934
96975
|
buildWriteInput(data) {
|
|
96935
96976
|
const extensionResult = buildGraphQLInputExtension$1({
|
|
@@ -97023,7 +97064,7 @@
|
|
|
97023
97064
|
if (augmentedQueryResult.isErr()) {
|
|
97024
97065
|
throw augmentedQueryResult.error;
|
|
97025
97066
|
}
|
|
97026
|
-
return augmentedQueryResult.value;
|
|
97067
|
+
return addTypenameToDocument(augmentedQueryResult.value);
|
|
97027
97068
|
}
|
|
97028
97069
|
buildWriteInput(data) {
|
|
97029
97070
|
const extensionResult = buildGraphQLInputExtension$1({
|
|
@@ -98029,7 +98070,7 @@
|
|
|
98029
98070
|
id: '@salesforce/lds-network-adapter',
|
|
98030
98071
|
instrument: instrument$2,
|
|
98031
98072
|
});
|
|
98032
|
-
// version: 1.380.0-
|
|
98073
|
+
// version: 1.380.0-dev2-40594334e8
|
|
98033
98074
|
|
|
98034
98075
|
const { create: create$3, keys: keys$3 } = Object;
|
|
98035
98076
|
const { stringify: stringify$1, parse } = JSON;
|
|
@@ -98987,7 +99028,7 @@
|
|
|
98987
99028
|
};
|
|
98988
99029
|
return prev;
|
|
98989
99030
|
}, {})) || {};
|
|
98990
|
-
const fragments = input.query.definitions.filter(
|
|
99031
|
+
const fragments = input.query.definitions.filter(isFragmentDefinition).reduce((prev, fragment) => {
|
|
98991
99032
|
prev[fragment.name.value] = fragment;
|
|
98992
99033
|
return prev;
|
|
98993
99034
|
}, {});
|
|
@@ -99028,14 +99069,14 @@
|
|
|
99028
99069
|
var _a;
|
|
99029
99070
|
const fieldNames = /* @__PURE__ */ new Set();
|
|
99030
99071
|
for (const selection of selections) {
|
|
99031
|
-
if (selection
|
|
99072
|
+
if (isField(selection)) {
|
|
99032
99073
|
fieldNames.add(((_a = selection.alias) == null ? void 0 : _a.value) || selection.name.value);
|
|
99033
|
-
} else if (selection
|
|
99074
|
+
} else if (isInlineFragment(selection)) {
|
|
99034
99075
|
collectFieldNames(
|
|
99035
99076
|
selection.selectionSet.selections,
|
|
99036
99077
|
fragments
|
|
99037
99078
|
).forEach((name) => fieldNames.add(name));
|
|
99038
|
-
} else if (selection
|
|
99079
|
+
} else if (isFragmentSpread(selection)) {
|
|
99039
99080
|
const fragment = fragments[selection.name.value];
|
|
99040
99081
|
if (fragment) {
|
|
99041
99082
|
collectFieldNames(
|
|
@@ -99065,6 +99106,25 @@
|
|
|
99065
99106
|
}
|
|
99066
99107
|
return ok$4(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
|
|
99067
99108
|
}
|
|
99109
|
+
({
|
|
99110
|
+
kind: Kind.FIELD,
|
|
99111
|
+
name: {
|
|
99112
|
+
kind: Kind.NAME,
|
|
99113
|
+
value: "__typename"
|
|
99114
|
+
}
|
|
99115
|
+
});
|
|
99116
|
+
function isField(node) {
|
|
99117
|
+
return node.kind === Kind.FIELD;
|
|
99118
|
+
}
|
|
99119
|
+
function isFragmentSpread(node) {
|
|
99120
|
+
return node.kind === Kind.FRAGMENT_SPREAD;
|
|
99121
|
+
}
|
|
99122
|
+
function isInlineFragment(node) {
|
|
99123
|
+
return node.kind === Kind.INLINE_FRAGMENT;
|
|
99124
|
+
}
|
|
99125
|
+
function isFragmentDefinition(node) {
|
|
99126
|
+
return node.kind === Kind.FRAGMENT_DEFINITION;
|
|
99127
|
+
}
|
|
99068
99128
|
function extractIfArgument(directive, variables, directiveName) {
|
|
99069
99129
|
var _a;
|
|
99070
99130
|
const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
|
|
@@ -99348,11 +99408,11 @@
|
|
|
99348
99408
|
const augmentedSelections = [];
|
|
99349
99409
|
let augmentedFragments = { ...input.fragments };
|
|
99350
99410
|
for (const selection of input.selections) {
|
|
99351
|
-
if (selection
|
|
99411
|
+
if (isField(selection)) {
|
|
99352
99412
|
const result = this.augmentFieldSelection(selection, augmentedFragments);
|
|
99353
99413
|
augmentedSelections.push(...result.selections);
|
|
99354
99414
|
augmentedFragments = result.fragments;
|
|
99355
|
-
} else if (selection
|
|
99415
|
+
} else if (isInlineFragment(selection)) {
|
|
99356
99416
|
const augmentedFragmentSelections = this.augmentInlineFragmentSelection(
|
|
99357
99417
|
selection,
|
|
99358
99418
|
augmentedFragments
|
|
@@ -99467,14 +99527,14 @@
|
|
|
99467
99527
|
const normalized = {};
|
|
99468
99528
|
const errors = [];
|
|
99469
99529
|
for (const selection of input.selections) {
|
|
99470
|
-
if (selection
|
|
99530
|
+
if (isField(selection)) {
|
|
99471
99531
|
deepMerge$2(
|
|
99472
99532
|
normalized,
|
|
99473
99533
|
this.normalizeFieldSelection(cache, input, selection, errors)
|
|
99474
99534
|
);
|
|
99475
99535
|
} else {
|
|
99476
99536
|
let fragment;
|
|
99477
|
-
if (selection
|
|
99537
|
+
if (isInlineFragment(selection)) {
|
|
99478
99538
|
fragment = selection;
|
|
99479
99539
|
} else {
|
|
99480
99540
|
const fragmentDefinition = input.request.definitions.fragments[selection.name.value];
|
|
@@ -99579,14 +99639,14 @@
|
|
|
99579
99639
|
const errors = [];
|
|
99580
99640
|
const denormalized = {};
|
|
99581
99641
|
for (const selection of input.selections) {
|
|
99582
|
-
if (selection
|
|
99642
|
+
if (isField(selection)) {
|
|
99583
99643
|
deepMerge$2(
|
|
99584
99644
|
denormalized,
|
|
99585
99645
|
this.denormalizeFieldSelection(cache, input, selection, errors)
|
|
99586
99646
|
);
|
|
99587
99647
|
} else {
|
|
99588
99648
|
let fragment;
|
|
99589
|
-
if (selection
|
|
99649
|
+
if (isInlineFragment(selection)) {
|
|
99590
99650
|
fragment = selection;
|
|
99591
99651
|
} else {
|
|
99592
99652
|
const fragmentDefinition = input.request.definitions.fragments[selection.name.value];
|
|
@@ -99844,6 +99904,19 @@
|
|
|
99844
99904
|
buildFieldKey(selection, variables) {
|
|
99845
99905
|
return this.graphqlRepository.buildFieldKey(selection, variables);
|
|
99846
99906
|
}
|
|
99907
|
+
buildKeyParams(input) {
|
|
99908
|
+
var _a;
|
|
99909
|
+
const idField = input.selections.find(
|
|
99910
|
+
(selection) => selection.kind === Kind.FIELD && selection.name.value === this.idField
|
|
99911
|
+
);
|
|
99912
|
+
if (!idField) {
|
|
99913
|
+
throw new Error(`Id field ${this.idField} not found in selections`);
|
|
99914
|
+
}
|
|
99915
|
+
const idFieldDataProperty = ((_a = idField.alias) == null ? void 0 : _a.value) || idField.name.value;
|
|
99916
|
+
return {
|
|
99917
|
+
[this.idField]: input.data[idFieldDataProperty]
|
|
99918
|
+
};
|
|
99919
|
+
}
|
|
99847
99920
|
}
|
|
99848
99921
|
class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepository {
|
|
99849
99922
|
constructor() {
|
|
@@ -100389,6 +100462,25 @@
|
|
|
100389
100462
|
(validationError) => validationError instanceof MissingRequiredPropertyError
|
|
100390
100463
|
) !== void 0;
|
|
100391
100464
|
}
|
|
100465
|
+
function resolveAst(ast) {
|
|
100466
|
+
if (ast === null) {
|
|
100467
|
+
return;
|
|
100468
|
+
}
|
|
100469
|
+
const result = astResolver(ast);
|
|
100470
|
+
if (result === void 0) {
|
|
100471
|
+
throw new Error("Could not resolve AST. Did you parse the query with gql?");
|
|
100472
|
+
}
|
|
100473
|
+
return result;
|
|
100474
|
+
}
|
|
100475
|
+
function wrapConfigAndVerify(config) {
|
|
100476
|
+
if (config == null ? void 0 : config.query) {
|
|
100477
|
+
config = { ...config, query: resolveAst(config.query) };
|
|
100478
|
+
if (config.query === void 0) {
|
|
100479
|
+
throw new Error("Internal error in GraphQL adapter occurred: Unable to resolve query");
|
|
100480
|
+
}
|
|
100481
|
+
}
|
|
100482
|
+
return config;
|
|
100483
|
+
}
|
|
100392
100484
|
class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor {
|
|
100393
100485
|
emit(result) {
|
|
100394
100486
|
try {
|
|
@@ -100459,13 +100551,14 @@
|
|
|
100459
100551
|
this.unsubscribe();
|
|
100460
100552
|
this.config = {
|
|
100461
100553
|
...sanitize(config),
|
|
100462
|
-
query: config.query
|
|
100554
|
+
query: resolveAst(config.query)
|
|
100463
100555
|
};
|
|
100464
100556
|
this.invokeAdapter();
|
|
100465
100557
|
}
|
|
100466
100558
|
}
|
|
100467
100559
|
function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
|
|
100468
100560
|
const invoke = async (config, requestContext, callback) => {
|
|
100561
|
+
config = wrapConfigAndVerify(config);
|
|
100469
100562
|
const command = getCommand({ config, assertIsValid });
|
|
100470
100563
|
try {
|
|
100471
100564
|
const overrides = requestContextIsCachePolicy(requestContext) ? { cacheControlConfig: { type: "no-cache" } } : {};
|
|
@@ -100498,6 +100591,7 @@
|
|
|
100498
100591
|
}
|
|
100499
100592
|
};
|
|
100500
100593
|
const subscribe = (config, requestContext, callback) => {
|
|
100594
|
+
config = wrapConfigAndVerify(config);
|
|
100501
100595
|
const command = getCommand({ config, assertIsValid });
|
|
100502
100596
|
let unsubscribe = () => {
|
|
100503
100597
|
};
|
|
@@ -100558,14 +100652,7 @@
|
|
|
100558
100652
|
function requestContextIsCachePolicy(requestContext) {
|
|
100559
100653
|
return typeof requestContext === "object" && requestContext !== null && "cachePolicy" in requestContext && typeof requestContext.cachePolicy === "object" && requestContext.cachePolicy !== null && "type" in requestContext.cachePolicy && requestContext.cachePolicy.type === "no-cache";
|
|
100560
100654
|
}
|
|
100561
|
-
|
|
100562
|
-
const result = astResolver(ast);
|
|
100563
|
-
if (result === void 0) {
|
|
100564
|
-
throw new Error("Could not resolve AST. Did you parse the query with gql?");
|
|
100565
|
-
}
|
|
100566
|
-
return result;
|
|
100567
|
-
}
|
|
100568
|
-
// version: 1.380.0-dev1-b7c5fad9db
|
|
100655
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
100569
100656
|
|
|
100570
100657
|
class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
|
|
100571
100658
|
constructor(services, typeRegistry) {
|
|
@@ -100630,6 +100717,7 @@
|
|
|
100630
100717
|
this.namespace = "oas";
|
|
100631
100718
|
this.typeName = "Analytics__AnalyticsRepresentation";
|
|
100632
100719
|
this.implementedInterfaces = ["Analytics__AnalyticsRepresentationInterface"];
|
|
100720
|
+
this.idField = "Id";
|
|
100633
100721
|
}
|
|
100634
100722
|
get fields() {
|
|
100635
100723
|
return {
|
|
@@ -100648,9 +100736,6 @@
|
|
|
100648
100736
|
Dataspaces: new BaseArrayFieldDef(new BaseObjectFieldDef(this.typeRegistry.Analytics__DataspaceRepresentation, true), true),
|
|
100649
100737
|
};
|
|
100650
100738
|
}
|
|
100651
|
-
buildKeyParams(input) {
|
|
100652
|
-
return { Id: input.data.Id };
|
|
100653
|
-
}
|
|
100654
100739
|
get cacheControl() {
|
|
100655
100740
|
return { type: "max-age", maxAge: 60 };
|
|
100656
100741
|
}
|
|
@@ -100721,6 +100806,7 @@
|
|
|
100721
100806
|
this.namespace = "oas";
|
|
100722
100807
|
this.typeName = "Analytics__AnalyticsWorkspace";
|
|
100723
100808
|
this.implementedInterfaces = [];
|
|
100809
|
+
this.idField = "Id";
|
|
100724
100810
|
}
|
|
100725
100811
|
get fields() {
|
|
100726
100812
|
return {
|
|
@@ -100735,9 +100821,6 @@
|
|
|
100735
100821
|
ApiName: new BaseScalarFieldDef(false),
|
|
100736
100822
|
};
|
|
100737
100823
|
}
|
|
100738
|
-
buildKeyParams(input) {
|
|
100739
|
-
return { Id: input.data.Id };
|
|
100740
|
-
}
|
|
100741
100824
|
get cacheControl() {
|
|
100742
100825
|
return { type: "max-age", maxAge: 60 };
|
|
100743
100826
|
}
|
|
@@ -100751,6 +100834,7 @@
|
|
|
100751
100834
|
this.namespace = "oas";
|
|
100752
100835
|
this.typeName = "Analytics__DataspaceRepresentation";
|
|
100753
100836
|
this.implementedInterfaces = [];
|
|
100837
|
+
this.idField = "Id";
|
|
100754
100838
|
}
|
|
100755
100839
|
get fields() {
|
|
100756
100840
|
return {
|
|
@@ -100761,9 +100845,6 @@
|
|
|
100761
100845
|
DeveloperName: new BaseScalarFieldDef(true),
|
|
100762
100846
|
};
|
|
100763
100847
|
}
|
|
100764
|
-
buildKeyParams(input) {
|
|
100765
|
-
return { Id: input.data.Id };
|
|
100766
|
-
}
|
|
100767
100848
|
get cacheControl() {
|
|
100768
100849
|
return { type: "max-age", maxAge: 60 };
|
|
100769
100850
|
}
|
|
@@ -101941,6 +102022,7 @@
|
|
|
101941
102022
|
this.namespace = "oas";
|
|
101942
102023
|
this.typeName = "RecordRepresentation";
|
|
101943
102024
|
this.implementedInterfaces = ["Record"];
|
|
102025
|
+
this.idField = "Id";
|
|
101944
102026
|
}
|
|
101945
102027
|
get fields() {
|
|
101946
102028
|
return {
|
|
@@ -101984,9 +102066,6 @@
|
|
|
101984
102066
|
AnyType: new BaseObjectFieldDef(this.typeRegistry.AnyType, true),
|
|
101985
102067
|
};
|
|
101986
102068
|
}
|
|
101987
|
-
buildKeyParams(input) {
|
|
101988
|
-
return { Id: input.data.Id };
|
|
101989
|
-
}
|
|
101990
102069
|
get cacheControl() {
|
|
101991
102070
|
return { type: "max-age", maxAge: 60 };
|
|
101992
102071
|
}
|
|
@@ -102116,6 +102195,7 @@
|
|
|
102116
102195
|
this.namespace = "oas";
|
|
102117
102196
|
this.typeName = "Setup__EntityRepresentation";
|
|
102118
102197
|
this.implementedInterfaces = [];
|
|
102198
|
+
this.idField = "Id";
|
|
102119
102199
|
}
|
|
102120
102200
|
get fields() {
|
|
102121
102201
|
return {
|
|
@@ -102154,9 +102234,6 @@
|
|
|
102154
102234
|
AnyType: new BaseObjectFieldDef(this.typeRegistry.AnyType, true),
|
|
102155
102235
|
};
|
|
102156
102236
|
}
|
|
102157
|
-
buildKeyParams(input) {
|
|
102158
|
-
return { Id: input.data.Id };
|
|
102159
|
-
}
|
|
102160
102237
|
get cacheControl() {
|
|
102161
102238
|
return { type: "max-age", maxAge: 60 };
|
|
102162
102239
|
}
|
|
@@ -102331,6 +102408,7 @@
|
|
|
102331
102408
|
this.namespace = "oas";
|
|
102332
102409
|
this.typeName = "Setup__ListViewRow";
|
|
102333
102410
|
this.implementedInterfaces = [];
|
|
102411
|
+
this.idField = "id";
|
|
102334
102412
|
}
|
|
102335
102413
|
get fields() {
|
|
102336
102414
|
return {
|
|
@@ -102339,9 +102417,6 @@
|
|
|
102339
102417
|
columns: new BaseArrayFieldDef(new BaseObjectFieldDef(this.typeRegistry.Setup__ListScalarField, true), false),
|
|
102340
102418
|
};
|
|
102341
102419
|
}
|
|
102342
|
-
buildKeyParams(input) {
|
|
102343
|
-
return { id: input.data.id };
|
|
102344
|
-
}
|
|
102345
102420
|
get cacheControl() {
|
|
102346
102421
|
return { type: "max-age", maxAge: 60 };
|
|
102347
102422
|
}
|
|
@@ -103377,6 +103452,61 @@
|
|
|
103377
103452
|
return data.__genericTypename || data.__typename;
|
|
103378
103453
|
}
|
|
103379
103454
|
|
|
103455
|
+
/**
|
|
103456
|
+
* Finds the typename field name from GraphQL selections, looking for __typename or aliased fields.
|
|
103457
|
+
*
|
|
103458
|
+
* @param input - The normalize/denormalize data input containing selections
|
|
103459
|
+
* @returns The field name to use for typename lookup, or '__typename' as fallback
|
|
103460
|
+
*/
|
|
103461
|
+
function findTypenameFieldFromSelections(input) {
|
|
103462
|
+
// For normalize inputs, check if selections exist and find __typename field
|
|
103463
|
+
if (input && 'selections' in input && Array.isArray(input.selections)) {
|
|
103464
|
+
const typenameSelection = input.selections.find((selection) => selection.kind === 'Field' && selection.name?.value === '__typename');
|
|
103465
|
+
if (typenameSelection) {
|
|
103466
|
+
// If there's an alias, use the alias name, otherwise use the field name
|
|
103467
|
+
return typenameSelection.alias?.value || typenameSelection.name.value;
|
|
103468
|
+
}
|
|
103469
|
+
}
|
|
103470
|
+
// Fallback to standard __typename field name
|
|
103471
|
+
return '__typename';
|
|
103472
|
+
}
|
|
103473
|
+
/**
|
|
103474
|
+
* Checks if the input data satisfies a fragment type condition by comparing the typename
|
|
103475
|
+
* from the input data with the fragment's conditional type name.
|
|
103476
|
+
*
|
|
103477
|
+
* @param input - The normalize/denormalize data input containing the typename
|
|
103478
|
+
* @param fragment - The fragment containing the type condition
|
|
103479
|
+
* @returns Result<boolean, Error> - true if the type condition is satisfied
|
|
103480
|
+
*/
|
|
103481
|
+
function dataSatisfiesFragmentTypeCondition(input, fragment) {
|
|
103482
|
+
const conditionalTypeName = fragment?.typeCondition?.name.value;
|
|
103483
|
+
const typename = input?.data?.[findTypenameFieldFromSelections(input)] ||
|
|
103484
|
+
input?.normalizedData?.__typename?.data;
|
|
103485
|
+
if (conditionalTypeName && typename === conditionalTypeName) {
|
|
103486
|
+
return ok(true);
|
|
103487
|
+
}
|
|
103488
|
+
return ok(false);
|
|
103489
|
+
}
|
|
103490
|
+
/**
|
|
103491
|
+
* Generic implementation of satisfiesFragmentTypeCondition for repositories.
|
|
103492
|
+
* Combines the base class type condition check with custom typename validation.
|
|
103493
|
+
*
|
|
103494
|
+
* @param superSatisfiesFragmentTypeCondition - The super class method to call first
|
|
103495
|
+
* @param input - The normalize/denormalize data input
|
|
103496
|
+
* @param fragment - The fragment containing the type condition
|
|
103497
|
+
* @param typeName - The repository type name for error messages
|
|
103498
|
+
* @returns Result<boolean, Error> - true if the fragment type condition is satisfied
|
|
103499
|
+
*/
|
|
103500
|
+
function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment, typeName) {
|
|
103501
|
+
// First try the base class implementation
|
|
103502
|
+
const result = superSatisfiesFragmentTypeCondition(input, fragment);
|
|
103503
|
+
if (result.isErr() || result.value) {
|
|
103504
|
+
return result;
|
|
103505
|
+
}
|
|
103506
|
+
// Then try our custom typename checking
|
|
103507
|
+
return dataSatisfiesFragmentTypeCondition(input, fragment);
|
|
103508
|
+
}
|
|
103509
|
+
|
|
103380
103510
|
class RecordRepresentationBaseRepository extends BaseGraphQLTypeRepository {
|
|
103381
103511
|
constructor(namespace, typeName, implementedInterfaces, fields, idField, services) {
|
|
103382
103512
|
super();
|
|
@@ -103403,15 +103533,8 @@
|
|
|
103403
103533
|
getFieldDef(_input, selection) {
|
|
103404
103534
|
return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
|
|
103405
103535
|
}
|
|
103406
|
-
satisfiesFragmentTypeCondition(
|
|
103407
|
-
|
|
103408
|
-
if (result.isErr()) {
|
|
103409
|
-
return result;
|
|
103410
|
-
}
|
|
103411
|
-
if (result.value) {
|
|
103412
|
-
return result;
|
|
103413
|
-
}
|
|
103414
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103536
|
+
satisfiesFragmentTypeCondition(input, fragment) {
|
|
103537
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), input, fragment, this.typeName);
|
|
103415
103538
|
}
|
|
103416
103539
|
}
|
|
103417
103540
|
|
|
@@ -103420,7 +103543,7 @@
|
|
|
103420
103543
|
super(services, typeRegistry);
|
|
103421
103544
|
this.services = services;
|
|
103422
103545
|
this.typeRegistry = typeRegistry;
|
|
103423
|
-
this.namespace = '
|
|
103546
|
+
this.namespace = 'uiapi';
|
|
103424
103547
|
this.typeName = 'RecordRepresentation';
|
|
103425
103548
|
this.implementedInterfaces = ['Record'];
|
|
103426
103549
|
this._graphqlRepositoryOverride = undefined;
|
|
@@ -103572,14 +103695,7 @@
|
|
|
103572
103695
|
return super.getFieldDef(undefined, selection) !== undefined;
|
|
103573
103696
|
}
|
|
103574
103697
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103575
|
-
|
|
103576
|
-
if (result.isErr()) {
|
|
103577
|
-
return result;
|
|
103578
|
-
}
|
|
103579
|
-
if (result.value) {
|
|
103580
|
-
return result;
|
|
103581
|
-
}
|
|
103582
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103698
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103583
103699
|
}
|
|
103584
103700
|
}
|
|
103585
103701
|
|
|
@@ -103603,14 +103719,7 @@
|
|
|
103603
103719
|
return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
|
|
103604
103720
|
}
|
|
103605
103721
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103606
|
-
|
|
103607
|
-
if (result.isErr()) {
|
|
103608
|
-
return result;
|
|
103609
|
-
}
|
|
103610
|
-
if (result.value) {
|
|
103611
|
-
return result;
|
|
103612
|
-
}
|
|
103613
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103722
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103614
103723
|
}
|
|
103615
103724
|
}
|
|
103616
103725
|
|
|
@@ -103646,7 +103755,7 @@
|
|
|
103646
103755
|
super(services);
|
|
103647
103756
|
this.services = services;
|
|
103648
103757
|
this.typeRegistry = typeRegistry;
|
|
103649
|
-
this.namespace = '
|
|
103758
|
+
this.namespace = 'uiapi';
|
|
103650
103759
|
this.typeName = 'Setup__EntityRepresentation';
|
|
103651
103760
|
this.implementedInterfaces = [];
|
|
103652
103761
|
}
|
|
@@ -103696,14 +103805,7 @@
|
|
|
103696
103805
|
return blobTypeDef;
|
|
103697
103806
|
}
|
|
103698
103807
|
satisfiesFragmentTypeCondition(input, fragment) {
|
|
103699
|
-
|
|
103700
|
-
if (result.isErr()) {
|
|
103701
|
-
return result;
|
|
103702
|
-
}
|
|
103703
|
-
if (result.value) {
|
|
103704
|
-
return result;
|
|
103705
|
-
}
|
|
103706
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103808
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), input, fragment, this.typeName);
|
|
103707
103809
|
}
|
|
103708
103810
|
}
|
|
103709
103811
|
|
|
@@ -103743,14 +103845,7 @@
|
|
|
103743
103845
|
return blobTypeDef;
|
|
103744
103846
|
}
|
|
103745
103847
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103746
|
-
|
|
103747
|
-
if (result.isErr()) {
|
|
103748
|
-
return result;
|
|
103749
|
-
}
|
|
103750
|
-
if (result.value) {
|
|
103751
|
-
return result;
|
|
103752
|
-
}
|
|
103753
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103848
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103754
103849
|
}
|
|
103755
103850
|
}
|
|
103756
103851
|
|
|
@@ -103769,7 +103864,7 @@
|
|
|
103769
103864
|
constructor(services, typeRegistry) {
|
|
103770
103865
|
super(services);
|
|
103771
103866
|
this.typeRegistry = typeRegistry;
|
|
103772
|
-
this.namespace = '
|
|
103867
|
+
this.namespace = 'uiapi';
|
|
103773
103868
|
this.typeName = 'Setup__Setup';
|
|
103774
103869
|
this.implementedInterfaces = [];
|
|
103775
103870
|
this.cacheControl = {
|
|
@@ -103790,14 +103885,7 @@
|
|
|
103790
103885
|
|
|
103791
103886
|
class SetupEdgeRepository extends Setup__SetupEdgeRepository {
|
|
103792
103887
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103793
|
-
|
|
103794
|
-
if (result.isErr()) {
|
|
103795
|
-
return result;
|
|
103796
|
-
}
|
|
103797
|
-
if (result.value) {
|
|
103798
|
-
return result;
|
|
103799
|
-
}
|
|
103800
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103888
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103801
103889
|
}
|
|
103802
103890
|
}
|
|
103803
103891
|
|
|
@@ -103811,118 +103899,55 @@
|
|
|
103811
103899
|
|
|
103812
103900
|
class RecordAggregateConnectionRepository extends RecordAggregateConnectionRepository$1 {
|
|
103813
103901
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103814
|
-
|
|
103815
|
-
if (result.isErr()) {
|
|
103816
|
-
return result;
|
|
103817
|
-
}
|
|
103818
|
-
if (result.value) {
|
|
103819
|
-
return result;
|
|
103820
|
-
}
|
|
103821
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103902
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103822
103903
|
}
|
|
103823
103904
|
}
|
|
103824
103905
|
|
|
103825
103906
|
class RecordAggregateEdgeRepository extends RecordAggregateEdgeRepository$1 {
|
|
103826
103907
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103827
|
-
|
|
103828
|
-
if (result.isErr()) {
|
|
103829
|
-
return result;
|
|
103830
|
-
}
|
|
103831
|
-
if (result.value) {
|
|
103832
|
-
return result;
|
|
103833
|
-
}
|
|
103834
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103908
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103835
103909
|
}
|
|
103836
103910
|
}
|
|
103837
103911
|
|
|
103838
103912
|
class RecordConnectionRepository extends RecordConnectionRepository$1 {
|
|
103839
103913
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103840
|
-
|
|
103841
|
-
if (result.isErr()) {
|
|
103842
|
-
return result;
|
|
103843
|
-
}
|
|
103844
|
-
if (result.value) {
|
|
103845
|
-
return result;
|
|
103846
|
-
}
|
|
103847
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103914
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103848
103915
|
}
|
|
103849
103916
|
}
|
|
103850
103917
|
|
|
103851
103918
|
class RecordEdgeRepository extends RecordEdgeRepository$1 {
|
|
103852
103919
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103853
|
-
|
|
103854
|
-
if (result.isErr()) {
|
|
103855
|
-
return result;
|
|
103856
|
-
}
|
|
103857
|
-
if (result.value) {
|
|
103858
|
-
return result;
|
|
103859
|
-
}
|
|
103860
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103920
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103861
103921
|
}
|
|
103862
103922
|
}
|
|
103863
103923
|
|
|
103864
103924
|
class RecordResultRepository extends RecordResultRepository$1 {
|
|
103865
103925
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103866
|
-
|
|
103867
|
-
if (result.isErr()) {
|
|
103868
|
-
return result;
|
|
103869
|
-
}
|
|
103870
|
-
if (result.value) {
|
|
103871
|
-
return result;
|
|
103872
|
-
}
|
|
103873
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103926
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103874
103927
|
}
|
|
103875
103928
|
}
|
|
103876
103929
|
|
|
103877
103930
|
class SetupRecordResultRepository extends Setup__SetupRecordResultRepository {
|
|
103878
103931
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103879
|
-
|
|
103880
|
-
if (result.isErr()) {
|
|
103881
|
-
return result;
|
|
103882
|
-
}
|
|
103883
|
-
if (result.value) {
|
|
103884
|
-
return result;
|
|
103885
|
-
}
|
|
103886
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103932
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103887
103933
|
}
|
|
103888
103934
|
}
|
|
103889
103935
|
|
|
103890
103936
|
class SetupAggregateConnectionRepository extends Setup__SetupAggregateConnectionRepository {
|
|
103891
103937
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103892
|
-
|
|
103893
|
-
if (result.isErr()) {
|
|
103894
|
-
return result;
|
|
103895
|
-
}
|
|
103896
|
-
if (result.value) {
|
|
103897
|
-
return result;
|
|
103898
|
-
}
|
|
103899
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103938
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103900
103939
|
}
|
|
103901
103940
|
}
|
|
103902
103941
|
|
|
103903
103942
|
class SetupAggregateEdgeRepository extends Setup__SetupAggregateEdgeRepository {
|
|
103904
103943
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103905
|
-
|
|
103906
|
-
if (result.isErr()) {
|
|
103907
|
-
return result;
|
|
103908
|
-
}
|
|
103909
|
-
if (result.value) {
|
|
103910
|
-
return result;
|
|
103911
|
-
}
|
|
103912
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103944
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103913
103945
|
}
|
|
103914
103946
|
}
|
|
103915
103947
|
|
|
103916
103948
|
class SetupConnectionRepository extends Setup__SetupConnectionRepository {
|
|
103917
103949
|
satisfiesFragmentTypeCondition(_input, fragment) {
|
|
103918
|
-
|
|
103919
|
-
if (result.isErr()) {
|
|
103920
|
-
return result;
|
|
103921
|
-
}
|
|
103922
|
-
if (result.value) {
|
|
103923
|
-
return result;
|
|
103924
|
-
}
|
|
103925
|
-
return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
|
|
103950
|
+
return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
|
|
103926
103951
|
}
|
|
103927
103952
|
}
|
|
103928
103953
|
|
|
@@ -104400,14 +104425,14 @@
|
|
|
104400
104425
|
this.exposeRefresh = true;
|
|
104401
104426
|
}
|
|
104402
104427
|
getCommand() {
|
|
104403
|
-
return new graphql_ctor(
|
|
104428
|
+
return new graphql_ctor(this.config, documentRootType, services);
|
|
104404
104429
|
}
|
|
104405
104430
|
};
|
|
104406
104431
|
const graphql_imperative_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_imperative');
|
|
104407
104432
|
graphql_imperative$1 = buildAsyncGraphQLImperativeLegacyInvoker(({ config, assertIsValid }) => {
|
|
104408
104433
|
const _ = assertIsValid;
|
|
104409
104434
|
_(config, CONFIG_SCHEMA);
|
|
104410
|
-
return new graphql_imperative_ctor(
|
|
104435
|
+
return new graphql_imperative_ctor(config, documentRootType, services);
|
|
104411
104436
|
});
|
|
104412
104437
|
useOneStoreGraphQL = services.featureFlags?.get('useOneStoreGraphQL') ?? false;
|
|
104413
104438
|
if (provisionedCallback) {
|
|
@@ -104422,7 +104447,7 @@
|
|
|
104422
104447
|
cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
|
|
104423
104448
|
}
|
|
104424
104449
|
}
|
|
104425
|
-
// version: 1.380.0-
|
|
104450
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
104426
104451
|
|
|
104427
104452
|
function createFragmentMap(documentNode) {
|
|
104428
104453
|
const fragments = {};
|
|
@@ -130917,7 +130942,7 @@
|
|
|
130917
130942
|
}
|
|
130918
130943
|
return refresh$3(data, 'refreshUiApi');
|
|
130919
130944
|
}
|
|
130920
|
-
// version: 1.380.0-
|
|
130945
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
130921
130946
|
|
|
130922
130947
|
// On core the unstable adapters are re-exported with different names,
|
|
130923
130948
|
// we want to match them here.
|
|
@@ -131069,7 +131094,7 @@
|
|
|
131069
131094
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
131070
131095
|
graphQLImperative = ldsAdapter;
|
|
131071
131096
|
});
|
|
131072
|
-
// version: 1.380.0-
|
|
131097
|
+
// version: 1.380.0-dev2-fd70e1c449
|
|
131073
131098
|
|
|
131074
131099
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
131075
131100
|
__proto__: null,
|
|
@@ -131868,7 +131893,7 @@
|
|
|
131868
131893
|
function register(r) {
|
|
131869
131894
|
callbacks$1.forEach((callback) => callback(r));
|
|
131870
131895
|
}
|
|
131871
|
-
// version: 1.380.0-
|
|
131896
|
+
// version: 1.380.0-dev2-40594334e8
|
|
131872
131897
|
|
|
131873
131898
|
/**
|
|
131874
131899
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -133205,4 +133230,4 @@
|
|
|
133205
133230
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
133206
133231
|
|
|
133207
133232
|
}));
|
|
133208
|
-
// version: 1.380.0-
|
|
133233
|
+
// version: 1.380.0-dev2-40594334e8
|