@supacloud/cli 0.51.0 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +629 -1237
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -186729,6 +186729,9 @@ var init_esm3 = __esm(() => {
|
|
|
186729
186729
|
init_utils();
|
|
186730
186730
|
});
|
|
186731
186731
|
|
|
186732
|
+
// node_modules/@graphql-codegen/visitor-plugin-common/esm/avoid-optionals.js
|
|
186733
|
+
var init_avoid_optionals = () => {};
|
|
186734
|
+
|
|
186732
186735
|
// node_modules/auto-bind/index.js
|
|
186733
186736
|
function autoBind(self2, { include, exclude } = {}) {
|
|
186734
186737
|
const filter = (key) => {
|
|
@@ -186762,39 +186765,6 @@ var getAllProperties = (object) => {
|
|
|
186762
186765
|
return properties;
|
|
186763
186766
|
};
|
|
186764
186767
|
|
|
186765
|
-
// node_modules/@graphql-codegen/visitor-plugin-common/esm/avoid-optionals.js
|
|
186766
|
-
function normalizeAvoidOptionals(avoidOptionals) {
|
|
186767
|
-
if (typeof avoidOptionals === "boolean") {
|
|
186768
|
-
return {
|
|
186769
|
-
object: avoidOptionals,
|
|
186770
|
-
inputValue: avoidOptionals,
|
|
186771
|
-
field: avoidOptionals,
|
|
186772
|
-
defaultValue: avoidOptionals,
|
|
186773
|
-
resolvers: avoidOptionals,
|
|
186774
|
-
query: avoidOptionals,
|
|
186775
|
-
mutation: avoidOptionals,
|
|
186776
|
-
subscription: avoidOptionals
|
|
186777
|
-
};
|
|
186778
|
-
}
|
|
186779
|
-
return {
|
|
186780
|
-
...DEFAULT_AVOID_OPTIONALS,
|
|
186781
|
-
...avoidOptionals
|
|
186782
|
-
};
|
|
186783
|
-
}
|
|
186784
|
-
var DEFAULT_AVOID_OPTIONALS;
|
|
186785
|
-
var init_avoid_optionals = __esm(() => {
|
|
186786
|
-
DEFAULT_AVOID_OPTIONALS = {
|
|
186787
|
-
object: false,
|
|
186788
|
-
inputValue: false,
|
|
186789
|
-
field: false,
|
|
186790
|
-
defaultValue: false,
|
|
186791
|
-
resolvers: false,
|
|
186792
|
-
query: false,
|
|
186793
|
-
mutation: false,
|
|
186794
|
-
subscription: false
|
|
186795
|
-
};
|
|
186796
|
-
});
|
|
186797
|
-
|
|
186798
186768
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/mappers.js
|
|
186799
186769
|
function prepareLegacy(mapper) {
|
|
186800
186770
|
const isScoped = mapper.includes("\\#");
|
|
@@ -186909,15 +186879,6 @@ function addSuffix(element, suffix) {
|
|
|
186909
186879
|
function isExternalMapper(value) {
|
|
186910
186880
|
return value.includes("#");
|
|
186911
186881
|
}
|
|
186912
|
-
function transformDirectiveArgumentAndInputFieldMappings(rawDirectiveArgumentAndInputFieldMappings, directiveArgumentAndInputFieldMappingTypeSuffix) {
|
|
186913
|
-
const result = {};
|
|
186914
|
-
for (const directive of Object.keys(rawDirectiveArgumentAndInputFieldMappings)) {
|
|
186915
|
-
const mapperDef = rawDirectiveArgumentAndInputFieldMappings[directive];
|
|
186916
|
-
const parsedMapper = parseMapper(mapperDef, directive, directiveArgumentAndInputFieldMappingTypeSuffix);
|
|
186917
|
-
result[directive] = parsedMapper;
|
|
186918
|
-
}
|
|
186919
|
-
return result;
|
|
186920
|
-
}
|
|
186921
186882
|
var MapperKind3;
|
|
186922
186883
|
var init_mappers = __esm(() => {
|
|
186923
186884
|
(function(MapperKind4) {
|
|
@@ -188164,33 +188125,7 @@ var init_convert_schema_enum_to_declaration_block_string = __esm(() => {
|
|
|
188164
188125
|
});
|
|
188165
188126
|
|
|
188166
188127
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/declaration-kinds.js
|
|
188167
|
-
|
|
188168
|
-
if (typeof declarationKind === "string") {
|
|
188169
|
-
return {
|
|
188170
|
-
directive: declarationKind,
|
|
188171
|
-
scalar: declarationKind,
|
|
188172
|
-
input: declarationKind,
|
|
188173
|
-
type: declarationKind,
|
|
188174
|
-
interface: declarationKind,
|
|
188175
|
-
arguments: declarationKind
|
|
188176
|
-
};
|
|
188177
|
-
}
|
|
188178
|
-
return {
|
|
188179
|
-
...DEFAULT_DECLARATION_KINDS,
|
|
188180
|
-
...declarationKind
|
|
188181
|
-
};
|
|
188182
|
-
}
|
|
188183
|
-
var DEFAULT_DECLARATION_KINDS;
|
|
188184
|
-
var init_declaration_kinds = __esm(() => {
|
|
188185
|
-
DEFAULT_DECLARATION_KINDS = {
|
|
188186
|
-
directive: "type",
|
|
188187
|
-
scalar: "type",
|
|
188188
|
-
input: "type",
|
|
188189
|
-
type: "type",
|
|
188190
|
-
interface: "type",
|
|
188191
|
-
arguments: "type"
|
|
188192
|
-
};
|
|
188193
|
-
});
|
|
188128
|
+
var init_declaration_kinds = () => {};
|
|
188194
188129
|
|
|
188195
188130
|
// node_modules/unc-path-regex/index.js
|
|
188196
188131
|
var require_unc_path_regex = __commonJS(function(exports, module) {
|
|
@@ -188544,7 +188479,6 @@ var init_imports = __esm(() => {
|
|
|
188544
188479
|
});
|
|
188545
188480
|
|
|
188546
188481
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/base-types-visitor.js
|
|
188547
|
-
var import_graphql74, BaseTypesVisitor;
|
|
188548
188482
|
var init_base_types_visitor = __esm(() => {
|
|
188549
188483
|
init_base_visitor();
|
|
188550
188484
|
init_convert_schema_enum_to_declaration_block_string();
|
|
@@ -188555,358 +188489,6 @@ var init_base_types_visitor = __esm(() => {
|
|
|
188555
188489
|
init_scalars();
|
|
188556
188490
|
init_utils2();
|
|
188557
188491
|
init_variables_to_object();
|
|
188558
|
-
import_graphql74 = __toESM(require_graphql2(), 1);
|
|
188559
|
-
BaseTypesVisitor = class BaseTypesVisitor extends BaseVisitor {
|
|
188560
|
-
_schema;
|
|
188561
|
-
_argumentsTransformer;
|
|
188562
|
-
constructor(_schema, rawConfig, additionalConfig, defaultScalars = DEFAULT_SCALARS) {
|
|
188563
|
-
super(rawConfig, {
|
|
188564
|
-
onlyEnums: getConfigValue(rawConfig.onlyEnums, false),
|
|
188565
|
-
onlyOperationTypes: getConfigValue(rawConfig.onlyOperationTypes, false),
|
|
188566
|
-
addUnderscoreToArgsType: getConfigValue(rawConfig.addUnderscoreToArgsType, false),
|
|
188567
|
-
ignoreEnumValuesFromSchema: getConfigValue(rawConfig.ignoreEnumValuesFromSchema, false),
|
|
188568
|
-
declarationKind: normalizeDeclarationKind(rawConfig.declarationKind),
|
|
188569
|
-
scalars: buildScalarsFromConfig(_schema, rawConfig, defaultScalars),
|
|
188570
|
-
fieldWrapperValue: getConfigValue(rawConfig.fieldWrapperValue, "T"),
|
|
188571
|
-
wrapFieldDefinitions: getConfigValue(rawConfig.wrapFieldDefinitions, false),
|
|
188572
|
-
entireFieldWrapperValue: getConfigValue(rawConfig.entireFieldWrapperValue, "T"),
|
|
188573
|
-
wrapEntireDefinitions: getConfigValue(rawConfig.wrapEntireFieldDefinitions, false),
|
|
188574
|
-
directiveArgumentAndInputFieldMappings: transformDirectiveArgumentAndInputFieldMappings(rawConfig.directiveArgumentAndInputFieldMappings ?? {}, rawConfig.directiveArgumentAndInputFieldMappingTypeSuffix),
|
|
188575
|
-
addTypename: !rawConfig.skipTypename,
|
|
188576
|
-
nonOptionalTypename: getConfigValue(rawConfig.nonOptionalTypename, false),
|
|
188577
|
-
...additionalConfig
|
|
188578
|
-
});
|
|
188579
|
-
this._schema = _schema;
|
|
188580
|
-
this.config.enumValues = parseEnumValues({
|
|
188581
|
-
schema: _schema,
|
|
188582
|
-
mapOrStr: rawConfig.enumValues,
|
|
188583
|
-
ignoreEnumValuesFromSchema: this.config.ignoreEnumValuesFromSchema,
|
|
188584
|
-
naming: {
|
|
188585
|
-
convert: this.config.convert,
|
|
188586
|
-
options: {
|
|
188587
|
-
typesPrefix: this.config.typesPrefix,
|
|
188588
|
-
typesSuffix: this.config.typesSuffix,
|
|
188589
|
-
useTypesPrefix: this.config.enumPrefix,
|
|
188590
|
-
useTypesSuffix: this.config.enumSuffix
|
|
188591
|
-
}
|
|
188592
|
-
}
|
|
188593
|
-
});
|
|
188594
|
-
this._argumentsTransformer = new OperationVariablesToObject(this.scalars, this.convertName);
|
|
188595
|
-
}
|
|
188596
|
-
getExportPrefix() {
|
|
188597
|
-
return "export ";
|
|
188598
|
-
}
|
|
188599
|
-
getFieldWrapperValue() {
|
|
188600
|
-
if (this.config.fieldWrapperValue) {
|
|
188601
|
-
return `${this.getExportPrefix()}type FieldWrapper<T> = ${this.config.fieldWrapperValue};`;
|
|
188602
|
-
}
|
|
188603
|
-
return "";
|
|
188604
|
-
}
|
|
188605
|
-
getEntireFieldWrapperValue() {
|
|
188606
|
-
if (this.config.entireFieldWrapperValue) {
|
|
188607
|
-
return `${this.getExportPrefix()}type EntireFieldWrapper<T> = ${this.config.entireFieldWrapperValue};`;
|
|
188608
|
-
}
|
|
188609
|
-
return "";
|
|
188610
|
-
}
|
|
188611
|
-
getScalarsImports() {
|
|
188612
|
-
return Object.keys(this.config.scalars).reduce((res, enumName) => {
|
|
188613
|
-
const mappedValue = this.config.scalars[enumName];
|
|
188614
|
-
if (mappedValue.input.isExternal) {
|
|
188615
|
-
res.push(buildTypeImport({
|
|
188616
|
-
identifier: mappedValue.input.import,
|
|
188617
|
-
source: mappedValue.input.source,
|
|
188618
|
-
asDefault: mappedValue.input.default,
|
|
188619
|
-
useTypeImports: this.config.useTypeImports
|
|
188620
|
-
}));
|
|
188621
|
-
}
|
|
188622
|
-
if (mappedValue.output.isExternal) {
|
|
188623
|
-
res.push(buildTypeImport({
|
|
188624
|
-
identifier: mappedValue.output.import,
|
|
188625
|
-
source: mappedValue.output.source,
|
|
188626
|
-
asDefault: mappedValue.output.default,
|
|
188627
|
-
useTypeImports: this.config.useTypeImports
|
|
188628
|
-
}));
|
|
188629
|
-
}
|
|
188630
|
-
return res;
|
|
188631
|
-
}, []);
|
|
188632
|
-
}
|
|
188633
|
-
getDirectiveArgumentAndInputFieldMappingsImports() {
|
|
188634
|
-
return Object.keys(this.config.directiveArgumentAndInputFieldMappings).map((directive) => {
|
|
188635
|
-
const mappedValue = this.config.directiveArgumentAndInputFieldMappings[directive];
|
|
188636
|
-
if (mappedValue.isExternal) {
|
|
188637
|
-
return buildTypeImport({
|
|
188638
|
-
identifier: mappedValue.import,
|
|
188639
|
-
source: mappedValue.source,
|
|
188640
|
-
asDefault: mappedValue.default,
|
|
188641
|
-
useTypeImports: this.config.useTypeImports
|
|
188642
|
-
});
|
|
188643
|
-
}
|
|
188644
|
-
return null;
|
|
188645
|
-
}).filter((a) => a);
|
|
188646
|
-
}
|
|
188647
|
-
get scalarsDefinition() {
|
|
188648
|
-
if (this.config.onlyEnums)
|
|
188649
|
-
return "";
|
|
188650
|
-
const allScalars = Object.keys(this.config.scalars).map((scalarName) => {
|
|
188651
|
-
const inputScalarValue = this.config.scalars[scalarName].input.type;
|
|
188652
|
-
const outputScalarValue = this.config.scalars[scalarName].output.type;
|
|
188653
|
-
const scalarType = this._schema.getType(scalarName);
|
|
188654
|
-
const comment = scalarType?.astNode && scalarType.description ? transformComment(scalarType.description, 1) : "";
|
|
188655
|
-
const { scalar } = this._parsedConfig.declarationKind;
|
|
188656
|
-
return comment + indent3(`${scalarName}: { input: ${inputScalarValue}${this.getPunctuation(scalar)} output: ${outputScalarValue}${this.getPunctuation(scalar)} }`);
|
|
188657
|
-
});
|
|
188658
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind(this._parsedConfig.declarationKind.scalar).withName("Scalars").withComment("All built-in and custom scalars, mapped to their actual values").withBlock(allScalars.join(`
|
|
188659
|
-
`)).string;
|
|
188660
|
-
}
|
|
188661
|
-
get directiveArgumentAndInputFieldMappingsDefinition() {
|
|
188662
|
-
const directiveEntries = Object.entries(this.config.directiveArgumentAndInputFieldMappings);
|
|
188663
|
-
if (directiveEntries.length === 0) {
|
|
188664
|
-
return "";
|
|
188665
|
-
}
|
|
188666
|
-
const allDirectives = [];
|
|
188667
|
-
for (const [directiveName, parsedMapper] of directiveEntries) {
|
|
188668
|
-
const directiveType = this._schema.getDirective(directiveName);
|
|
188669
|
-
const comment = directiveType?.astNode && directiveType.description ? transformComment(directiveType.description, 1) : "";
|
|
188670
|
-
const { directive } = this._parsedConfig.declarationKind;
|
|
188671
|
-
allDirectives.push(comment + indent3(`${directiveName}: ${parsedMapper.type}${this.getPunctuation(directive)}`));
|
|
188672
|
-
}
|
|
188673
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind(this._parsedConfig.declarationKind.directive).withName("DirectiveArgumentAndInputFieldMappings").withComment("Type overrides using directives").withBlock(allDirectives.join(`
|
|
188674
|
-
`)).string;
|
|
188675
|
-
}
|
|
188676
|
-
setDeclarationBlockConfig(config) {
|
|
188677
|
-
this._declarationBlockConfig = config;
|
|
188678
|
-
}
|
|
188679
|
-
setArgumentsTransformer(argumentsTransfomer) {
|
|
188680
|
-
this._argumentsTransformer = argumentsTransfomer;
|
|
188681
|
-
}
|
|
188682
|
-
NonNullType(node) {
|
|
188683
|
-
const asString = node.type;
|
|
188684
|
-
return asString;
|
|
188685
|
-
}
|
|
188686
|
-
getInputObjectDeclarationBlock(node) {
|
|
188687
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind(this._parsedConfig.declarationKind.input).withName(this.convertName(node)).withComment(node.description?.value).withBlock(node.fields.join(`
|
|
188688
|
-
`));
|
|
188689
|
-
}
|
|
188690
|
-
getInputObjectOneOfDeclarationBlock(node) {
|
|
188691
|
-
const declarationKind = node.fields.length === 1 ? this._parsedConfig.declarationKind.input : "type";
|
|
188692
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind(declarationKind).withName(this.convertName(node)).withComment(node.description?.value).withContent(`
|
|
188693
|
-
` + node.fields.join(`
|
|
188694
|
-
|`));
|
|
188695
|
-
}
|
|
188696
|
-
InputObjectTypeDefinition(node) {
|
|
188697
|
-
if (this.config.onlyEnums)
|
|
188698
|
-
return "";
|
|
188699
|
-
if (isOneOfInputObjectType(this._schema.getType(node.name.value))) {
|
|
188700
|
-
return this.getInputObjectOneOfDeclarationBlock(node).string;
|
|
188701
|
-
}
|
|
188702
|
-
return this.getInputObjectDeclarationBlock(node).string;
|
|
188703
|
-
}
|
|
188704
|
-
InputValueDefinition(node) {
|
|
188705
|
-
if (this.config.onlyEnums)
|
|
188706
|
-
return "";
|
|
188707
|
-
const comment = transformComment(node.description.value, 1);
|
|
188708
|
-
const { input } = this._parsedConfig.declarationKind;
|
|
188709
|
-
let type = node.type;
|
|
188710
|
-
if (node.directives && this.config.directiveArgumentAndInputFieldMappings) {
|
|
188711
|
-
type = this._getDirectiveOverrideType(node.directives) || type;
|
|
188712
|
-
}
|
|
188713
|
-
return comment + indent3(`${node.name.value}: ${type}${this.getPunctuation(input)}`);
|
|
188714
|
-
}
|
|
188715
|
-
FieldDefinition(node) {
|
|
188716
|
-
if (this.config.onlyEnums)
|
|
188717
|
-
return "";
|
|
188718
|
-
const typeString = node.type;
|
|
188719
|
-
const { type } = this._parsedConfig.declarationKind;
|
|
188720
|
-
const comment = getNodeComment(node);
|
|
188721
|
-
return comment + indent3(`${node.name.value}: ${typeString}${this.getPunctuation(type)}`);
|
|
188722
|
-
}
|
|
188723
|
-
UnionTypeDefinition(node, key, parent) {
|
|
188724
|
-
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
188725
|
-
return "";
|
|
188726
|
-
const originalNode = parent[key];
|
|
188727
|
-
const possibleTypes = originalNode.types.map((t) => this.scalars[t.name.value] ? this._getScalar(t.name.value, "output") : this.convertName(t)).join(" | ");
|
|
188728
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind("type").withName(this.convertName(node)).withComment(node.description.value).withContent(possibleTypes).string;
|
|
188729
|
-
}
|
|
188730
|
-
mergeInterfaces(interfaces, hasOtherFields) {
|
|
188731
|
-
return interfaces.join(" & ") + (interfaces.length && hasOtherFields ? " & " : "");
|
|
188732
|
-
}
|
|
188733
|
-
appendInterfacesAndFieldsToBlock(block3, interfaces, fields2) {
|
|
188734
|
-
block3.withContent(this.mergeInterfaces(interfaces, fields2.length > 0));
|
|
188735
|
-
block3.withBlock(this.mergeAllFields(fields2, interfaces.length > 0));
|
|
188736
|
-
}
|
|
188737
|
-
getObjectTypeDeclarationBlock(node, originalNode) {
|
|
188738
|
-
const optionalTypename = this.config.nonOptionalTypename ? "__typename" : "__typename?";
|
|
188739
|
-
const { type, interface: interfacesType } = this._parsedConfig.declarationKind;
|
|
188740
|
-
const allFields = [
|
|
188741
|
-
...this.config.addTypename ? [
|
|
188742
|
-
indent3(`${this.config.immutableTypes ? "readonly " : ""}${optionalTypename}: '${node.name.value}'${this.getPunctuation(type)}`)
|
|
188743
|
-
] : [],
|
|
188744
|
-
...node.fields
|
|
188745
|
-
];
|
|
188746
|
-
const interfacesNames = originalNode.interfaces ? originalNode.interfaces.map((i) => this.convertName(i)) : [];
|
|
188747
|
-
const declarationBlock = new DeclarationBlock(this._declarationBlockConfig).export().asKind(type).withName(this.convertName(node)).withComment(node.description?.value);
|
|
188748
|
-
if (type === "interface" || type === "class") {
|
|
188749
|
-
if (interfacesNames.length > 0) {
|
|
188750
|
-
const keyword = interfacesType === "interface" && type === "class" ? "implements" : "extends";
|
|
188751
|
-
declarationBlock.withContent(`${keyword} ` + interfacesNames.join(", ") + (allFields.length > 0 ? " " : " {}"));
|
|
188752
|
-
}
|
|
188753
|
-
declarationBlock.withBlock(this.mergeAllFields(allFields, false));
|
|
188754
|
-
} else {
|
|
188755
|
-
this.appendInterfacesAndFieldsToBlock(declarationBlock, interfacesNames, allFields);
|
|
188756
|
-
}
|
|
188757
|
-
return declarationBlock;
|
|
188758
|
-
}
|
|
188759
|
-
mergeAllFields(allFields, _hasInterfaces) {
|
|
188760
|
-
return allFields.join(`
|
|
188761
|
-
`);
|
|
188762
|
-
}
|
|
188763
|
-
ObjectTypeDefinition(node, key, parent) {
|
|
188764
|
-
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
188765
|
-
return "";
|
|
188766
|
-
const originalNode = parent[key];
|
|
188767
|
-
return [
|
|
188768
|
-
this.getObjectTypeDeclarationBlock(node, originalNode).string,
|
|
188769
|
-
this.buildArgumentsBlock(originalNode)
|
|
188770
|
-
].filter((f) => f).join(`
|
|
188771
|
-
|
|
188772
|
-
`);
|
|
188773
|
-
}
|
|
188774
|
-
getInterfaceTypeDeclarationBlock(node, _originalNode) {
|
|
188775
|
-
const declarationBlock = new DeclarationBlock(this._declarationBlockConfig).export().asKind(this._parsedConfig.declarationKind.interface).withName(this.convertName(node)).withComment(node.description?.value);
|
|
188776
|
-
return declarationBlock.withBlock(node.fields.join(`
|
|
188777
|
-
`));
|
|
188778
|
-
}
|
|
188779
|
-
InterfaceTypeDefinition(node, key, parent) {
|
|
188780
|
-
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
188781
|
-
return "";
|
|
188782
|
-
const originalNode = parent[key];
|
|
188783
|
-
return [
|
|
188784
|
-
this.getInterfaceTypeDeclarationBlock(node, originalNode).string,
|
|
188785
|
-
this.buildArgumentsBlock(originalNode)
|
|
188786
|
-
].filter((f) => f).join(`
|
|
188787
|
-
|
|
188788
|
-
`);
|
|
188789
|
-
}
|
|
188790
|
-
ScalarTypeDefinition(_node) {
|
|
188791
|
-
return "";
|
|
188792
|
-
}
|
|
188793
|
-
getEnumsImports() {
|
|
188794
|
-
return getEnumsImports({
|
|
188795
|
-
enumValues: this.config.enumValues,
|
|
188796
|
-
useTypeImports: this.config.useTypeImports
|
|
188797
|
-
});
|
|
188798
|
-
}
|
|
188799
|
-
EnumTypeDefinition(node) {
|
|
188800
|
-
const enumName = node.name.value;
|
|
188801
|
-
if (this.config.enumValues[enumName]?.sourceFile) {
|
|
188802
|
-
return null;
|
|
188803
|
-
}
|
|
188804
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind("enum").withName(this.convertName(node, {
|
|
188805
|
-
useTypesPrefix: this.config.enumPrefix,
|
|
188806
|
-
useTypesSuffix: this.config.enumSuffix
|
|
188807
|
-
})).withComment(node.description.value).withBlock(buildEnumValuesBlock({
|
|
188808
|
-
typeName: enumName,
|
|
188809
|
-
values: node.values,
|
|
188810
|
-
schema: this._schema,
|
|
188811
|
-
naming: {
|
|
188812
|
-
convert: this.config.convert,
|
|
188813
|
-
options: {
|
|
188814
|
-
typesPrefix: this.config.typesPrefix,
|
|
188815
|
-
useTypesPrefix: this.config.enumPrefix,
|
|
188816
|
-
typesSuffix: this.config.typesSuffix,
|
|
188817
|
-
useTypesSuffix: this.config.enumSuffix
|
|
188818
|
-
}
|
|
188819
|
-
},
|
|
188820
|
-
ignoreEnumValuesFromSchema: this.config.ignoreEnumValuesFromSchema,
|
|
188821
|
-
declarationBlockConfig: this._declarationBlockConfig,
|
|
188822
|
-
enumValues: this.config.enumValues
|
|
188823
|
-
})).string;
|
|
188824
|
-
}
|
|
188825
|
-
makeValidEnumIdentifier(identifier) {
|
|
188826
|
-
if (/^[0-9]/.exec(identifier)) {
|
|
188827
|
-
return wrapWithSingleQuotes(identifier, true);
|
|
188828
|
-
}
|
|
188829
|
-
return identifier;
|
|
188830
|
-
}
|
|
188831
|
-
DirectiveDefinition(_node) {
|
|
188832
|
-
return "";
|
|
188833
|
-
}
|
|
188834
|
-
getArgumentsObjectDeclarationBlock(node, name, field) {
|
|
188835
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind(this._parsedConfig.declarationKind.arguments).withName(this.convertName(name)).withComment(node.description?.value).withBlock(this._argumentsTransformer.transform(field.arguments));
|
|
188836
|
-
}
|
|
188837
|
-
getArgumentsObjectTypeDefinition(node, name, field) {
|
|
188838
|
-
if (this.config.onlyEnums)
|
|
188839
|
-
return "";
|
|
188840
|
-
return this.getArgumentsObjectDeclarationBlock(node, name, field).string;
|
|
188841
|
-
}
|
|
188842
|
-
buildArgumentsBlock(node) {
|
|
188843
|
-
const fieldsWithArguments = node.fields.filter((field) => field.arguments && field.arguments.length > 0) || [];
|
|
188844
|
-
return fieldsWithArguments.map((field) => {
|
|
188845
|
-
const name = node.name.value + (this.config.addUnderscoreToArgsType ? "_" : "") + this.convertName(field, {
|
|
188846
|
-
useTypesPrefix: false,
|
|
188847
|
-
useTypesSuffix: false
|
|
188848
|
-
}) + "Args";
|
|
188849
|
-
return this.getArgumentsObjectTypeDefinition(node, name, field);
|
|
188850
|
-
}).join(`
|
|
188851
|
-
|
|
188852
|
-
`);
|
|
188853
|
-
}
|
|
188854
|
-
_getScalar(name, type) {
|
|
188855
|
-
return `Scalars['${name}']['${type}']`;
|
|
188856
|
-
}
|
|
188857
|
-
_getDirectiveArgumentNadInputFieldMapping(name) {
|
|
188858
|
-
return `DirectiveArgumentAndInputFieldMappings['${name}']`;
|
|
188859
|
-
}
|
|
188860
|
-
_getDirectiveOverrideType(directives2) {
|
|
188861
|
-
const type = directives2.map((directive) => {
|
|
188862
|
-
const directiveName = directive.name.value;
|
|
188863
|
-
if (this.config.directiveArgumentAndInputFieldMappings[directiveName]) {
|
|
188864
|
-
return this._getDirectiveArgumentNadInputFieldMapping(directiveName);
|
|
188865
|
-
}
|
|
188866
|
-
return null;
|
|
188867
|
-
}).reverse().find((a) => !!a);
|
|
188868
|
-
return type || null;
|
|
188869
|
-
}
|
|
188870
|
-
_getTypeForNode(node, isVisitingInputType) {
|
|
188871
|
-
const typeAsString = node.name.value;
|
|
188872
|
-
if (this.scalars[typeAsString]) {
|
|
188873
|
-
return this._getScalar(typeAsString, isVisitingInputType ? "input" : "output");
|
|
188874
|
-
}
|
|
188875
|
-
if (this.config.enumValues[typeAsString]) {
|
|
188876
|
-
return this.config.enumValues[typeAsString].typeIdentifierConverted;
|
|
188877
|
-
}
|
|
188878
|
-
const schemaType = this._schema.getType(typeAsString);
|
|
188879
|
-
if (schemaType && import_graphql74.isEnumType(schemaType)) {
|
|
188880
|
-
return this.convertName(node, {
|
|
188881
|
-
useTypesPrefix: this.config.enumPrefix,
|
|
188882
|
-
useTypesSuffix: this.config.enumSuffix
|
|
188883
|
-
});
|
|
188884
|
-
}
|
|
188885
|
-
return this.convertName(node);
|
|
188886
|
-
}
|
|
188887
|
-
NamedType(node, key, parent, path, ancestors) {
|
|
188888
|
-
const currentVisitContext = this.getVisitorKindContextFromAncestors(ancestors);
|
|
188889
|
-
const isVisitingInputType = currentVisitContext.includes(import_graphql74.Kind.INPUT_OBJECT_TYPE_DEFINITION);
|
|
188890
|
-
const typeToUse = this._getTypeForNode(node, isVisitingInputType);
|
|
188891
|
-
if (!isVisitingInputType && this.config.fieldWrapperValue && this.config.wrapFieldDefinitions) {
|
|
188892
|
-
return `FieldWrapper<${typeToUse}>`;
|
|
188893
|
-
}
|
|
188894
|
-
return typeToUse;
|
|
188895
|
-
}
|
|
188896
|
-
ListType(node, _key, _parent, _path, _ancestors) {
|
|
188897
|
-
const asString = node.type;
|
|
188898
|
-
return this.wrapWithListType(asString);
|
|
188899
|
-
}
|
|
188900
|
-
SchemaDefinition() {
|
|
188901
|
-
return null;
|
|
188902
|
-
}
|
|
188903
|
-
SchemaExtension() {
|
|
188904
|
-
return null;
|
|
188905
|
-
}
|
|
188906
|
-
wrapWithListType(str) {
|
|
188907
|
-
return `Array<${str}>`;
|
|
188908
|
-
}
|
|
188909
|
-
};
|
|
188910
188492
|
});
|
|
188911
188493
|
|
|
188912
188494
|
// node_modules/dependency-graph/lib/dep_graph.js
|
|
@@ -189893,7 +189475,7 @@ var require_main = __commonJS(function(exports, module) {
|
|
|
189893
189475
|
});
|
|
189894
189476
|
|
|
189895
189477
|
// node_modules/@graphql-tools/optimize/esm/optimizers/remove-description.js
|
|
189896
|
-
var
|
|
189478
|
+
var import_graphql74, removeDescriptions = (input) => {
|
|
189897
189479
|
function transformNode(node) {
|
|
189898
189480
|
if (!node.description) {
|
|
189899
189481
|
return node;
|
|
@@ -189901,7 +189483,7 @@ var import_graphql75, removeDescriptions = (input) => {
|
|
|
189901
189483
|
const { description, ...rest } = node;
|
|
189902
189484
|
return rest;
|
|
189903
189485
|
}
|
|
189904
|
-
return
|
|
189486
|
+
return import_graphql74.visit(input, {
|
|
189905
189487
|
ScalarTypeDefinition: transformNode,
|
|
189906
189488
|
ObjectTypeDefinition: transformNode,
|
|
189907
189489
|
InterfaceTypeDefinition: transformNode,
|
|
@@ -189920,11 +189502,11 @@ var import_graphql75, removeDescriptions = (input) => {
|
|
|
189920
189502
|
});
|
|
189921
189503
|
};
|
|
189922
189504
|
var init_remove_description = __esm(() => {
|
|
189923
|
-
|
|
189505
|
+
import_graphql74 = __toESM(require_graphql2(), 1);
|
|
189924
189506
|
});
|
|
189925
189507
|
|
|
189926
189508
|
// node_modules/@graphql-tools/optimize/esm/optimizers/remove-empty-nodes.js
|
|
189927
|
-
var
|
|
189509
|
+
var import_graphql75, removeEmptyNodes = (input) => {
|
|
189928
189510
|
function transformNode(node) {
|
|
189929
189511
|
let resultNode = node;
|
|
189930
189512
|
if (resultNode.directives && Array.isArray(resultNode.directives) && resultNode.directives.length === 0) {
|
|
@@ -189941,7 +189523,7 @@ var import_graphql76, removeEmptyNodes = (input) => {
|
|
|
189941
189523
|
}
|
|
189942
189524
|
return resultNode;
|
|
189943
189525
|
}
|
|
189944
|
-
return
|
|
189526
|
+
return import_graphql75.visit(input, {
|
|
189945
189527
|
FragmentDefinition: transformNode,
|
|
189946
189528
|
OperationDefinition: transformNode,
|
|
189947
189529
|
VariableDefinition: transformNode,
|
|
@@ -189970,11 +189552,11 @@ var import_graphql76, removeEmptyNodes = (input) => {
|
|
|
189970
189552
|
});
|
|
189971
189553
|
};
|
|
189972
189554
|
var init_remove_empty_nodes = __esm(() => {
|
|
189973
|
-
|
|
189555
|
+
import_graphql75 = __toESM(require_graphql2(), 1);
|
|
189974
189556
|
});
|
|
189975
189557
|
|
|
189976
189558
|
// node_modules/@graphql-tools/optimize/esm/optimizers/remove-loc.js
|
|
189977
|
-
var
|
|
189559
|
+
var import_graphql76, removeLoc = (input) => {
|
|
189978
189560
|
function transformNode(node) {
|
|
189979
189561
|
if (node.loc && typeof node.loc === "object") {
|
|
189980
189562
|
const { loc, ...rest } = node;
|
|
@@ -189982,10 +189564,10 @@ var import_graphql77, removeLoc = (input) => {
|
|
|
189982
189564
|
}
|
|
189983
189565
|
return node;
|
|
189984
189566
|
}
|
|
189985
|
-
return
|
|
189567
|
+
return import_graphql76.visit(input, { enter: transformNode });
|
|
189986
189568
|
};
|
|
189987
189569
|
var init_remove_loc = __esm(() => {
|
|
189988
|
-
|
|
189570
|
+
import_graphql76 = __toESM(require_graphql2(), 1);
|
|
189989
189571
|
});
|
|
189990
189572
|
|
|
189991
189573
|
// node_modules/@graphql-tools/optimize/esm/optimize.js
|
|
@@ -190025,7 +189607,7 @@ var init_esm4 = __esm(() => {
|
|
|
190025
189607
|
|
|
190026
189608
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/client-side-base-visitor.js
|
|
190027
189609
|
import { basename as basename4, extname } from "path";
|
|
190028
|
-
var import_dependency_graph,
|
|
189610
|
+
var import_dependency_graph, import_graphql77, import_graphql_tag, DocumentMode, EXTENSIONS_TO_REMOVE, ClientSideBaseVisitor;
|
|
190029
189611
|
var init_client_side_base_visitor = __esm(() => {
|
|
190030
189612
|
init_dist();
|
|
190031
189613
|
init_esm3();
|
|
@@ -190034,7 +189616,7 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190034
189616
|
init_imports();
|
|
190035
189617
|
init_utils2();
|
|
190036
189618
|
import_dependency_graph = __toESM(require_dep_graph(), 1);
|
|
190037
|
-
|
|
189619
|
+
import_graphql77 = __toESM(require_graphql2(), 1);
|
|
190038
189620
|
import_graphql_tag = __toESM(require_main(), 1);
|
|
190039
189621
|
import_graphql_tag.default.enableExperimentalFragmentVariables();
|
|
190040
189622
|
(function(DocumentMode2) {
|
|
@@ -190115,7 +189697,7 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190115
189697
|
_includeFragments(fragments, nodeKind) {
|
|
190116
189698
|
if (fragments && fragments.length > 0) {
|
|
190117
189699
|
if (this.config.documentMode === DocumentMode.documentNode || this.config.documentMode === DocumentMode.string) {
|
|
190118
|
-
return Array.from(this._fragments.values()).filter((f) => fragments.includes(this.getFragmentVariableName(f.name))).map((fragment) =>
|
|
189700
|
+
return Array.from(this._fragments.values()).filter((f) => fragments.includes(this.getFragmentVariableName(f.name))).map((fragment) => import_graphql77.print(fragment.node)).join(`
|
|
190119
189701
|
`);
|
|
190120
189702
|
}
|
|
190121
189703
|
if (this.config.documentMode === DocumentMode.documentNodeImportFragments) {
|
|
@@ -190137,7 +189719,7 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190137
189719
|
const fragmentNames = this._extractFragments(node, includeNestedFragments);
|
|
190138
189720
|
const fragments = this._transformFragments(fragmentNames);
|
|
190139
189721
|
const doc = this._prepareDocument(`
|
|
190140
|
-
${
|
|
189722
|
+
${import_graphql77.print(node).split("\\").join("\\\\")}
|
|
190141
189723
|
${this._includeFragments(fragments, node.kind)}`);
|
|
190142
189724
|
if (this.config.documentMode === DocumentMode.documentNode) {
|
|
190143
189725
|
let gqlObj = import_graphql_tag.default([doc]);
|
|
@@ -190160,7 +189742,7 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190160
189742
|
if (this.config.optimizeDocumentNode) {
|
|
190161
189743
|
definitions = [
|
|
190162
189744
|
...optimizeDocumentNode({
|
|
190163
|
-
kind:
|
|
189745
|
+
kind: import_graphql77.Kind.DOCUMENT,
|
|
190164
189746
|
definitions
|
|
190165
189747
|
}).definitions
|
|
190166
189748
|
];
|
|
@@ -190175,17 +189757,17 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190175
189757
|
metaString = `"__meta__":${JSON.stringify(meta)},`;
|
|
190176
189758
|
}
|
|
190177
189759
|
}
|
|
190178
|
-
return `{${metaString}"kind":"${
|
|
189760
|
+
return `{${metaString}"kind":"${import_graphql77.Kind.DOCUMENT}","definitions":${jsonStringify(definitions)}}`;
|
|
190179
189761
|
}
|
|
190180
189762
|
if (this.config.documentMode === DocumentMode.string) {
|
|
190181
|
-
if (node.kind ===
|
|
189763
|
+
if (node.kind === import_graphql77.Kind.FRAGMENT_DEFINITION) {
|
|
190182
189764
|
const meta = this._getGraphQLCodegenMetadata(node, import_graphql_tag.default([doc]).definitions);
|
|
190183
189765
|
return `new TypedDocumentString(\`${doc}\`, ${JSON.stringify({
|
|
190184
189766
|
fragmentName: node.name.value,
|
|
190185
189767
|
...meta
|
|
190186
189768
|
})})`;
|
|
190187
189769
|
}
|
|
190188
|
-
if (this._onExecutableDocumentNode && node.kind ===
|
|
189770
|
+
if (this._onExecutableDocumentNode && node.kind === import_graphql77.Kind.OPERATION_DEFINITION) {
|
|
190189
189771
|
const meta = this._getGraphQLCodegenMetadata(node, import_graphql_tag.default([doc]).definitions);
|
|
190190
189772
|
if (meta) {
|
|
190191
189773
|
if (this._omitDefinitions === true) {
|
|
@@ -190201,9 +189783,9 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190201
189783
|
}
|
|
190202
189784
|
_getGraphQLCodegenMetadata(node, definitions) {
|
|
190203
189785
|
let meta;
|
|
190204
|
-
if (node.kind ===
|
|
189786
|
+
if (node.kind === import_graphql77.Kind.OPERATION_DEFINITION) {
|
|
190205
189787
|
meta = this._onExecutableDocumentNode({
|
|
190206
|
-
kind:
|
|
189788
|
+
kind: import_graphql77.Kind.DOCUMENT,
|
|
190207
189789
|
definitions
|
|
190208
189790
|
});
|
|
190209
189791
|
}
|
|
@@ -190221,19 +189803,19 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190221
189803
|
const queue = [...node.selectionSet.selections];
|
|
190222
189804
|
while (queue.length) {
|
|
190223
189805
|
const selection = queue.shift();
|
|
190224
|
-
if (selection.kind ===
|
|
189806
|
+
if (selection.kind === import_graphql77.Kind.FRAGMENT_SPREAD && selection.directives?.some((d) => d.name.value === "defer")) {
|
|
190225
189807
|
const fragmentName = selection.name.value;
|
|
190226
189808
|
const fragment = this.fragmentsGraph.getNodeData(fragmentName);
|
|
190227
189809
|
if (fragment) {
|
|
190228
189810
|
const fields2 = fragment.node.selectionSet.selections.reduce((acc, selection2) => {
|
|
190229
|
-
if (selection2.kind ===
|
|
189811
|
+
if (selection2.kind === import_graphql77.Kind.FIELD) {
|
|
190230
189812
|
acc.push(selection2.name.value);
|
|
190231
189813
|
}
|
|
190232
189814
|
return acc;
|
|
190233
189815
|
}, []);
|
|
190234
189816
|
deferredFields[fragmentName] = fields2;
|
|
190235
189817
|
}
|
|
190236
|
-
} else if (selection.kind ===
|
|
189818
|
+
} else if (selection.kind === import_graphql77.Kind.FIELD && selection.selectionSet) {
|
|
190237
189819
|
queue.push(...selection.selectionSet.selections);
|
|
190238
189820
|
}
|
|
190239
189821
|
}
|
|
@@ -190253,8 +189835,8 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190253
189835
|
const graph = new import_dependency_graph.DepGraph({ circular: true });
|
|
190254
189836
|
for (const fragment of this._fragments.values()) {
|
|
190255
189837
|
if (graph.hasNode(fragment.name)) {
|
|
190256
|
-
const cachedAsString =
|
|
190257
|
-
const asString =
|
|
189838
|
+
const cachedAsString = import_graphql77.print(graph.getNodeData(fragment.name).node);
|
|
189839
|
+
const asString = import_graphql77.print(fragment.node);
|
|
190258
189840
|
if (cachedAsString !== asString) {
|
|
190259
189841
|
throw new Error(`Duplicated fragment called '${fragment.name}'!`);
|
|
190260
189842
|
}
|
|
@@ -190400,7 +189982,7 @@ var init_client_side_base_visitor = __esm(() => {
|
|
|
190400
189982
|
if (variables.length === 0) {
|
|
190401
189983
|
return false;
|
|
190402
189984
|
}
|
|
190403
|
-
return variables.some((variableDef) => variableDef.type.kind ===
|
|
189985
|
+
return variables.some((variableDef) => variableDef.type.kind === import_graphql77.Kind.NON_NULL_TYPE && !variableDef.defaultValue);
|
|
190404
189986
|
}
|
|
190405
189987
|
getOperationVariableName(node) {
|
|
190406
189988
|
return this.convertName(node, {
|
|
@@ -199800,8 +199382,8 @@ function createGraphQLError4(message, options) {
|
|
|
199800
199382
|
if (options?.originalError && !(options.originalError instanceof Error) && isGraphQLErrorLike4(options.originalError)) {
|
|
199801
199383
|
options.originalError = createGraphQLError4(options.originalError.message, options.originalError);
|
|
199802
199384
|
}
|
|
199803
|
-
const Constructor2 =
|
|
199804
|
-
const error =
|
|
199385
|
+
const Constructor2 = import_graphql78.GraphQLError;
|
|
199386
|
+
const error = import_graphql78.versionInfo.major >= 16 ? new Constructor2(message, options) : new Constructor2(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
199805
199387
|
if (options?.coordinate && error.coordinate == null) {
|
|
199806
199388
|
Object.defineProperties(error, {
|
|
199807
199389
|
coordinate: { value: options.coordinate, enumerable: true, configurable: true }
|
|
@@ -199809,9 +199391,9 @@ function createGraphQLError4(message, options) {
|
|
|
199809
199391
|
}
|
|
199810
199392
|
return error;
|
|
199811
199393
|
}
|
|
199812
|
-
var
|
|
199394
|
+
var import_graphql78, possibleGraphQLErrorProperties4;
|
|
199813
199395
|
var init_errors2 = __esm(() => {
|
|
199814
|
-
|
|
199396
|
+
import_graphql78 = __toESM(require_graphql2(), 1);
|
|
199815
199397
|
possibleGraphQLErrorProperties4 = [
|
|
199816
199398
|
"message",
|
|
199817
199399
|
"locations",
|
|
@@ -199851,10 +199433,10 @@ function getArgumentValues5(def, node, variableValues = {}) {
|
|
|
199851
199433
|
const argumentNode = argNodeMap[arg.name];
|
|
199852
199434
|
if (!argumentNode) {
|
|
199853
199435
|
if ("default" in arg && arg.default) {
|
|
199854
|
-
coercedValues[arg.name] = "value" in arg.default ? arg.default.value :
|
|
199436
|
+
coercedValues[arg.name] = "value" in arg.default ? arg.default.value : import_graphql79.valueFromASTUntyped(arg.default.literal);
|
|
199855
199437
|
} else if (arg.defaultValue !== undefined) {
|
|
199856
199438
|
coercedValues[arg.name] = arg.defaultValue;
|
|
199857
|
-
} else if (
|
|
199439
|
+
} else if (import_graphql79.isNonNullType(arg.type)) {
|
|
199858
199440
|
throw createGraphQLError4(`Argument "${arg.name}" of required type "${inspect(arg.type)}" ` + "was not provided.", {
|
|
199859
199441
|
nodes: [node]
|
|
199860
199442
|
});
|
|
@@ -199862,13 +199444,13 @@ function getArgumentValues5(def, node, variableValues = {}) {
|
|
|
199862
199444
|
continue;
|
|
199863
199445
|
}
|
|
199864
199446
|
const valueNode = argumentNode.value;
|
|
199865
|
-
let isNull = valueNode.kind ===
|
|
199866
|
-
if (valueNode.kind ===
|
|
199447
|
+
let isNull = valueNode.kind === import_graphql79.Kind.NULL;
|
|
199448
|
+
if (valueNode.kind === import_graphql79.Kind.VARIABLE) {
|
|
199867
199449
|
const variableName = valueNode.name.value;
|
|
199868
199450
|
if (variableValues == null || !hasOwnProperty4(variableValues, variableName)) {
|
|
199869
199451
|
if (arg.defaultValue !== undefined) {
|
|
199870
199452
|
coercedValues[arg.name] = arg.defaultValue;
|
|
199871
|
-
} else if (
|
|
199453
|
+
} else if (import_graphql79.isNonNullType(arg.type)) {
|
|
199872
199454
|
throw createGraphQLError4(`Argument "${arg.name}" of required type "${inspect(arg.type)}" ` + `was provided the variable "$${variableName}" which was not provided a runtime value.`, {
|
|
199873
199455
|
nodes: [valueNode]
|
|
199874
199456
|
});
|
|
@@ -199877,14 +199459,14 @@ function getArgumentValues5(def, node, variableValues = {}) {
|
|
|
199877
199459
|
}
|
|
199878
199460
|
isNull = variableValues[variableName] == null;
|
|
199879
199461
|
}
|
|
199880
|
-
if (isNull &&
|
|
199462
|
+
if (isNull && import_graphql79.isNonNullType(arg.type)) {
|
|
199881
199463
|
throw createGraphQLError4(`Argument "${arg.name}" of non-null type "${inspect(arg.type)}" ` + "must not be null.", {
|
|
199882
199464
|
nodes: [valueNode]
|
|
199883
199465
|
});
|
|
199884
199466
|
}
|
|
199885
|
-
const coercedValue =
|
|
199467
|
+
const coercedValue = import_graphql79.valueFromAST(valueNode, arg.type, variableValues);
|
|
199886
199468
|
if (coercedValue === undefined) {
|
|
199887
|
-
throw createGraphQLError4(`Argument "${arg.name}" has invalid value ${
|
|
199469
|
+
throw createGraphQLError4(`Argument "${arg.name}" has invalid value ${import_graphql79.print(valueNode)}.`, {
|
|
199888
199470
|
nodes: [valueNode]
|
|
199889
199471
|
});
|
|
199890
199472
|
}
|
|
@@ -199892,11 +199474,11 @@ function getArgumentValues5(def, node, variableValues = {}) {
|
|
|
199892
199474
|
}
|
|
199893
199475
|
return coercedValues;
|
|
199894
199476
|
}
|
|
199895
|
-
var
|
|
199477
|
+
var import_graphql79;
|
|
199896
199478
|
var init_getArgumentValues2 = __esm(() => {
|
|
199897
199479
|
init_errors2();
|
|
199898
199480
|
init_jsutils2();
|
|
199899
|
-
|
|
199481
|
+
import_graphql79 = __toESM(require_graphql2(), 1);
|
|
199900
199482
|
});
|
|
199901
199483
|
|
|
199902
199484
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/memoize.js
|
|
@@ -200049,11 +199631,11 @@ function getDirectiveExtensions5(directableObj, schema, pathToDirectivesInExtens
|
|
|
200049
199631
|
if (value[argName] == null) {
|
|
200050
199632
|
const argInDirective = directiveInSchema?.args.find((arg) => arg.name === argName);
|
|
200051
199633
|
if (argInDirective) {
|
|
200052
|
-
value[argName] =
|
|
199634
|
+
value[argName] = import_graphql80.valueFromAST(argNode.value, argInDirective.type);
|
|
200053
199635
|
}
|
|
200054
199636
|
}
|
|
200055
199637
|
if (value[argName] == null) {
|
|
200056
|
-
value[argName] =
|
|
199638
|
+
value[argName] = import_graphql80.valueFromASTUntyped(argNode.value);
|
|
200057
199639
|
}
|
|
200058
199640
|
}
|
|
200059
199641
|
}
|
|
@@ -200069,10 +199651,10 @@ function getDirectiveExtensions5(directableObj, schema, pathToDirectivesInExtens
|
|
|
200069
199651
|
}
|
|
200070
199652
|
return directiveExtensions;
|
|
200071
199653
|
}
|
|
200072
|
-
var
|
|
199654
|
+
var import_graphql80;
|
|
200073
199655
|
var init_getDirectiveExtensions2 = __esm(() => {
|
|
200074
199656
|
init_getArgumentValues2();
|
|
200075
|
-
|
|
199657
|
+
import_graphql80 = __toESM(require_graphql2(), 1);
|
|
200076
199658
|
});
|
|
200077
199659
|
|
|
200078
199660
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/get-directives.js
|
|
@@ -200095,38 +199677,38 @@ var init_get_arguments_with_directives2 = () => {};
|
|
|
200095
199677
|
|
|
200096
199678
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/astFromType.js
|
|
200097
199679
|
function astFromType5(type) {
|
|
200098
|
-
if (
|
|
199680
|
+
if (import_graphql81.isNonNullType(type)) {
|
|
200099
199681
|
const innerType = astFromType5(type.ofType);
|
|
200100
|
-
if (innerType.kind ===
|
|
199682
|
+
if (innerType.kind === import_graphql81.Kind.NON_NULL_TYPE) {
|
|
200101
199683
|
throw new Error(`Invalid type node ${inspect(type)}. Inner type of non-null type cannot be a non-null type.`);
|
|
200102
199684
|
}
|
|
200103
199685
|
return {
|
|
200104
|
-
kind:
|
|
199686
|
+
kind: import_graphql81.Kind.NON_NULL_TYPE,
|
|
200105
199687
|
type: innerType
|
|
200106
199688
|
};
|
|
200107
|
-
} else if (
|
|
199689
|
+
} else if (import_graphql81.isListType(type)) {
|
|
200108
199690
|
return {
|
|
200109
|
-
kind:
|
|
199691
|
+
kind: import_graphql81.Kind.LIST_TYPE,
|
|
200110
199692
|
type: astFromType5(type.ofType)
|
|
200111
199693
|
};
|
|
200112
199694
|
}
|
|
200113
199695
|
return {
|
|
200114
|
-
kind:
|
|
199696
|
+
kind: import_graphql81.Kind.NAMED_TYPE,
|
|
200115
199697
|
name: {
|
|
200116
|
-
kind:
|
|
199698
|
+
kind: import_graphql81.Kind.NAME,
|
|
200117
199699
|
value: type.name
|
|
200118
199700
|
}
|
|
200119
199701
|
};
|
|
200120
199702
|
}
|
|
200121
|
-
var
|
|
199703
|
+
var import_graphql81;
|
|
200122
199704
|
var init_astFromType2 = __esm(() => {
|
|
200123
|
-
|
|
199705
|
+
import_graphql81 = __toESM(require_graphql2(), 1);
|
|
200124
199706
|
});
|
|
200125
199707
|
|
|
200126
199708
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
|
|
200127
199709
|
function astFromValueUntyped5(value) {
|
|
200128
199710
|
if (value === null) {
|
|
200129
|
-
return { kind:
|
|
199711
|
+
return { kind: import_graphql82.Kind.NULL };
|
|
200130
199712
|
}
|
|
200131
199713
|
if (value === undefined) {
|
|
200132
199714
|
return null;
|
|
@@ -200139,7 +199721,7 @@ function astFromValueUntyped5(value) {
|
|
|
200139
199721
|
valuesNodes.push(itemNode);
|
|
200140
199722
|
}
|
|
200141
199723
|
}
|
|
200142
|
-
return { kind:
|
|
199724
|
+
return { kind: import_graphql82.Kind.LIST, values: valuesNodes };
|
|
200143
199725
|
}
|
|
200144
199726
|
if (typeof value === "object") {
|
|
200145
199727
|
if (value?.toJSON) {
|
|
@@ -200151,51 +199733,51 @@ function astFromValueUntyped5(value) {
|
|
|
200151
199733
|
const ast = astFromValueUntyped5(fieldValue);
|
|
200152
199734
|
if (ast) {
|
|
200153
199735
|
fieldNodes.push({
|
|
200154
|
-
kind:
|
|
200155
|
-
name: { kind:
|
|
199736
|
+
kind: import_graphql82.Kind.OBJECT_FIELD,
|
|
199737
|
+
name: { kind: import_graphql82.Kind.NAME, value: fieldName },
|
|
200156
199738
|
value: ast
|
|
200157
199739
|
});
|
|
200158
199740
|
}
|
|
200159
199741
|
}
|
|
200160
|
-
return { kind:
|
|
199742
|
+
return { kind: import_graphql82.Kind.OBJECT, fields: fieldNodes };
|
|
200161
199743
|
}
|
|
200162
199744
|
if (typeof value === "boolean") {
|
|
200163
|
-
return { kind:
|
|
199745
|
+
return { kind: import_graphql82.Kind.BOOLEAN, value };
|
|
200164
199746
|
}
|
|
200165
199747
|
if (typeof value === "bigint") {
|
|
200166
|
-
return { kind:
|
|
199748
|
+
return { kind: import_graphql82.Kind.INT, value: String(value) };
|
|
200167
199749
|
}
|
|
200168
199750
|
if (typeof value === "number" && isFinite(value)) {
|
|
200169
199751
|
const stringNum = String(value);
|
|
200170
|
-
return integerStringRegExp7.test(stringNum) ? { kind:
|
|
199752
|
+
return integerStringRegExp7.test(stringNum) ? { kind: import_graphql82.Kind.INT, value: stringNum } : { kind: import_graphql82.Kind.FLOAT, value: stringNum };
|
|
200171
199753
|
}
|
|
200172
199754
|
if (typeof value === "string") {
|
|
200173
|
-
return { kind:
|
|
199755
|
+
return { kind: import_graphql82.Kind.STRING, value };
|
|
200174
199756
|
}
|
|
200175
199757
|
throw new TypeError(`Cannot convert value to AST: ${value}.`);
|
|
200176
199758
|
}
|
|
200177
|
-
var
|
|
199759
|
+
var import_graphql82, integerStringRegExp7;
|
|
200178
199760
|
var init_astFromValueUntyped2 = __esm(() => {
|
|
200179
|
-
|
|
199761
|
+
import_graphql82 = __toESM(require_graphql2(), 1);
|
|
200180
199762
|
integerStringRegExp7 = /^-?(?:0|[1-9][0-9]*)$/;
|
|
200181
199763
|
});
|
|
200182
199764
|
|
|
200183
199765
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
200184
199766
|
function astFromValue4(value, type) {
|
|
200185
|
-
if (
|
|
199767
|
+
if (import_graphql83.isNonNullType(type)) {
|
|
200186
199768
|
const astValue = astFromValue4(value, type.ofType);
|
|
200187
|
-
if (astValue?.kind ===
|
|
199769
|
+
if (astValue?.kind === import_graphql83.Kind.NULL) {
|
|
200188
199770
|
return null;
|
|
200189
199771
|
}
|
|
200190
199772
|
return astValue;
|
|
200191
199773
|
}
|
|
200192
199774
|
if (value === null) {
|
|
200193
|
-
return { kind:
|
|
199775
|
+
return { kind: import_graphql83.Kind.NULL };
|
|
200194
199776
|
}
|
|
200195
199777
|
if (value === undefined) {
|
|
200196
199778
|
return null;
|
|
200197
199779
|
}
|
|
200198
|
-
if (
|
|
199780
|
+
if (import_graphql83.isListType(type)) {
|
|
200199
199781
|
const itemType = type.ofType;
|
|
200200
199782
|
if (isIterableObject4(value)) {
|
|
200201
199783
|
const valuesNodes = [];
|
|
@@ -200205,11 +199787,11 @@ function astFromValue4(value, type) {
|
|
|
200205
199787
|
valuesNodes.push(itemNode);
|
|
200206
199788
|
}
|
|
200207
199789
|
}
|
|
200208
|
-
return { kind:
|
|
199790
|
+
return { kind: import_graphql83.Kind.LIST, values: valuesNodes };
|
|
200209
199791
|
}
|
|
200210
199792
|
return astFromValue4(value, itemType);
|
|
200211
199793
|
}
|
|
200212
|
-
if (
|
|
199794
|
+
if (import_graphql83.isInputObjectType(type)) {
|
|
200213
199795
|
if (!isObjectLike4(value)) {
|
|
200214
199796
|
return null;
|
|
200215
199797
|
}
|
|
@@ -200218,16 +199800,16 @@ function astFromValue4(value, type) {
|
|
|
200218
199800
|
const fieldValue = astFromValue4(value[field.name], field.type);
|
|
200219
199801
|
if (fieldValue) {
|
|
200220
199802
|
fieldNodes.push({
|
|
200221
|
-
kind:
|
|
200222
|
-
name: { kind:
|
|
199803
|
+
kind: import_graphql83.Kind.OBJECT_FIELD,
|
|
199804
|
+
name: { kind: import_graphql83.Kind.NAME, value: field.name },
|
|
200223
199805
|
value: fieldValue
|
|
200224
199806
|
});
|
|
200225
199807
|
}
|
|
200226
199808
|
}
|
|
200227
|
-
return { kind:
|
|
199809
|
+
return { kind: import_graphql83.Kind.OBJECT, fields: fieldNodes };
|
|
200228
199810
|
}
|
|
200229
|
-
if (
|
|
200230
|
-
if (
|
|
199811
|
+
if (import_graphql83.isLeafType(type)) {
|
|
199812
|
+
if (import_graphql83.isEnumType(type)) {
|
|
200231
199813
|
const values = type.getValues();
|
|
200232
199814
|
for (const enumValue of values) {
|
|
200233
199815
|
if (enumValue.value === value) {
|
|
@@ -200239,7 +199821,7 @@ function astFromValue4(value, type) {
|
|
|
200239
199821
|
break;
|
|
200240
199822
|
}
|
|
200241
199823
|
}
|
|
200242
|
-
return { kind:
|
|
199824
|
+
return { kind: import_graphql83.Kind.ENUM, value };
|
|
200243
199825
|
} else {
|
|
200244
199826
|
value = type.serialize(value);
|
|
200245
199827
|
}
|
|
@@ -200247,21 +199829,21 @@ function astFromValue4(value, type) {
|
|
|
200247
199829
|
return null;
|
|
200248
199830
|
}
|
|
200249
199831
|
if (type.name === "ID" && typeof value === "string" && integerStringRegExp8.test(value)) {
|
|
200250
|
-
return { kind:
|
|
199832
|
+
return { kind: import_graphql83.Kind.INT, value };
|
|
200251
199833
|
}
|
|
200252
199834
|
}
|
|
200253
199835
|
return astFromValueUntyped5(value);
|
|
200254
199836
|
}
|
|
200255
|
-
var
|
|
199837
|
+
var import_graphql83, integerStringRegExp8;
|
|
200256
199838
|
var init_astFromValue2 = __esm(() => {
|
|
200257
199839
|
init_astFromValueUntyped2();
|
|
200258
199840
|
init_jsutils2();
|
|
200259
|
-
|
|
199841
|
+
import_graphql83 = __toESM(require_graphql2(), 1);
|
|
200260
199842
|
integerStringRegExp8 = /^-?(?:0|[1-9][0-9]*)$/;
|
|
200261
199843
|
});
|
|
200262
199844
|
|
|
200263
199845
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/defaultValueAstFromType.js
|
|
200264
|
-
var
|
|
199846
|
+
var import_graphql84, defaultValueAstFromType4 = (arg) => {
|
|
200265
199847
|
if ("default" in arg) {
|
|
200266
199848
|
if (!arg.default) {
|
|
200267
199849
|
return;
|
|
@@ -200269,7 +199851,7 @@ var import_graphql85, defaultValueAstFromType4 = (arg) => {
|
|
|
200269
199851
|
if ("value" in arg.default) {
|
|
200270
199852
|
return astFromValueUntyped5(arg.default.value) ?? undefined;
|
|
200271
199853
|
}
|
|
200272
|
-
const value =
|
|
199854
|
+
const value = import_graphql84.valueFromASTUntyped(arg.default.literal);
|
|
200273
199855
|
return astFromValue4(value, arg.type) ?? undefined;
|
|
200274
199856
|
}
|
|
200275
199857
|
return arg.defaultValue !== undefined ? astFromValue4(arg.defaultValue, arg.type) ?? undefined : undefined;
|
|
@@ -200277,14 +199859,14 @@ var import_graphql85, defaultValueAstFromType4 = (arg) => {
|
|
|
200277
199859
|
var init_defaultValueAstFromType2 = __esm(() => {
|
|
200278
199860
|
init_astFromValue2();
|
|
200279
199861
|
init_astFromValueUntyped2();
|
|
200280
|
-
|
|
199862
|
+
import_graphql84 = __toESM(require_graphql2(), 1);
|
|
200281
199863
|
});
|
|
200282
199864
|
|
|
200283
199865
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/descriptionFromObject.js
|
|
200284
199866
|
function getDescriptionNode4(obj) {
|
|
200285
199867
|
if (typeof obj.description === "string") {
|
|
200286
199868
|
return {
|
|
200287
|
-
kind:
|
|
199869
|
+
kind: import_graphql85.Kind.STRING,
|
|
200288
199870
|
value: obj.description,
|
|
200289
199871
|
block: true
|
|
200290
199872
|
};
|
|
@@ -200296,9 +199878,9 @@ function getDescriptionNode4(obj) {
|
|
|
200296
199878
|
};
|
|
200297
199879
|
}
|
|
200298
199880
|
}
|
|
200299
|
-
var
|
|
199881
|
+
var import_graphql85;
|
|
200300
199882
|
var init_descriptionFromObject2 = __esm(() => {
|
|
200301
|
-
|
|
199883
|
+
import_graphql85 = __toESM(require_graphql2(), 1);
|
|
200302
199884
|
});
|
|
200303
199885
|
|
|
200304
199886
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/rootTypes.js
|
|
@@ -200338,42 +199920,42 @@ function getDocumentNodeFromSchema4(schema, options = {}) {
|
|
|
200338
199920
|
const definitions = schemaNode != null ? [schemaNode] : [];
|
|
200339
199921
|
const directives2 = schema.getDirectives();
|
|
200340
199922
|
for (const directive of directives2) {
|
|
200341
|
-
if (
|
|
199923
|
+
if (import_graphql86.isSpecifiedDirective(directive)) {
|
|
200342
199924
|
continue;
|
|
200343
199925
|
}
|
|
200344
199926
|
definitions.push(astFromDirective4(directive, schema, pathToDirectivesInExtensions));
|
|
200345
199927
|
}
|
|
200346
199928
|
for (const typeName in typesMap) {
|
|
200347
199929
|
const type = typesMap[typeName];
|
|
200348
|
-
const isPredefinedScalar =
|
|
200349
|
-
const isIntrospection =
|
|
199930
|
+
const isPredefinedScalar = import_graphql86.isSpecifiedScalarType(type);
|
|
199931
|
+
const isIntrospection = import_graphql86.isIntrospectionType(type);
|
|
200350
199932
|
if (isPredefinedScalar || isIntrospection) {
|
|
200351
199933
|
continue;
|
|
200352
199934
|
}
|
|
200353
|
-
if (
|
|
199935
|
+
if (import_graphql86.isObjectType(type)) {
|
|
200354
199936
|
definitions.push(astFromObjectType4(type, schema, pathToDirectivesInExtensions));
|
|
200355
|
-
} else if (
|
|
199937
|
+
} else if (import_graphql86.isInterfaceType(type)) {
|
|
200356
199938
|
definitions.push(astFromInterfaceType4(type, schema, pathToDirectivesInExtensions));
|
|
200357
|
-
} else if (
|
|
199939
|
+
} else if (import_graphql86.isUnionType(type)) {
|
|
200358
199940
|
definitions.push(astFromUnionType4(type, schema, pathToDirectivesInExtensions));
|
|
200359
|
-
} else if (
|
|
199941
|
+
} else if (import_graphql86.isInputObjectType(type)) {
|
|
200360
199942
|
definitions.push(astFromInputObjectType4(type, schema, pathToDirectivesInExtensions));
|
|
200361
|
-
} else if (
|
|
199943
|
+
} else if (import_graphql86.isEnumType(type)) {
|
|
200362
199944
|
definitions.push(astFromEnumType4(type, schema, pathToDirectivesInExtensions));
|
|
200363
|
-
} else if (
|
|
199945
|
+
} else if (import_graphql86.isScalarType(type)) {
|
|
200364
199946
|
definitions.push(astFromScalarType4(type, schema, pathToDirectivesInExtensions));
|
|
200365
199947
|
} else {
|
|
200366
199948
|
throw new Error(`Unknown type ${type}.`);
|
|
200367
199949
|
}
|
|
200368
199950
|
}
|
|
200369
199951
|
return {
|
|
200370
|
-
kind:
|
|
199952
|
+
kind: import_graphql86.Kind.DOCUMENT,
|
|
200371
199953
|
definitions
|
|
200372
199954
|
};
|
|
200373
199955
|
}
|
|
200374
199956
|
function printSchemaWithDirectives(schema, options = {}) {
|
|
200375
199957
|
const documentNode = getDocumentNodeFromSchema4(schema, options);
|
|
200376
|
-
return
|
|
199958
|
+
return import_graphql86.print(documentNode);
|
|
200377
199959
|
}
|
|
200378
199960
|
function astFromSchema4(schema, pathToDirectivesInExtensions) {
|
|
200379
199961
|
const operationTypeMap = new Map([
|
|
@@ -200406,7 +199988,7 @@ function astFromSchema4(schema, pathToDirectivesInExtensions) {
|
|
|
200406
199988
|
operationTypeDefinitionNode.type = rootTypeAST;
|
|
200407
199989
|
} else {
|
|
200408
199990
|
operationTypeMap.set(operationTypeNode, {
|
|
200409
|
-
kind:
|
|
199991
|
+
kind: import_graphql86.Kind.OPERATION_TYPE_DEFINITION,
|
|
200410
199992
|
operation: operationTypeNode,
|
|
200411
199993
|
type: rootTypeAST
|
|
200412
199994
|
});
|
|
@@ -200421,7 +200003,7 @@ function astFromSchema4(schema, pathToDirectivesInExtensions) {
|
|
|
200421
200003
|
return null;
|
|
200422
200004
|
}
|
|
200423
200005
|
const schemaNode = {
|
|
200424
|
-
kind: operationTypes.length ?
|
|
200006
|
+
kind: operationTypes.length ? import_graphql86.Kind.SCHEMA_DEFINITION : import_graphql86.Kind.SCHEMA_EXTENSION,
|
|
200425
200007
|
operationTypes,
|
|
200426
200008
|
directives: directives2
|
|
200427
200009
|
};
|
|
@@ -200433,16 +200015,16 @@ function astFromSchema4(schema, pathToDirectivesInExtensions) {
|
|
|
200433
200015
|
}
|
|
200434
200016
|
function astFromDirective4(directive, schema, pathToDirectivesInExtensions) {
|
|
200435
200017
|
return {
|
|
200436
|
-
kind:
|
|
200018
|
+
kind: import_graphql86.Kind.DIRECTIVE_DEFINITION,
|
|
200437
200019
|
description: getDescriptionNode4(directive),
|
|
200438
200020
|
name: {
|
|
200439
|
-
kind:
|
|
200021
|
+
kind: import_graphql86.Kind.NAME,
|
|
200440
200022
|
value: directive.name
|
|
200441
200023
|
},
|
|
200442
200024
|
arguments: directive.args?.map((arg) => astFromArg4(arg, schema, pathToDirectivesInExtensions)),
|
|
200443
200025
|
repeatable: directive.isRepeatable,
|
|
200444
200026
|
locations: directive.locations?.map((location) => ({
|
|
200445
|
-
kind:
|
|
200027
|
+
kind: import_graphql86.Kind.NAME,
|
|
200446
200028
|
value: location
|
|
200447
200029
|
})) || []
|
|
200448
200030
|
};
|
|
@@ -200458,7 +200040,7 @@ function getDirectiveNodes4(entity, schema, pathToDirectivesInExtensions) {
|
|
|
200458
200040
|
let specifiedByDirectiveNode = null;
|
|
200459
200041
|
let oneOfDirectiveNode = null;
|
|
200460
200042
|
if (directives2 != null) {
|
|
200461
|
-
directiveNodesBesidesNativeDirectives = directives2.filter((directive) =>
|
|
200043
|
+
directiveNodesBesidesNativeDirectives = directives2.filter((directive) => import_graphql86.specifiedDirectives.every((specifiedDirective) => specifiedDirective.name !== directive.name.value));
|
|
200462
200044
|
deprecatedDirectiveNode = directives2.find((directive) => directive.name.value === "deprecated");
|
|
200463
200045
|
specifiedByDirectiveNode = directives2.find((directive) => directive.name.value === "specifiedBy");
|
|
200464
200046
|
oneOfDirectiveNode = directives2.find((directive) => directive.name.value === "oneOf");
|
|
@@ -200489,10 +200071,10 @@ function getDirectiveNodes4(entity, schema, pathToDirectivesInExtensions) {
|
|
|
200489
200071
|
}
|
|
200490
200072
|
function astFromArg4(arg, schema, pathToDirectivesInExtensions) {
|
|
200491
200073
|
return {
|
|
200492
|
-
kind:
|
|
200074
|
+
kind: import_graphql86.Kind.INPUT_VALUE_DEFINITION,
|
|
200493
200075
|
description: getDescriptionNode4(arg),
|
|
200494
200076
|
name: {
|
|
200495
|
-
kind:
|
|
200077
|
+
kind: import_graphql86.Kind.NAME,
|
|
200496
200078
|
value: arg.name
|
|
200497
200079
|
},
|
|
200498
200080
|
type: astFromType5(arg.type),
|
|
@@ -200502,10 +200084,10 @@ function astFromArg4(arg, schema, pathToDirectivesInExtensions) {
|
|
|
200502
200084
|
}
|
|
200503
200085
|
function astFromObjectType4(type, schema, pathToDirectivesInExtensions) {
|
|
200504
200086
|
return {
|
|
200505
|
-
kind:
|
|
200087
|
+
kind: import_graphql86.Kind.OBJECT_TYPE_DEFINITION,
|
|
200506
200088
|
description: getDescriptionNode4(type),
|
|
200507
200089
|
name: {
|
|
200508
|
-
kind:
|
|
200090
|
+
kind: import_graphql86.Kind.NAME,
|
|
200509
200091
|
value: type.name
|
|
200510
200092
|
},
|
|
200511
200093
|
fields: Object.values(type.getFields()).map((field) => astFromField4(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -200515,10 +200097,10 @@ function astFromObjectType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200515
200097
|
}
|
|
200516
200098
|
function astFromInterfaceType4(type, schema, pathToDirectivesInExtensions) {
|
|
200517
200099
|
const node = {
|
|
200518
|
-
kind:
|
|
200100
|
+
kind: import_graphql86.Kind.INTERFACE_TYPE_DEFINITION,
|
|
200519
200101
|
description: getDescriptionNode4(type),
|
|
200520
200102
|
name: {
|
|
200521
|
-
kind:
|
|
200103
|
+
kind: import_graphql86.Kind.NAME,
|
|
200522
200104
|
value: type.name
|
|
200523
200105
|
},
|
|
200524
200106
|
fields: Object.values(type.getFields()).map((field) => astFromField4(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -200531,10 +200113,10 @@ function astFromInterfaceType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200531
200113
|
}
|
|
200532
200114
|
function astFromUnionType4(type, schema, pathToDirectivesInExtensions) {
|
|
200533
200115
|
return {
|
|
200534
|
-
kind:
|
|
200116
|
+
kind: import_graphql86.Kind.UNION_TYPE_DEFINITION,
|
|
200535
200117
|
description: getDescriptionNode4(type),
|
|
200536
200118
|
name: {
|
|
200537
|
-
kind:
|
|
200119
|
+
kind: import_graphql86.Kind.NAME,
|
|
200538
200120
|
value: type.name
|
|
200539
200121
|
},
|
|
200540
200122
|
directives: getDirectiveNodes4(type, schema, pathToDirectivesInExtensions),
|
|
@@ -200543,10 +200125,10 @@ function astFromUnionType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200543
200125
|
}
|
|
200544
200126
|
function astFromInputObjectType4(type, schema, pathToDirectivesInExtensions) {
|
|
200545
200127
|
return {
|
|
200546
|
-
kind:
|
|
200128
|
+
kind: import_graphql86.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
200547
200129
|
description: getDescriptionNode4(type),
|
|
200548
200130
|
name: {
|
|
200549
|
-
kind:
|
|
200131
|
+
kind: import_graphql86.Kind.NAME,
|
|
200550
200132
|
value: type.name
|
|
200551
200133
|
},
|
|
200552
200134
|
fields: Object.values(type.getFields()).map((field) => astFromInputField4(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -200555,10 +200137,10 @@ function astFromInputObjectType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200555
200137
|
}
|
|
200556
200138
|
function astFromEnumType4(type, schema, pathToDirectivesInExtensions) {
|
|
200557
200139
|
return {
|
|
200558
|
-
kind:
|
|
200140
|
+
kind: import_graphql86.Kind.ENUM_TYPE_DEFINITION,
|
|
200559
200141
|
description: getDescriptionNode4(type),
|
|
200560
200142
|
name: {
|
|
200561
|
-
kind:
|
|
200143
|
+
kind: import_graphql86.Kind.NAME,
|
|
200562
200144
|
value: type.name
|
|
200563
200145
|
},
|
|
200564
200146
|
values: Object.values(type.getValues()).map((value) => astFromEnumValue4(value, schema, pathToDirectivesInExtensions)),
|
|
@@ -200576,10 +200158,10 @@ function astFromScalarType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200576
200158
|
directives2.push(makeDirectiveNode4("specifiedBy", specifiedByArgs));
|
|
200577
200159
|
}
|
|
200578
200160
|
return {
|
|
200579
|
-
kind:
|
|
200161
|
+
kind: import_graphql86.Kind.SCALAR_TYPE_DEFINITION,
|
|
200580
200162
|
description: getDescriptionNode4(type),
|
|
200581
200163
|
name: {
|
|
200582
|
-
kind:
|
|
200164
|
+
kind: import_graphql86.Kind.NAME,
|
|
200583
200165
|
value: type.name
|
|
200584
200166
|
},
|
|
200585
200167
|
directives: directives2
|
|
@@ -200587,10 +200169,10 @@ function astFromScalarType4(type, schema, pathToDirectivesInExtensions) {
|
|
|
200587
200169
|
}
|
|
200588
200170
|
function astFromField4(field, schema, pathToDirectivesInExtensions) {
|
|
200589
200171
|
return {
|
|
200590
|
-
kind:
|
|
200172
|
+
kind: import_graphql86.Kind.FIELD_DEFINITION,
|
|
200591
200173
|
description: getDescriptionNode4(field),
|
|
200592
200174
|
name: {
|
|
200593
|
-
kind:
|
|
200175
|
+
kind: import_graphql86.Kind.NAME,
|
|
200594
200176
|
value: field.name
|
|
200595
200177
|
},
|
|
200596
200178
|
arguments: field.args.map((arg) => astFromArg4(arg, schema, pathToDirectivesInExtensions)),
|
|
@@ -200600,10 +200182,10 @@ function astFromField4(field, schema, pathToDirectivesInExtensions) {
|
|
|
200600
200182
|
}
|
|
200601
200183
|
function astFromInputField4(field, schema, pathToDirectivesInExtensions) {
|
|
200602
200184
|
return {
|
|
200603
|
-
kind:
|
|
200185
|
+
kind: import_graphql86.Kind.INPUT_VALUE_DEFINITION,
|
|
200604
200186
|
description: getDescriptionNode4(field),
|
|
200605
200187
|
name: {
|
|
200606
|
-
kind:
|
|
200188
|
+
kind: import_graphql86.Kind.NAME,
|
|
200607
200189
|
value: field.name
|
|
200608
200190
|
},
|
|
200609
200191
|
type: astFromType5(field.type),
|
|
@@ -200613,17 +200195,17 @@ function astFromInputField4(field, schema, pathToDirectivesInExtensions) {
|
|
|
200613
200195
|
}
|
|
200614
200196
|
function astFromEnumValue4(value, schema, pathToDirectivesInExtensions) {
|
|
200615
200197
|
return {
|
|
200616
|
-
kind:
|
|
200198
|
+
kind: import_graphql86.Kind.ENUM_VALUE_DEFINITION,
|
|
200617
200199
|
description: getDescriptionNode4(value),
|
|
200618
200200
|
name: {
|
|
200619
|
-
kind:
|
|
200201
|
+
kind: import_graphql86.Kind.NAME,
|
|
200620
200202
|
value: value.name
|
|
200621
200203
|
},
|
|
200622
200204
|
directives: getDirectiveNodes4(value, schema, pathToDirectivesInExtensions)
|
|
200623
200205
|
};
|
|
200624
200206
|
}
|
|
200625
200207
|
function makeDeprecatedDirective4(deprecationReason) {
|
|
200626
|
-
return makeDirectiveNode4("deprecated", { reason: deprecationReason },
|
|
200208
|
+
return makeDirectiveNode4("deprecated", { reason: deprecationReason }, import_graphql86.GraphQLDeprecatedDirective);
|
|
200627
200209
|
}
|
|
200628
200210
|
function makeDirectiveNode4(name, args, directive) {
|
|
200629
200211
|
const directiveArguments = [];
|
|
@@ -200641,9 +200223,9 @@ function makeDirectiveNode4(name, args, directive) {
|
|
|
200641
200223
|
}
|
|
200642
200224
|
if (value != null) {
|
|
200643
200225
|
directiveArguments.push({
|
|
200644
|
-
kind:
|
|
200226
|
+
kind: import_graphql86.Kind.ARGUMENT,
|
|
200645
200227
|
name: {
|
|
200646
|
-
kind:
|
|
200228
|
+
kind: import_graphql86.Kind.NAME,
|
|
200647
200229
|
value: argName
|
|
200648
200230
|
},
|
|
200649
200231
|
value
|
|
@@ -200651,9 +200233,9 @@ function makeDirectiveNode4(name, args, directive) {
|
|
|
200651
200233
|
}
|
|
200652
200234
|
}
|
|
200653
200235
|
return {
|
|
200654
|
-
kind:
|
|
200236
|
+
kind: import_graphql86.Kind.DIRECTIVE,
|
|
200655
200237
|
name: {
|
|
200656
|
-
kind:
|
|
200238
|
+
kind: import_graphql86.Kind.NAME,
|
|
200657
200239
|
value: name
|
|
200658
200240
|
},
|
|
200659
200241
|
arguments: directiveArguments
|
|
@@ -200667,7 +200249,7 @@ function makeDirectiveNodes4(schema, directiveValues) {
|
|
|
200667
200249
|
}
|
|
200668
200250
|
return directiveNodes;
|
|
200669
200251
|
}
|
|
200670
|
-
var
|
|
200252
|
+
var import_graphql86;
|
|
200671
200253
|
var init_print_schema_with_directives2 = __esm(() => {
|
|
200672
200254
|
init_astFromType2();
|
|
200673
200255
|
init_astFromValue2();
|
|
@@ -200677,7 +200259,7 @@ var init_print_schema_with_directives2 = __esm(() => {
|
|
|
200677
200259
|
init_get_directives2();
|
|
200678
200260
|
init_helpers3();
|
|
200679
200261
|
init_rootTypes2();
|
|
200680
|
-
|
|
200262
|
+
import_graphql86 = __toESM(require_graphql2(), 1);
|
|
200681
200263
|
});
|
|
200682
200264
|
|
|
200683
200265
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/validate-documents.js
|
|
@@ -201041,42 +200623,42 @@ var init_AccumulatorMap2 = __esm(() => {
|
|
|
201041
200623
|
});
|
|
201042
200624
|
|
|
201043
200625
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/directives.js
|
|
201044
|
-
var
|
|
200626
|
+
var import_graphql87, GraphQLDeferDirective2, GraphQLStreamDirective2;
|
|
201045
200627
|
var init_directives2 = __esm(() => {
|
|
201046
|
-
|
|
201047
|
-
GraphQLDeferDirective2 = new
|
|
200628
|
+
import_graphql87 = __toESM(require_graphql2(), 1);
|
|
200629
|
+
GraphQLDeferDirective2 = new import_graphql87.GraphQLDirective({
|
|
201048
200630
|
name: "defer",
|
|
201049
200631
|
description: "Directs the executor to defer this fragment when the `if` argument is true or undefined.",
|
|
201050
|
-
locations: [
|
|
200632
|
+
locations: [import_graphql87.DirectiveLocation.FRAGMENT_SPREAD, import_graphql87.DirectiveLocation.INLINE_FRAGMENT],
|
|
201051
200633
|
args: {
|
|
201052
200634
|
if: {
|
|
201053
|
-
type: new
|
|
200635
|
+
type: new import_graphql87.GraphQLNonNull(import_graphql87.GraphQLBoolean),
|
|
201054
200636
|
description: "Deferred when true or undefined.",
|
|
201055
200637
|
defaultValue: true
|
|
201056
200638
|
},
|
|
201057
200639
|
label: {
|
|
201058
|
-
type:
|
|
200640
|
+
type: import_graphql87.GraphQLString,
|
|
201059
200641
|
description: "Unique name"
|
|
201060
200642
|
}
|
|
201061
200643
|
}
|
|
201062
200644
|
});
|
|
201063
|
-
GraphQLStreamDirective2 = new
|
|
200645
|
+
GraphQLStreamDirective2 = new import_graphql87.GraphQLDirective({
|
|
201064
200646
|
name: "stream",
|
|
201065
200647
|
description: "Directs the executor to stream plural fields when the `if` argument is true or undefined.",
|
|
201066
|
-
locations: [
|
|
200648
|
+
locations: [import_graphql87.DirectiveLocation.FIELD],
|
|
201067
200649
|
args: {
|
|
201068
200650
|
if: {
|
|
201069
|
-
type: new
|
|
200651
|
+
type: new import_graphql87.GraphQLNonNull(import_graphql87.GraphQLBoolean),
|
|
201070
200652
|
description: "Stream when true or undefined.",
|
|
201071
200653
|
defaultValue: true
|
|
201072
200654
|
},
|
|
201073
200655
|
label: {
|
|
201074
|
-
type:
|
|
200656
|
+
type: import_graphql87.GraphQLString,
|
|
201075
200657
|
description: "Unique name"
|
|
201076
200658
|
},
|
|
201077
200659
|
initialCount: {
|
|
201078
200660
|
defaultValue: 0,
|
|
201079
|
-
type:
|
|
200661
|
+
type: import_graphql87.GraphQLInt,
|
|
201080
200662
|
description: "Number of items to return immediately"
|
|
201081
200663
|
}
|
|
201082
200664
|
}
|
|
@@ -201085,28 +200667,28 @@ var init_directives2 = __esm(() => {
|
|
|
201085
200667
|
|
|
201086
200668
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/getDirectiveValues.js
|
|
201087
200669
|
function getDirectiveValues2(directiveDef, node, variableValues) {
|
|
201088
|
-
if (
|
|
201089
|
-
return
|
|
200670
|
+
if (import_graphql88.versionInfo.major >= 17) {
|
|
200671
|
+
return import_graphql88.getDirectiveValues(directiveDef, node, variableValues);
|
|
201090
200672
|
}
|
|
201091
|
-
return
|
|
200673
|
+
return import_graphql88.getDirectiveValues(directiveDef, node, variableValues?.coerced);
|
|
201092
200674
|
}
|
|
201093
|
-
var
|
|
200675
|
+
var import_graphql88;
|
|
201094
200676
|
var init_getDirectiveValues = __esm(() => {
|
|
201095
|
-
|
|
200677
|
+
import_graphql88 = __toESM(require_graphql2(), 1);
|
|
201096
200678
|
});
|
|
201097
200679
|
|
|
201098
200680
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/collectFields.js
|
|
201099
200681
|
function collectFieldsImpl2(schema, fragments, variableValues, runtimeType, selectionSet, fields2, patches, visitedFragmentNames) {
|
|
201100
200682
|
for (const selection of selectionSet.selections) {
|
|
201101
200683
|
switch (selection.kind) {
|
|
201102
|
-
case
|
|
200684
|
+
case import_graphql89.Kind.FIELD: {
|
|
201103
200685
|
if (!shouldIncludeNode2(variableValues, selection)) {
|
|
201104
200686
|
continue;
|
|
201105
200687
|
}
|
|
201106
200688
|
fields2.add(getFieldEntryKey2(selection), selection);
|
|
201107
200689
|
break;
|
|
201108
200690
|
}
|
|
201109
|
-
case
|
|
200691
|
+
case import_graphql89.Kind.INLINE_FRAGMENT: {
|
|
201110
200692
|
if (!shouldIncludeNode2(variableValues, selection) || !doesFragmentConditionMatch2(schema, selection, runtimeType)) {
|
|
201111
200693
|
continue;
|
|
201112
200694
|
}
|
|
@@ -201123,7 +200705,7 @@ function collectFieldsImpl2(schema, fragments, variableValues, runtimeType, sele
|
|
|
201123
200705
|
}
|
|
201124
200706
|
break;
|
|
201125
200707
|
}
|
|
201126
|
-
case
|
|
200708
|
+
case import_graphql89.Kind.FRAGMENT_SPREAD: {
|
|
201127
200709
|
const fragName = selection.name.value;
|
|
201128
200710
|
if (!shouldIncludeNode2(variableValues, selection)) {
|
|
201129
200711
|
continue;
|
|
@@ -201155,11 +200737,11 @@ function collectFieldsImpl2(schema, fragments, variableValues, runtimeType, sele
|
|
|
201155
200737
|
}
|
|
201156
200738
|
}
|
|
201157
200739
|
function shouldIncludeNode2(variableValues, node) {
|
|
201158
|
-
const skip = getDirectiveValues2(
|
|
200740
|
+
const skip = getDirectiveValues2(import_graphql89.GraphQLSkipDirective, node, variableValues);
|
|
201159
200741
|
if (skip?.["if"] === true) {
|
|
201160
200742
|
return false;
|
|
201161
200743
|
}
|
|
201162
|
-
const include = getDirectiveValues2(
|
|
200744
|
+
const include = getDirectiveValues2(import_graphql89.GraphQLIncludeDirective, node, variableValues);
|
|
201163
200745
|
if (include?.["if"] === false) {
|
|
201164
200746
|
return false;
|
|
201165
200747
|
}
|
|
@@ -201170,11 +200752,11 @@ function doesFragmentConditionMatch2(schema, fragment, type) {
|
|
|
201170
200752
|
if (!typeConditionNode) {
|
|
201171
200753
|
return true;
|
|
201172
200754
|
}
|
|
201173
|
-
const conditionalType =
|
|
200755
|
+
const conditionalType = import_graphql89.typeFromAST(schema, typeConditionNode);
|
|
201174
200756
|
if (conditionalType === type) {
|
|
201175
200757
|
return true;
|
|
201176
200758
|
}
|
|
201177
|
-
if (
|
|
200759
|
+
if (import_graphql89.isAbstractType(conditionalType)) {
|
|
201178
200760
|
const possibleTypes = schema.getPossibleTypes(conditionalType);
|
|
201179
200761
|
return possibleTypes.includes(type);
|
|
201180
200762
|
}
|
|
@@ -201195,12 +200777,12 @@ function getDeferValues2(variableValues, node) {
|
|
|
201195
200777
|
label: typeof defer["label"] === "string" ? defer["label"] : undefined
|
|
201196
200778
|
};
|
|
201197
200779
|
}
|
|
201198
|
-
var
|
|
200780
|
+
var import_graphql89, collectSubFields2;
|
|
201199
200781
|
var init_collectFields2 = __esm(() => {
|
|
201200
200782
|
init_AccumulatorMap2();
|
|
201201
200783
|
init_directives2();
|
|
201202
200784
|
init_getDirectiveValues();
|
|
201203
|
-
|
|
200785
|
+
import_graphql89 = __toESM(require_graphql2(), 1);
|
|
201204
200786
|
collectSubFields2 = memoize52(function collectSubfields2(schema, fragments, variableValues, returnType, fieldNodes) {
|
|
201205
200787
|
const subFieldNodes = new AccumulatorMap2;
|
|
201206
200788
|
const visitedFragmentNames = new Set;
|
|
@@ -201220,15 +200802,15 @@ var init_collectFields2 = __esm(() => {
|
|
|
201220
200802
|
|
|
201221
200803
|
// node_modules/@graphql-tools/relay-operation-optimizer/node_modules/@graphql-tools/utils/esm/getOperationASTFromRequest.js
|
|
201222
200804
|
function getOperationASTFromDocument2(documentNode, operationName) {
|
|
201223
|
-
const doc =
|
|
200805
|
+
const doc = import_graphql90.getOperationAST(documentNode, operationName);
|
|
201224
200806
|
if (!doc) {
|
|
201225
200807
|
throw new Error(`Cannot infer operation ${operationName || ""}`);
|
|
201226
200808
|
}
|
|
201227
200809
|
return doc;
|
|
201228
200810
|
}
|
|
201229
|
-
var
|
|
200811
|
+
var import_graphql90, getOperationASTFromRequest4;
|
|
201230
200812
|
var init_getOperationASTFromRequest2 = __esm(() => {
|
|
201231
|
-
|
|
200813
|
+
import_graphql90 = __toESM(require_graphql2(), 1);
|
|
201232
200814
|
getOperationASTFromRequest4 = memoize14(function getOperationASTFromRequest5(request) {
|
|
201233
200815
|
return getOperationASTFromDocument2(request.document, request.operationName);
|
|
201234
200816
|
});
|
|
@@ -201367,7 +200949,7 @@ function optimizeDocuments(schema, documents, options = {}) {
|
|
|
201367
200949
|
...options
|
|
201368
200950
|
};
|
|
201369
200951
|
const adjustedSchema = import_Schema.create(printSchemaWithDirectives(schema, options));
|
|
201370
|
-
const documentAsts =
|
|
200952
|
+
const documentAsts = import_graphql91.concatAST(documents);
|
|
201371
200953
|
const relayDocuments = import_RelayParser.transform(adjustedSchema, documentAsts.definitions);
|
|
201372
200954
|
const result = [];
|
|
201373
200955
|
if (options.includeFragments) {
|
|
@@ -201376,7 +200958,7 @@ function optimizeDocuments(schema, documents, options = {}) {
|
|
|
201376
200958
|
import_FlattenTransform.transformWithOptions({ flattenAbstractTypes: false }),
|
|
201377
200959
|
import_SkipRedundantNodesTransform.transform
|
|
201378
200960
|
]);
|
|
201379
|
-
result.push(...fragmentCompilerContext.documents().filter((doc) => doc.kind === "Fragment").map((doc) =>
|
|
200961
|
+
result.push(...fragmentCompilerContext.documents().filter((doc) => doc.kind === "Fragment").map((doc) => import_graphql91.parse(import_IRPrinter.print(adjustedSchema, doc), options)));
|
|
201380
200962
|
}
|
|
201381
200963
|
const queryCompilerContext = new import_CompilerContext.default(adjustedSchema).addAll(relayDocuments).applyTransforms([
|
|
201382
200964
|
import_ApplyFragmentArgumentTransform.transform,
|
|
@@ -201384,13 +200966,13 @@ function optimizeDocuments(schema, documents, options = {}) {
|
|
|
201384
200966
|
import_FlattenTransform.transformWithOptions({ flattenAbstractTypes: false }),
|
|
201385
200967
|
import_SkipRedundantNodesTransform.transform
|
|
201386
200968
|
]);
|
|
201387
|
-
result.push(...queryCompilerContext.documents().map((doc) =>
|
|
200969
|
+
result.push(...queryCompilerContext.documents().map((doc) => import_graphql91.parse(import_IRPrinter.print(adjustedSchema, doc), options)));
|
|
201388
200970
|
return result;
|
|
201389
200971
|
}
|
|
201390
|
-
var
|
|
200972
|
+
var import_graphql91, import_CompilerContext, import_IRPrinter, import_RelayParser, import_Schema, import_ApplyFragmentArgumentTransform, import_FlattenTransform, import_InlineFragmentsTransform, import_SkipRedundantNodesTransform;
|
|
201391
200973
|
var init_esm6 = __esm(() => {
|
|
201392
200974
|
init_esm5();
|
|
201393
|
-
|
|
200975
|
+
import_graphql91 = __toESM(require_graphql2(), 1);
|
|
201394
200976
|
import_CompilerContext = __toESM(require_CompilerContext(), 1);
|
|
201395
200977
|
import_IRPrinter = __toESM(require_IRPrinter(), 1);
|
|
201396
200978
|
import_RelayParser = __toESM(require_RelayParser(), 1);
|
|
@@ -201457,10 +201039,10 @@ class BaseSelectionSetProcessor {
|
|
|
201457
201039
|
}
|
|
201458
201040
|
|
|
201459
201041
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/selection-set-processor/pre-resolve-types.js
|
|
201460
|
-
var
|
|
201042
|
+
var import_graphql92, PreResolveTypesProcessor;
|
|
201461
201043
|
var init_pre_resolve_types = __esm(() => {
|
|
201462
201044
|
init_esm3();
|
|
201463
|
-
|
|
201045
|
+
import_graphql92 = __toESM(require_graphql2(), 1);
|
|
201464
201046
|
PreResolveTypesProcessor = class PreResolveTypesProcessor extends BaseSelectionSetProcessor {
|
|
201465
201047
|
transformTypenameField(type, name) {
|
|
201466
201048
|
return [
|
|
@@ -201488,7 +201070,7 @@ var init_pre_resolve_types = __esm(() => {
|
|
|
201488
201070
|
type: "never"
|
|
201489
201071
|
};
|
|
201490
201072
|
}
|
|
201491
|
-
if (
|
|
201073
|
+
if (import_graphql92.isEnumType(baseType)) {
|
|
201492
201074
|
typeToUse = (this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : "") + this.config.convertName(baseType.name, {
|
|
201493
201075
|
useTypesPrefix: this.config.enumPrefix,
|
|
201494
201076
|
useTypesSuffix: this.config.enumSuffix
|
|
@@ -201518,7 +201100,7 @@ var init_pre_resolve_types = __esm(() => {
|
|
|
201518
201100
|
const fieldObj = schemaType.getFields()[aliasedField.fieldName];
|
|
201519
201101
|
const baseType = getBaseType(fieldObj.type);
|
|
201520
201102
|
let typeToUse = this.config.scalars[baseType.name]?.output || baseType.name;
|
|
201521
|
-
if (
|
|
201103
|
+
if (import_graphql92.isEnumType(baseType)) {
|
|
201522
201104
|
typeToUse = (this.config.namespacedImportName ? `${this.config.namespacedImportName}.` : "") + this.config.convertName(baseType.name, {
|
|
201523
201105
|
useTypesPrefix: this.config.enumPrefix,
|
|
201524
201106
|
useTypesSuffix: this.config.enumSuffix
|
|
@@ -201602,10 +201184,10 @@ class SelectionSetToObject {
|
|
|
201602
201184
|
directives: directives3
|
|
201603
201185
|
};
|
|
201604
201186
|
};
|
|
201605
|
-
if (
|
|
201187
|
+
if (import_graphql93.isListType(parentType) || import_graphql93.isNonNullType(parentType)) {
|
|
201606
201188
|
return this._collectInlineFragments(parentType.ofType, nodes, types5);
|
|
201607
201189
|
}
|
|
201608
|
-
if (
|
|
201190
|
+
if (import_graphql93.isObjectType(parentType)) {
|
|
201609
201191
|
for (const node of nodes) {
|
|
201610
201192
|
const typeOnSchema = node.typeCondition ? this._schema.getType(node.typeCondition.name.value) : parentType;
|
|
201611
201193
|
const { fields: fields3, inlines, spreads } = separateSelectionSet(node.selectionSet.selections);
|
|
@@ -201614,28 +201196,28 @@ class SelectionSetToObject {
|
|
|
201614
201196
|
fields: fields3
|
|
201615
201197
|
});
|
|
201616
201198
|
const spreadsUsage = this.buildFragmentSpreadsUsage(spreads);
|
|
201617
|
-
if (
|
|
201199
|
+
if (import_graphql93.isObjectType(typeOnSchema)) {
|
|
201618
201200
|
this._appendToTypeMap(types5, typeOnSchema.name, fieldsWithFragmentDirectives);
|
|
201619
201201
|
this._appendToTypeMap(types5, typeOnSchema.name, spreadsUsage[typeOnSchema.name]);
|
|
201620
201202
|
this._appendToTypeMap(types5, typeOnSchema.name, directives3);
|
|
201621
201203
|
this._collectInlineFragments(typeOnSchema, inlines, types5);
|
|
201622
|
-
} else if (
|
|
201204
|
+
} else if (import_graphql93.isInterfaceType(typeOnSchema) && parentType.getInterfaces().includes(typeOnSchema)) {
|
|
201623
201205
|
this._appendToTypeMap(types5, parentType.name, fields3);
|
|
201624
201206
|
this._appendToTypeMap(types5, parentType.name, spreadsUsage[parentType.name]);
|
|
201625
201207
|
this._collectInlineFragments(typeOnSchema, inlines, types5);
|
|
201626
201208
|
}
|
|
201627
201209
|
}
|
|
201628
|
-
} else if (
|
|
201210
|
+
} else if (import_graphql93.isInterfaceType(parentType)) {
|
|
201629
201211
|
const possibleTypes = getPossibleTypes(this._schema, parentType);
|
|
201630
201212
|
for (const node of nodes) {
|
|
201631
201213
|
const schemaType = node.typeCondition ? this._schema.getType(node.typeCondition.name.value) : parentType;
|
|
201632
201214
|
const { fields: fields3, inlines, spreads } = separateSelectionSet(node.selectionSet.selections);
|
|
201633
201215
|
const spreadsUsage = this.buildFragmentSpreadsUsage(spreads);
|
|
201634
|
-
if (
|
|
201216
|
+
if (import_graphql93.isObjectType(schemaType) && possibleTypes.find((possibleType) => possibleType.name === schemaType.name)) {
|
|
201635
201217
|
this._appendToTypeMap(types5, schemaType.name, fields3);
|
|
201636
201218
|
this._appendToTypeMap(types5, schemaType.name, spreadsUsage[schemaType.name]);
|
|
201637
201219
|
this._collectInlineFragments(schemaType, inlines, types5);
|
|
201638
|
-
} else if (
|
|
201220
|
+
} else if (import_graphql93.isInterfaceType(schemaType) && schemaType.name === parentType.name) {
|
|
201639
201221
|
for (const possibleType of possibleTypes) {
|
|
201640
201222
|
this._appendToTypeMap(types5, possibleType.name, fields3);
|
|
201641
201223
|
this._appendToTypeMap(types5, possibleType.name, spreadsUsage[possibleType.name]);
|
|
@@ -201647,25 +201229,25 @@ class SelectionSetToObject {
|
|
|
201647
201229
|
throw new Error("Invalid state. Expected type condition for interface spread on a interface field.");
|
|
201648
201230
|
}
|
|
201649
201231
|
const fragmentSpreadType = this._schema.getType(node.typeCondition.name.value);
|
|
201650
|
-
if (
|
|
201232
|
+
if (import_graphql93.isTypeSubTypeOf(this._schema, possibleType, fragmentSpreadType)) {
|
|
201651
201233
|
this._appendToTypeMap(types5, possibleType.name, fields3);
|
|
201652
201234
|
this._appendToTypeMap(types5, possibleType.name, spreadsUsage[possibleType.name]);
|
|
201653
201235
|
}
|
|
201654
201236
|
}
|
|
201655
201237
|
}
|
|
201656
201238
|
}
|
|
201657
|
-
} else if (
|
|
201239
|
+
} else if (import_graphql93.isUnionType(parentType)) {
|
|
201658
201240
|
const possibleTypes = parentType.getTypes();
|
|
201659
201241
|
for (const node of nodes) {
|
|
201660
201242
|
const schemaType = node.typeCondition ? this._schema.getType(node.typeCondition.name.value) : parentType;
|
|
201661
201243
|
const { fields: fields3, inlines, spreads } = separateSelectionSet(node.selectionSet.selections);
|
|
201662
201244
|
const { fieldsWithFragmentDirectives } = enrichFieldWithDirectives({ node, fields: fields3 });
|
|
201663
201245
|
const spreadsUsage = this.buildFragmentSpreadsUsage(spreads);
|
|
201664
|
-
if (
|
|
201246
|
+
if (import_graphql93.isObjectType(schemaType) && possibleTypes.find((possibleType) => possibleType.name === schemaType.name)) {
|
|
201665
201247
|
this._appendToTypeMap(types5, schemaType.name, fieldsWithFragmentDirectives);
|
|
201666
201248
|
this._appendToTypeMap(types5, schemaType.name, spreadsUsage[schemaType.name]);
|
|
201667
201249
|
this._collectInlineFragments(schemaType, inlines, types5);
|
|
201668
|
-
} else if (
|
|
201250
|
+
} else if (import_graphql93.isInterfaceType(schemaType)) {
|
|
201669
201251
|
const possibleInterfaceTypes = getPossibleTypes(this._schema, schemaType);
|
|
201670
201252
|
for (const possibleType of possibleTypes) {
|
|
201671
201253
|
if (possibleInterfaceTypes.find((possibleInterfaceType) => possibleInterfaceType.name === possibleType.name)) {
|
|
@@ -201697,7 +201279,7 @@ class SelectionSetToObject {
|
|
|
201697
201279
|
const fragmentSelectionNodes = [
|
|
201698
201280
|
...fragmentSpreadObject.node.selectionSet.selections
|
|
201699
201281
|
].map((originalNode) => {
|
|
201700
|
-
if (originalNode.kind ===
|
|
201282
|
+
if (originalNode.kind === import_graphql93.Kind.FIELD) {
|
|
201701
201283
|
return {
|
|
201702
201284
|
...originalNode,
|
|
201703
201285
|
fragmentDirectives: [...spread.directives || []]
|
|
@@ -201729,17 +201311,17 @@ class SelectionSetToObject {
|
|
|
201729
201311
|
const fragmentSpreadsConditionalSelections = [];
|
|
201730
201312
|
for (const selection of selections) {
|
|
201731
201313
|
switch (selection.kind) {
|
|
201732
|
-
case
|
|
201314
|
+
case import_graphql93.Kind.FIELD:
|
|
201733
201315
|
fieldNodes.push(selection);
|
|
201734
201316
|
break;
|
|
201735
|
-
case
|
|
201317
|
+
case import_graphql93.Kind.INLINE_FRAGMENT:
|
|
201736
201318
|
if (!this._config.extractAllFieldsToTypesCompact && (hasConditionalDirectives(selection.directives) || hasIncrementalDeliveryDirectives(selection.directives))) {
|
|
201737
201319
|
inlineFragmentConditionalSelections.push(selection);
|
|
201738
201320
|
break;
|
|
201739
201321
|
}
|
|
201740
201322
|
inlineFragmentSelections.push(selection);
|
|
201741
201323
|
break;
|
|
201742
|
-
case
|
|
201324
|
+
case import_graphql93.Kind.FRAGMENT_SPREAD:
|
|
201743
201325
|
if (!this._config.extractAllFieldsToTypesCompact && (hasConditionalDirectives(selection.directives) || hasIncrementalDeliveryDirectives(selection.directives))) {
|
|
201744
201326
|
fragmentSpreadsConditionalSelections.push(selection);
|
|
201745
201327
|
break;
|
|
@@ -201750,17 +201332,17 @@ class SelectionSetToObject {
|
|
|
201750
201332
|
}
|
|
201751
201333
|
if (fieldNodes.length) {
|
|
201752
201334
|
inlineFragmentSelections.push({
|
|
201753
|
-
kind:
|
|
201335
|
+
kind: import_graphql93.Kind.INLINE_FRAGMENT,
|
|
201754
201336
|
typeCondition: {
|
|
201755
|
-
kind:
|
|
201337
|
+
kind: import_graphql93.Kind.NAMED_TYPE,
|
|
201756
201338
|
name: {
|
|
201757
|
-
kind:
|
|
201339
|
+
kind: import_graphql93.Kind.NAME,
|
|
201758
201340
|
value: (parentSchemaType ?? this._parentSchemaType).name
|
|
201759
201341
|
}
|
|
201760
201342
|
},
|
|
201761
201343
|
directives: [],
|
|
201762
201344
|
selectionSet: {
|
|
201763
|
-
kind:
|
|
201345
|
+
kind: import_graphql93.Kind.SELECTION_SET,
|
|
201764
201346
|
selections: fieldNodes
|
|
201765
201347
|
}
|
|
201766
201348
|
});
|
|
@@ -201807,7 +201389,7 @@ class SelectionSetToObject {
|
|
|
201807
201389
|
const grouped2 = possibleTypes.reduce((prev, type) => {
|
|
201808
201390
|
const typeName = type.name;
|
|
201809
201391
|
const schemaType = this._schema.getType(typeName);
|
|
201810
|
-
if (!
|
|
201392
|
+
if (!import_graphql93.isObjectType(schemaType)) {
|
|
201811
201393
|
throw new TypeError(`Invalid state! Schema type ${typeName} is not a valid GraphQL object!`);
|
|
201812
201394
|
}
|
|
201813
201395
|
prev[typeName] ||= [];
|
|
@@ -201863,7 +201445,7 @@ class SelectionSetToObject {
|
|
|
201863
201445
|
const directNodes = [];
|
|
201864
201446
|
const nestedSelections = [];
|
|
201865
201447
|
for (const n of flattenedSelectionNodes) {
|
|
201866
|
-
if ("kind" in n && (n.kind ===
|
|
201448
|
+
if ("kind" in n && (n.kind === import_graphql93.Kind.INLINE_FRAGMENT || n.kind === import_graphql93.Kind.FRAGMENT_SPREAD)) {
|
|
201867
201449
|
nestedSelections.push(n);
|
|
201868
201450
|
} else {
|
|
201869
201451
|
directNodes.push(n);
|
|
@@ -201909,7 +201491,7 @@ class SelectionSetToObject {
|
|
|
201909
201491
|
const grouped = possibleTypes.reduce((prev, type) => {
|
|
201910
201492
|
const typeName = type.name;
|
|
201911
201493
|
const schemaType = this._schema.getType(typeName);
|
|
201912
|
-
if (!
|
|
201494
|
+
if (!import_graphql93.isObjectType(schemaType)) {
|
|
201913
201495
|
throw new TypeError(`Invalid state! Schema type ${typeName} is not a valid GraphQL object!`);
|
|
201914
201496
|
}
|
|
201915
201497
|
const selectionNodes = selectionNodesByTypeName.get(typeName) || [];
|
|
@@ -201957,7 +201539,7 @@ class SelectionSetToObject {
|
|
|
201957
201539
|
let inlineFragmentConditional = false;
|
|
201958
201540
|
for (const selectionNode of selectionNodes) {
|
|
201959
201541
|
if ("kind" in selectionNode) {
|
|
201960
|
-
if (selectionNode.kind ===
|
|
201542
|
+
if (selectionNode.kind === import_graphql93.Kind.FIELD) {
|
|
201961
201543
|
if (selectionNode.selectionSet) {
|
|
201962
201544
|
let selectedField = null;
|
|
201963
201545
|
const fields4 = parentSchemaType.getFields();
|
|
@@ -201992,7 +201574,7 @@ class SelectionSetToObject {
|
|
|
201992
201574
|
} else {
|
|
201993
201575
|
primitiveFields.set(selectionNode.name.value, selectionNode);
|
|
201994
201576
|
}
|
|
201995
|
-
} else if (selectionNode.kind ===
|
|
201577
|
+
} else if (selectionNode.kind === import_graphql93.Kind.DIRECTIVE) {
|
|
201996
201578
|
if (hasConditionalDirectives([selectionNode])) {
|
|
201997
201579
|
inlineFragmentConditional = true;
|
|
201998
201580
|
}
|
|
@@ -202015,7 +201597,7 @@ class SelectionSetToObject {
|
|
|
202015
201597
|
if (fragmentType == null) {
|
|
202016
201598
|
throw new TypeError(`Unexpected error: Type ${selectionNode.onType} does not exist within schema.`);
|
|
202017
201599
|
}
|
|
202018
|
-
if (parentSchemaType.name === selectionNode.onType || parentSchemaType.getInterfaces().find((iinterface) => iinterface.name === selectionNode.onType) != null ||
|
|
201600
|
+
if (parentSchemaType.name === selectionNode.onType || parentSchemaType.getInterfaces().find((iinterface) => iinterface.name === selectionNode.onType) != null || import_graphql93.isUnionType(fragmentType) && fragmentType.getTypes().find((objectType) => objectType.name === parentSchemaType.name)) {
|
|
202019
201601
|
const { selectionNodesByTypeName, selectionNodesByTypeNameConditional } = this.flattenSelectionSet(selectionNode.selectionNodes, parentSchemaType);
|
|
202020
201602
|
const typeNodes = selectionNodesByTypeName.get(parentSchemaType.name) ?? [];
|
|
202021
201603
|
selectionNodes.push(...typeNodes);
|
|
@@ -202268,16 +201850,16 @@ class SelectionSetToObject {
|
|
|
202268
201850
|
}
|
|
202269
201851
|
const schemaType = this._schema.getType(typeName);
|
|
202270
201852
|
const hasTypeNarrowingFragments = this._selectionSet?.selections?.some((selection) => {
|
|
202271
|
-
if (selection.kind ===
|
|
201853
|
+
if (selection.kind === import_graphql93.Kind.INLINE_FRAGMENT) {
|
|
202272
201854
|
return true;
|
|
202273
201855
|
}
|
|
202274
|
-
if (selection.kind ===
|
|
201856
|
+
if (selection.kind === import_graphql93.Kind.FRAGMENT_SPREAD) {
|
|
202275
201857
|
const spreadFragment = this._loadedFragments.find((lf) => lf.name === selection.name.value);
|
|
202276
201858
|
return !spreadFragment || !this._parentSchemaType || spreadFragment.onType !== this._parentSchemaType.name;
|
|
202277
201859
|
}
|
|
202278
201860
|
return false;
|
|
202279
201861
|
}) ?? false;
|
|
202280
|
-
if (
|
|
201862
|
+
if (import_graphql93.isObjectType(schemaType) && this._parentSchemaType && import_graphql93.isInterfaceType(this._parentSchemaType) && !hasTypeNarrowingFragments) {
|
|
202281
201863
|
return `${parentName}_${this._parentSchemaType.name}`;
|
|
202282
201864
|
}
|
|
202283
201865
|
return `${parentName}_${typeName}`;
|
|
@@ -202293,16 +201875,16 @@ function formatUnion(members) {
|
|
|
202293
201875
|
}
|
|
202294
201876
|
return members.join(" | ");
|
|
202295
201877
|
}
|
|
202296
|
-
var
|
|
201878
|
+
var import_graphql93, operationTypes, metadataFieldMap;
|
|
202297
201879
|
var init_selection_set_to_object = __esm(() => {
|
|
202298
201880
|
init_esm3();
|
|
202299
201881
|
init_esm2();
|
|
202300
201882
|
init_utils2();
|
|
202301
|
-
|
|
201883
|
+
import_graphql93 = __toESM(require_graphql2(), 1);
|
|
202302
201884
|
operationTypes = ["Query", "Mutation", "Subscription"];
|
|
202303
201885
|
metadataFieldMap = {
|
|
202304
|
-
__schema:
|
|
202305
|
-
__type:
|
|
201886
|
+
__schema: import_graphql93.SchemaMetaFieldDef,
|
|
201887
|
+
__type: import_graphql93.TypeMetaFieldDef
|
|
202306
201888
|
};
|
|
202307
201889
|
});
|
|
202308
201890
|
|
|
@@ -202310,14 +201892,14 @@ var init_selection_set_to_object = __esm(() => {
|
|
|
202310
201892
|
var init_types4 = () => {};
|
|
202311
201893
|
|
|
202312
201894
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/graphql-type-utils.js
|
|
202313
|
-
var
|
|
202314
|
-
if (
|
|
201895
|
+
var import_graphql94, isNativeNamedType = (namedType) => {
|
|
201896
|
+
if (import_graphql94.isSpecifiedScalarType(namedType) || import_graphql94.isIntrospectionType(namedType)) {
|
|
202315
201897
|
return true;
|
|
202316
201898
|
}
|
|
202317
201899
|
return false;
|
|
202318
201900
|
};
|
|
202319
201901
|
var init_graphql_type_utils = __esm(() => {
|
|
202320
|
-
|
|
201902
|
+
import_graphql94 = __toESM(require_graphql2(), 1);
|
|
202321
201903
|
});
|
|
202322
201904
|
|
|
202323
201905
|
// node_modules/@graphql-codegen/visitor-plugin-common/esm/typed-document-string.js
|
|
@@ -202381,13 +201963,13 @@ var init_visitor = __esm(() => {
|
|
|
202381
201963
|
init_esm7();
|
|
202382
201964
|
TypeScriptDocumentNodesVisitor = class TypeScriptDocumentNodesVisitor extends ClientSideBaseVisitor {
|
|
202383
201965
|
pluginConfig;
|
|
202384
|
-
constructor(schema, fragments,
|
|
201966
|
+
constructor(schema, fragments, config, documents) {
|
|
202385
201967
|
super(schema, fragments, {
|
|
202386
201968
|
documentNodeImport: "@graphql-typed-document-node/core#TypedDocumentNode",
|
|
202387
|
-
...
|
|
202388
|
-
documentMode:
|
|
201969
|
+
...config,
|
|
201970
|
+
documentMode: config.documentMode || DocumentMode.documentNodeImportFragments
|
|
202389
201971
|
}, {}, documents);
|
|
202390
|
-
this.pluginConfig =
|
|
201972
|
+
this.pluginConfig = config;
|
|
202391
201973
|
autoBind(this);
|
|
202392
201974
|
if (this.config.documentMode === DocumentMode.graphQLTag) {
|
|
202393
201975
|
const documentNodeImport = this._parseImport(this.config.documentNodeImport || "graphql#DocumentNode");
|
|
@@ -202443,35 +202025,35 @@ var init_visitor = __esm(() => {
|
|
|
202443
202025
|
});
|
|
202444
202026
|
|
|
202445
202027
|
// node_modules/@graphql-codegen/typed-document-node/esm/index.js
|
|
202446
|
-
var
|
|
202447
|
-
__export(
|
|
202448
|
-
plugin: () =>
|
|
202028
|
+
var exports_esm2 = {};
|
|
202029
|
+
__export(exports_esm2, {
|
|
202030
|
+
plugin: () => plugin2,
|
|
202449
202031
|
validate: () => validate2
|
|
202450
202032
|
});
|
|
202451
202033
|
import { extname as extname2 } from "path";
|
|
202452
|
-
var
|
|
202453
|
-
const documents =
|
|
202454
|
-
const allAst =
|
|
202034
|
+
var import_graphql98, plugin2 = (schema, rawDocuments, config) => {
|
|
202035
|
+
const documents = config.flattenGeneratedTypes ? optimizeOperations(schema, rawDocuments) : rawDocuments;
|
|
202036
|
+
const allAst = import_graphql98.concatAST(documents.map((v) => v.document));
|
|
202455
202037
|
const allFragments = [
|
|
202456
|
-
...allAst.definitions.filter((d) => d.kind ===
|
|
202038
|
+
...allAst.definitions.filter((d) => d.kind === import_graphql98.Kind.FRAGMENT_DEFINITION).map((fragmentDef) => ({
|
|
202457
202039
|
node: fragmentDef,
|
|
202458
202040
|
name: fragmentDef.name.value,
|
|
202459
202041
|
onType: fragmentDef.typeCondition.name.value,
|
|
202460
202042
|
isExternal: false
|
|
202461
202043
|
})),
|
|
202462
|
-
...
|
|
202044
|
+
...config.externalFragments || []
|
|
202463
202045
|
];
|
|
202464
|
-
const
|
|
202465
|
-
const visitorResult = oldVisit(allAst, { leave:
|
|
202046
|
+
const visitor = new TypeScriptDocumentNodesVisitor(schema, allFragments, config, documents);
|
|
202047
|
+
const visitorResult = oldVisit(allAst, { leave: visitor });
|
|
202466
202048
|
let content = [];
|
|
202467
|
-
if (
|
|
202049
|
+
if (config.documentMode === DocumentMode.string) {
|
|
202468
202050
|
content = [typedDocumentString.template];
|
|
202469
202051
|
}
|
|
202470
202052
|
return {
|
|
202471
|
-
prepend: allAst.definitions.length === 0 ? [] :
|
|
202053
|
+
prepend: allAst.definitions.length === 0 ? [] : visitor.getImports(),
|
|
202472
202054
|
content: [
|
|
202473
202055
|
...content,
|
|
202474
|
-
|
|
202056
|
+
visitor.fragments,
|
|
202475
202057
|
...visitorResult.definitions.filter((t) => typeof t === "string")
|
|
202476
202058
|
].join(`
|
|
202477
202059
|
`)
|
|
@@ -202485,7 +202067,7 @@ var init_esm8 = __esm(() => {
|
|
|
202485
202067
|
init_esm3();
|
|
202486
202068
|
init_esm7();
|
|
202487
202069
|
init_visitor();
|
|
202488
|
-
|
|
202070
|
+
import_graphql98 = __toESM(require_graphql2(), 1);
|
|
202489
202071
|
});
|
|
202490
202072
|
|
|
202491
202073
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -216697,12 +216279,14 @@ import { dirname as dirname6, join as join12, resolve as resolve12 } from "node:
|
|
|
216697
216279
|
|
|
216698
216280
|
// node_modules/@supacloud/compiler/dist/index.js
|
|
216699
216281
|
var ts6 = __toESM(require_typescript(), 1);
|
|
216700
|
-
var
|
|
216282
|
+
var ts7 = __toESM(require_typescript(), 1);
|
|
216283
|
+
var import_graphql99 = __toESM(require_graphql2(), 1);
|
|
216701
216284
|
import { createHash as createHash42 } from "node:crypto";
|
|
216702
216285
|
import { access, mkdir, rename as rename2, unlink as unlink2, writeFile as writeFile2 } from "node:fs/promises";
|
|
216703
216286
|
import { join as join22 } from "node:path";
|
|
216704
216287
|
import { extname as extname3 } from "node:path";
|
|
216705
216288
|
import { resolve as resolve42 } from "node:path";
|
|
216289
|
+
import { resolve as resolve52 } from "node:path";
|
|
216706
216290
|
import { createHash as createHash5 } from "node:crypto";
|
|
216707
216291
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
216708
216292
|
import { relative as relative5, sep as sep5 } from "node:path";
|
|
@@ -221447,17 +221031,14 @@ function validateDuplicateDocuments(files) {
|
|
|
221447
221031
|
}
|
|
221448
221032
|
}
|
|
221449
221033
|
}
|
|
221450
|
-
// node_modules/@graphql-codegen/typescript/esm/index.js
|
|
221034
|
+
// node_modules/@graphql-codegen/typescript-operations/esm/index.js
|
|
221451
221035
|
init_esm3();
|
|
221452
221036
|
var exports_esm = {};
|
|
221453
221037
|
__export(exports_esm, {
|
|
221454
|
-
|
|
221455
|
-
TsVisitor: () => TsVisitor,
|
|
221456
|
-
TypeScriptOperationVariablesToObject: () => TypeScriptOperationVariablesToObject,
|
|
221457
|
-
includeIntrospectionTypesDefinitions: () => includeIntrospectionTypesDefinitions,
|
|
221038
|
+
TypeScriptDocumentsVisitor: () => TypeScriptDocumentsVisitor,
|
|
221458
221039
|
plugin: () => plugin
|
|
221459
221040
|
});
|
|
221460
|
-
var
|
|
221041
|
+
var import_graphql97 = __toESM(require_graphql2(), 1);
|
|
221461
221042
|
|
|
221462
221043
|
// node_modules/@graphql-codegen/schema-ast/esm/index.js
|
|
221463
221044
|
init_esm3();
|
|
@@ -221486,382 +221067,20 @@ function transformSchemaAST(schema, config) {
|
|
|
221486
221067
|
ast
|
|
221487
221068
|
};
|
|
221488
221069
|
}
|
|
221489
|
-
// node_modules/@graphql-codegen/typescript/esm/visitor.js
|
|
221490
|
-
init_esm7();
|
|
221491
|
-
var import_graphql97 = __toESM(require_graphql2(), 1);
|
|
221492
|
-
|
|
221493
|
-
// node_modules/@graphql-codegen/typescript/esm/typescript-variables-to-object.js
|
|
221494
|
-
init_esm7();
|
|
221495
|
-
var import_graphql96 = __toESM(require_graphql2(), 1);
|
|
221496
|
-
|
|
221497
|
-
class TypeScriptOperationVariablesToObject extends OperationVariablesToObject {
|
|
221498
|
-
_avoidOptionals;
|
|
221499
|
-
_immutableTypes;
|
|
221500
|
-
_maybeType;
|
|
221501
|
-
constructor(_scalars, _convertName, _avoidOptionals, _immutableTypes, _namespacedImportName = null, _enumNames = [], _enumPrefix = true, _enumSuffix = true, _enumValues = {}, _applyCoercion = false, _directiveArgumentAndInputFieldMappings = {}, _maybeType = "Maybe") {
|
|
221502
|
-
super(_scalars, _convertName, _namespacedImportName, _enumNames, _enumPrefix, _enumSuffix, _enumValues, _applyCoercion, _directiveArgumentAndInputFieldMappings);
|
|
221503
|
-
this._avoidOptionals = _avoidOptionals;
|
|
221504
|
-
this._immutableTypes = _immutableTypes;
|
|
221505
|
-
this._maybeType = _maybeType;
|
|
221506
|
-
}
|
|
221507
|
-
clearOptional(str) {
|
|
221508
|
-
const prefix = this._namespacedImportName ? `${this._namespacedImportName}.` : "";
|
|
221509
|
-
const rgx = new RegExp(`^${this.wrapMaybe(`(.*?)`)}$`, "i");
|
|
221510
|
-
if (str.startsWith(`${prefix}${this._maybeType}`)) {
|
|
221511
|
-
return str.replace(rgx, "$1");
|
|
221512
|
-
}
|
|
221513
|
-
return str;
|
|
221514
|
-
}
|
|
221515
|
-
wrapAstTypeWithModifiers(baseType, typeNode, applyCoercion = false) {
|
|
221516
|
-
if (typeNode.kind === import_graphql96.Kind.NON_NULL_TYPE) {
|
|
221517
|
-
const type = this.wrapAstTypeWithModifiers(baseType, typeNode.type, applyCoercion);
|
|
221518
|
-
return this.clearOptional(type);
|
|
221519
|
-
}
|
|
221520
|
-
if (typeNode.kind === import_graphql96.Kind.LIST_TYPE) {
|
|
221521
|
-
const innerType = this.wrapAstTypeWithModifiers(baseType, typeNode.type, applyCoercion);
|
|
221522
|
-
const listInputCoercionExtension = applyCoercion ? ` | ${innerType}` : "";
|
|
221523
|
-
return this.wrapMaybe(`${this._immutableTypes ? "ReadonlyArray" : "Array"}<${innerType}>${listInputCoercionExtension}`);
|
|
221524
|
-
}
|
|
221525
|
-
return this.wrapMaybe(baseType);
|
|
221526
|
-
}
|
|
221527
|
-
formatFieldString(fieldName, isNonNullType21, hasDefaultValue) {
|
|
221528
|
-
return `${fieldName}${this.getAvoidOption(isNonNullType21, hasDefaultValue) ? "?" : ""}`;
|
|
221529
|
-
}
|
|
221530
|
-
formatTypeString(fieldType, isNonNullType21, hasDefaultValue) {
|
|
221531
|
-
if (!hasDefaultValue && isNonNullType21) {
|
|
221532
|
-
return this.clearOptional(fieldType);
|
|
221533
|
-
}
|
|
221534
|
-
return fieldType;
|
|
221535
|
-
}
|
|
221536
|
-
wrapMaybe(type) {
|
|
221537
|
-
const prefix = this._namespacedImportName ? `${this._namespacedImportName}.` : "";
|
|
221538
|
-
return `${prefix}${this._maybeType}${type ? `<${type}>` : ""}`;
|
|
221539
|
-
}
|
|
221540
|
-
getAvoidOption(isNonNullType21, hasDefaultValue) {
|
|
221541
|
-
const options = this._avoidOptionals;
|
|
221542
|
-
return (options.object || !options.defaultValue) && hasDefaultValue || !options.object && !isNonNullType21;
|
|
221543
|
-
}
|
|
221544
|
-
getPunctuation() {
|
|
221545
|
-
return ";";
|
|
221546
|
-
}
|
|
221547
|
-
}
|
|
221548
|
-
|
|
221549
|
-
// node_modules/@graphql-codegen/typescript/esm/visitor.js
|
|
221550
|
-
class TsVisitor extends BaseTypesVisitor {
|
|
221551
|
-
constructor(schema, pluginConfig, additionalConfig = {}) {
|
|
221552
|
-
super(schema, pluginConfig, {
|
|
221553
|
-
noExport: getConfigValue(pluginConfig.noExport, false),
|
|
221554
|
-
avoidOptionals: normalizeAvoidOptionals(getConfigValue(pluginConfig.avoidOptionals, false)),
|
|
221555
|
-
maybeValue: getConfigValue(pluginConfig.maybeValue, "T | null"),
|
|
221556
|
-
inputMaybeValue: getConfigValue(pluginConfig.inputMaybeValue, getConfigValue(pluginConfig.maybeValue, "Maybe<T>")),
|
|
221557
|
-
constEnums: getConfigValue(pluginConfig.constEnums, false),
|
|
221558
|
-
enumsAsTypes: getConfigValue(pluginConfig.enumsAsTypes, false),
|
|
221559
|
-
futureProofEnums: getConfigValue(pluginConfig.futureProofEnums, false),
|
|
221560
|
-
futureProofUnions: getConfigValue(pluginConfig.futureProofUnions, false),
|
|
221561
|
-
enumsAsConst: getConfigValue(pluginConfig.enumsAsConst, false),
|
|
221562
|
-
numericEnums: getConfigValue(pluginConfig.numericEnums, false),
|
|
221563
|
-
onlyEnums: getConfigValue(pluginConfig.onlyEnums, false),
|
|
221564
|
-
onlyOperationTypes: getConfigValue(pluginConfig.onlyOperationTypes, false),
|
|
221565
|
-
immutableTypes: getConfigValue(pluginConfig.immutableTypes, false),
|
|
221566
|
-
useImplementingTypes: getConfigValue(pluginConfig.useImplementingTypes, false),
|
|
221567
|
-
entireFieldWrapperValue: getConfigValue(pluginConfig.entireFieldWrapperValue, "T"),
|
|
221568
|
-
wrapEntireDefinitions: getConfigValue(pluginConfig.wrapEntireFieldDefinitions, false),
|
|
221569
|
-
...additionalConfig
|
|
221570
|
-
});
|
|
221571
|
-
autoBind(this);
|
|
221572
|
-
const enumNames = Object.values(schema.getTypeMap()).filter(import_graphql97.isEnumType).map((type) => type.name);
|
|
221573
|
-
this.setArgumentsTransformer(new TypeScriptOperationVariablesToObject(this.scalars, this.convertName, this.config.avoidOptionals, this.config.immutableTypes, null, enumNames, pluginConfig.enumPrefix, pluginConfig.enumSuffix, this.config.enumValues, false, this.config.directiveArgumentAndInputFieldMappings, "InputMaybe"));
|
|
221574
|
-
this.setDeclarationBlockConfig({
|
|
221575
|
-
enumNameValueSeparator: " =",
|
|
221576
|
-
ignoreExport: this.config.noExport
|
|
221577
|
-
});
|
|
221578
|
-
}
|
|
221579
|
-
_getTypeForNode(node, isVisitingInputType) {
|
|
221580
|
-
const typeAsString = node.name.value;
|
|
221581
|
-
if (this.config.useImplementingTypes) {
|
|
221582
|
-
const allTypesMap = this._schema.getTypeMap();
|
|
221583
|
-
const implementingTypes = [];
|
|
221584
|
-
for (const graphqlType of Object.values(allTypesMap)) {
|
|
221585
|
-
if (graphqlType instanceof import_graphql97.GraphQLObjectType) {
|
|
221586
|
-
const allInterfaces = graphqlType.getInterfaces();
|
|
221587
|
-
if (allInterfaces.some((int) => typeAsString === int.name)) {
|
|
221588
|
-
implementingTypes.push(this.convertName(graphqlType.name));
|
|
221589
|
-
}
|
|
221590
|
-
}
|
|
221591
|
-
}
|
|
221592
|
-
if (implementingTypes.length > 0) {
|
|
221593
|
-
return implementingTypes.join(" | ");
|
|
221594
|
-
}
|
|
221595
|
-
}
|
|
221596
|
-
const typeString = super._getTypeForNode(node, isVisitingInputType);
|
|
221597
|
-
const schemaType = this._schema.getType(node.name.value);
|
|
221598
|
-
if (import_graphql97.isEnumType(schemaType)) {
|
|
221599
|
-
const futureProofEnumUsageEnabled = this.config.futureProofEnums === true && this.config.enumsAsTypes !== true;
|
|
221600
|
-
if (futureProofEnumUsageEnabled && this.config.allowEnumStringTypes === true) {
|
|
221601
|
-
return `${typeString} | '%future added value' | ` + "`${" + typeString + "}`";
|
|
221602
|
-
}
|
|
221603
|
-
if (futureProofEnumUsageEnabled) {
|
|
221604
|
-
return `${typeString} | '%future added value'`;
|
|
221605
|
-
}
|
|
221606
|
-
if (this.config.allowEnumStringTypes === true) {
|
|
221607
|
-
return `${typeString} | ` + "`${" + typeString + "}`";
|
|
221608
|
-
}
|
|
221609
|
-
}
|
|
221610
|
-
return typeString;
|
|
221611
|
-
}
|
|
221612
|
-
getWrapperDefinitions() {
|
|
221613
|
-
if (this.config.onlyEnums)
|
|
221614
|
-
return [];
|
|
221615
|
-
const definitions = [this.getMaybeValue(), this.getInputMaybeValue()];
|
|
221616
|
-
if (this.config.wrapFieldDefinitions) {
|
|
221617
|
-
definitions.push(this.getFieldWrapperValue());
|
|
221618
|
-
}
|
|
221619
|
-
if (this.config.wrapEntireDefinitions) {
|
|
221620
|
-
definitions.push(this.getEntireFieldWrapperValue());
|
|
221621
|
-
}
|
|
221622
|
-
return definitions;
|
|
221623
|
-
}
|
|
221624
|
-
getMaybeValue() {
|
|
221625
|
-
return `${this.getExportPrefix()}type Maybe<T> = ${this.config.maybeValue};`;
|
|
221626
|
-
}
|
|
221627
|
-
getInputMaybeValue() {
|
|
221628
|
-
return `${this.getExportPrefix()}type InputMaybe<T> = ${this.config.inputMaybeValue};`;
|
|
221629
|
-
}
|
|
221630
|
-
clearOptional(str) {
|
|
221631
|
-
if (str.startsWith("Maybe")) {
|
|
221632
|
-
return str.replace(/Maybe<(.*?)>$/, "$1");
|
|
221633
|
-
}
|
|
221634
|
-
if (str.startsWith("InputMaybe")) {
|
|
221635
|
-
return str.replace(/InputMaybe<(.*?)>$/, "$1");
|
|
221636
|
-
}
|
|
221637
|
-
return str;
|
|
221638
|
-
}
|
|
221639
|
-
getExportPrefix() {
|
|
221640
|
-
if (this.config.noExport) {
|
|
221641
|
-
return "";
|
|
221642
|
-
}
|
|
221643
|
-
return super.getExportPrefix();
|
|
221644
|
-
}
|
|
221645
|
-
getMaybeWrapper(ancestors) {
|
|
221646
|
-
const currentVisitContext = this.getVisitorKindContextFromAncestors(ancestors);
|
|
221647
|
-
const isInputContext = currentVisitContext.includes(import_graphql97.Kind.INPUT_OBJECT_TYPE_DEFINITION);
|
|
221648
|
-
return isInputContext ? "InputMaybe" : "Maybe";
|
|
221649
|
-
}
|
|
221650
|
-
NamedType(node, key, parent, path, ancestors) {
|
|
221651
|
-
return `${this.getMaybeWrapper(ancestors)}<${super.NamedType(node, key, parent, path, ancestors)}>`;
|
|
221652
|
-
}
|
|
221653
|
-
ListType(node, key, parent, path, ancestors) {
|
|
221654
|
-
return `${this.getMaybeWrapper(ancestors)}<${super.ListType(node, key, parent, path, ancestors)}>`;
|
|
221655
|
-
}
|
|
221656
|
-
UnionTypeDefinition(node, key, parent) {
|
|
221657
|
-
if (this.config.onlyOperationTypes || this.config.onlyEnums)
|
|
221658
|
-
return "";
|
|
221659
|
-
let withFutureAddedValue = [];
|
|
221660
|
-
if (this.config.futureProofUnions) {
|
|
221661
|
-
withFutureAddedValue = [
|
|
221662
|
-
this.config.immutableTypes ? `{ readonly __typename?: "%other" }` : `{ __typename?: "%other" }`
|
|
221663
|
-
];
|
|
221664
|
-
}
|
|
221665
|
-
const originalNode = parent[key];
|
|
221666
|
-
const possibleTypes = originalNode.types.map((t) => this.scalars[t.name.value] ? this._getScalar(t.name.value, "output") : this.convertName(t)).concat(...withFutureAddedValue).join(" | ");
|
|
221667
|
-
return new DeclarationBlock(this._declarationBlockConfig).export().asKind("type").withName(this.convertName(node)).withComment(node.description?.value).withContent(possibleTypes).string;
|
|
221668
|
-
}
|
|
221669
|
-
wrapWithListType(str) {
|
|
221670
|
-
return `${this.config.immutableTypes ? "ReadonlyArray" : "Array"}<${str}>`;
|
|
221671
|
-
}
|
|
221672
|
-
NonNullType(node) {
|
|
221673
|
-
const baseValue = super.NonNullType(node);
|
|
221674
|
-
return this.clearOptional(baseValue);
|
|
221675
|
-
}
|
|
221676
|
-
FieldDefinition(node, key, parent) {
|
|
221677
|
-
const typeString = this.config.wrapEntireDefinitions ? `EntireFieldWrapper<${node.type}>` : node.type;
|
|
221678
|
-
const originalFieldNode = parent[key];
|
|
221679
|
-
const addOptionalSign = !this.config.avoidOptionals.field && originalFieldNode.type.kind !== import_graphql97.Kind.NON_NULL_TYPE;
|
|
221680
|
-
const comment = getNodeComment(node);
|
|
221681
|
-
const { type } = this.config.declarationKind;
|
|
221682
|
-
return comment + indent3(`${this.config.immutableTypes ? "readonly " : ""}${node.name.value}${addOptionalSign ? "?" : ""}: ${typeString}${this.getPunctuation(type)}`);
|
|
221683
|
-
}
|
|
221684
|
-
InputValueDefinition(node, key, parent, _path, ancestors) {
|
|
221685
|
-
const originalFieldNode = parent[key];
|
|
221686
|
-
const addOptionalSign = !this.config.avoidOptionals.inputValue && (originalFieldNode.type.kind !== import_graphql97.Kind.NON_NULL_TYPE || !this.config.avoidOptionals.defaultValue && node.defaultValue !== undefined);
|
|
221687
|
-
const comment = getNodeComment(node);
|
|
221688
|
-
const declarationKind = this.config.declarationKind.type;
|
|
221689
|
-
let type = node.type;
|
|
221690
|
-
if (node.directives && this.config.directiveArgumentAndInputFieldMappings) {
|
|
221691
|
-
type = this._getDirectiveOverrideType(node.directives) || type;
|
|
221692
|
-
}
|
|
221693
|
-
const readonlyPrefix = this.config.immutableTypes ? "readonly " : "";
|
|
221694
|
-
const buildFieldDefinition = (isOneOf = false) => {
|
|
221695
|
-
return `${readonlyPrefix}${node.name.value}${addOptionalSign && !isOneOf ? "?" : ""}: ${isOneOf ? this.clearOptional(type) : type}${this.getPunctuation(declarationKind)}`;
|
|
221696
|
-
};
|
|
221697
|
-
const realParentDef = ancestors?.[ancestors.length - 1];
|
|
221698
|
-
if (realParentDef) {
|
|
221699
|
-
const parentType = this._schema.getType(realParentDef.name.value);
|
|
221700
|
-
if (isOneOfInputObjectType(parentType)) {
|
|
221701
|
-
if (originalFieldNode.type.kind === import_graphql97.Kind.NON_NULL_TYPE) {
|
|
221702
|
-
throw new Error("Fields on an input object type can not be non-nullable. It seems like the schema was not validated.");
|
|
221703
|
-
}
|
|
221704
|
-
const fieldParts = [];
|
|
221705
|
-
for (const fieldName of Object.keys(parentType.getFields())) {
|
|
221706
|
-
if (fieldName === node.name.value) {
|
|
221707
|
-
fieldParts.push(buildFieldDefinition(true));
|
|
221708
|
-
continue;
|
|
221709
|
-
}
|
|
221710
|
-
fieldParts.push(`${readonlyPrefix}${fieldName}?: never;`);
|
|
221711
|
-
}
|
|
221712
|
-
return comment + indent3(`{ ${fieldParts.join(" ")} }`);
|
|
221713
|
-
}
|
|
221714
|
-
}
|
|
221715
|
-
return comment + indent3(buildFieldDefinition());
|
|
221716
|
-
}
|
|
221717
|
-
EnumTypeDefinition(node) {
|
|
221718
|
-
const enumName = node.name.value;
|
|
221719
|
-
const outputType = (() => {
|
|
221720
|
-
if (this.config.enumsAsTypes) {
|
|
221721
|
-
return "string-literal";
|
|
221722
|
-
}
|
|
221723
|
-
if (this.config.numericEnums) {
|
|
221724
|
-
return "native-numeric";
|
|
221725
|
-
}
|
|
221726
|
-
if (this.config.enumsAsConst) {
|
|
221727
|
-
return "const";
|
|
221728
|
-
}
|
|
221729
|
-
return this.config.constEnums ? "native-const" : "native";
|
|
221730
|
-
})();
|
|
221731
|
-
return convertSchemaEnumToDeclarationBlockString({
|
|
221732
|
-
schema: this._schema,
|
|
221733
|
-
node,
|
|
221734
|
-
declarationBlockConfig: this._declarationBlockConfig,
|
|
221735
|
-
enumName,
|
|
221736
|
-
enumValues: this.config.enumValues,
|
|
221737
|
-
futureProofEnums: this.config.futureProofEnums,
|
|
221738
|
-
ignoreEnumValuesFromSchema: this.config.ignoreEnumValuesFromSchema,
|
|
221739
|
-
outputType,
|
|
221740
|
-
naming: {
|
|
221741
|
-
convert: this.config.convert,
|
|
221742
|
-
options: {
|
|
221743
|
-
typesPrefix: this.config.typesPrefix,
|
|
221744
|
-
typesSuffix: this.config.typesSuffix,
|
|
221745
|
-
useTypesPrefix: this.config.enumPrefix,
|
|
221746
|
-
useTypesSuffix: this.config.enumSuffix
|
|
221747
|
-
}
|
|
221748
|
-
}
|
|
221749
|
-
});
|
|
221750
|
-
}
|
|
221751
|
-
getPunctuation(_declarationKind) {
|
|
221752
|
-
return ";";
|
|
221753
|
-
}
|
|
221754
|
-
}
|
|
221755
|
-
|
|
221756
|
-
// node_modules/@graphql-codegen/typescript/esm/introspection-visitor.js
|
|
221757
|
-
class TsIntrospectionVisitor extends TsVisitor {
|
|
221758
|
-
typesToInclude = [];
|
|
221759
|
-
constructor(schema, pluginConfig = {}, typesToInclude) {
|
|
221760
|
-
super(schema, pluginConfig);
|
|
221761
|
-
this.typesToInclude = typesToInclude;
|
|
221762
|
-
autoBind(this);
|
|
221763
|
-
}
|
|
221764
|
-
DirectiveDefinition() {
|
|
221765
|
-
return null;
|
|
221766
|
-
}
|
|
221767
|
-
ObjectTypeDefinition(node, key, parent) {
|
|
221768
|
-
const name = node.name.value;
|
|
221769
|
-
if (this.typesToInclude.some((type) => type.name === name)) {
|
|
221770
|
-
return super.ObjectTypeDefinition(node, key, parent);
|
|
221771
|
-
}
|
|
221772
|
-
return null;
|
|
221773
|
-
}
|
|
221774
|
-
EnumTypeDefinition(node) {
|
|
221775
|
-
const name = node.name.value;
|
|
221776
|
-
if (this.typesToInclude.some((type) => type.name === name)) {
|
|
221777
|
-
return super.EnumTypeDefinition(node);
|
|
221778
|
-
}
|
|
221779
|
-
return null;
|
|
221780
|
-
}
|
|
221781
|
-
}
|
|
221782
|
-
// node_modules/@graphql-codegen/typescript/esm/index.js
|
|
221783
|
-
var plugin = (schema, documents, config2) => {
|
|
221784
|
-
const { schema: _schema, ast } = transformSchemaAST(schema, config2);
|
|
221785
|
-
const visitor2 = new TsVisitor(_schema, config2);
|
|
221786
|
-
const visitorResult = oldVisit(ast, { leave: visitor2 });
|
|
221787
|
-
const introspectionDefinitions = includeIntrospectionTypesDefinitions(_schema, documents, config2);
|
|
221788
|
-
const scalars2 = visitor2.scalarsDefinition;
|
|
221789
|
-
const directiveArgumentAndInputFieldMappings = visitor2.directiveArgumentAndInputFieldMappingsDefinition;
|
|
221790
|
-
return {
|
|
221791
|
-
prepend: [
|
|
221792
|
-
...visitor2.getEnumsImports(),
|
|
221793
|
-
...visitor2.getDirectiveArgumentAndInputFieldMappingsImports(),
|
|
221794
|
-
...visitor2.getScalarsImports(),
|
|
221795
|
-
...visitor2.getWrapperDefinitions()
|
|
221796
|
-
].filter(Boolean),
|
|
221797
|
-
content: [
|
|
221798
|
-
scalars2,
|
|
221799
|
-
directiveArgumentAndInputFieldMappings,
|
|
221800
|
-
...visitorResult.definitions,
|
|
221801
|
-
...introspectionDefinitions
|
|
221802
|
-
].filter(Boolean).join(`
|
|
221803
|
-
`)
|
|
221804
|
-
};
|
|
221805
|
-
};
|
|
221806
|
-
function includeIntrospectionTypesDefinitions(schema, documents, config2) {
|
|
221807
|
-
const typeInfo = new import_graphql98.TypeInfo(schema);
|
|
221808
|
-
const usedTypes = [];
|
|
221809
|
-
const documentsVisitor = import_graphql98.visitWithTypeInfo(typeInfo, {
|
|
221810
|
-
Field() {
|
|
221811
|
-
const type = import_graphql98.getNamedType(typeInfo.getType());
|
|
221812
|
-
if (type && import_graphql98.isIntrospectionType(type) && !usedTypes.includes(type)) {
|
|
221813
|
-
usedTypes.push(type);
|
|
221814
|
-
}
|
|
221815
|
-
}
|
|
221816
|
-
});
|
|
221817
|
-
for (const doc of documents) {
|
|
221818
|
-
import_graphql98.visit(doc.document, documentsVisitor);
|
|
221819
|
-
}
|
|
221820
|
-
const typesToInclude = [];
|
|
221821
|
-
for (const type of usedTypes) {
|
|
221822
|
-
collectTypes(type);
|
|
221823
|
-
}
|
|
221824
|
-
const visitor2 = new TsIntrospectionVisitor(schema, config2, typesToInclude);
|
|
221825
|
-
const result = oldVisit(import_graphql98.parse(import_graphql98.printIntrospectionSchema(schema)), {
|
|
221826
|
-
leave: visitor2
|
|
221827
|
-
});
|
|
221828
|
-
function collectTypes(type) {
|
|
221829
|
-
if (typesToInclude.includes(type)) {
|
|
221830
|
-
return;
|
|
221831
|
-
}
|
|
221832
|
-
typesToInclude.push(type);
|
|
221833
|
-
if (import_graphql98.isObjectType(type)) {
|
|
221834
|
-
const fields3 = type.getFields();
|
|
221835
|
-
for (const key of Object.keys(fields3)) {
|
|
221836
|
-
const field = fields3[key];
|
|
221837
|
-
const type2 = import_graphql98.getNamedType(field.type);
|
|
221838
|
-
collectTypes(type2);
|
|
221839
|
-
}
|
|
221840
|
-
}
|
|
221841
|
-
}
|
|
221842
|
-
return result.definitions;
|
|
221843
|
-
}
|
|
221844
221070
|
|
|
221845
221071
|
// node_modules/@graphql-codegen/typescript-operations/esm/index.js
|
|
221846
|
-
init_esm3();
|
|
221847
|
-
var exports_esm2 = {};
|
|
221848
|
-
__export(exports_esm2, {
|
|
221849
|
-
TypeScriptDocumentsVisitor: () => TypeScriptDocumentsVisitor,
|
|
221850
|
-
plugin: () => plugin2
|
|
221851
|
-
});
|
|
221852
|
-
var import_graphql101 = __toESM(require_graphql2(), 1);
|
|
221853
221072
|
init_esm7();
|
|
221854
221073
|
|
|
221855
221074
|
// node_modules/@graphql-codegen/typescript-operations/esm/visitor.js
|
|
221856
221075
|
init_esm3();
|
|
221857
221076
|
init_esm7();
|
|
221858
|
-
var
|
|
221077
|
+
var import_graphql96 = __toESM(require_graphql2(), 1);
|
|
221859
221078
|
|
|
221860
221079
|
// node_modules/@graphql-codegen/typescript-operations/esm/ts-operation-variables-to-object.js
|
|
221861
221080
|
init_esm7();
|
|
221862
|
-
var
|
|
221081
|
+
var import_graphql95 = __toESM(require_graphql2(), 1);
|
|
221863
221082
|
|
|
221864
|
-
class
|
|
221083
|
+
class TypeScriptOperationVariablesToObject extends OperationVariablesToObject {
|
|
221865
221084
|
_config;
|
|
221866
221085
|
constructor(_config, _scalars, _convertName, _namespacedImportName, _enumNames, _enumPrefix, _enumSuffix, _enumValues, _applyCoercion) {
|
|
221867
221086
|
super(_scalars, _convertName, _namespacedImportName, _enumNames, _enumPrefix, _enumSuffix, _enumValues, _applyCoercion, {});
|
|
@@ -221891,11 +221110,11 @@ class TypeScriptOperationVariablesToObject2 extends OperationVariablesToObject {
|
|
|
221891
221110
|
return ";";
|
|
221892
221111
|
}
|
|
221893
221112
|
wrapAstTypeWithModifiers(baseType, typeNode, applyCoercion = false) {
|
|
221894
|
-
if (typeNode.kind ===
|
|
221113
|
+
if (typeNode.kind === import_graphql95.Kind.NON_NULL_TYPE) {
|
|
221895
221114
|
const type = this.wrapAstTypeWithModifiers(baseType, typeNode.type, applyCoercion);
|
|
221896
221115
|
return this.clearOptional(type);
|
|
221897
221116
|
}
|
|
221898
|
-
if (typeNode.kind ===
|
|
221117
|
+
if (typeNode.kind === import_graphql95.Kind.LIST_TYPE) {
|
|
221899
221118
|
const innerType = this.wrapAstTypeWithModifiers(baseType, typeNode.type, applyCoercion);
|
|
221900
221119
|
const listInputCoercionExtension = applyCoercion ? ` | ${innerType}` : "";
|
|
221901
221120
|
return this.wrapMaybe(`${this._config.immutableTypes ? "ReadonlyArray" : "Array"}<${innerType}>${listInputCoercionExtension}`);
|
|
@@ -221916,24 +221135,24 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
221916
221135
|
_needsExactUtilityType = false;
|
|
221917
221136
|
_usedEnumIntrospectionType = false;
|
|
221918
221137
|
_outputPath;
|
|
221919
|
-
constructor(schema,
|
|
221920
|
-
super(
|
|
221921
|
-
arrayInputCoercion: getConfigValue(
|
|
221922
|
-
noExport: getConfigValue(
|
|
221923
|
-
immutableTypes: getConfigValue(
|
|
221924
|
-
nonOptionalTypename: getConfigValue(
|
|
221925
|
-
mergeFragmentTypes: getConfigValue(
|
|
221926
|
-
allowUndefinedQueryVariables: getConfigValue(
|
|
221927
|
-
enumType: getConfigValue(
|
|
221928
|
-
ignoreEnumValuesFromSchema: getConfigValue(
|
|
221929
|
-
futureProofEnums: getConfigValue(
|
|
221930
|
-
maybeValue: getConfigValue(
|
|
221931
|
-
inputMaybeValue: getConfigValue(
|
|
221138
|
+
constructor(schema, config, documentNode, outputPath) {
|
|
221139
|
+
super(config, {
|
|
221140
|
+
arrayInputCoercion: getConfigValue(config.arrayInputCoercion, true),
|
|
221141
|
+
noExport: getConfigValue(config.noExport, false),
|
|
221142
|
+
immutableTypes: getConfigValue(config.immutableTypes, false),
|
|
221143
|
+
nonOptionalTypename: getConfigValue(config.nonOptionalTypename, false),
|
|
221144
|
+
mergeFragmentTypes: getConfigValue(config.mergeFragmentTypes, false),
|
|
221145
|
+
allowUndefinedQueryVariables: getConfigValue(config.allowUndefinedQueryVariables, false),
|
|
221146
|
+
enumType: getConfigValue(config.enumType, "string-literal"),
|
|
221147
|
+
ignoreEnumValuesFromSchema: getConfigValue(config.ignoreEnumValuesFromSchema, false),
|
|
221148
|
+
futureProofEnums: getConfigValue(config.futureProofEnums, false),
|
|
221149
|
+
maybeValue: getConfigValue(config.maybeValue, "T | null"),
|
|
221150
|
+
inputMaybeValue: getConfigValue(config.inputMaybeValue, "T | null | undefined")
|
|
221932
221151
|
}, schema);
|
|
221933
221152
|
this.config.enumValues = parseEnumValues({
|
|
221934
221153
|
schema,
|
|
221935
|
-
mapOrStr:
|
|
221936
|
-
ignoreEnumValuesFromSchema:
|
|
221154
|
+
mapOrStr: config.enumValues,
|
|
221155
|
+
ignoreEnumValuesFromSchema: config.ignoreEnumValuesFromSchema,
|
|
221937
221156
|
naming: {
|
|
221938
221157
|
convert: this.config.convert,
|
|
221939
221158
|
options: {
|
|
@@ -221947,18 +221166,18 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
221947
221166
|
this._outputPath = outputPath;
|
|
221948
221167
|
autoBind(this);
|
|
221949
221168
|
const allFragments = [
|
|
221950
|
-
...documentNode.definitions.filter((d) => d.kind ===
|
|
221169
|
+
...documentNode.definitions.filter((d) => d.kind === import_graphql96.Kind.FRAGMENT_DEFINITION).map((fragmentDef) => ({
|
|
221951
221170
|
node: fragmentDef,
|
|
221952
221171
|
name: fragmentDef.name.value,
|
|
221953
221172
|
onType: fragmentDef.typeCondition.name.value,
|
|
221954
221173
|
isExternal: false
|
|
221955
221174
|
})),
|
|
221956
|
-
...
|
|
221175
|
+
...config.externalFragments || []
|
|
221957
221176
|
];
|
|
221958
221177
|
const documentWithAllFragments = {
|
|
221959
221178
|
...documentNode,
|
|
221960
221179
|
definitions: [
|
|
221961
|
-
...documentNode.definitions.filter((d) => d.kind !==
|
|
221180
|
+
...documentNode.definitions.filter((d) => d.kind !== import_graphql96.Kind.FRAGMENT_DEFINITION),
|
|
221962
221181
|
...allFragments.map((f) => f.node)
|
|
221963
221182
|
]
|
|
221964
221183
|
};
|
|
@@ -221990,8 +221209,8 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
221990
221209
|
printFieldsOnNewLines: this.config.printFieldsOnNewLines
|
|
221991
221210
|
};
|
|
221992
221211
|
this.setSelectionSetHandler(new SelectionSetToObject(new PreResolveTypesProcessor(processorConfig), this.scalars, this.schema, this.convertName.bind(this), this.getFragmentSuffix.bind(this), allFragments, this.config));
|
|
221993
|
-
const enumsNames = Object.keys(schema.getTypeMap()).filter((typeName) =>
|
|
221994
|
-
this.setVariablesTransformer(new
|
|
221212
|
+
const enumsNames = Object.keys(schema.getTypeMap()).filter((typeName) => import_graphql96.isEnumType(schema.getType(typeName)));
|
|
221213
|
+
this.setVariablesTransformer(new TypeScriptOperationVariablesToObject({
|
|
221995
221214
|
avoidOptionals: this.config.avoidOptionals,
|
|
221996
221215
|
immutableTypes: this.config.immutableTypes,
|
|
221997
221216
|
inputMaybeValue: this.config.inputMaybeValue
|
|
@@ -222078,7 +221297,7 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222078
221297
|
}
|
|
222079
221298
|
}
|
|
222080
221299
|
}
|
|
222081
|
-
const addOptionalSign = !oneOfDetails.isOneOfInputValue && !this.config.avoidOptionals.inputValue && (node.type.kind !==
|
|
221300
|
+
const addOptionalSign = !oneOfDetails.isOneOfInputValue && !this.config.avoidOptionals.inputValue && (node.type.kind !== import_graphql96.Kind.NON_NULL_TYPE || !this.config.avoidOptionals.defaultValue && node.defaultValue !== undefined);
|
|
222082
221301
|
const keyPart = `${node.name.value}${addOptionalSign ? "?" : ""}`;
|
|
222083
221302
|
const commentPart = getNodeComment(node);
|
|
222084
221303
|
const readonlyPart = this.config.immutableTypes ? "readonly " : "";
|
|
@@ -222193,7 +221412,7 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222193
221412
|
return `Exact<${variablesBlock === "{}" ? `{ [key: string]: never; }` : variablesBlock}>${extraType}`;
|
|
222194
221413
|
}
|
|
222195
221414
|
collectInnerTypesRecursively({ node, usedSchemaTypes, location }) {
|
|
222196
|
-
if (node instanceof
|
|
221415
|
+
if (node instanceof import_graphql96.GraphQLEnumType) {
|
|
222197
221416
|
if (usedSchemaTypes[node.name]) {
|
|
222198
221417
|
return;
|
|
222199
221418
|
}
|
|
@@ -222204,7 +221423,7 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222204
221423
|
};
|
|
222205
221424
|
return;
|
|
222206
221425
|
}
|
|
222207
|
-
if (node instanceof
|
|
221426
|
+
if (node instanceof import_graphql96.GraphQLScalarType) {
|
|
222208
221427
|
const scalarType = usedSchemaTypes[node.name] || {
|
|
222209
221428
|
type: "GraphQLScalarType",
|
|
222210
221429
|
node,
|
|
@@ -222237,7 +221456,7 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222237
221456
|
};
|
|
222238
221457
|
const fields3 = node.getFields();
|
|
222239
221458
|
for (const field of Object.values(fields3)) {
|
|
222240
|
-
const fieldType =
|
|
221459
|
+
const fieldType = import_graphql96.getNamedType(field.type);
|
|
222241
221460
|
this.collectInnerTypesRecursively({
|
|
222242
221461
|
node: fieldType,
|
|
222243
221462
|
usedSchemaTypes,
|
|
@@ -222248,12 +221467,12 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222248
221467
|
collectUsedSchemaTypesToGenerate({ schema, documentNode }) {
|
|
222249
221468
|
const schemaTypes = schema.getTypeMap();
|
|
222250
221469
|
const usedSchemaTypes = {};
|
|
222251
|
-
|
|
221470
|
+
import_graphql96.visit(documentNode, {
|
|
222252
221471
|
VariableDefinition: (variableDefinitionNode) => {
|
|
222253
|
-
|
|
221472
|
+
import_graphql96.visit(variableDefinitionNode, {
|
|
222254
221473
|
NamedType: (namedTypeNode) => {
|
|
222255
221474
|
const foundInputType = schemaTypes[namedTypeNode.name.value];
|
|
222256
|
-
if (foundInputType && (foundInputType instanceof
|
|
221475
|
+
if (foundInputType && (foundInputType instanceof import_graphql96.GraphQLInputObjectType || foundInputType instanceof import_graphql96.GraphQLScalarType || foundInputType instanceof import_graphql96.GraphQLEnumType) && !isNativeNamedType(foundInputType)) {
|
|
222257
221476
|
this.collectInnerTypesRecursively({
|
|
222258
221477
|
node: foundInputType,
|
|
222259
221478
|
usedSchemaTypes,
|
|
@@ -222264,24 +221483,24 @@ class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor {
|
|
|
222264
221483
|
});
|
|
222265
221484
|
}
|
|
222266
221485
|
});
|
|
222267
|
-
const typeInfo = new
|
|
222268
|
-
|
|
221486
|
+
const typeInfo = new import_graphql96.TypeInfo(schema);
|
|
221487
|
+
import_graphql96.visit(documentNode, import_graphql96.visitWithTypeInfo(typeInfo, {
|
|
222269
221488
|
Field: () => {
|
|
222270
221489
|
const fieldType = typeInfo.getType();
|
|
222271
221490
|
if (fieldType) {
|
|
222272
|
-
const namedType =
|
|
222273
|
-
if (namedType instanceof
|
|
221491
|
+
const namedType = import_graphql96.getNamedType(fieldType);
|
|
221492
|
+
if (namedType instanceof import_graphql96.GraphQLEnumType) {
|
|
222274
221493
|
usedSchemaTypes[namedType.name] = {
|
|
222275
221494
|
type: "GraphQLEnumType",
|
|
222276
221495
|
node: namedType,
|
|
222277
221496
|
tsType: this.convertName(namedType.name)
|
|
222278
221497
|
};
|
|
222279
|
-
if (
|
|
221498
|
+
if (import_graphql96.isIntrospectionType(namedType)) {
|
|
222280
221499
|
this._usedEnumIntrospectionType = true;
|
|
222281
221500
|
}
|
|
222282
221501
|
return;
|
|
222283
221502
|
}
|
|
222284
|
-
if (namedType instanceof
|
|
221503
|
+
if (namedType instanceof import_graphql96.GraphQLScalarType) {
|
|
222285
221504
|
const scalarType = usedSchemaTypes[namedType.name] || {
|
|
222286
221505
|
type: "GraphQLScalarType",
|
|
222287
221506
|
node: namedType,
|
|
@@ -222322,7 +221541,7 @@ function parseOneOfInputValue({ node, schema, ancestors }) {
|
|
|
222322
221541
|
if (realParentDef) {
|
|
222323
221542
|
const parentType = schema.getType(realParentDef.name.value);
|
|
222324
221543
|
if (isOneOfInputObjectType(parentType)) {
|
|
222325
|
-
if (node.type.kind ===
|
|
221544
|
+
if (node.type.kind === import_graphql96.Kind.NON_NULL_TYPE) {
|
|
222326
221545
|
throw new Error("Fields on an input object type can not be non-nullable. It seems like the schema was not validated.");
|
|
222327
221546
|
}
|
|
222328
221547
|
return { isOneOfInputValue: true, realParentDef, parentType };
|
|
@@ -222331,14 +221550,14 @@ function parseOneOfInputValue({ node, schema, ancestors }) {
|
|
|
222331
221550
|
return { isOneOfInputValue: false };
|
|
222332
221551
|
}
|
|
222333
221552
|
function collectAndFlattenTypeNodes({ currentTypeNode, isPreviousNodeNonNullable, typeNodes }) {
|
|
222334
|
-
if (currentTypeNode.kind ===
|
|
221553
|
+
if (currentTypeNode.kind === import_graphql96.Kind.NON_NULL_TYPE) {
|
|
222335
221554
|
const nextTypeNode = currentTypeNode.type;
|
|
222336
221555
|
collectAndFlattenTypeNodes({
|
|
222337
221556
|
currentTypeNode: nextTypeNode,
|
|
222338
221557
|
isPreviousNodeNonNullable: true,
|
|
222339
221558
|
typeNodes
|
|
222340
221559
|
});
|
|
222341
|
-
} else if (currentTypeNode.kind ===
|
|
221560
|
+
} else if (currentTypeNode.kind === import_graphql96.Kind.LIST_TYPE) {
|
|
222342
221561
|
typeNodes.push({ type: "ListType", isNonNullable: isPreviousNodeNonNullable });
|
|
222343
221562
|
const nextTypeNode = currentTypeNode.type;
|
|
222344
221563
|
collectAndFlattenTypeNodes({
|
|
@@ -222346,7 +221565,7 @@ function collectAndFlattenTypeNodes({ currentTypeNode, isPreviousNodeNonNullable
|
|
|
222346
221565
|
isPreviousNodeNonNullable: false,
|
|
222347
221566
|
typeNodes
|
|
222348
221567
|
});
|
|
222349
|
-
} else if (currentTypeNode.kind ===
|
|
221568
|
+
} else if (currentTypeNode.kind === import_graphql96.Kind.NAMED_TYPE) {
|
|
222350
221569
|
typeNodes.push({
|
|
222351
221570
|
type: "NamedType",
|
|
222352
221571
|
isNonNullable: isPreviousNodeNonNullable,
|
|
@@ -222356,10 +221575,10 @@ function collectAndFlattenTypeNodes({ currentTypeNode, isPreviousNodeNonNullable
|
|
|
222356
221575
|
}
|
|
222357
221576
|
|
|
222358
221577
|
// node_modules/@graphql-codegen/typescript-operations/esm/index.js
|
|
222359
|
-
var
|
|
222360
|
-
const schema =
|
|
222361
|
-
const documents =
|
|
222362
|
-
includeFragments:
|
|
221578
|
+
var plugin = async (inputSchema, rawDocuments, config, { outputFile }) => {
|
|
221579
|
+
const schema = config.nullability?.errorHandlingClient ? await semanticToStrict(inputSchema) : inputSchema;
|
|
221580
|
+
const documents = config.flattenGeneratedTypes ? optimizeOperations(schema, rawDocuments, {
|
|
221581
|
+
includeFragments: config.flattenGeneratedTypesIncludeFragments
|
|
222363
221582
|
}) : rawDocuments;
|
|
222364
221583
|
const parsedDocuments = documents.reduce((prev, document) => {
|
|
222365
221584
|
prev.all.documentFiles.push(document);
|
|
@@ -222373,14 +221592,14 @@ var plugin2 = async (inputSchema, rawDocuments, config2, { outputFile }) => {
|
|
|
222373
221592
|
all: { documentFiles: [], documentNodes: [] },
|
|
222374
221593
|
standard: { documentFiles: [], documentNodes: [] }
|
|
222375
221594
|
});
|
|
222376
|
-
const allDocumentsAST =
|
|
222377
|
-
const
|
|
222378
|
-
const documentsToVisitAST =
|
|
221595
|
+
const allDocumentsAST = import_graphql97.concatAST(parsedDocuments.all.documentNodes);
|
|
221596
|
+
const visitor = new TypeScriptDocumentsVisitor(schema, config, allDocumentsAST, outputFile);
|
|
221597
|
+
const documentsToVisitAST = import_graphql97.concatAST(parsedDocuments.standard.documentNodes);
|
|
222379
221598
|
const operationsResult = oldVisit(documentsToVisitAST, {
|
|
222380
|
-
leave:
|
|
221599
|
+
leave: visitor
|
|
222381
221600
|
});
|
|
222382
221601
|
const operationsDefinitions = operationsResult.definitions;
|
|
222383
|
-
if (
|
|
221602
|
+
if (config.addOperationExport) {
|
|
222384
221603
|
for (const d of allDocumentsAST.definitions) {
|
|
222385
221604
|
if ("name" in d) {
|
|
222386
221605
|
operationsDefinitions.push(`export declare const ${d.name.value}: import("graphql").DocumentNode;`);
|
|
@@ -222388,14 +221607,14 @@ var plugin2 = async (inputSchema, rawDocuments, config2, { outputFile }) => {
|
|
|
222388
221607
|
}
|
|
222389
221608
|
}
|
|
222390
221609
|
let schemaTypesDefinitions = [];
|
|
222391
|
-
if (!
|
|
222392
|
-
const schemaTypes = oldVisit(transformSchemaAST(schema,
|
|
221610
|
+
if (!config.importSchemaTypesFrom) {
|
|
221611
|
+
const schemaTypes = oldVisit(transformSchemaAST(schema, config).ast, { leave: visitor });
|
|
222393
221612
|
schemaTypesDefinitions = findTransformedDefinitions(schemaTypes);
|
|
222394
221613
|
}
|
|
222395
221614
|
let introspectionTypesDefinitions = [];
|
|
222396
|
-
if (
|
|
222397
|
-
const introspectionTypes = oldVisit(
|
|
222398
|
-
leave:
|
|
221615
|
+
if (visitor.shouldVisitIntrospectionTypes()) {
|
|
221616
|
+
const introspectionTypes = oldVisit(import_graphql97.parse(import_graphql97.printIntrospectionSchema(schema)), {
|
|
221617
|
+
leave: visitor
|
|
222399
221618
|
});
|
|
222400
221619
|
introspectionTypesDefinitions = findTransformedDefinitions(introspectionTypes);
|
|
222401
221620
|
}
|
|
@@ -222405,7 +221624,7 @@ var plugin2 = async (inputSchema, rawDocuments, config2, { outputFile }) => {
|
|
|
222405
221624
|
...operationsDefinitions
|
|
222406
221625
|
].join(`
|
|
222407
221626
|
`);
|
|
222408
|
-
if (
|
|
221627
|
+
if (config.globalNamespace) {
|
|
222409
221628
|
content = `
|
|
222410
221629
|
declare global {
|
|
222411
221630
|
${content}
|
|
@@ -222413,13 +221632,13 @@ var plugin2 = async (inputSchema, rawDocuments, config2, { outputFile }) => {
|
|
|
222413
221632
|
}
|
|
222414
221633
|
return {
|
|
222415
221634
|
prepend: [
|
|
222416
|
-
...
|
|
222417
|
-
...
|
|
222418
|
-
...
|
|
222419
|
-
...
|
|
222420
|
-
...
|
|
222421
|
-
|
|
222422
|
-
|
|
221635
|
+
...visitor.getImports(),
|
|
221636
|
+
...visitor.getExternalSchemaTypeImports(),
|
|
221637
|
+
...visitor.getEnumsImports(),
|
|
221638
|
+
...visitor.getScalarsImports(),
|
|
221639
|
+
...visitor.getGlobalDeclarations(visitor.config.noExport),
|
|
221640
|
+
visitor.getExactUtilityType(),
|
|
221641
|
+
visitor.getIncrementalUtilityType()
|
|
222423
221642
|
],
|
|
222424
221643
|
content
|
|
222425
221644
|
};
|
|
@@ -222442,12 +221661,12 @@ var ts2 = __toESM(require_typescript(), 1);
|
|
|
222442
221661
|
var ts = __toESM(require_typescript(), 1);
|
|
222443
221662
|
import { mkdir as mkdir2, readFile as readFile4 } from "node:fs/promises";
|
|
222444
221663
|
import { createHash as createHash7 } from "node:crypto";
|
|
222445
|
-
import { dirname as dirname7, resolve as
|
|
221664
|
+
import { dirname as dirname7, resolve as resolve9 } from "node:path";
|
|
222446
221665
|
import { createHash as createHash32 } from "node:crypto";
|
|
222447
221666
|
import { relative as relative4, resolve as resolvePath, sep as sep3 } from "node:path";
|
|
222448
221667
|
import { createHash as createHash22 } from "node:crypto";
|
|
222449
221668
|
import { existsSync as existsSync8, readFileSync as readFileSync6 } from "node:fs";
|
|
222450
|
-
import { dirname as dirname4, join as join10, resolve as
|
|
221669
|
+
import { dirname as dirname4, join as join10, resolve as resolve8 } from "node:path";
|
|
222451
221670
|
import { createHash as createHash6 } from "node:crypto";
|
|
222452
221671
|
var ts4 = __toESM(require_typescript(), 1);
|
|
222453
221672
|
var ts5 = __toESM(require_typescript(), 1);
|
|
@@ -222457,7 +221676,7 @@ import { join as join42 } from "node:path";
|
|
|
222457
221676
|
import { existsSync as existsSync22, readFileSync as readFileSync22 } from "node:fs";
|
|
222458
221677
|
import { dirname as dirname42, join as join32, relative as relative42, resolve as resolve32, sep as sep4 } from "node:path";
|
|
222459
221678
|
import { existsSync as existsSync62 } from "node:fs";
|
|
222460
|
-
import { join as join62, resolve as
|
|
221679
|
+
import { join as join62, resolve as resolve82 } from "node:path";
|
|
222461
221680
|
import { pathToFileURL } from "node:url";
|
|
222462
221681
|
var __defProp2 = Object.defineProperty;
|
|
222463
221682
|
var __returnValue2 = (v) => v;
|
|
@@ -222695,19 +221914,19 @@ function topoSortModules(modules) {
|
|
|
222695
221914
|
const byName = new Map(modules.map((m) => [m.name, m]));
|
|
222696
221915
|
const visited2 = new Set;
|
|
222697
221916
|
const result = [];
|
|
222698
|
-
const
|
|
221917
|
+
const visit9 = (module) => {
|
|
222699
221918
|
if (visited2.has(module.name))
|
|
222700
221919
|
return;
|
|
222701
221920
|
visited2.add(module.name);
|
|
222702
221921
|
for (const importName of module.imports) {
|
|
222703
221922
|
const dep = byName.get(importName);
|
|
222704
221923
|
if (dep && dep !== module)
|
|
222705
|
-
|
|
221924
|
+
visit9(dep);
|
|
222706
221925
|
}
|
|
222707
221926
|
result.push(module);
|
|
222708
221927
|
};
|
|
222709
221928
|
for (const module of modules)
|
|
222710
|
-
|
|
221929
|
+
visit9(module);
|
|
222711
221930
|
return result;
|
|
222712
221931
|
}
|
|
222713
221932
|
function pascalName(name) {
|
|
@@ -223665,11 +222884,11 @@ export function createGraphqlClient(options: GraphqlClientOptions) {
|
|
|
223665
222884
|
}
|
|
223666
222885
|
endpoint.pathname = endpoint.pathname.replace(/\\/$/, "") + "/graphql/v1";
|
|
223667
222886
|
const fetcher = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
223668
|
-
return getSdk<GraphqlRequestOptions>(async
|
|
222887
|
+
return getSdk<GraphqlRequestOptions>(async (
|
|
223669
222888
|
query: string,
|
|
223670
|
-
variables?:
|
|
222889
|
+
variables?: unknown,
|
|
223671
222890
|
request?: GraphqlRequestOptions,
|
|
223672
|
-
): Promise<
|
|
222891
|
+
): Promise<unknown> => {
|
|
223673
222892
|
const headers = new Headers({ "Content-Type": "application/json", Accept: "application/json" });
|
|
223674
222893
|
if (options.publishableKey) headers.set("apikey", options.publishableKey);
|
|
223675
222894
|
const token = await options.getAccessToken?.();
|
|
@@ -223678,7 +222897,7 @@ export function createGraphqlClient(options: GraphqlClientOptions) {
|
|
|
223678
222897
|
method: "POST",
|
|
223679
222898
|
headers,
|
|
223680
222899
|
body: JSON.stringify({ query, variables }),
|
|
223681
|
-
signal: request
|
|
222900
|
+
...(request?.signal ? { signal: request.signal } : {}),
|
|
223682
222901
|
redirect: "error",
|
|
223683
222902
|
});
|
|
223684
222903
|
if (!response.ok) {
|
|
@@ -223704,8 +222923,8 @@ export function createGraphqlClient(options: GraphqlClientOptions) {
|
|
|
223704
222923
|
if (!("data" in envelope) || !envelope.data || typeof envelope.data !== "object" || Array.isArray(envelope.data)) {
|
|
223705
222924
|
throw new GraphqlRequestError("invalid-response", "GraphQL returned no result object.", response.status);
|
|
223706
222925
|
}
|
|
223707
|
-
//
|
|
223708
|
-
return envelope.data
|
|
222926
|
+
// The operation-specific parser in getSdk validates selected field values.
|
|
222927
|
+
return envelope.data;
|
|
223709
222928
|
});
|
|
223710
222929
|
}
|
|
223711
222930
|
`;
|
|
@@ -223772,6 +222991,161 @@ function graphqlInputPaths(options) {
|
|
|
223772
222991
|
var init_graphql_inputs = __esm2(() => {
|
|
223773
222992
|
init_graphql_options();
|
|
223774
222993
|
});
|
|
222994
|
+
function renderGraphqlValidators(source, operationNames) {
|
|
222995
|
+
const fileName = resolve52("/__supacloud_graphql__/contracts.ts");
|
|
222996
|
+
const options = {
|
|
222997
|
+
strict: true,
|
|
222998
|
+
noUncheckedIndexedAccess: true,
|
|
222999
|
+
exactOptionalPropertyTypes: true,
|
|
223000
|
+
noImplicitOverride: true,
|
|
223001
|
+
noPropertyAccessFromIndexSignature: true,
|
|
223002
|
+
noFallthroughCasesInSwitch: true,
|
|
223003
|
+
skipLibCheck: false,
|
|
223004
|
+
target: ts7.ScriptTarget.ES2022,
|
|
223005
|
+
lib: ["lib.es2022.d.ts"],
|
|
223006
|
+
types: [],
|
|
223007
|
+
noEmit: true
|
|
223008
|
+
};
|
|
223009
|
+
const host = ts7.createCompilerHost(options);
|
|
223010
|
+
const getSourceFile = host.getSourceFile.bind(host);
|
|
223011
|
+
host.getSourceFile = (path, languageVersion, onError, shouldCreateNewSourceFile) => path === fileName ? ts7.createSourceFile(path, source, languageVersion, true) : getSourceFile(path, languageVersion, onError, shouldCreateNewSourceFile);
|
|
223012
|
+
const program = ts7.createProgram([fileName], options, host);
|
|
223013
|
+
const diagnostics = ts7.getPreEmitDiagnostics(program);
|
|
223014
|
+
if (diagnostics.length) {
|
|
223015
|
+
throw new Error(`Generated GraphQL types cannot be validated: ${diagnostics.map((item) => ts7.flattenDiagnosticMessageText(item.messageText, `
|
|
223016
|
+
`)).join("; ")}`);
|
|
223017
|
+
}
|
|
223018
|
+
const checker = program.getTypeChecker();
|
|
223019
|
+
const entry = program.getSourceFile(fileName);
|
|
223020
|
+
const module = entry && checker.getSymbolAtLocation(entry);
|
|
223021
|
+
if (!module)
|
|
223022
|
+
throw new Error("Generated GraphQL types have no module");
|
|
223023
|
+
const exports = new Map(checker.getExportsOfModule(module).map((symbol) => [symbol.name, symbol]));
|
|
223024
|
+
if (exports.has("GraphqlQueryResults")) {
|
|
223025
|
+
throw new Error("GraphQL type GraphqlQueryResults conflicts with the generated result registry.");
|
|
223026
|
+
}
|
|
223027
|
+
const names = new Map;
|
|
223028
|
+
const definitions = new Map;
|
|
223029
|
+
function unsupported(type) {
|
|
223030
|
+
throw new Error(`Unsupported GraphQL result wire type: ${checker.typeToString(type)}. Map custom scalars to JSON wire types or unknown.`);
|
|
223031
|
+
}
|
|
223032
|
+
function reference(type) {
|
|
223033
|
+
const existing = names.get(type);
|
|
223034
|
+
if (existing)
|
|
223035
|
+
return existing;
|
|
223036
|
+
const name = `checkGraphqlValue${names.size}`;
|
|
223037
|
+
names.set(type, name);
|
|
223038
|
+
definitions.set(name, "");
|
|
223039
|
+
definitions.set(name, `function ${name}(value: unknown): boolean {
|
|
223040
|
+
return ${expression(type)};
|
|
223041
|
+
}`);
|
|
223042
|
+
return name;
|
|
223043
|
+
}
|
|
223044
|
+
function expression(type) {
|
|
223045
|
+
if (type.flags & ts7.TypeFlags.Any)
|
|
223046
|
+
return unsupported(type);
|
|
223047
|
+
if (type.flags & ts7.TypeFlags.Unknown)
|
|
223048
|
+
return "true";
|
|
223049
|
+
if (type.flags & ts7.TypeFlags.Never)
|
|
223050
|
+
return "false";
|
|
223051
|
+
if (type.flags & ts7.TypeFlags.Null)
|
|
223052
|
+
return "value === null";
|
|
223053
|
+
if (type.flags & ts7.TypeFlags.Undefined)
|
|
223054
|
+
return "value === undefined";
|
|
223055
|
+
if (type.isStringLiteral() || type.isNumberLiteral())
|
|
223056
|
+
return `value === ${JSON.stringify(type.value)}`;
|
|
223057
|
+
if (type.flags & ts7.TypeFlags.BooleanLiteral)
|
|
223058
|
+
return `value === ${checker.typeToString(type)}`;
|
|
223059
|
+
if (type.flags & ts7.TypeFlags.String)
|
|
223060
|
+
return 'typeof value === "string"';
|
|
223061
|
+
if (type.flags & ts7.TypeFlags.Number)
|
|
223062
|
+
return 'typeof value === "number" && Number.isFinite(value)';
|
|
223063
|
+
if (type.flags & ts7.TypeFlags.Boolean)
|
|
223064
|
+
return 'typeof value === "boolean"';
|
|
223065
|
+
if (type.isUnion())
|
|
223066
|
+
return type.types.map((part) => `${reference(part)}(value)`).join(" || ");
|
|
223067
|
+
if (type.isIntersection())
|
|
223068
|
+
return type.types.map((part) => `${reference(part)}(value)`).join(" && ");
|
|
223069
|
+
if (checker.isTupleType(type))
|
|
223070
|
+
return unsupported(type);
|
|
223071
|
+
if (checker.isArrayType(type)) {
|
|
223072
|
+
const item = checker.getIndexTypeOfType(type, ts7.IndexKind.Number);
|
|
223073
|
+
if (!item)
|
|
223074
|
+
return unsupported(type);
|
|
223075
|
+
return `isGraphqlArray(value) && Array.from(value).every(${reference(item)})`;
|
|
223076
|
+
}
|
|
223077
|
+
if (type.flags & ts7.TypeFlags.Object) {
|
|
223078
|
+
if (type.getCallSignatures().length || type.getConstructSignatures().length)
|
|
223079
|
+
return unsupported(type);
|
|
223080
|
+
const indexes = checker.getIndexInfosOfType(type);
|
|
223081
|
+
if (indexes.some((index) => !(index.keyType.flags & ts7.TypeFlags.String)))
|
|
223082
|
+
return unsupported(type);
|
|
223083
|
+
const properties = checker.getPropertiesOfType(type).map((property2) => {
|
|
223084
|
+
const declaration = property2.valueDeclaration ?? property2.declarations?.[0];
|
|
223085
|
+
if (!declaration)
|
|
223086
|
+
return unsupported(type);
|
|
223087
|
+
const check2 = reference(checker.getTypeOfSymbolAtLocation(property2, declaration));
|
|
223088
|
+
const key = JSON.stringify(property2.name);
|
|
223089
|
+
const present = `Object.prototype.hasOwnProperty.call(value, ${key})`;
|
|
223090
|
+
return property2.flags & ts7.SymbolFlags.Optional ? `(!${present} || ${check2}(value[${key}]))` : `(${present} && ${check2}(value[${key}]))`;
|
|
223091
|
+
});
|
|
223092
|
+
const indexedValues = indexes.map((index) => `Object.values(value).every(${reference(index.type)})`);
|
|
223093
|
+
return ["isGraphqlRecord(value)", ...properties, ...indexedValues].join(" && ");
|
|
223094
|
+
}
|
|
223095
|
+
return unsupported(type);
|
|
223096
|
+
}
|
|
223097
|
+
const operations = [...operationNames].sort();
|
|
223098
|
+
const parsers = operations.map((name) => {
|
|
223099
|
+
const typeName = `${name}Query`;
|
|
223100
|
+
const symbol = exports.get(typeName);
|
|
223101
|
+
if (!symbol)
|
|
223102
|
+
throw new Error(`Missing generated operation type: ${typeName}`);
|
|
223103
|
+
const check2 = reference(checker.getDeclaredTypeOfSymbol(symbol));
|
|
223104
|
+
return `export function is${typeName}(value: unknown): value is ${typeName} {
|
|
223105
|
+
return ${check2}(value);
|
|
223106
|
+
}
|
|
223107
|
+
export function parse${typeName}(value: unknown): ${typeName} {
|
|
223108
|
+
if (!is${typeName}(value)) {
|
|
223109
|
+
throw new GraphqlRequestError("invalid-response", ${JSON.stringify(`GraphQL result does not match ${name}.`)});
|
|
223110
|
+
}
|
|
223111
|
+
return value;
|
|
223112
|
+
}`;
|
|
223113
|
+
});
|
|
223114
|
+
return `
|
|
223115
|
+
function isGraphqlRecord(value: unknown): value is Record<string, unknown> {
|
|
223116
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
223117
|
+
}
|
|
223118
|
+
function isGraphqlArray(value: unknown): value is unknown[] {
|
|
223119
|
+
return Array.isArray(value);
|
|
223120
|
+
}
|
|
223121
|
+
${[...definitions.values()].join(`
|
|
223122
|
+
`)}
|
|
223123
|
+
${parsers.join(`
|
|
223124
|
+
`)}
|
|
223125
|
+
export interface GraphqlQueryResults {
|
|
223126
|
+
${operations.map((name) => ` ${JSON.stringify(name)}: ${name}Query;`).join(`
|
|
223127
|
+
`)}
|
|
223128
|
+
}
|
|
223129
|
+
export function isGraphqlResult<Name extends keyof GraphqlQueryResults>(
|
|
223130
|
+
name: Name, value: unknown,
|
|
223131
|
+
): value is GraphqlQueryResults[Name] {
|
|
223132
|
+
switch (name) {
|
|
223133
|
+
${operations.map((name) => ` case ${JSON.stringify(name)}: return is${name}Query(value);`).join(`
|
|
223134
|
+
`)}
|
|
223135
|
+
default: return false;
|
|
223136
|
+
}
|
|
223137
|
+
}
|
|
223138
|
+
export function parseGraphqlResult<Name extends keyof GraphqlQueryResults>(
|
|
223139
|
+
name: Name, value: unknown,
|
|
223140
|
+
): GraphqlQueryResults[Name] {
|
|
223141
|
+
if (!isGraphqlResult(name, value)) {
|
|
223142
|
+
throw new GraphqlRequestError("invalid-response", "GraphQL result does not match operation " + name + ".");
|
|
223143
|
+
}
|
|
223144
|
+
return value;
|
|
223145
|
+
}
|
|
223146
|
+
`;
|
|
223147
|
+
}
|
|
223148
|
+
var init_graphql_runtime = () => {};
|
|
223775
223149
|
var exports_graphql = {};
|
|
223776
223150
|
__export2(exports_graphql, {
|
|
223777
223151
|
renderGraphql: () => renderGraphql
|
|
@@ -223801,7 +223175,7 @@ async function renderGraphql(options) {
|
|
|
223801
223175
|
};
|
|
223802
223176
|
result.contract = contract;
|
|
223803
223177
|
const diagnostic = (code, error, file) => {
|
|
223804
|
-
const gql = error instanceof
|
|
223178
|
+
const gql = error instanceof import_graphql99.GraphQLError ? error : undefined;
|
|
223805
223179
|
const source = gql?.source?.name ?? gql?.nodes?.[0]?.loc?.source.name ?? file;
|
|
223806
223180
|
result.diagnostics.push({
|
|
223807
223181
|
severity: "error",
|
|
@@ -223819,11 +223193,11 @@ async function renderGraphql(options) {
|
|
|
223819
223193
|
contract.schemaHash = createHash5("sha256").update(schemaContent).digest("hex");
|
|
223820
223194
|
if (schemaPath.endsWith(".json")) {
|
|
223821
223195
|
const json = JSON.parse(schemaContent);
|
|
223822
|
-
schema =
|
|
223196
|
+
schema = import_graphql99.buildClientSchema(json.data ?? json);
|
|
223823
223197
|
} else {
|
|
223824
|
-
schema =
|
|
223198
|
+
schema = import_graphql99.buildSchema(new import_graphql99.Source(schemaContent, schemaPath));
|
|
223825
223199
|
}
|
|
223826
|
-
for (const error of
|
|
223200
|
+
for (const error of import_graphql99.validateSchema(schema))
|
|
223827
223201
|
diagnostic("graphql-schema-invalid", error, schemaPath);
|
|
223828
223202
|
} catch (error) {
|
|
223829
223203
|
diagnostic("graphql-schema-invalid", error, schemaPath);
|
|
@@ -223834,7 +223208,7 @@ async function renderGraphql(options) {
|
|
|
223834
223208
|
const documents = [];
|
|
223835
223209
|
for (const path of paths.slice(1)) {
|
|
223836
223210
|
try {
|
|
223837
|
-
documents.push({ location: path, document:
|
|
223211
|
+
documents.push({ location: path, document: import_graphql99.parse(new import_graphql99.Source(await readFile2(path, "utf8"), path)) });
|
|
223838
223212
|
} catch (error) {
|
|
223839
223213
|
diagnostic("graphql-document-invalid", error, path);
|
|
223840
223214
|
}
|
|
@@ -223845,13 +223219,13 @@ async function renderGraphql(options) {
|
|
|
223845
223219
|
diagnostic("graphql-documents-missing", new Error("No GraphQL query documents matched the configured patterns."), schemaPath);
|
|
223846
223220
|
return result;
|
|
223847
223221
|
}
|
|
223848
|
-
const combined =
|
|
223222
|
+
const combined = import_graphql99.concatAST(documents.map(({ document }) => document));
|
|
223849
223223
|
const queryEntries = contract.operations;
|
|
223850
223224
|
for (const definition of combined.definitions) {
|
|
223851
|
-
if (definition.kind !==
|
|
223852
|
-
diagnostic("graphql-document-invalid", new
|
|
223225
|
+
if (definition.kind !== import_graphql99.Kind.OPERATION_DEFINITION && definition.kind !== import_graphql99.Kind.FRAGMENT_DEFINITION) {
|
|
223226
|
+
diagnostic("graphql-document-invalid", new import_graphql99.GraphQLError("Query documents may contain only operations and fragments.", { nodes: definition }));
|
|
223853
223227
|
}
|
|
223854
|
-
if (definition.kind !==
|
|
223228
|
+
if (definition.kind !== import_graphql99.Kind.OPERATION_DEFINITION)
|
|
223855
223229
|
continue;
|
|
223856
223230
|
if (definition.operation !== "query") {
|
|
223857
223231
|
result.diagnostics.push({
|
|
@@ -223864,7 +223238,7 @@ async function renderGraphql(options) {
|
|
|
223864
223238
|
});
|
|
223865
223239
|
}
|
|
223866
223240
|
if (!definition.name) {
|
|
223867
|
-
diagnostic("graphql-operation-name-required", new
|
|
223241
|
+
diagnostic("graphql-operation-name-required", new import_graphql99.GraphQLError("Name each query to generate a stable client method.", { nodes: definition }));
|
|
223868
223242
|
} else {
|
|
223869
223243
|
queryEntries.push({
|
|
223870
223244
|
name: definition.name.value,
|
|
@@ -223873,16 +223247,15 @@ async function renderGraphql(options) {
|
|
|
223873
223247
|
});
|
|
223874
223248
|
}
|
|
223875
223249
|
}
|
|
223876
|
-
for (const error of
|
|
223250
|
+
for (const error of import_graphql99.validate(schema, combined))
|
|
223877
223251
|
diagnostic("graphql-validation", error);
|
|
223878
223252
|
if (result.diagnostics.length)
|
|
223879
223253
|
return result;
|
|
223880
223254
|
try {
|
|
223881
|
-
const
|
|
223255
|
+
const config = {
|
|
223882
223256
|
useTypeImports: true,
|
|
223883
|
-
|
|
223884
|
-
|
|
223885
|
-
onlyOperationTypes: true,
|
|
223257
|
+
nonOptionalTypename: false,
|
|
223258
|
+
enumType: "string-literal",
|
|
223886
223259
|
namingConvention: "keep",
|
|
223887
223260
|
dedupeOperationSuffix: false,
|
|
223888
223261
|
omitOperationSuffix: false,
|
|
@@ -223891,25 +223264,25 @@ async function renderGraphql(options) {
|
|
|
223891
223264
|
};
|
|
223892
223265
|
const generated = await codegen({
|
|
223893
223266
|
filename: "graphql.ts",
|
|
223894
|
-
schema:
|
|
223267
|
+
schema: import_graphql99.parse(import_graphql99.printSchema(schema)),
|
|
223895
223268
|
schemaAst: schema,
|
|
223896
223269
|
documents,
|
|
223897
|
-
config
|
|
223898
|
-
plugins: [{
|
|
223899
|
-
pluginMap: {
|
|
223270
|
+
config,
|
|
223271
|
+
plugins: [{ operations: {} }],
|
|
223272
|
+
pluginMap: { operations: exports_esm }
|
|
223900
223273
|
});
|
|
223901
|
-
const separated =
|
|
223274
|
+
const separated = import_graphql99.separateOperations(combined);
|
|
223902
223275
|
const methods = Object.entries(separated).sort(([a], [b]) => a.localeCompare(b)).map(([name, document]) => {
|
|
223903
|
-
const operation = document.definitions.find((node) => node.kind ===
|
|
223904
|
-
if (operation.kind !==
|
|
223276
|
+
const operation = document.definitions.find((node) => node.kind === import_graphql99.Kind.OPERATION_DEFINITION);
|
|
223277
|
+
if (!operation || operation.kind !== import_graphql99.Kind.OPERATION_DEFINITION)
|
|
223905
223278
|
throw new Error("Missing query operation");
|
|
223906
|
-
const required = operation.variableDefinitions?.some((variable) => variable.type.kind ===
|
|
223907
|
-
return ` ${JSON.stringify(name)}(variables${required ? "" : "?"}: ${name}QueryVariables, options?: C): Promise<${name}Query> {
|
|
223908
|
-
return
|
|
223279
|
+
const required = operation.variableDefinitions?.some((variable) => variable.type.kind === import_graphql99.Kind.NON_NULL_TYPE && !variable.defaultValue);
|
|
223280
|
+
return ` async ${JSON.stringify(name)}(variables${required ? "" : "?"}: ${name}QueryVariables, options?: C): Promise<${name}Query> {
|
|
223281
|
+
return parse${name}Query(await requester(${JSON.stringify(import_graphql99.print(document))}, variables, options));
|
|
223909
223282
|
}`;
|
|
223910
223283
|
});
|
|
223911
223284
|
const facade = `
|
|
223912
|
-
export type Requester<C> =
|
|
223285
|
+
export type Requester<C> = (query: string, variables?: unknown, options?: C) => Promise<unknown>;
|
|
223913
223286
|
export function getSdk<C>(requester: Requester<C>) {
|
|
223914
223287
|
return {
|
|
223915
223288
|
${methods.join(`,
|
|
@@ -223917,19 +223290,20 @@ ${methods.join(`,
|
|
|
223917
223290
|
};
|
|
223918
223291
|
}
|
|
223919
223292
|
`;
|
|
223293
|
+
const validators = renderGraphqlValidators(generated, queryEntries.map((entry) => entry.name));
|
|
223920
223294
|
result.files["graphql.ts"] = `// GENERATED BY @supacloud/compiler. DO NOT EDIT.
|
|
223921
|
-
` + generated + facade + GRAPHQL_CLIENT_SOURCE;
|
|
223295
|
+
` + generated + validators + facade + GRAPHQL_CLIENT_SOURCE;
|
|
223922
223296
|
if (options.graphql.typedDocuments) {
|
|
223923
|
-
const typedDocuments = await Promise.resolve().then(() => (init_esm8(),
|
|
223297
|
+
const typedDocuments = await Promise.resolve().then(() => (init_esm8(), exports_esm2));
|
|
223924
223298
|
result.files["graphql.documents.ts"] = `// GENERATED BY @supacloud/compiler. DO NOT EDIT.
|
|
223925
223299
|
` + await codegen({
|
|
223926
223300
|
filename: "graphql.documents.ts",
|
|
223927
|
-
schema:
|
|
223301
|
+
schema: import_graphql99.parse(import_graphql99.printSchema(schema)),
|
|
223928
223302
|
schemaAst: schema,
|
|
223929
223303
|
documents,
|
|
223930
|
-
config
|
|
223931
|
-
plugins: [{
|
|
223932
|
-
pluginMap: {
|
|
223304
|
+
config,
|
|
223305
|
+
plugins: [{ operations: {} }, { typedDocuments: {} }],
|
|
223306
|
+
pluginMap: { operations: exports_esm, typedDocuments }
|
|
223933
223307
|
});
|
|
223934
223308
|
}
|
|
223935
223309
|
result.files["graphql.manifest.json"] = JSON.stringify({
|
|
@@ -223947,6 +223321,7 @@ ${methods.join(`,
|
|
|
223947
223321
|
var init_graphql = __esm2(() => {
|
|
223948
223322
|
init_graphql_inputs();
|
|
223949
223323
|
init_graphql_options();
|
|
223324
|
+
init_graphql_runtime();
|
|
223950
223325
|
});
|
|
223951
223326
|
var exports_graphql_schema = {};
|
|
223952
223327
|
__export2(exports_graphql_schema, {
|
|
@@ -223991,7 +223366,7 @@ async function pullGraphqlSchema(options) {
|
|
|
223991
223366
|
throw new Error("GraphQL schema export failed. Verify caller grants and enable introspection only in the intended development environment.");
|
|
223992
223367
|
}
|
|
223993
223368
|
const schema = lexicographicSortSchema(buildClientSchema2(data));
|
|
223994
|
-
const path =
|
|
223369
|
+
const path = resolve9(options.output);
|
|
223995
223370
|
const content = path.endsWith(".json") ? JSON.stringify(introspectionFromSchema(schema), null, 2) + `
|
|
223996
223371
|
` : `# GENERATED BY supacloud-compiler graphql-schema. DO NOT EDIT.
|
|
223997
223372
|
# Database First: change database declarations, apply migrations, then re-export for the intended role.
|
|
@@ -224039,15 +223414,15 @@ class TraitCompiler {
|
|
|
224039
223414
|
}
|
|
224040
223415
|
compileSourceFile(sourceFile) {
|
|
224041
223416
|
const traits = [];
|
|
224042
|
-
const
|
|
223417
|
+
const visit9 = (node) => {
|
|
224043
223418
|
for (const handler of this.handlers) {
|
|
224044
223419
|
const name = handler.detect(node);
|
|
224045
223420
|
if (name)
|
|
224046
223421
|
traits.push(record(handler.kind, name, sourceFile, node));
|
|
224047
223422
|
}
|
|
224048
|
-
ts.forEachChild(node,
|
|
223423
|
+
ts.forEachChild(node, visit9);
|
|
224049
223424
|
};
|
|
224050
|
-
|
|
223425
|
+
visit9(sourceFile);
|
|
224051
223426
|
return traits;
|
|
224052
223427
|
}
|
|
224053
223428
|
}
|
|
@@ -224134,7 +223509,7 @@ function decoratedDeclaration(decorator) {
|
|
|
224134
223509
|
};
|
|
224135
223510
|
}
|
|
224136
223511
|
function createIncrementalProgramSession(projectRoot) {
|
|
224137
|
-
const rootDir =
|
|
223512
|
+
const rootDir = resolve8(projectRoot);
|
|
224138
223513
|
let projectConfig = readProjectConfig(rootDir);
|
|
224139
223514
|
let projectConfigKey = configKey(projectConfig);
|
|
224140
223515
|
let builder;
|
|
@@ -224163,8 +223538,8 @@ function createIncrementalProgramSession(projectRoot) {
|
|
|
224163
223538
|
}
|
|
224164
223539
|
projectConfig = nextProjectConfig;
|
|
224165
223540
|
projectConfigKey = nextProjectConfigKey;
|
|
224166
|
-
const normalizedRoots = [...new Set(rootNames.map((file) =>
|
|
224167
|
-
const normalizedChanged = [...new Set(changedPaths.map((file) =>
|
|
223541
|
+
const normalizedRoots = [...new Set(rootNames.map((file) => resolve8(rootDir, file)))].sort();
|
|
223542
|
+
const normalizedChanged = [...new Set(changedPaths.map((file) => resolve8(rootDir, file)))];
|
|
224168
223543
|
const invalidatedPaths = new Set(normalizedChanged.map(canonical));
|
|
224169
223544
|
for (const sourceFile of oldSourceFiles.values()) {
|
|
224170
223545
|
if (sourceVersion(sourceFile.fileName) !== sourceFileVersion(sourceFile)) {
|
|
@@ -224265,7 +223640,7 @@ function createHost(options, rootDir, sourceFileCache, invalidatedPaths, invalid
|
|
|
224265
223640
|
return host;
|
|
224266
223641
|
}
|
|
224267
223642
|
function canonical(fileName) {
|
|
224268
|
-
const normalized =
|
|
223643
|
+
const normalized = resolve8(fileName);
|
|
224269
223644
|
return ts2.sys.useCaseSensitiveFileNames ? normalized : normalized.toLowerCase();
|
|
224270
223645
|
}
|
|
224271
223646
|
function sourceFileParseKey(languageVersion) {
|
|
@@ -224275,11 +223650,11 @@ function sourceFileParseKey(languageVersion) {
|
|
|
224275
223650
|
jsDocParsingMode: languageVersion.jsDocParsingMode
|
|
224276
223651
|
});
|
|
224277
223652
|
}
|
|
224278
|
-
function configKey(
|
|
223653
|
+
function configKey(config) {
|
|
224279
223654
|
return JSON.stringify({
|
|
224280
|
-
options:
|
|
224281
|
-
projectReferences:
|
|
224282
|
-
configFingerprint:
|
|
223655
|
+
options: config.options,
|
|
223656
|
+
projectReferences: config.projectReferences,
|
|
223657
|
+
configFingerprint: config.configFingerprint
|
|
224283
223658
|
});
|
|
224284
223659
|
}
|
|
224285
223660
|
function hashText(text) {
|
|
@@ -224319,15 +223694,15 @@ function readProjectConfig(rootDir) {
|
|
|
224319
223694
|
configReads.set(canonical(fileName), text === undefined ? "missing" : hashText(text));
|
|
224320
223695
|
return text;
|
|
224321
223696
|
};
|
|
224322
|
-
const
|
|
224323
|
-
if (
|
|
223697
|
+
const config = ts2.readConfigFile(configPath, readConfig);
|
|
223698
|
+
if (config.error) {
|
|
224324
223699
|
return {
|
|
224325
223700
|
options: {},
|
|
224326
|
-
errors: [
|
|
223701
|
+
errors: [config.error],
|
|
224327
223702
|
configFingerprint: JSON.stringify([...configReads])
|
|
224328
223703
|
};
|
|
224329
223704
|
}
|
|
224330
|
-
const parsed = ts2.parseJsonConfigFileContent(
|
|
223705
|
+
const parsed = ts2.parseJsonConfigFileContent(config.config, { ...ts2.sys, readFile: readConfig }, dirname4(configPath));
|
|
224331
223706
|
return {
|
|
224332
223707
|
options: parsed.options,
|
|
224333
223708
|
errors: parsed.errors,
|
|
@@ -224383,12 +223758,12 @@ function hasDestroyHook(cls) {
|
|
|
224383
223758
|
}
|
|
224384
223759
|
function descendantsOfKind(root, predicate) {
|
|
224385
223760
|
const result = [];
|
|
224386
|
-
const
|
|
223761
|
+
const visit9 = (node) => {
|
|
224387
223762
|
if (predicate(node))
|
|
224388
223763
|
result.push(node);
|
|
224389
|
-
ts3.forEachChild(node,
|
|
223764
|
+
ts3.forEachChild(node, visit9);
|
|
224390
223765
|
};
|
|
224391
|
-
|
|
223766
|
+
visit9(root);
|
|
224392
223767
|
return result;
|
|
224393
223768
|
}
|
|
224394
223769
|
async function analyzeProject(rootDir, include, cache, changedPaths) {
|
|
@@ -227157,7 +226532,7 @@ function detectCycles(graph, resolveDep) {
|
|
|
227157
226532
|
const state = new Map;
|
|
227158
226533
|
const stack = [];
|
|
227159
226534
|
const reported = new Set;
|
|
227160
|
-
const
|
|
226535
|
+
const visit9 = (ref) => {
|
|
227161
226536
|
const id = nodeId(ref);
|
|
227162
226537
|
if (state.get(id) === "done")
|
|
227163
226538
|
return;
|
|
@@ -227190,13 +226565,13 @@ function detectCycles(graph, resolveDep) {
|
|
|
227190
226565
|
skipSelf: ref.provider.skipSelfDeps?.includes(dep)
|
|
227191
226566
|
});
|
|
227192
226567
|
if (resolved)
|
|
227193
|
-
|
|
226568
|
+
visit9(resolved);
|
|
227194
226569
|
}
|
|
227195
226570
|
stack.pop();
|
|
227196
226571
|
state.set(id, "done");
|
|
227197
226572
|
};
|
|
227198
226573
|
for (const ref of nodes)
|
|
227199
|
-
|
|
226574
|
+
visit9(ref);
|
|
227200
226575
|
return diagnostics;
|
|
227201
226576
|
}
|
|
227202
226577
|
function detectExistingAliasCycles(graph, resolveDep) {
|
|
@@ -227246,7 +226621,7 @@ function detectModuleCycles(graph) {
|
|
|
227246
226621
|
const state = new Map;
|
|
227247
226622
|
const stack = [];
|
|
227248
226623
|
const reported = new Set;
|
|
227249
|
-
const
|
|
226624
|
+
const visit9 = (name) => {
|
|
227250
226625
|
if (state.get(name) === "done")
|
|
227251
226626
|
return;
|
|
227252
226627
|
if (state.get(name) === "visiting") {
|
|
@@ -227276,7 +226651,7 @@ function detectModuleCycles(graph) {
|
|
|
227276
226651
|
if (mod) {
|
|
227277
226652
|
for (const importName of mod.imports) {
|
|
227278
226653
|
if (moduleMap.has(importName)) {
|
|
227279
|
-
|
|
226654
|
+
visit9(importName);
|
|
227280
226655
|
}
|
|
227281
226656
|
}
|
|
227282
226657
|
}
|
|
@@ -227284,7 +226659,7 @@ function detectModuleCycles(graph) {
|
|
|
227284
226659
|
state.set(name, "done");
|
|
227285
226660
|
};
|
|
227286
226661
|
for (const mod of graph.modules) {
|
|
227287
|
-
|
|
226662
|
+
visit9(mod.name);
|
|
227288
226663
|
}
|
|
227289
226664
|
return diagnostics;
|
|
227290
226665
|
}
|
|
@@ -227446,10 +226821,10 @@ function scanSourceFile(sourceFile, checker, rootDir, diagnostics, strict) {
|
|
|
227446
226821
|
}
|
|
227447
226822
|
}
|
|
227448
226823
|
function readProjectConfig2(configPath) {
|
|
227449
|
-
const
|
|
227450
|
-
if (
|
|
227451
|
-
return { options: {}, errors: [
|
|
227452
|
-
const parsed = ts5.parseJsonConfigFileContent(
|
|
226824
|
+
const config = ts5.readConfigFile(configPath, (file) => readFileSync22(file, "utf8"));
|
|
226825
|
+
if (config.error)
|
|
226826
|
+
return { options: {}, errors: [config.error] };
|
|
226827
|
+
const parsed = ts5.parseJsonConfigFileContent(config.config, ts5.sys, dirname42(configPath));
|
|
227453
226828
|
return { options: parsed.options, errors: parsed.errors };
|
|
227454
226829
|
}
|
|
227455
226830
|
function isProductionSource(rootDir, sourceFile, excludes, outDir) {
|
|
@@ -227500,21 +226875,21 @@ function isConstDeclaration(declaration) {
|
|
|
227500
226875
|
}
|
|
227501
226876
|
function descendants(root) {
|
|
227502
226877
|
const result = [];
|
|
227503
|
-
const
|
|
226878
|
+
const visit9 = (node) => {
|
|
227504
226879
|
result.push(node);
|
|
227505
|
-
ts5.forEachChild(node,
|
|
226880
|
+
ts5.forEachChild(node, visit9);
|
|
227506
226881
|
};
|
|
227507
|
-
ts5.forEachChild(root,
|
|
226882
|
+
ts5.forEachChild(root, visit9);
|
|
227508
226883
|
return result;
|
|
227509
226884
|
}
|
|
227510
226885
|
function descendantsOfKind2(root, predicate) {
|
|
227511
226886
|
const result = [];
|
|
227512
|
-
const
|
|
226887
|
+
const visit9 = (node) => {
|
|
227513
226888
|
if (predicate(node))
|
|
227514
226889
|
result.push(node);
|
|
227515
|
-
ts5.forEachChild(node,
|
|
226890
|
+
ts5.forEachChild(node, visit9);
|
|
227516
226891
|
};
|
|
227517
|
-
ts5.forEachChild(root,
|
|
226892
|
+
ts5.forEachChild(root, visit9);
|
|
227518
226893
|
return result;
|
|
227519
226894
|
}
|
|
227520
226895
|
function makeDiagnostic(code, message, fileOrSourceFile, node, strict, rootDir) {
|
|
@@ -227769,21 +227144,46 @@ var DEFAULT_SUPACLOUD_CONFIG = {
|
|
|
227769
227144
|
treeShakeUnusedProviders: true,
|
|
227770
227145
|
moduleBoundaryPreset: "modular-monolith"
|
|
227771
227146
|
};
|
|
227772
|
-
function defineSupacloudConfig(
|
|
227773
|
-
if (
|
|
227774
|
-
assertGraphqlOptions(
|
|
227147
|
+
function defineSupacloudConfig(config = {}) {
|
|
227148
|
+
if (config.graphql !== undefined && config.graphql !== false)
|
|
227149
|
+
assertGraphqlOptions(config.graphql);
|
|
227150
|
+
validateGovernanceConfig(config);
|
|
227775
227151
|
return {
|
|
227776
227152
|
...DEFAULT_SUPACLOUD_CONFIG,
|
|
227777
|
-
...
|
|
227778
|
-
include:
|
|
227779
|
-
graphql:
|
|
227153
|
+
...config,
|
|
227154
|
+
include: config.include ?? [...DEFAULT_SUPACLOUD_CONFIG.include],
|
|
227155
|
+
graphql: config.graphql ?? DEFAULT_SUPACLOUD_CONFIG.graphql
|
|
227780
227156
|
};
|
|
227781
227157
|
}
|
|
227782
|
-
function
|
|
227783
|
-
const
|
|
227158
|
+
function validateGovernanceConfig(config) {
|
|
227159
|
+
const isRecord3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
227160
|
+
const isStrings = (value) => Array.isArray(value) && Array.from(value).every((item) => typeof item === "string" && item.trim().length > 0);
|
|
227161
|
+
if (config.moduleBoundaries !== undefined) {
|
|
227162
|
+
if (!Array.isArray(config.moduleBoundaries))
|
|
227163
|
+
throw new Error("moduleBoundaries must be an array of module tag rules.");
|
|
227164
|
+
const rules = config.moduleBoundaries;
|
|
227165
|
+
for (const rule of rules) {
|
|
227166
|
+
if (!isRecord3(rule) || typeof rule["sourceTag"] !== "string" || !rule["sourceTag"].trim() || Object.keys(rule).some((key) => !["sourceTag", "onlyDependOnLibsWithTags", "bannedDependenciesWithTags"].includes(key)) || rule["onlyDependOnLibsWithTags"] !== undefined && !isStrings(rule["onlyDependOnLibsWithTags"]) || rule["bannedDependenciesWithTags"] !== undefined && !isStrings(rule["bannedDependenciesWithTags"])) {
|
|
227167
|
+
throw new Error("moduleBoundaries rules require sourceTag and optional string arrays onlyDependOnLibsWithTags/bannedDependenciesWithTags.");
|
|
227168
|
+
}
|
|
227169
|
+
}
|
|
227170
|
+
}
|
|
227171
|
+
if (config.typeSafety !== undefined) {
|
|
227172
|
+
const rules = config.typeSafety;
|
|
227173
|
+
if (!isRecord3(rules) || Object.keys(rules).some((key) => !["scanProductionSource", "noAnyInGenerated", "exclude"].includes(key)) || rules["scanProductionSource"] !== undefined && typeof rules["scanProductionSource"] !== "boolean" || rules["noAnyInGenerated"] !== undefined && typeof rules["noAnyInGenerated"] !== "boolean" || rules["exclude"] !== undefined && !isStrings(rules["exclude"])) {
|
|
227174
|
+
throw new Error("typeSafety accepts boolean scanProductionSource/noAnyInGenerated and a string array exclude.");
|
|
227175
|
+
}
|
|
227176
|
+
}
|
|
227177
|
+
for (const key of ["allowRouteCommandBindings", "disallowControllerDirectDb", "detectOrphanModules"]) {
|
|
227178
|
+
if (config[key] !== undefined && typeof config[key] !== "boolean")
|
|
227179
|
+
throw new Error(`${key} must be a boolean.`);
|
|
227180
|
+
}
|
|
227181
|
+
}
|
|
227182
|
+
function resolveSupacloudConfig(config = {}, cwd2 = process.cwd()) {
|
|
227183
|
+
const resolved = defineSupacloudConfig(config);
|
|
227784
227184
|
return {
|
|
227785
|
-
rootDir:
|
|
227786
|
-
outDir:
|
|
227185
|
+
rootDir: resolve82(cwd2, resolved.root ?? DEFAULT_SUPACLOUD_CONFIG.root),
|
|
227186
|
+
outDir: resolve82(cwd2, resolved.outDir ?? DEFAULT_SUPACLOUD_CONFIG.outDir),
|
|
227787
227187
|
include: resolved.include ?? [...DEFAULT_SUPACLOUD_CONFIG.include],
|
|
227788
227188
|
strict: resolved.strict ?? DEFAULT_SUPACLOUD_CONFIG.strict,
|
|
227789
227189
|
requireRouteContracts: resolved.requireRouteContracts ?? DEFAULT_SUPACLOUD_CONFIG.requireRouteContracts,
|
|
@@ -227791,10 +227191,15 @@ function resolveSupacloudConfig(config2 = {}, cwd2 = process.cwd()) {
|
|
|
227791
227191
|
generatePermissions: resolved.generatePermissions ?? DEFAULT_SUPACLOUD_CONFIG.generatePermissions,
|
|
227792
227192
|
moduleBoundaryPreset: resolved.moduleBoundaryPreset ?? DEFAULT_SUPACLOUD_CONFIG.moduleBoundaryPreset,
|
|
227793
227193
|
commandCapabilities: resolved.commandCapabilities,
|
|
227194
|
+
...resolved.moduleBoundaries ? { moduleBoundaries: resolved.moduleBoundaries } : {},
|
|
227195
|
+
...resolved.typeSafety ? { typeSafety: resolved.typeSafety } : {},
|
|
227196
|
+
...resolved.allowRouteCommandBindings === undefined ? {} : { allowRouteCommandBindings: resolved.allowRouteCommandBindings },
|
|
227197
|
+
...resolved.disallowControllerDirectDb === undefined ? {} : { disallowControllerDirectDb: resolved.disallowControllerDirectDb },
|
|
227198
|
+
...resolved.detectOrphanModules === undefined ? {} : { detectOrphanModules: resolved.detectOrphanModules },
|
|
227794
227199
|
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders ?? DEFAULT_SUPACLOUD_CONFIG.treeShakeUnusedProviders,
|
|
227795
227200
|
graphql: resolved.graphql ? {
|
|
227796
227201
|
...resolved.graphql,
|
|
227797
|
-
schema:
|
|
227202
|
+
schema: resolve82(cwd2, resolved.graphql.schema)
|
|
227798
227203
|
} : undefined
|
|
227799
227204
|
};
|
|
227800
227205
|
}
|
|
@@ -227811,21 +227216,8 @@ async function loadSupacloudConfig(cwd2 = process.cwd()) {
|
|
|
227811
227216
|
const imported = await import(pathToFileURL(configPath).href);
|
|
227812
227217
|
return defineSupacloudConfig(imported.default ?? {});
|
|
227813
227218
|
}
|
|
227814
|
-
function compileOptionsFromConfig(
|
|
227815
|
-
|
|
227816
|
-
return {
|
|
227817
|
-
rootDir: resolved.rootDir,
|
|
227818
|
-
outDir: resolved.outDir,
|
|
227819
|
-
include: resolved.include,
|
|
227820
|
-
strict: resolved.strict,
|
|
227821
|
-
requireRouteContracts: resolved.requireRouteContracts,
|
|
227822
|
-
generateClient: resolved.generateClient,
|
|
227823
|
-
generatePermissions: resolved.generatePermissions,
|
|
227824
|
-
moduleBoundaryPreset: resolved.moduleBoundaryPreset,
|
|
227825
|
-
commandCapabilities: resolved.commandCapabilities,
|
|
227826
|
-
treeShakeUnusedProviders: resolved.treeShakeUnusedProviders,
|
|
227827
|
-
graphql: resolved.graphql
|
|
227828
|
-
};
|
|
227219
|
+
function compileOptionsFromConfig(config, cwd2 = process.cwd()) {
|
|
227220
|
+
return resolveSupacloudConfig(config, cwd2);
|
|
227829
227221
|
}
|
|
227830
227222
|
init_graphql_schema();
|
|
227831
227223
|
|
|
@@ -227945,7 +227337,7 @@ function buildToolDefinitions(manifest) {
|
|
|
227945
227337
|
|
|
227946
227338
|
// src/shared/tools/app-starter.ts
|
|
227947
227339
|
import { lstat, mkdir as mkdir3, readdir, writeFile } from "node:fs/promises";
|
|
227948
|
-
import { basename as basename5, dirname as dirname5, join as join11, resolve as
|
|
227340
|
+
import { basename as basename5, dirname as dirname5, join as join11, resolve as resolve10 } from "node:path";
|
|
227949
227341
|
|
|
227950
227342
|
// src/shared/tools/app-starter-environment.ts
|
|
227951
227343
|
var STARTER_ENVIRONMENT = String.raw`import { existsSync, readFileSync } from "node:fs";
|
|
@@ -228080,7 +227472,7 @@ test("partial and untagged inherited remote profiles cannot mix with selected fi
|
|
|
228080
227472
|
// ../compiler/package.json
|
|
228081
227473
|
var package_default = {
|
|
228082
227474
|
name: "@supacloud/compiler",
|
|
228083
|
-
version: "0.
|
|
227475
|
+
version: "0.14.0",
|
|
228084
227476
|
description: "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
|
|
228085
227477
|
type: "module",
|
|
228086
227478
|
main: "./dist/index.js",
|
|
@@ -228105,8 +227497,9 @@ var package_default = {
|
|
|
228105
227497
|
"build:js": "bun build src/index.ts src/cli.ts --outdir dist --target node --external @typescript/typescript6 --external graphql --external '@graphql-codegen/*'",
|
|
228106
227498
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
228107
227499
|
clean: "rm -rf dist",
|
|
228108
|
-
prepublishOnly: "bun run build",
|
|
227500
|
+
prepublishOnly: "bun run build && bun run test:package",
|
|
228109
227501
|
test: "bun test",
|
|
227502
|
+
"test:package": 'SUPACLOUD_COMPILER_TEST_CLI="$PWD/dist/cli.js" bun test src/graphql-package.test.ts',
|
|
228110
227503
|
benchmark: "bun run src/benchmark.ts",
|
|
228111
227504
|
typecheck: "tsc -p tsconfig.json --noEmit",
|
|
228112
227505
|
"typecheck:test": "tsc -p tsconfig.test.json --noEmit"
|
|
@@ -228127,7 +227520,6 @@ var package_default = {
|
|
|
228127
227520
|
dependencies: {
|
|
228128
227521
|
"@graphql-codegen/core": "^6.2.0",
|
|
228129
227522
|
"@graphql-codegen/typed-document-node": "^7.1.0",
|
|
228130
|
-
"@graphql-codegen/typescript": "^6.1.0",
|
|
228131
227523
|
"@graphql-codegen/typescript-operations": "^6.1.6",
|
|
228132
227524
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
228133
227525
|
"@typescript/typescript6": "^6.0.2",
|
|
@@ -228776,7 +228168,7 @@ and governance; TypeScript checks both application and generated source.
|
|
|
228776
228168
|
};
|
|
228777
228169
|
}
|
|
228778
228170
|
async function initializeAppProject(options) {
|
|
228779
|
-
const root =
|
|
228171
|
+
const root = resolve10(options.root ?? process.cwd());
|
|
228780
228172
|
const name = options.name ?? basename5(root);
|
|
228781
228173
|
if (!/^[a-z][a-z0-9-]*$/.test(name) || name.length > 100) {
|
|
228782
228174
|
throw new Error("Project name must be lowercase kebab-case (1-100 characters)");
|
|
@@ -228951,14 +228343,14 @@ async function runCheck(args) {
|
|
|
228951
228343
|
const root = resolve12(args.root || process.cwd());
|
|
228952
228344
|
const loadedConfig = await loadSupacloudConfig(root);
|
|
228953
228345
|
const defaults = resolveSupacloudConfig(loadedConfig, root);
|
|
228954
|
-
const
|
|
228346
|
+
const config = compileOptionsFromConfig({
|
|
228955
228347
|
...loadedConfig,
|
|
228956
228348
|
root: sourceRoot(args, root, loadedConfig.root),
|
|
228957
228349
|
outDir: args.out_dir ? resolve12(root, args.out_dir) : defaults.outDir,
|
|
228958
228350
|
include: parseInclude(args.include) ?? loadedConfig.include,
|
|
228959
228351
|
strict: args.strict ?? loadedConfig.strict ?? false
|
|
228960
228352
|
}, root);
|
|
228961
|
-
const result = await checkProject(
|
|
228353
|
+
const result = await checkProject(config);
|
|
228962
228354
|
const hasError = result.diagnostics.some((diagnostic) => diagnostic.severity === "error") || result.mismatches.length > 0;
|
|
228963
228355
|
const summary = `checked ${result.graph.modules.length} module(s), no files written`;
|
|
228964
228356
|
return textResult([
|
|
@@ -229266,10 +228658,10 @@ var POLCMD_MAP = {
|
|
|
229266
228658
|
d: "delete",
|
|
229267
228659
|
"*": "all"
|
|
229268
228660
|
};
|
|
229269
|
-
function extractSearchPath(
|
|
229270
|
-
if (!
|
|
228661
|
+
function extractSearchPath(config) {
|
|
228662
|
+
if (!config)
|
|
229271
228663
|
return null;
|
|
229272
|
-
const entry =
|
|
228664
|
+
const entry = config.find((item) => item.startsWith("search_path="));
|
|
229273
228665
|
if (!entry)
|
|
229274
228666
|
return null;
|
|
229275
228667
|
return entry.slice("search_path=".length);
|
|
@@ -231936,14 +231328,14 @@ async function readDeployConfig(configRoot) {
|
|
|
231936
231328
|
const candidate = await readJson(configPath);
|
|
231937
231329
|
if (candidate === null)
|
|
231938
231330
|
return {};
|
|
231939
|
-
const
|
|
231940
|
-
const frontend = record2(
|
|
231941
|
-
const targetValues = record2(
|
|
231942
|
-
if (!
|
|
231331
|
+
const config = record2(candidate);
|
|
231332
|
+
const frontend = record2(config?.frontend);
|
|
231333
|
+
const targetValues = record2(config?.targets);
|
|
231334
|
+
if (!config || config.frontend !== undefined && !frontend || config.targets !== undefined && !targetValues) {
|
|
231943
231335
|
throw new Error("supacloud.json must contain object-valued 'frontend' or 'targets' configuration");
|
|
231944
231336
|
}
|
|
231945
231337
|
return {
|
|
231946
|
-
defaultTarget: optionalText(
|
|
231338
|
+
defaultTarget: optionalText(config.defaultTarget, "defaultTarget"),
|
|
231947
231339
|
targets: targetValues ? Object.fromEntries(Object.entries(targetValues).map(([name, value]) => [name, deployTargetConfig(value, name)])) : undefined,
|
|
231948
231340
|
frontend: frontend ? {
|
|
231949
231341
|
id: optionalText(frontend.id, "frontend.id"),
|
|
@@ -232014,13 +231406,13 @@ function targetRoot(configRoot, target, name) {
|
|
|
232014
231406
|
}
|
|
232015
231407
|
return root;
|
|
232016
231408
|
}
|
|
232017
|
-
function selectTarget(configRoot, invocationDirectory,
|
|
232018
|
-
const targets =
|
|
231409
|
+
function selectTarget(configRoot, invocationDirectory, config, requestedName) {
|
|
231410
|
+
const targets = config.targets ? Object.entries(config.targets) : [["frontend", {
|
|
232019
231411
|
type: "frontend",
|
|
232020
|
-
root:
|
|
232021
|
-
id:
|
|
232022
|
-
buildCommand:
|
|
232023
|
-
outputDirectory:
|
|
231412
|
+
root: config.frontend?.root,
|
|
231413
|
+
id: config.frontend?.id,
|
|
231414
|
+
buildCommand: config.frontend?.buildCommand,
|
|
231415
|
+
outputDirectory: config.frontend?.outputDirectory
|
|
232024
231416
|
}]];
|
|
232025
231417
|
if (targets.length === 0)
|
|
232026
231418
|
throw new Error("supacloud.json defines no deploy targets");
|
|
@@ -232035,10 +231427,10 @@ function selectTarget(configRoot, invocationDirectory, config2, requestedName) {
|
|
|
232035
231427
|
const selected = containing[0];
|
|
232036
231428
|
return { name: selected.name, config: selected.target, root: selected.root };
|
|
232037
231429
|
}
|
|
232038
|
-
if (
|
|
232039
|
-
const selected = targets.find(([name]) => name ===
|
|
231430
|
+
if (config.defaultTarget) {
|
|
231431
|
+
const selected = targets.find(([name]) => name === config.defaultTarget);
|
|
232040
231432
|
if (!selected)
|
|
232041
|
-
throw new Error(`supacloud.json defaultTarget '${
|
|
231433
|
+
throw new Error(`supacloud.json defaultTarget '${config.defaultTarget}' was not found`);
|
|
232042
231434
|
return { name: selected[0], config: selected[1], root: targetRoot(configRoot, selected[1], selected[0]) };
|
|
232043
231435
|
}
|
|
232044
231436
|
if (targets.length === 1) {
|
|
@@ -232086,7 +231478,7 @@ async function collectArchiveFiles(root) {
|
|
|
232086
231478
|
throw new Error(`Frontend output directory does not exist or is not a regular directory: ${root}`);
|
|
232087
231479
|
}
|
|
232088
231480
|
const paths = [];
|
|
232089
|
-
const
|
|
231481
|
+
const visit9 = async (directory) => {
|
|
232090
231482
|
const entries = [];
|
|
232091
231483
|
for await (const entry of await opendir(directory))
|
|
232092
231484
|
entries.push(entry);
|
|
@@ -232097,14 +231489,14 @@ async function collectArchiveFiles(root) {
|
|
|
232097
231489
|
if (stats.isSymbolicLink())
|
|
232098
231490
|
throw new Error(`Frontend output cannot contain symbolic links: ${path}`);
|
|
232099
231491
|
if (stats.isDirectory())
|
|
232100
|
-
await
|
|
231492
|
+
await visit9(path);
|
|
232101
231493
|
else if (stats.isFile())
|
|
232102
231494
|
paths.push(path);
|
|
232103
231495
|
else
|
|
232104
231496
|
throw new Error(`Frontend output contains an unsupported file type: ${path}`);
|
|
232105
231497
|
}
|
|
232106
231498
|
};
|
|
232107
|
-
await
|
|
231499
|
+
await visit9(root);
|
|
232108
231500
|
if (paths.length === 0)
|
|
232109
231501
|
throw new Error(`Frontend output directory is empty: ${root}`);
|
|
232110
231502
|
let bytes = 0;
|
|
@@ -232177,8 +231569,8 @@ function registerDeployTools(server2, http, options = {}) {
|
|
|
232177
231569
|
if (!projectRef2)
|
|
232178
231570
|
throw new Error("A linked project ref is required. Set SUPACLOUD_PROJECT_REF or pass --ref");
|
|
232179
231571
|
const configRoot = await findDeployConfigRoot(invocationDirectory);
|
|
232180
|
-
const
|
|
232181
|
-
const target = selectTarget(configRoot, invocationDirectory,
|
|
231572
|
+
const config = await readDeployConfig(configRoot);
|
|
231573
|
+
const target = selectTarget(configRoot, invocationDirectory, config, String(args.target || "").trim() || undefined);
|
|
232182
231574
|
const projectDirectory = target.root;
|
|
232183
231575
|
const targetState = await lstat2(projectDirectory).catch(() => null);
|
|
232184
231576
|
if (!targetState?.isDirectory() || targetState.isSymbolicLink()) {
|
|
@@ -232400,8 +231792,8 @@ function toolFailed(value) {
|
|
|
232400
231792
|
async function migrateDatabase(args, options) {
|
|
232401
231793
|
const root = resolve17(String(args.project_dir || options.cwd || process.cwd()));
|
|
232402
231794
|
const projectConfig = await readProjectConfig3(root);
|
|
232403
|
-
const
|
|
232404
|
-
const database =
|
|
231795
|
+
const config = projectConfig.dev || {};
|
|
231796
|
+
const database = config.database || {};
|
|
232405
231797
|
const execute = options.execute || ((command, commandArgs, cwd2) => runProcess(command, commandArgs, cwd2));
|
|
232406
231798
|
const drizzleConfig = resolve17(root, String(args.drizzle_config || database.drizzleConfig || "drizzle.config.ts"));
|
|
232407
231799
|
const migrationsDir = String(args.migrations_dir || database.migrationsDir || "supabase/migrations");
|
|
@@ -232434,22 +231826,22 @@ async function readProjectConfig3(root) {
|
|
|
232434
231826
|
}
|
|
232435
231827
|
}
|
|
232436
231828
|
async function readDevConfig(root) {
|
|
232437
|
-
const
|
|
232438
|
-
return
|
|
231829
|
+
const config = await readProjectConfig3(root);
|
|
231830
|
+
return config.dev || {};
|
|
232439
231831
|
}
|
|
232440
231832
|
async function sourceFingerprint(root) {
|
|
232441
231833
|
const files = [];
|
|
232442
|
-
const
|
|
231834
|
+
const visit9 = async (directory) => {
|
|
232443
231835
|
const entries = await readdir2(directory, { withFileTypes: true });
|
|
232444
231836
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
232445
231837
|
const path = join16(directory, entry.name);
|
|
232446
231838
|
if (entry.isDirectory() && ![".git", "node_modules", "dist", "generated", ".supacloud"].includes(entry.name))
|
|
232447
|
-
await
|
|
231839
|
+
await visit9(path);
|
|
232448
231840
|
else if (entry.isFile())
|
|
232449
231841
|
files.push(path);
|
|
232450
231842
|
}
|
|
232451
231843
|
};
|
|
232452
|
-
await
|
|
231844
|
+
await visit9(root);
|
|
232453
231845
|
const hash2 = createHash10("sha256");
|
|
232454
231846
|
for (const file of files) {
|
|
232455
231847
|
hash2.update(file.slice(root.length).replace(/\\/g, "/"));
|
|
@@ -232468,17 +231860,17 @@ function remoteRoot(value) {
|
|
|
232468
231860
|
throw new Error("Invalid remote_root");
|
|
232469
231861
|
return normalized.replace(/\/$/, "");
|
|
232470
231862
|
}
|
|
232471
|
-
function targetDirectory(root, target, functionSlug,
|
|
231863
|
+
function targetDirectory(root, target, functionSlug, config = {}) {
|
|
232472
231864
|
if (target === "db")
|
|
232473
231865
|
return join16(root, "supabase", "migrations");
|
|
232474
231866
|
if (target === "functions") {
|
|
232475
|
-
const targets =
|
|
231867
|
+
const targets = config.targets && typeof config.targets === "object" ? config.targets : {};
|
|
232476
231868
|
const match = Object.values(targets).find((entry) => entry?.type === "edge_function" && (!functionSlug || String(entry.slug || "") === functionSlug));
|
|
232477
231869
|
const base2 = match?.root ? resolve17(root, String(match.root)) : join16(root, "supabase", "functions");
|
|
232478
231870
|
return match?.root ? base2 : functionSlug ? join16(base2, safeToken(functionSlug, "function")) : base2;
|
|
232479
231871
|
}
|
|
232480
231872
|
if (target === "frontend") {
|
|
232481
|
-
const targets =
|
|
231873
|
+
const targets = config.targets && typeof config.targets === "object" ? config.targets : {};
|
|
232482
231874
|
const match = Object.values(targets).find((entry) => entry?.type === "frontend");
|
|
232483
231875
|
return match?.root ? resolve17(root, String(match.root)) : join16(root, "apps", "web");
|
|
232484
231876
|
}
|
|
@@ -232493,11 +231885,11 @@ function remoteTargetRoot(root, target, functionSlug) {
|
|
|
232493
231885
|
return `${root}/frontend`;
|
|
232494
231886
|
return `${root}/project`;
|
|
232495
231887
|
}
|
|
232496
|
-
function connectionArgs(options,
|
|
232497
|
-
const host = String(args.remote_host ||
|
|
232498
|
-
const user = String(args.remote_user ||
|
|
232499
|
-
const port = Number(args.remote_port ||
|
|
232500
|
-
const key = String(args.remote_key ||
|
|
231888
|
+
function connectionArgs(options, config, args) {
|
|
231889
|
+
const host = String(args.remote_host || config.host || options.host || "").trim();
|
|
231890
|
+
const user = String(args.remote_user || config.user || options.sshUser || "").trim();
|
|
231891
|
+
const port = Number(args.remote_port || config.port || options.sshPort || 22);
|
|
231892
|
+
const key = String(args.remote_key || config.key || options.sshKey || "").trim();
|
|
232501
231893
|
if (!host)
|
|
232502
231894
|
throw new Error("Remote dev requires SUPACLOUD_HOST or --remote_host");
|
|
232503
231895
|
safeToken(host, "remote_host");
|
|
@@ -232512,8 +231904,8 @@ function connectionArgs(options, config2, args) {
|
|
|
232512
231904
|
function targetConfigPath(target) {
|
|
232513
231905
|
return target === "project" ? "project" : target;
|
|
232514
231906
|
}
|
|
232515
|
-
function reloadCommand(
|
|
232516
|
-
const command =
|
|
231907
|
+
function reloadCommand(config, target, projectRef2, functionSlug) {
|
|
231908
|
+
const command = config.reloadCommand?.trim() || "supacloud-dev-agent reload";
|
|
232517
231909
|
if (!/^[A-Za-z0-9._/-]+(?: [A-Za-z0-9._:/=-]+)*$/.test(command))
|
|
232518
231910
|
throw new Error("Invalid reloadCommand in supacloud.json");
|
|
232519
231911
|
return [...command.split(" "), "--project-ref", safeToken(projectRef2 || "test", "project_ref"), "--target", targetConfigPath(target), ...functionSlug ? ["--function", safeToken(functionSlug, "function")] : []];
|
|
@@ -232536,19 +231928,19 @@ function rsyncArgs(connection, source, destination, excludes, deleteRemote) {
|
|
|
232536
231928
|
async function syncOnce(args, options) {
|
|
232537
231929
|
const root = resolve17(String(args.project_dir || options.cwd || process.cwd()));
|
|
232538
231930
|
const projectConfig = await readProjectConfig3(root);
|
|
232539
|
-
const
|
|
231931
|
+
const config = projectConfig.dev || {};
|
|
232540
231932
|
const target = String(args.target || "project");
|
|
232541
231933
|
const source = targetDirectory(root, target, typeof args.function === "string" ? args.function : undefined, projectConfig);
|
|
232542
231934
|
if (!existsSync12(source))
|
|
232543
231935
|
throw new Error(`Dev source directory not found: ${source}`);
|
|
232544
231936
|
let compiled = false;
|
|
232545
|
-
if (
|
|
232546
|
-
const compileRoot = resolve17(root,
|
|
232547
|
-
const compileOutDir = resolve17(root,
|
|
231937
|
+
if (config.compile === true && target !== "db") {
|
|
231938
|
+
const compileRoot = resolve17(root, config.compileRoot || ".");
|
|
231939
|
+
const compileOutDir = resolve17(root, config.compileOutDir || "generated");
|
|
232548
231940
|
const compilation = await compileProject({
|
|
232549
231941
|
rootDir: compileRoot,
|
|
232550
231942
|
outDir: compileOutDir,
|
|
232551
|
-
strict:
|
|
231943
|
+
strict: config.compileStrict !== false
|
|
232552
231944
|
});
|
|
232553
231945
|
const errors3 = compilation.diagnostics.filter((diagnostic) => diagnostic.severity === "error");
|
|
232554
231946
|
if (errors3.length > 0) {
|
|
@@ -232556,22 +231948,22 @@ async function syncOnce(args, options) {
|
|
|
232556
231948
|
}
|
|
232557
231949
|
compiled = true;
|
|
232558
231950
|
}
|
|
232559
|
-
const remoteBase = remoteRoot(String(args.remote_root ||
|
|
231951
|
+
const remoteBase = remoteRoot(String(args.remote_root || config.remoteRoot || `/var/lib/supacloud/dev/${options.projectRef || "project"}`));
|
|
232560
231952
|
const slug = typeof args.function === "string" ? args.function : undefined;
|
|
232561
231953
|
const destination = remoteTargetRoot(remoteBase, target, slug);
|
|
232562
|
-
const connection = connectionArgs(options,
|
|
231954
|
+
const connection = connectionArgs(options, config, args);
|
|
232563
231955
|
const execute = options.execute || ((command, commandArgs, cwd2) => runProcess(command, commandArgs, cwd2));
|
|
232564
231956
|
const mkdir4 = await execute("ssh", sshArgs(connection, ["mkdir", "-p", destination]), root);
|
|
232565
231957
|
if (mkdir4.exitCode !== 0)
|
|
232566
231958
|
throw new Error(`Remote dev prepare failed: ${mkdir4.stderr.trim() || `exit ${mkdir4.exitCode}`}`);
|
|
232567
|
-
const excludes = Array.isArray(
|
|
231959
|
+
const excludes = Array.isArray(config.excludes) ? config.excludes : ["node_modules", ".git", ".env*", "dist", ".supacloud"];
|
|
232568
231960
|
const sync = await execute("rsync", rsyncArgs(connection, source, destination, excludes, args.delete === true), root);
|
|
232569
231961
|
if (sync.exitCode !== 0)
|
|
232570
231962
|
throw new Error(`Remote dev sync failed: ${sync.stderr.trim() || `exit ${sync.exitCode}`}`);
|
|
232571
231963
|
const shouldReload = args.reload !== false;
|
|
232572
231964
|
let reload = null;
|
|
232573
231965
|
if (shouldReload) {
|
|
232574
|
-
reload = await execute("ssh", sshArgs(connection, reloadCommand(
|
|
231966
|
+
reload = await execute("ssh", sshArgs(connection, reloadCommand(config, target, options.projectRef, slug)), root);
|
|
232575
231967
|
if (reload.exitCode !== 0)
|
|
232576
231968
|
throw new Error(`Remote dev reload failed: ${reload.stderr.trim() || `exit ${reload.exitCode}`}`);
|
|
232577
231969
|
}
|
|
@@ -232583,8 +231975,8 @@ function registerRemoteDevTools(server2, options = {}) {
|
|
|
232583
231975
|
throw new Error("Remote dev mode is forbidden for production environments");
|
|
232584
231976
|
if (args.action === "status") {
|
|
232585
231977
|
const root = resolve17(String(args.project_dir || options.cwd || process.cwd()));
|
|
232586
|
-
const
|
|
232587
|
-
const connection = connectionArgs(options,
|
|
231978
|
+
const config = await readDevConfig(root);
|
|
231979
|
+
const connection = connectionArgs(options, config, args);
|
|
232588
231980
|
const execute = options.execute || ((command, commandArgs, cwd2) => runProcess(command, commandArgs, cwd2));
|
|
232589
231981
|
const status = await execute("ssh", sshArgs(connection, ["supacloud-dev-agent", "status", "--project-ref", safeToken(options.projectRef || "test", "project_ref")]), root);
|
|
232590
231982
|
return { content: [{ type: "text", text: JSON.stringify({ ok: status.exitCode === 0, mode: "dev", action: "status", host: connection.host, output: status.stdout.trim(), error: status.stderr.trim() }, null, 2) }], isError: status.exitCode !== 0 };
|
|
@@ -232617,7 +232009,7 @@ function registerRemoteDevTools(server2, options = {}) {
|
|
|
232617
232009
|
// package.json
|
|
232618
232010
|
var package_default4 = {
|
|
232619
232011
|
name: "@supacloud/cli",
|
|
232620
|
-
version: "0.51.
|
|
232012
|
+
version: "0.51.1",
|
|
232621
232013
|
description: "Project-scoped CLI for SupaCloud users",
|
|
232622
232014
|
type: "module",
|
|
232623
232015
|
main: "./dist/index.js",
|
|
@@ -232650,7 +232042,7 @@ var package_default4 = {
|
|
|
232650
232042
|
},
|
|
232651
232043
|
dependencies: {
|
|
232652
232044
|
"@sinclair/typebox": "^0.34.52",
|
|
232653
|
-
"@supacloud/compiler": "^0.
|
|
232045
|
+
"@supacloud/compiler": "^0.14.0",
|
|
232654
232046
|
"@supacloud/db": "^0.2.0",
|
|
232655
232047
|
fflate: "^0.8.3"
|
|
232656
232048
|
},
|