@skilder-ai/runtime 0.9.0 → 0.9.2
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 +929 -775
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -87,15 +87,15 @@ var require_Reflect = __commonJS({
|
|
|
87
87
|
} : function() {
|
|
88
88
|
return MakeDictionary({});
|
|
89
89
|
},
|
|
90
|
-
has: downLevel ? function(
|
|
91
|
-
return hasOwn.call(
|
|
92
|
-
} : function(
|
|
93
|
-
return key in
|
|
90
|
+
has: downLevel ? function(map4, key) {
|
|
91
|
+
return hasOwn.call(map4, key);
|
|
92
|
+
} : function(map4, key) {
|
|
93
|
+
return key in map4;
|
|
94
94
|
},
|
|
95
|
-
get: downLevel ? function(
|
|
96
|
-
return hasOwn.call(
|
|
97
|
-
} : function(
|
|
98
|
-
return
|
|
95
|
+
get: downLevel ? function(map4, key) {
|
|
96
|
+
return hasOwn.call(map4, key) ? map4[key] : void 0;
|
|
97
|
+
} : function(map4, key) {
|
|
98
|
+
return map4[key];
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
var functionPrototype = Object.getPrototypeOf(Function);
|
|
@@ -4094,9 +4094,9 @@ var require_parser = __commonJS({
|
|
|
4094
4094
|
function parseType(source, options) {
|
|
4095
4095
|
const parser = new Parser(source, options);
|
|
4096
4096
|
parser.expectToken(_tokenKind.TokenKind.SOF);
|
|
4097
|
-
const
|
|
4097
|
+
const type27 = parser.parseTypeReference();
|
|
4098
4098
|
parser.expectToken(_tokenKind.TokenKind.EOF);
|
|
4099
|
-
return
|
|
4099
|
+
return type27;
|
|
4100
4100
|
}
|
|
4101
4101
|
function parseSchemaCoordinate(source) {
|
|
4102
4102
|
const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source);
|
|
@@ -4629,24 +4629,24 @@ var require_parser = __commonJS({
|
|
|
4629
4629
|
*/
|
|
4630
4630
|
parseTypeReference() {
|
|
4631
4631
|
const start2 = this._lexer.token;
|
|
4632
|
-
let
|
|
4632
|
+
let type27;
|
|
4633
4633
|
if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) {
|
|
4634
4634
|
const innerType = this.parseTypeReference();
|
|
4635
4635
|
this.expectToken(_tokenKind.TokenKind.BRACKET_R);
|
|
4636
|
-
|
|
4636
|
+
type27 = this.node(start2, {
|
|
4637
4637
|
kind: _kinds.Kind.LIST_TYPE,
|
|
4638
4638
|
type: innerType
|
|
4639
4639
|
});
|
|
4640
4640
|
} else {
|
|
4641
|
-
|
|
4641
|
+
type27 = this.parseNamedType();
|
|
4642
4642
|
}
|
|
4643
4643
|
if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) {
|
|
4644
4644
|
return this.node(start2, {
|
|
4645
4645
|
kind: _kinds.Kind.NON_NULL_TYPE,
|
|
4646
|
-
type:
|
|
4646
|
+
type: type27
|
|
4647
4647
|
});
|
|
4648
4648
|
}
|
|
4649
|
-
return
|
|
4649
|
+
return type27;
|
|
4650
4650
|
}
|
|
4651
4651
|
/**
|
|
4652
4652
|
* NamedType : Name
|
|
@@ -4698,11 +4698,11 @@ var require_parser = __commonJS({
|
|
|
4698
4698
|
const start2 = this._lexer.token;
|
|
4699
4699
|
const operation = this.parseOperationType();
|
|
4700
4700
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
4701
|
-
const
|
|
4701
|
+
const type27 = this.parseNamedType();
|
|
4702
4702
|
return this.node(start2, {
|
|
4703
4703
|
kind: _kinds.Kind.OPERATION_TYPE_DEFINITION,
|
|
4704
4704
|
operation,
|
|
4705
|
-
type:
|
|
4705
|
+
type: type27
|
|
4706
4706
|
});
|
|
4707
4707
|
}
|
|
4708
4708
|
/**
|
|
@@ -4773,14 +4773,14 @@ var require_parser = __commonJS({
|
|
|
4773
4773
|
const name21 = this.parseName();
|
|
4774
4774
|
const args = this.parseArgumentDefs();
|
|
4775
4775
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
4776
|
-
const
|
|
4776
|
+
const type27 = this.parseTypeReference();
|
|
4777
4777
|
const directives = this.parseConstDirectives();
|
|
4778
4778
|
return this.node(start2, {
|
|
4779
4779
|
kind: _kinds.Kind.FIELD_DEFINITION,
|
|
4780
4780
|
description,
|
|
4781
4781
|
name: name21,
|
|
4782
4782
|
arguments: args,
|
|
4783
|
-
type:
|
|
4783
|
+
type: type27,
|
|
4784
4784
|
directives
|
|
4785
4785
|
});
|
|
4786
4786
|
}
|
|
@@ -4803,7 +4803,7 @@ var require_parser = __commonJS({
|
|
|
4803
4803
|
const description = this.parseDescription();
|
|
4804
4804
|
const name21 = this.parseName();
|
|
4805
4805
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
4806
|
-
const
|
|
4806
|
+
const type27 = this.parseTypeReference();
|
|
4807
4807
|
let defaultValue;
|
|
4808
4808
|
if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) {
|
|
4809
4809
|
defaultValue = this.parseConstValueLiteral();
|
|
@@ -4813,7 +4813,7 @@ var require_parser = __commonJS({
|
|
|
4813
4813
|
kind: _kinds.Kind.INPUT_VALUE_DEFINITION,
|
|
4814
4814
|
description,
|
|
4815
4815
|
name: name21,
|
|
4816
|
-
type:
|
|
4816
|
+
type: type27,
|
|
4817
4817
|
defaultValue,
|
|
4818
4818
|
directives
|
|
4819
4819
|
});
|
|
@@ -5542,10 +5542,10 @@ var require_mapValue = __commonJS({
|
|
|
5542
5542
|
value: true
|
|
5543
5543
|
});
|
|
5544
5544
|
exports2.mapValue = mapValue;
|
|
5545
|
-
function mapValue(
|
|
5545
|
+
function mapValue(map4, fn) {
|
|
5546
5546
|
const result = /* @__PURE__ */ Object.create(null);
|
|
5547
|
-
for (const key of Object.keys(
|
|
5548
|
-
result[key] = fn(
|
|
5547
|
+
for (const key of Object.keys(map4)) {
|
|
5548
|
+
result[key] = fn(map4[key], key);
|
|
5549
5549
|
}
|
|
5550
5550
|
return result;
|
|
5551
5551
|
}
|
|
@@ -5722,11 +5722,11 @@ var require_toObjMap = __commonJS({
|
|
|
5722
5722
|
if (Object.getPrototypeOf(obj) === null) {
|
|
5723
5723
|
return obj;
|
|
5724
5724
|
}
|
|
5725
|
-
const
|
|
5725
|
+
const map4 = /* @__PURE__ */ Object.create(null);
|
|
5726
5726
|
for (const [key, value] of Object.entries(obj)) {
|
|
5727
|
-
|
|
5727
|
+
map4[key] = value;
|
|
5728
5728
|
}
|
|
5729
|
-
return
|
|
5729
|
+
return map4;
|
|
5730
5730
|
}
|
|
5731
5731
|
}
|
|
5732
5732
|
});
|
|
@@ -6165,7 +6165,7 @@ var require_printer = __commonJS({
|
|
|
6165
6165
|
}
|
|
6166
6166
|
},
|
|
6167
6167
|
VariableDefinition: {
|
|
6168
|
-
leave: ({ variable, type:
|
|
6168
|
+
leave: ({ variable, type: type27, defaultValue, directives, description }) => wrap("", description, "\n") + variable + ": " + type27 + wrap(" = ", defaultValue) + wrap(" ", join6(directives, " "))
|
|
6169
6169
|
},
|
|
6170
6170
|
SelectionSet: {
|
|
6171
6171
|
leave: ({ selections }) => block(selections)
|
|
@@ -6247,17 +6247,17 @@ var require_printer = __commonJS({
|
|
|
6247
6247
|
leave: ({ name: name21 }) => name21
|
|
6248
6248
|
},
|
|
6249
6249
|
ListType: {
|
|
6250
|
-
leave: ({ type:
|
|
6250
|
+
leave: ({ type: type27 }) => "[" + type27 + "]"
|
|
6251
6251
|
},
|
|
6252
6252
|
NonNullType: {
|
|
6253
|
-
leave: ({ type:
|
|
6253
|
+
leave: ({ type: type27 }) => type27 + "!"
|
|
6254
6254
|
},
|
|
6255
6255
|
// Type System Definitions
|
|
6256
6256
|
SchemaDefinition: {
|
|
6257
6257
|
leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join6(["schema", join6(directives, " "), block(operationTypes)], " ")
|
|
6258
6258
|
},
|
|
6259
6259
|
OperationTypeDefinition: {
|
|
6260
|
-
leave: ({ operation, type:
|
|
6260
|
+
leave: ({ operation, type: type27 }) => operation + ": " + type27
|
|
6261
6261
|
},
|
|
6262
6262
|
ScalarTypeDefinition: {
|
|
6263
6263
|
leave: ({ description, name: name21, directives }) => wrap("", description, "\n") + join6(["scalar", name21, join6(directives, " ")], " ")
|
|
@@ -6275,11 +6275,11 @@ var require_printer = __commonJS({
|
|
|
6275
6275
|
)
|
|
6276
6276
|
},
|
|
6277
6277
|
FieldDefinition: {
|
|
6278
|
-
leave: ({ description, name: name21, arguments: args, type:
|
|
6278
|
+
leave: ({ description, name: name21, arguments: args, type: type27, directives }) => wrap("", description, "\n") + name21 + (hasMultilineItems(args) ? wrap("(\n", indent(join6(args, "\n")), "\n)") : wrap("(", join6(args, ", "), ")")) + ": " + type27 + wrap(" ", join6(directives, " "))
|
|
6279
6279
|
},
|
|
6280
6280
|
InputValueDefinition: {
|
|
6281
|
-
leave: ({ description, name: name21, type:
|
|
6282
|
-
[name21 + ": " +
|
|
6281
|
+
leave: ({ description, name: name21, type: type27, defaultValue, directives }) => wrap("", description, "\n") + join6(
|
|
6282
|
+
[name21 + ": " + type27, wrap("= ", defaultValue), join6(directives, " ")],
|
|
6283
6283
|
" "
|
|
6284
6284
|
)
|
|
6285
6285
|
},
|
|
@@ -6550,161 +6550,161 @@ var require_definition = __commonJS({
|
|
|
6550
6550
|
var _printer = require_printer();
|
|
6551
6551
|
var _valueFromASTUntyped = require_valueFromASTUntyped();
|
|
6552
6552
|
var _assertName = require_assertName();
|
|
6553
|
-
function isType(
|
|
6554
|
-
return isScalarType(
|
|
6553
|
+
function isType(type27) {
|
|
6554
|
+
return isScalarType(type27) || isObjectType(type27) || isInterfaceType(type27) || isUnionType(type27) || isEnumType(type27) || isInputObjectType(type27) || isListType(type27) || isNonNullType(type27);
|
|
6555
6555
|
}
|
|
6556
|
-
function assertType(
|
|
6557
|
-
if (!isType(
|
|
6556
|
+
function assertType(type27) {
|
|
6557
|
+
if (!isType(type27)) {
|
|
6558
6558
|
throw new Error(
|
|
6559
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6559
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL type.`
|
|
6560
6560
|
);
|
|
6561
6561
|
}
|
|
6562
|
-
return
|
|
6562
|
+
return type27;
|
|
6563
6563
|
}
|
|
6564
|
-
function isScalarType(
|
|
6565
|
-
return (0, _instanceOf.instanceOf)(
|
|
6564
|
+
function isScalarType(type27) {
|
|
6565
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLScalarType);
|
|
6566
6566
|
}
|
|
6567
|
-
function assertScalarType(
|
|
6568
|
-
if (!isScalarType(
|
|
6567
|
+
function assertScalarType(type27) {
|
|
6568
|
+
if (!isScalarType(type27)) {
|
|
6569
6569
|
throw new Error(
|
|
6570
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6570
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Scalar type.`
|
|
6571
6571
|
);
|
|
6572
6572
|
}
|
|
6573
|
-
return
|
|
6573
|
+
return type27;
|
|
6574
6574
|
}
|
|
6575
|
-
function isObjectType(
|
|
6576
|
-
return (0, _instanceOf.instanceOf)(
|
|
6575
|
+
function isObjectType(type27) {
|
|
6576
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLObjectType);
|
|
6577
6577
|
}
|
|
6578
|
-
function assertObjectType(
|
|
6579
|
-
if (!isObjectType(
|
|
6578
|
+
function assertObjectType(type27) {
|
|
6579
|
+
if (!isObjectType(type27)) {
|
|
6580
6580
|
throw new Error(
|
|
6581
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6581
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Object type.`
|
|
6582
6582
|
);
|
|
6583
6583
|
}
|
|
6584
|
-
return
|
|
6584
|
+
return type27;
|
|
6585
6585
|
}
|
|
6586
|
-
function isInterfaceType(
|
|
6587
|
-
return (0, _instanceOf.instanceOf)(
|
|
6586
|
+
function isInterfaceType(type27) {
|
|
6587
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLInterfaceType);
|
|
6588
6588
|
}
|
|
6589
|
-
function assertInterfaceType(
|
|
6590
|
-
if (!isInterfaceType(
|
|
6589
|
+
function assertInterfaceType(type27) {
|
|
6590
|
+
if (!isInterfaceType(type27)) {
|
|
6591
6591
|
throw new Error(
|
|
6592
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6592
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Interface type.`
|
|
6593
6593
|
);
|
|
6594
6594
|
}
|
|
6595
|
-
return
|
|
6595
|
+
return type27;
|
|
6596
6596
|
}
|
|
6597
|
-
function isUnionType(
|
|
6598
|
-
return (0, _instanceOf.instanceOf)(
|
|
6597
|
+
function isUnionType(type27) {
|
|
6598
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLUnionType);
|
|
6599
6599
|
}
|
|
6600
|
-
function assertUnionType(
|
|
6601
|
-
if (!isUnionType(
|
|
6600
|
+
function assertUnionType(type27) {
|
|
6601
|
+
if (!isUnionType(type27)) {
|
|
6602
6602
|
throw new Error(
|
|
6603
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6603
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Union type.`
|
|
6604
6604
|
);
|
|
6605
6605
|
}
|
|
6606
|
-
return
|
|
6606
|
+
return type27;
|
|
6607
6607
|
}
|
|
6608
|
-
function isEnumType(
|
|
6609
|
-
return (0, _instanceOf.instanceOf)(
|
|
6608
|
+
function isEnumType(type27) {
|
|
6609
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLEnumType);
|
|
6610
6610
|
}
|
|
6611
|
-
function assertEnumType(
|
|
6612
|
-
if (!isEnumType(
|
|
6611
|
+
function assertEnumType(type27) {
|
|
6612
|
+
if (!isEnumType(type27)) {
|
|
6613
6613
|
throw new Error(
|
|
6614
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6614
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Enum type.`
|
|
6615
6615
|
);
|
|
6616
6616
|
}
|
|
6617
|
-
return
|
|
6617
|
+
return type27;
|
|
6618
6618
|
}
|
|
6619
|
-
function isInputObjectType(
|
|
6620
|
-
return (0, _instanceOf.instanceOf)(
|
|
6619
|
+
function isInputObjectType(type27) {
|
|
6620
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLInputObjectType);
|
|
6621
6621
|
}
|
|
6622
|
-
function assertInputObjectType(
|
|
6623
|
-
if (!isInputObjectType(
|
|
6622
|
+
function assertInputObjectType(type27) {
|
|
6623
|
+
if (!isInputObjectType(type27)) {
|
|
6624
6624
|
throw new Error(
|
|
6625
6625
|
`Expected ${(0, _inspect.inspect)(
|
|
6626
|
-
|
|
6626
|
+
type27
|
|
6627
6627
|
)} to be a GraphQL Input Object type.`
|
|
6628
6628
|
);
|
|
6629
6629
|
}
|
|
6630
|
-
return
|
|
6630
|
+
return type27;
|
|
6631
6631
|
}
|
|
6632
|
-
function isListType(
|
|
6633
|
-
return (0, _instanceOf.instanceOf)(
|
|
6632
|
+
function isListType(type27) {
|
|
6633
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLList);
|
|
6634
6634
|
}
|
|
6635
|
-
function assertListType(
|
|
6636
|
-
if (!isListType(
|
|
6635
|
+
function assertListType(type27) {
|
|
6636
|
+
if (!isListType(type27)) {
|
|
6637
6637
|
throw new Error(
|
|
6638
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6638
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL List type.`
|
|
6639
6639
|
);
|
|
6640
6640
|
}
|
|
6641
|
-
return
|
|
6641
|
+
return type27;
|
|
6642
6642
|
}
|
|
6643
|
-
function isNonNullType(
|
|
6644
|
-
return (0, _instanceOf.instanceOf)(
|
|
6643
|
+
function isNonNullType(type27) {
|
|
6644
|
+
return (0, _instanceOf.instanceOf)(type27, GraphQLNonNull);
|
|
6645
6645
|
}
|
|
6646
|
-
function assertNonNullType(
|
|
6647
|
-
if (!isNonNullType(
|
|
6646
|
+
function assertNonNullType(type27) {
|
|
6647
|
+
if (!isNonNullType(type27)) {
|
|
6648
6648
|
throw new Error(
|
|
6649
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6649
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL Non-Null type.`
|
|
6650
6650
|
);
|
|
6651
6651
|
}
|
|
6652
|
-
return
|
|
6652
|
+
return type27;
|
|
6653
6653
|
}
|
|
6654
|
-
function isInputType(
|
|
6655
|
-
return isScalarType(
|
|
6654
|
+
function isInputType(type27) {
|
|
6655
|
+
return isScalarType(type27) || isEnumType(type27) || isInputObjectType(type27) || isWrappingType(type27) && isInputType(type27.ofType);
|
|
6656
6656
|
}
|
|
6657
|
-
function assertInputType(
|
|
6658
|
-
if (!isInputType(
|
|
6657
|
+
function assertInputType(type27) {
|
|
6658
|
+
if (!isInputType(type27)) {
|
|
6659
6659
|
throw new Error(
|
|
6660
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6660
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL input type.`
|
|
6661
6661
|
);
|
|
6662
6662
|
}
|
|
6663
|
-
return
|
|
6663
|
+
return type27;
|
|
6664
6664
|
}
|
|
6665
|
-
function isOutputType(
|
|
6666
|
-
return isScalarType(
|
|
6665
|
+
function isOutputType(type27) {
|
|
6666
|
+
return isScalarType(type27) || isObjectType(type27) || isInterfaceType(type27) || isUnionType(type27) || isEnumType(type27) || isWrappingType(type27) && isOutputType(type27.ofType);
|
|
6667
6667
|
}
|
|
6668
|
-
function assertOutputType(
|
|
6669
|
-
if (!isOutputType(
|
|
6668
|
+
function assertOutputType(type27) {
|
|
6669
|
+
if (!isOutputType(type27)) {
|
|
6670
6670
|
throw new Error(
|
|
6671
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6671
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL output type.`
|
|
6672
6672
|
);
|
|
6673
6673
|
}
|
|
6674
|
-
return
|
|
6674
|
+
return type27;
|
|
6675
6675
|
}
|
|
6676
|
-
function isLeafType(
|
|
6677
|
-
return isScalarType(
|
|
6676
|
+
function isLeafType(type27) {
|
|
6677
|
+
return isScalarType(type27) || isEnumType(type27);
|
|
6678
6678
|
}
|
|
6679
|
-
function assertLeafType(
|
|
6680
|
-
if (!isLeafType(
|
|
6679
|
+
function assertLeafType(type27) {
|
|
6680
|
+
if (!isLeafType(type27)) {
|
|
6681
6681
|
throw new Error(
|
|
6682
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6682
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL leaf type.`
|
|
6683
6683
|
);
|
|
6684
6684
|
}
|
|
6685
|
-
return
|
|
6685
|
+
return type27;
|
|
6686
6686
|
}
|
|
6687
|
-
function isCompositeType(
|
|
6688
|
-
return isObjectType(
|
|
6687
|
+
function isCompositeType(type27) {
|
|
6688
|
+
return isObjectType(type27) || isInterfaceType(type27) || isUnionType(type27);
|
|
6689
6689
|
}
|
|
6690
|
-
function assertCompositeType(
|
|
6691
|
-
if (!isCompositeType(
|
|
6690
|
+
function assertCompositeType(type27) {
|
|
6691
|
+
if (!isCompositeType(type27)) {
|
|
6692
6692
|
throw new Error(
|
|
6693
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6693
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL composite type.`
|
|
6694
6694
|
);
|
|
6695
6695
|
}
|
|
6696
|
-
return
|
|
6696
|
+
return type27;
|
|
6697
6697
|
}
|
|
6698
|
-
function isAbstractType(
|
|
6699
|
-
return isInterfaceType(
|
|
6698
|
+
function isAbstractType(type27) {
|
|
6699
|
+
return isInterfaceType(type27) || isUnionType(type27);
|
|
6700
6700
|
}
|
|
6701
|
-
function assertAbstractType(
|
|
6702
|
-
if (!isAbstractType(
|
|
6701
|
+
function assertAbstractType(type27) {
|
|
6702
|
+
if (!isAbstractType(type27)) {
|
|
6703
6703
|
throw new Error(
|
|
6704
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6704
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL abstract type.`
|
|
6705
6705
|
);
|
|
6706
6706
|
}
|
|
6707
|
-
return
|
|
6707
|
+
return type27;
|
|
6708
6708
|
}
|
|
6709
6709
|
var GraphQLList = class {
|
|
6710
6710
|
constructor(ofType) {
|
|
@@ -6746,47 +6746,47 @@ var require_definition = __commonJS({
|
|
|
6746
6746
|
}
|
|
6747
6747
|
};
|
|
6748
6748
|
exports2.GraphQLNonNull = GraphQLNonNull;
|
|
6749
|
-
function isWrappingType(
|
|
6750
|
-
return isListType(
|
|
6749
|
+
function isWrappingType(type27) {
|
|
6750
|
+
return isListType(type27) || isNonNullType(type27);
|
|
6751
6751
|
}
|
|
6752
|
-
function assertWrappingType(
|
|
6753
|
-
if (!isWrappingType(
|
|
6752
|
+
function assertWrappingType(type27) {
|
|
6753
|
+
if (!isWrappingType(type27)) {
|
|
6754
6754
|
throw new Error(
|
|
6755
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6755
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL wrapping type.`
|
|
6756
6756
|
);
|
|
6757
6757
|
}
|
|
6758
|
-
return
|
|
6758
|
+
return type27;
|
|
6759
6759
|
}
|
|
6760
|
-
function isNullableType(
|
|
6761
|
-
return isType(
|
|
6760
|
+
function isNullableType(type27) {
|
|
6761
|
+
return isType(type27) && !isNonNullType(type27);
|
|
6762
6762
|
}
|
|
6763
|
-
function assertNullableType(
|
|
6764
|
-
if (!isNullableType(
|
|
6763
|
+
function assertNullableType(type27) {
|
|
6764
|
+
if (!isNullableType(type27)) {
|
|
6765
6765
|
throw new Error(
|
|
6766
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6766
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL nullable type.`
|
|
6767
6767
|
);
|
|
6768
6768
|
}
|
|
6769
|
-
return
|
|
6769
|
+
return type27;
|
|
6770
6770
|
}
|
|
6771
|
-
function getNullableType(
|
|
6772
|
-
if (
|
|
6773
|
-
return isNonNullType(
|
|
6771
|
+
function getNullableType(type27) {
|
|
6772
|
+
if (type27) {
|
|
6773
|
+
return isNonNullType(type27) ? type27.ofType : type27;
|
|
6774
6774
|
}
|
|
6775
6775
|
}
|
|
6776
|
-
function isNamedType(
|
|
6777
|
-
return isScalarType(
|
|
6776
|
+
function isNamedType(type27) {
|
|
6777
|
+
return isScalarType(type27) || isObjectType(type27) || isInterfaceType(type27) || isUnionType(type27) || isEnumType(type27) || isInputObjectType(type27);
|
|
6778
6778
|
}
|
|
6779
|
-
function assertNamedType(
|
|
6780
|
-
if (!isNamedType(
|
|
6779
|
+
function assertNamedType(type27) {
|
|
6780
|
+
if (!isNamedType(type27)) {
|
|
6781
6781
|
throw new Error(
|
|
6782
|
-
`Expected ${(0, _inspect.inspect)(
|
|
6782
|
+
`Expected ${(0, _inspect.inspect)(type27)} to be a GraphQL named type.`
|
|
6783
6783
|
);
|
|
6784
6784
|
}
|
|
6785
|
-
return
|
|
6785
|
+
return type27;
|
|
6786
6786
|
}
|
|
6787
|
-
function getNamedType(
|
|
6788
|
-
if (
|
|
6789
|
-
let unwrappedType =
|
|
6787
|
+
function getNamedType(type27) {
|
|
6788
|
+
if (type27) {
|
|
6789
|
+
let unwrappedType = type27;
|
|
6790
6790
|
while (isWrappingType(unwrappedType)) {
|
|
6791
6791
|
unwrappedType = unwrappedType.ofType;
|
|
6792
6792
|
}
|
|
@@ -7365,7 +7365,7 @@ var require_typeComparators = __commonJS({
|
|
|
7365
7365
|
}
|
|
7366
7366
|
if ((0, _definition.isAbstractType)(typeA)) {
|
|
7367
7367
|
if ((0, _definition.isAbstractType)(typeB)) {
|
|
7368
|
-
return schema.getPossibleTypes(typeA).some((
|
|
7368
|
+
return schema.getPossibleTypes(typeA).some((type27) => schema.isSubType(typeB, type27));
|
|
7369
7369
|
}
|
|
7370
7370
|
return schema.isSubType(typeA, typeB);
|
|
7371
7371
|
}
|
|
@@ -7638,8 +7638,8 @@ var require_scalars = __commonJS({
|
|
|
7638
7638
|
GraphQLID
|
|
7639
7639
|
]);
|
|
7640
7640
|
exports2.specifiedScalarTypes = specifiedScalarTypes;
|
|
7641
|
-
function isSpecifiedScalarType(
|
|
7642
|
-
return specifiedScalarTypes.some(({ name: name21 }) =>
|
|
7641
|
+
function isSpecifiedScalarType(type27) {
|
|
7642
|
+
return specifiedScalarTypes.some(({ name: name21 }) => type27.name === name21);
|
|
7643
7643
|
}
|
|
7644
7644
|
function serializeObject(outputValue) {
|
|
7645
7645
|
if ((0, _isObjectLike.isObjectLike)(outputValue)) {
|
|
@@ -7846,9 +7846,9 @@ var require_astFromValue = __commonJS({
|
|
|
7846
7846
|
var _kinds = require_kinds();
|
|
7847
7847
|
var _definition = require_definition();
|
|
7848
7848
|
var _scalars = require_scalars();
|
|
7849
|
-
function astFromValue(value,
|
|
7850
|
-
if ((0, _definition.isNonNullType)(
|
|
7851
|
-
const astValue = astFromValue(value,
|
|
7849
|
+
function astFromValue(value, type27) {
|
|
7850
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
7851
|
+
const astValue = astFromValue(value, type27.ofType);
|
|
7852
7852
|
if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {
|
|
7853
7853
|
return null;
|
|
7854
7854
|
}
|
|
@@ -7862,8 +7862,8 @@ var require_astFromValue = __commonJS({
|
|
|
7862
7862
|
if (value === void 0) {
|
|
7863
7863
|
return null;
|
|
7864
7864
|
}
|
|
7865
|
-
if ((0, _definition.isListType)(
|
|
7866
|
-
const itemType =
|
|
7865
|
+
if ((0, _definition.isListType)(type27)) {
|
|
7866
|
+
const itemType = type27.ofType;
|
|
7867
7867
|
if ((0, _isIterableObject.isIterableObject)(value)) {
|
|
7868
7868
|
const valuesNodes = [];
|
|
7869
7869
|
for (const item of value) {
|
|
@@ -7879,12 +7879,12 @@ var require_astFromValue = __commonJS({
|
|
|
7879
7879
|
}
|
|
7880
7880
|
return astFromValue(value, itemType);
|
|
7881
7881
|
}
|
|
7882
|
-
if ((0, _definition.isInputObjectType)(
|
|
7882
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
7883
7883
|
if (!(0, _isObjectLike.isObjectLike)(value)) {
|
|
7884
7884
|
return null;
|
|
7885
7885
|
}
|
|
7886
7886
|
const fieldNodes = [];
|
|
7887
|
-
for (const field of Object.values(
|
|
7887
|
+
for (const field of Object.values(type27.getFields())) {
|
|
7888
7888
|
const fieldValue = astFromValue(value[field.name], field.type);
|
|
7889
7889
|
if (fieldValue) {
|
|
7890
7890
|
fieldNodes.push({
|
|
@@ -7902,8 +7902,8 @@ var require_astFromValue = __commonJS({
|
|
|
7902
7902
|
fields: fieldNodes
|
|
7903
7903
|
};
|
|
7904
7904
|
}
|
|
7905
|
-
if ((0, _definition.isLeafType)(
|
|
7906
|
-
const serialized =
|
|
7905
|
+
if ((0, _definition.isLeafType)(type27)) {
|
|
7906
|
+
const serialized = type27.serialize(value);
|
|
7907
7907
|
if (serialized == null) {
|
|
7908
7908
|
return null;
|
|
7909
7909
|
}
|
|
@@ -7924,13 +7924,13 @@ var require_astFromValue = __commonJS({
|
|
|
7924
7924
|
};
|
|
7925
7925
|
}
|
|
7926
7926
|
if (typeof serialized === "string") {
|
|
7927
|
-
if ((0, _definition.isEnumType)(
|
|
7927
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
7928
7928
|
return {
|
|
7929
7929
|
kind: _kinds.Kind.ENUM,
|
|
7930
7930
|
value: serialized
|
|
7931
7931
|
};
|
|
7932
7932
|
}
|
|
7933
|
-
if (
|
|
7933
|
+
if (type27 === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {
|
|
7934
7934
|
return {
|
|
7935
7935
|
kind: _kinds.Kind.INT,
|
|
7936
7936
|
value: serialized
|
|
@@ -7947,7 +7947,7 @@ var require_astFromValue = __commonJS({
|
|
|
7947
7947
|
}
|
|
7948
7948
|
(0, _invariant.invariant)(
|
|
7949
7949
|
false,
|
|
7950
|
-
"Unexpected input type: " + (0, _inspect.inspect)(
|
|
7950
|
+
"Unexpected input type: " + (0, _inspect.inspect)(type27)
|
|
7951
7951
|
);
|
|
7952
7952
|
}
|
|
7953
7953
|
var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;
|
|
@@ -8146,46 +8146,46 @@ var require_introspection = __commonJS({
|
|
|
8146
8146
|
fields: () => ({
|
|
8147
8147
|
kind: {
|
|
8148
8148
|
type: new _definition.GraphQLNonNull(__TypeKind),
|
|
8149
|
-
resolve(
|
|
8150
|
-
if ((0, _definition.isScalarType)(
|
|
8149
|
+
resolve(type27) {
|
|
8150
|
+
if ((0, _definition.isScalarType)(type27)) {
|
|
8151
8151
|
return TypeKind.SCALAR;
|
|
8152
8152
|
}
|
|
8153
|
-
if ((0, _definition.isObjectType)(
|
|
8153
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
8154
8154
|
return TypeKind.OBJECT;
|
|
8155
8155
|
}
|
|
8156
|
-
if ((0, _definition.isInterfaceType)(
|
|
8156
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
8157
8157
|
return TypeKind.INTERFACE;
|
|
8158
8158
|
}
|
|
8159
|
-
if ((0, _definition.isUnionType)(
|
|
8159
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
8160
8160
|
return TypeKind.UNION;
|
|
8161
8161
|
}
|
|
8162
|
-
if ((0, _definition.isEnumType)(
|
|
8162
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
8163
8163
|
return TypeKind.ENUM;
|
|
8164
8164
|
}
|
|
8165
|
-
if ((0, _definition.isInputObjectType)(
|
|
8165
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
8166
8166
|
return TypeKind.INPUT_OBJECT;
|
|
8167
8167
|
}
|
|
8168
|
-
if ((0, _definition.isListType)(
|
|
8168
|
+
if ((0, _definition.isListType)(type27)) {
|
|
8169
8169
|
return TypeKind.LIST;
|
|
8170
8170
|
}
|
|
8171
|
-
if ((0, _definition.isNonNullType)(
|
|
8171
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
8172
8172
|
return TypeKind.NON_NULL;
|
|
8173
8173
|
}
|
|
8174
8174
|
(0, _invariant.invariant)(
|
|
8175
8175
|
false,
|
|
8176
|
-
`Unexpected type: "${(0, _inspect.inspect)(
|
|
8176
|
+
`Unexpected type: "${(0, _inspect.inspect)(type27)}".`
|
|
8177
8177
|
);
|
|
8178
8178
|
}
|
|
8179
8179
|
},
|
|
8180
8180
|
name: {
|
|
8181
8181
|
type: _scalars.GraphQLString,
|
|
8182
|
-
resolve: (
|
|
8182
|
+
resolve: (type27) => "name" in type27 ? type27.name : void 0
|
|
8183
8183
|
},
|
|
8184
8184
|
description: {
|
|
8185
8185
|
type: _scalars.GraphQLString,
|
|
8186
|
-
resolve: (
|
|
8186
|
+
resolve: (type27) => (
|
|
8187
8187
|
/* c8 ignore next */
|
|
8188
|
-
"description" in
|
|
8188
|
+
"description" in type27 ? type27.description : void 0
|
|
8189
8189
|
)
|
|
8190
8190
|
},
|
|
8191
8191
|
specifiedByURL: {
|
|
@@ -8202,26 +8202,26 @@ var require_introspection = __commonJS({
|
|
|
8202
8202
|
defaultValue: false
|
|
8203
8203
|
}
|
|
8204
8204
|
},
|
|
8205
|
-
resolve(
|
|
8206
|
-
if ((0, _definition.isObjectType)(
|
|
8207
|
-
const fields = Object.values(
|
|
8205
|
+
resolve(type27, { includeDeprecated }) {
|
|
8206
|
+
if ((0, _definition.isObjectType)(type27) || (0, _definition.isInterfaceType)(type27)) {
|
|
8207
|
+
const fields = Object.values(type27.getFields());
|
|
8208
8208
|
return includeDeprecated ? fields : fields.filter((field) => field.deprecationReason == null);
|
|
8209
8209
|
}
|
|
8210
8210
|
}
|
|
8211
8211
|
},
|
|
8212
8212
|
interfaces: {
|
|
8213
8213
|
type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),
|
|
8214
|
-
resolve(
|
|
8215
|
-
if ((0, _definition.isObjectType)(
|
|
8216
|
-
return
|
|
8214
|
+
resolve(type27) {
|
|
8215
|
+
if ((0, _definition.isObjectType)(type27) || (0, _definition.isInterfaceType)(type27)) {
|
|
8216
|
+
return type27.getInterfaces();
|
|
8217
8217
|
}
|
|
8218
8218
|
}
|
|
8219
8219
|
},
|
|
8220
8220
|
possibleTypes: {
|
|
8221
8221
|
type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),
|
|
8222
|
-
resolve(
|
|
8223
|
-
if ((0, _definition.isAbstractType)(
|
|
8224
|
-
return schema.getPossibleTypes(
|
|
8222
|
+
resolve(type27, _args, _context, { schema }) {
|
|
8223
|
+
if ((0, _definition.isAbstractType)(type27)) {
|
|
8224
|
+
return schema.getPossibleTypes(type27);
|
|
8225
8225
|
}
|
|
8226
8226
|
}
|
|
8227
8227
|
},
|
|
@@ -8235,9 +8235,9 @@ var require_introspection = __commonJS({
|
|
|
8235
8235
|
defaultValue: false
|
|
8236
8236
|
}
|
|
8237
8237
|
},
|
|
8238
|
-
resolve(
|
|
8239
|
-
if ((0, _definition.isEnumType)(
|
|
8240
|
-
const values =
|
|
8238
|
+
resolve(type27, { includeDeprecated }) {
|
|
8239
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
8240
|
+
const values = type27.getValues();
|
|
8241
8241
|
return includeDeprecated ? values : values.filter((field) => field.deprecationReason == null);
|
|
8242
8242
|
}
|
|
8243
8243
|
}
|
|
@@ -8252,22 +8252,22 @@ var require_introspection = __commonJS({
|
|
|
8252
8252
|
defaultValue: false
|
|
8253
8253
|
}
|
|
8254
8254
|
},
|
|
8255
|
-
resolve(
|
|
8256
|
-
if ((0, _definition.isInputObjectType)(
|
|
8257
|
-
const values = Object.values(
|
|
8255
|
+
resolve(type27, { includeDeprecated }) {
|
|
8256
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
8257
|
+
const values = Object.values(type27.getFields());
|
|
8258
8258
|
return includeDeprecated ? values : values.filter((field) => field.deprecationReason == null);
|
|
8259
8259
|
}
|
|
8260
8260
|
}
|
|
8261
8261
|
},
|
|
8262
8262
|
ofType: {
|
|
8263
8263
|
type: __Type,
|
|
8264
|
-
resolve: (
|
|
8264
|
+
resolve: (type27) => "ofType" in type27 ? type27.ofType : void 0
|
|
8265
8265
|
},
|
|
8266
8266
|
isOneOf: {
|
|
8267
8267
|
type: _scalars.GraphQLBoolean,
|
|
8268
|
-
resolve: (
|
|
8269
|
-
if ((0, _definition.isInputObjectType)(
|
|
8270
|
-
return
|
|
8268
|
+
resolve: (type27) => {
|
|
8269
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
8270
|
+
return type27.isOneOf;
|
|
8271
8271
|
}
|
|
8272
8272
|
}
|
|
8273
8273
|
}
|
|
@@ -8337,8 +8337,8 @@ var require_introspection = __commonJS({
|
|
|
8337
8337
|
type: _scalars.GraphQLString,
|
|
8338
8338
|
description: "A GraphQL-formatted string representing the default value for this input value.",
|
|
8339
8339
|
resolve(inputValue) {
|
|
8340
|
-
const { type:
|
|
8341
|
-
const valueAST = (0, _astFromValue.astFromValue)(defaultValue,
|
|
8340
|
+
const { type: type27, defaultValue } = inputValue;
|
|
8341
|
+
const valueAST = (0, _astFromValue.astFromValue)(defaultValue, type27);
|
|
8342
8342
|
return valueAST ? (0, _printer.print)(valueAST) : null;
|
|
8343
8343
|
}
|
|
8344
8344
|
},
|
|
@@ -8481,8 +8481,8 @@ var require_introspection = __commonJS({
|
|
|
8481
8481
|
__TypeKind
|
|
8482
8482
|
]);
|
|
8483
8483
|
exports2.introspectionTypes = introspectionTypes;
|
|
8484
|
-
function isIntrospectionType(
|
|
8485
|
-
return introspectionTypes.some(({ name: name21 }) =>
|
|
8484
|
+
function isIntrospectionType(type27) {
|
|
8485
|
+
return introspectionTypes.some(({ name: name21 }) => type27.name === name21);
|
|
8486
8486
|
}
|
|
8487
8487
|
}
|
|
8488
8488
|
});
|
|
@@ -8543,9 +8543,9 @@ var require_schema = __commonJS({
|
|
|
8543
8543
|
this._directives = (_config$directives = config2.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives;
|
|
8544
8544
|
const allReferencedTypes = new Set(config2.types);
|
|
8545
8545
|
if (config2.types != null) {
|
|
8546
|
-
for (const
|
|
8547
|
-
allReferencedTypes.delete(
|
|
8548
|
-
collectReferencedTypes(
|
|
8546
|
+
for (const type27 of config2.types) {
|
|
8547
|
+
allReferencedTypes.delete(type27);
|
|
8548
|
+
collectReferencedTypes(type27, allReferencedTypes);
|
|
8549
8549
|
}
|
|
8550
8550
|
}
|
|
8551
8551
|
if (this._queryType != null) {
|
|
@@ -8651,25 +8651,25 @@ var require_schema = __commonJS({
|
|
|
8651
8651
|
};
|
|
8652
8652
|
}
|
|
8653
8653
|
isSubType(abstractType, maybeSubType) {
|
|
8654
|
-
let
|
|
8655
|
-
if (
|
|
8656
|
-
|
|
8654
|
+
let map4 = this._subTypeMap[abstractType.name];
|
|
8655
|
+
if (map4 === void 0) {
|
|
8656
|
+
map4 = /* @__PURE__ */ Object.create(null);
|
|
8657
8657
|
if ((0, _definition.isUnionType)(abstractType)) {
|
|
8658
|
-
for (const
|
|
8659
|
-
|
|
8658
|
+
for (const type27 of abstractType.getTypes()) {
|
|
8659
|
+
map4[type27.name] = true;
|
|
8660
8660
|
}
|
|
8661
8661
|
} else {
|
|
8662
8662
|
const implementations = this.getImplementations(abstractType);
|
|
8663
|
-
for (const
|
|
8664
|
-
|
|
8663
|
+
for (const type27 of implementations.objects) {
|
|
8664
|
+
map4[type27.name] = true;
|
|
8665
8665
|
}
|
|
8666
|
-
for (const
|
|
8667
|
-
|
|
8666
|
+
for (const type27 of implementations.interfaces) {
|
|
8667
|
+
map4[type27.name] = true;
|
|
8668
8668
|
}
|
|
8669
8669
|
}
|
|
8670
|
-
this._subTypeMap[abstractType.name] =
|
|
8670
|
+
this._subTypeMap[abstractType.name] = map4;
|
|
8671
8671
|
}
|
|
8672
|
-
return
|
|
8672
|
+
return map4[maybeSubType.name] !== void 0;
|
|
8673
8673
|
}
|
|
8674
8674
|
getDirectives() {
|
|
8675
8675
|
return this._directives;
|
|
@@ -8693,8 +8693,8 @@ var require_schema = __commonJS({
|
|
|
8693
8693
|
}
|
|
8694
8694
|
};
|
|
8695
8695
|
exports2.GraphQLSchema = GraphQLSchema;
|
|
8696
|
-
function collectReferencedTypes(
|
|
8697
|
-
const namedType = (0, _definition.getNamedType)(
|
|
8696
|
+
function collectReferencedTypes(type27, typeSet) {
|
|
8697
|
+
const namedType = (0, _definition.getNamedType)(type27);
|
|
8698
8698
|
if (!typeSet.has(namedType)) {
|
|
8699
8699
|
typeSet.add(namedType);
|
|
8700
8700
|
if ((0, _definition.isUnionType)(namedType)) {
|
|
@@ -8874,39 +8874,39 @@ var require_validate = __commonJS({
|
|
|
8874
8874
|
function validateTypes2(context2) {
|
|
8875
8875
|
const validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context2);
|
|
8876
8876
|
const typeMap = context2.schema.getTypeMap();
|
|
8877
|
-
for (const
|
|
8878
|
-
if (!(0, _definition.isNamedType)(
|
|
8877
|
+
for (const type27 of Object.values(typeMap)) {
|
|
8878
|
+
if (!(0, _definition.isNamedType)(type27)) {
|
|
8879
8879
|
context2.reportError(
|
|
8880
|
-
`Expected GraphQL named type but got: ${(0, _inspect.inspect)(
|
|
8881
|
-
|
|
8880
|
+
`Expected GraphQL named type but got: ${(0, _inspect.inspect)(type27)}.`,
|
|
8881
|
+
type27.astNode
|
|
8882
8882
|
);
|
|
8883
8883
|
continue;
|
|
8884
8884
|
}
|
|
8885
|
-
if (!(0, _introspection.isIntrospectionType)(
|
|
8886
|
-
validateName(context2,
|
|
8885
|
+
if (!(0, _introspection.isIntrospectionType)(type27)) {
|
|
8886
|
+
validateName(context2, type27);
|
|
8887
8887
|
}
|
|
8888
|
-
if ((0, _definition.isObjectType)(
|
|
8889
|
-
validateFields(context2,
|
|
8890
|
-
validateInterfaces(context2,
|
|
8891
|
-
} else if ((0, _definition.isInterfaceType)(
|
|
8892
|
-
validateFields(context2,
|
|
8893
|
-
validateInterfaces(context2,
|
|
8894
|
-
} else if ((0, _definition.isUnionType)(
|
|
8895
|
-
validateUnionMembers(context2,
|
|
8896
|
-
} else if ((0, _definition.isEnumType)(
|
|
8897
|
-
validateEnumValues(context2,
|
|
8898
|
-
} else if ((0, _definition.isInputObjectType)(
|
|
8899
|
-
validateInputFields(context2,
|
|
8900
|
-
validateInputObjectCircularRefs(
|
|
8888
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
8889
|
+
validateFields(context2, type27);
|
|
8890
|
+
validateInterfaces(context2, type27);
|
|
8891
|
+
} else if ((0, _definition.isInterfaceType)(type27)) {
|
|
8892
|
+
validateFields(context2, type27);
|
|
8893
|
+
validateInterfaces(context2, type27);
|
|
8894
|
+
} else if ((0, _definition.isUnionType)(type27)) {
|
|
8895
|
+
validateUnionMembers(context2, type27);
|
|
8896
|
+
} else if ((0, _definition.isEnumType)(type27)) {
|
|
8897
|
+
validateEnumValues(context2, type27);
|
|
8898
|
+
} else if ((0, _definition.isInputObjectType)(type27)) {
|
|
8899
|
+
validateInputFields(context2, type27);
|
|
8900
|
+
validateInputObjectCircularRefs(type27);
|
|
8901
8901
|
}
|
|
8902
8902
|
}
|
|
8903
8903
|
}
|
|
8904
|
-
function validateFields(context2,
|
|
8905
|
-
const fields = Object.values(
|
|
8904
|
+
function validateFields(context2, type27) {
|
|
8905
|
+
const fields = Object.values(type27.getFields());
|
|
8906
8906
|
if (fields.length === 0) {
|
|
8907
|
-
context2.reportError(`Type ${
|
|
8908
|
-
|
|
8909
|
-
...
|
|
8907
|
+
context2.reportError(`Type ${type27.name} must define one or more fields.`, [
|
|
8908
|
+
type27.astNode,
|
|
8909
|
+
...type27.extensionASTNodes
|
|
8910
8910
|
]);
|
|
8911
8911
|
}
|
|
8912
8912
|
for (const field of fields) {
|
|
@@ -8914,7 +8914,7 @@ var require_validate = __commonJS({
|
|
|
8914
8914
|
if (!(0, _definition.isOutputType)(field.type)) {
|
|
8915
8915
|
var _field$astNode;
|
|
8916
8916
|
context2.reportError(
|
|
8917
|
-
`The type of ${
|
|
8917
|
+
`The type of ${type27.name}.${field.name} must be Output Type but got: ${(0, _inspect.inspect)(field.type)}.`,
|
|
8918
8918
|
(_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type
|
|
8919
8919
|
);
|
|
8920
8920
|
}
|
|
@@ -8924,14 +8924,14 @@ var require_validate = __commonJS({
|
|
|
8924
8924
|
if (!(0, _definition.isInputType)(arg.type)) {
|
|
8925
8925
|
var _arg$astNode2;
|
|
8926
8926
|
context2.reportError(
|
|
8927
|
-
`The type of ${
|
|
8927
|
+
`The type of ${type27.name}.${field.name}(${argName}:) must be Input Type but got: ${(0, _inspect.inspect)(arg.type)}.`,
|
|
8928
8928
|
(_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type
|
|
8929
8929
|
);
|
|
8930
8930
|
}
|
|
8931
8931
|
if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) {
|
|
8932
8932
|
var _arg$astNode3;
|
|
8933
8933
|
context2.reportError(
|
|
8934
|
-
`Required argument ${
|
|
8934
|
+
`Required argument ${type27.name}.${field.name}(${argName}:) cannot be deprecated.`,
|
|
8935
8935
|
[
|
|
8936
8936
|
getDeprecatedDirectiveNode(arg.astNode),
|
|
8937
8937
|
(_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type
|
|
@@ -8941,46 +8941,46 @@ var require_validate = __commonJS({
|
|
|
8941
8941
|
}
|
|
8942
8942
|
}
|
|
8943
8943
|
}
|
|
8944
|
-
function validateInterfaces(context2,
|
|
8944
|
+
function validateInterfaces(context2, type27) {
|
|
8945
8945
|
const ifaceTypeNames = /* @__PURE__ */ Object.create(null);
|
|
8946
|
-
for (const iface of
|
|
8946
|
+
for (const iface of type27.getInterfaces()) {
|
|
8947
8947
|
if (!(0, _definition.isInterfaceType)(iface)) {
|
|
8948
8948
|
context2.reportError(
|
|
8949
8949
|
`Type ${(0, _inspect.inspect)(
|
|
8950
|
-
|
|
8950
|
+
type27
|
|
8951
8951
|
)} must only implement Interface types, it cannot implement ${(0, _inspect.inspect)(iface)}.`,
|
|
8952
|
-
getAllImplementsInterfaceNodes(
|
|
8952
|
+
getAllImplementsInterfaceNodes(type27, iface)
|
|
8953
8953
|
);
|
|
8954
8954
|
continue;
|
|
8955
8955
|
}
|
|
8956
|
-
if (
|
|
8956
|
+
if (type27 === iface) {
|
|
8957
8957
|
context2.reportError(
|
|
8958
|
-
`Type ${
|
|
8959
|
-
getAllImplementsInterfaceNodes(
|
|
8958
|
+
`Type ${type27.name} cannot implement itself because it would create a circular reference.`,
|
|
8959
|
+
getAllImplementsInterfaceNodes(type27, iface)
|
|
8960
8960
|
);
|
|
8961
8961
|
continue;
|
|
8962
8962
|
}
|
|
8963
8963
|
if (ifaceTypeNames[iface.name]) {
|
|
8964
8964
|
context2.reportError(
|
|
8965
|
-
`Type ${
|
|
8966
|
-
getAllImplementsInterfaceNodes(
|
|
8965
|
+
`Type ${type27.name} can only implement ${iface.name} once.`,
|
|
8966
|
+
getAllImplementsInterfaceNodes(type27, iface)
|
|
8967
8967
|
);
|
|
8968
8968
|
continue;
|
|
8969
8969
|
}
|
|
8970
8970
|
ifaceTypeNames[iface.name] = true;
|
|
8971
|
-
validateTypeImplementsAncestors(context2,
|
|
8972
|
-
validateTypeImplementsInterface(context2,
|
|
8971
|
+
validateTypeImplementsAncestors(context2, type27, iface);
|
|
8972
|
+
validateTypeImplementsInterface(context2, type27, iface);
|
|
8973
8973
|
}
|
|
8974
8974
|
}
|
|
8975
|
-
function validateTypeImplementsInterface(context2,
|
|
8976
|
-
const typeFieldMap =
|
|
8975
|
+
function validateTypeImplementsInterface(context2, type27, iface) {
|
|
8976
|
+
const typeFieldMap = type27.getFields();
|
|
8977
8977
|
for (const ifaceField of Object.values(iface.getFields())) {
|
|
8978
8978
|
const fieldName = ifaceField.name;
|
|
8979
8979
|
const typeField = typeFieldMap[fieldName];
|
|
8980
8980
|
if (!typeField) {
|
|
8981
8981
|
context2.reportError(
|
|
8982
|
-
`Interface field ${iface.name}.${fieldName} expected but ${
|
|
8983
|
-
[ifaceField.astNode,
|
|
8982
|
+
`Interface field ${iface.name}.${fieldName} expected but ${type27.name} does not provide it.`,
|
|
8983
|
+
[ifaceField.astNode, type27.astNode, ...type27.extensionASTNodes]
|
|
8984
8984
|
);
|
|
8985
8985
|
continue;
|
|
8986
8986
|
}
|
|
@@ -8991,7 +8991,7 @@ var require_validate = __commonJS({
|
|
|
8991
8991
|
)) {
|
|
8992
8992
|
var _ifaceField$astNode, _typeField$astNode;
|
|
8993
8993
|
context2.reportError(
|
|
8994
|
-
`Interface field ${iface.name}.${fieldName} expects type ${(0, _inspect.inspect)(ifaceField.type)} but ${
|
|
8994
|
+
`Interface field ${iface.name}.${fieldName} expects type ${(0, _inspect.inspect)(ifaceField.type)} but ${type27.name}.${fieldName} is type ${(0, _inspect.inspect)(typeField.type)}.`,
|
|
8995
8995
|
[
|
|
8996
8996
|
(_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type,
|
|
8997
8997
|
(_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type
|
|
@@ -9003,7 +9003,7 @@ var require_validate = __commonJS({
|
|
|
9003
9003
|
const typeArg = typeField.args.find((arg) => arg.name === argName);
|
|
9004
9004
|
if (!typeArg) {
|
|
9005
9005
|
context2.reportError(
|
|
9006
|
-
`Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${
|
|
9006
|
+
`Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type27.name}.${fieldName} does not provide it.`,
|
|
9007
9007
|
[ifaceArg.astNode, typeField.astNode]
|
|
9008
9008
|
);
|
|
9009
9009
|
continue;
|
|
@@ -9011,7 +9011,7 @@ var require_validate = __commonJS({
|
|
|
9011
9011
|
if (!(0, _typeComparators.isEqualType)(ifaceArg.type, typeArg.type)) {
|
|
9012
9012
|
var _ifaceArg$astNode, _typeArg$astNode;
|
|
9013
9013
|
context2.reportError(
|
|
9014
|
-
`Interface field argument ${iface.name}.${fieldName}(${argName}:) expects type ${(0, _inspect.inspect)(ifaceArg.type)} but ${
|
|
9014
|
+
`Interface field argument ${iface.name}.${fieldName}(${argName}:) expects type ${(0, _inspect.inspect)(ifaceArg.type)} but ${type27.name}.${fieldName}(${argName}:) is type ${(0, _inspect.inspect)(typeArg.type)}.`,
|
|
9015
9015
|
[
|
|
9016
9016
|
(_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type,
|
|
9017
9017
|
(_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type
|
|
@@ -9024,22 +9024,22 @@ var require_validate = __commonJS({
|
|
|
9024
9024
|
const ifaceArg = ifaceField.args.find((arg) => arg.name === argName);
|
|
9025
9025
|
if (!ifaceArg && (0, _definition.isRequiredArgument)(typeArg)) {
|
|
9026
9026
|
context2.reportError(
|
|
9027
|
-
`Object field ${
|
|
9027
|
+
`Object field ${type27.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`,
|
|
9028
9028
|
[typeArg.astNode, ifaceField.astNode]
|
|
9029
9029
|
);
|
|
9030
9030
|
}
|
|
9031
9031
|
}
|
|
9032
9032
|
}
|
|
9033
9033
|
}
|
|
9034
|
-
function validateTypeImplementsAncestors(context2,
|
|
9035
|
-
const ifaceInterfaces =
|
|
9034
|
+
function validateTypeImplementsAncestors(context2, type27, iface) {
|
|
9035
|
+
const ifaceInterfaces = type27.getInterfaces();
|
|
9036
9036
|
for (const transitive of iface.getInterfaces()) {
|
|
9037
9037
|
if (!ifaceInterfaces.includes(transitive)) {
|
|
9038
9038
|
context2.reportError(
|
|
9039
|
-
transitive ===
|
|
9039
|
+
transitive === type27 ? `Type ${type27.name} cannot implement ${iface.name} because it would create a circular reference.` : `Type ${type27.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`,
|
|
9040
9040
|
[
|
|
9041
9041
|
...getAllImplementsInterfaceNodes(iface, transitive),
|
|
9042
|
-
...getAllImplementsInterfaceNodes(
|
|
9042
|
+
...getAllImplementsInterfaceNodes(type27, iface)
|
|
9043
9043
|
]
|
|
9044
9044
|
);
|
|
9045
9045
|
}
|
|
@@ -9115,17 +9115,17 @@ var require_validate = __commonJS({
|
|
|
9115
9115
|
}
|
|
9116
9116
|
}
|
|
9117
9117
|
}
|
|
9118
|
-
function validateOneOfInputObjectField(
|
|
9118
|
+
function validateOneOfInputObjectField(type27, field, context2) {
|
|
9119
9119
|
if ((0, _definition.isNonNullType)(field.type)) {
|
|
9120
9120
|
var _field$astNode4;
|
|
9121
9121
|
context2.reportError(
|
|
9122
|
-
`OneOf input field ${
|
|
9122
|
+
`OneOf input field ${type27.name}.${field.name} must be nullable.`,
|
|
9123
9123
|
(_field$astNode4 = field.astNode) === null || _field$astNode4 === void 0 ? void 0 : _field$astNode4.type
|
|
9124
9124
|
);
|
|
9125
9125
|
}
|
|
9126
9126
|
if (field.defaultValue !== void 0) {
|
|
9127
9127
|
context2.reportError(
|
|
9128
|
-
`OneOf input field ${
|
|
9128
|
+
`OneOf input field ${type27.name}.${field.name} cannot have a default value.`,
|
|
9129
9129
|
field.astNode
|
|
9130
9130
|
);
|
|
9131
9131
|
}
|
|
@@ -9163,8 +9163,8 @@ var require_validate = __commonJS({
|
|
|
9163
9163
|
fieldPathIndexByTypeName[inputObj.name] = void 0;
|
|
9164
9164
|
}
|
|
9165
9165
|
}
|
|
9166
|
-
function getAllImplementsInterfaceNodes(
|
|
9167
|
-
const { astNode, extensionASTNodes } =
|
|
9166
|
+
function getAllImplementsInterfaceNodes(type27, iface) {
|
|
9167
|
+
const { astNode, extensionASTNodes } = type27;
|
|
9168
9168
|
const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;
|
|
9169
9169
|
return nodes.flatMap((typeNode) => {
|
|
9170
9170
|
var _typeNode$interfaces;
|
|
@@ -9603,24 +9603,24 @@ var require_FieldsOnCorrectTypeRule = __commonJS({
|
|
|
9603
9603
|
function FieldsOnCorrectTypeRule(context2) {
|
|
9604
9604
|
return {
|
|
9605
9605
|
Field(node) {
|
|
9606
|
-
const
|
|
9607
|
-
if (
|
|
9606
|
+
const type27 = context2.getParentType();
|
|
9607
|
+
if (type27) {
|
|
9608
9608
|
const fieldDef = context2.getFieldDef();
|
|
9609
9609
|
if (!fieldDef) {
|
|
9610
9610
|
const schema = context2.getSchema();
|
|
9611
9611
|
const fieldName = node.name.value;
|
|
9612
9612
|
let suggestion = (0, _didYouMean.didYouMean)(
|
|
9613
9613
|
"to use an inline fragment on",
|
|
9614
|
-
getSuggestedTypeNames(schema,
|
|
9614
|
+
getSuggestedTypeNames(schema, type27, fieldName)
|
|
9615
9615
|
);
|
|
9616
9616
|
if (suggestion === "") {
|
|
9617
9617
|
suggestion = (0, _didYouMean.didYouMean)(
|
|
9618
|
-
getSuggestedFieldNames(
|
|
9618
|
+
getSuggestedFieldNames(type27, fieldName)
|
|
9619
9619
|
);
|
|
9620
9620
|
}
|
|
9621
9621
|
context2.reportError(
|
|
9622
9622
|
new _GraphQLError.GraphQLError(
|
|
9623
|
-
`Cannot query field "${fieldName}" on type "${
|
|
9623
|
+
`Cannot query field "${fieldName}" on type "${type27.name}".` + suggestion,
|
|
9624
9624
|
{
|
|
9625
9625
|
nodes: node
|
|
9626
9626
|
}
|
|
@@ -9631,13 +9631,13 @@ var require_FieldsOnCorrectTypeRule = __commonJS({
|
|
|
9631
9631
|
}
|
|
9632
9632
|
};
|
|
9633
9633
|
}
|
|
9634
|
-
function getSuggestedTypeNames(schema,
|
|
9635
|
-
if (!(0, _definition.isAbstractType)(
|
|
9634
|
+
function getSuggestedTypeNames(schema, type27, fieldName) {
|
|
9635
|
+
if (!(0, _definition.isAbstractType)(type27)) {
|
|
9636
9636
|
return [];
|
|
9637
9637
|
}
|
|
9638
9638
|
const suggestedTypes = /* @__PURE__ */ new Set();
|
|
9639
9639
|
const usageCount = /* @__PURE__ */ Object.create(null);
|
|
9640
|
-
for (const possibleType of schema.getPossibleTypes(
|
|
9640
|
+
for (const possibleType of schema.getPossibleTypes(type27)) {
|
|
9641
9641
|
if (!possibleType.getFields()[fieldName]) {
|
|
9642
9642
|
continue;
|
|
9643
9643
|
}
|
|
@@ -9666,9 +9666,9 @@ var require_FieldsOnCorrectTypeRule = __commonJS({
|
|
|
9666
9666
|
return (0, _naturalCompare.naturalCompare)(typeA.name, typeB.name);
|
|
9667
9667
|
}).map((x3) => x3.name);
|
|
9668
9668
|
}
|
|
9669
|
-
function getSuggestedFieldNames(
|
|
9670
|
-
if ((0, _definition.isObjectType)(
|
|
9671
|
-
const possibleFieldNames = Object.keys(
|
|
9669
|
+
function getSuggestedFieldNames(type27, fieldName) {
|
|
9670
|
+
if ((0, _definition.isObjectType)(type27) || (0, _definition.isInterfaceType)(type27)) {
|
|
9671
|
+
const possibleFieldNames = Object.keys(type27.getFields());
|
|
9672
9672
|
return (0, _suggestionList.suggestionList)(fieldName, possibleFieldNames);
|
|
9673
9673
|
}
|
|
9674
9674
|
return [];
|
|
@@ -9693,11 +9693,11 @@ var require_FragmentsOnCompositeTypesRule = __commonJS({
|
|
|
9693
9693
|
InlineFragment(node) {
|
|
9694
9694
|
const typeCondition = node.typeCondition;
|
|
9695
9695
|
if (typeCondition) {
|
|
9696
|
-
const
|
|
9696
|
+
const type27 = (0, _typeFromAST.typeFromAST)(
|
|
9697
9697
|
context2.getSchema(),
|
|
9698
9698
|
typeCondition
|
|
9699
9699
|
);
|
|
9700
|
-
if (
|
|
9700
|
+
if (type27 && !(0, _definition.isCompositeType)(type27)) {
|
|
9701
9701
|
const typeStr = (0, _printer.print)(typeCondition);
|
|
9702
9702
|
context2.reportError(
|
|
9703
9703
|
new _GraphQLError.GraphQLError(
|
|
@@ -9711,11 +9711,11 @@ var require_FragmentsOnCompositeTypesRule = __commonJS({
|
|
|
9711
9711
|
}
|
|
9712
9712
|
},
|
|
9713
9713
|
FragmentDefinition(node) {
|
|
9714
|
-
const
|
|
9714
|
+
const type27 = (0, _typeFromAST.typeFromAST)(
|
|
9715
9715
|
context2.getSchema(),
|
|
9716
9716
|
node.typeCondition
|
|
9717
9717
|
);
|
|
9718
|
-
if (
|
|
9718
|
+
if (type27 && !(0, _definition.isCompositeType)(type27)) {
|
|
9719
9719
|
const typeStr = (0, _printer.print)(node.typeCondition);
|
|
9720
9720
|
context2.reportError(
|
|
9721
9721
|
new _GraphQLError.GraphQLError(
|
|
@@ -10026,7 +10026,7 @@ var require_KnownTypeNamesRule = __commonJS({
|
|
|
10026
10026
|
var standardTypeNames = [
|
|
10027
10027
|
..._scalars.specifiedScalarTypes,
|
|
10028
10028
|
..._introspection.introspectionTypes
|
|
10029
|
-
].map((
|
|
10029
|
+
].map((type27) => type27.name);
|
|
10030
10030
|
function isSDLNode(value) {
|
|
10031
10031
|
return "kind" in value && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value));
|
|
10032
10032
|
}
|
|
@@ -10752,14 +10752,14 @@ var require_OverlappingFieldsCanBeMergedRule = __commonJS({
|
|
|
10752
10752
|
}
|
|
10753
10753
|
}
|
|
10754
10754
|
const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type;
|
|
10755
|
-
const
|
|
10756
|
-
if (type1 &&
|
|
10755
|
+
const type27 = def2 === null || def2 === void 0 ? void 0 : def2.type;
|
|
10756
|
+
if (type1 && type27 && doTypesConflict(type1, type27)) {
|
|
10757
10757
|
return [
|
|
10758
10758
|
[
|
|
10759
10759
|
responseName,
|
|
10760
10760
|
`they return conflicting types "${(0, _inspect.inspect)(
|
|
10761
10761
|
type1
|
|
10762
|
-
)}" and "${(0, _inspect.inspect)(
|
|
10762
|
+
)}" and "${(0, _inspect.inspect)(type27)}"`
|
|
10763
10763
|
],
|
|
10764
10764
|
[node1],
|
|
10765
10765
|
[node2]
|
|
@@ -10776,7 +10776,7 @@ var require_OverlappingFieldsCanBeMergedRule = __commonJS({
|
|
|
10776
10776
|
areMutuallyExclusive,
|
|
10777
10777
|
(0, _definition.getNamedType)(type1),
|
|
10778
10778
|
selectionSet1,
|
|
10779
|
-
(0, _definition.getNamedType)(
|
|
10779
|
+
(0, _definition.getNamedType)(type27),
|
|
10780
10780
|
selectionSet2
|
|
10781
10781
|
);
|
|
10782
10782
|
return subfieldConflicts(conflicts, responseName, node1, node2);
|
|
@@ -10807,21 +10807,21 @@ var require_OverlappingFieldsCanBeMergedRule = __commonJS({
|
|
|
10807
10807
|
function stringifyValue(value) {
|
|
10808
10808
|
return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value));
|
|
10809
10809
|
}
|
|
10810
|
-
function doTypesConflict(type1,
|
|
10810
|
+
function doTypesConflict(type1, type27) {
|
|
10811
10811
|
if ((0, _definition.isListType)(type1)) {
|
|
10812
|
-
return (0, _definition.isListType)(
|
|
10812
|
+
return (0, _definition.isListType)(type27) ? doTypesConflict(type1.ofType, type27.ofType) : true;
|
|
10813
10813
|
}
|
|
10814
|
-
if ((0, _definition.isListType)(
|
|
10814
|
+
if ((0, _definition.isListType)(type27)) {
|
|
10815
10815
|
return true;
|
|
10816
10816
|
}
|
|
10817
10817
|
if ((0, _definition.isNonNullType)(type1)) {
|
|
10818
|
-
return (0, _definition.isNonNullType)(
|
|
10818
|
+
return (0, _definition.isNonNullType)(type27) ? doTypesConflict(type1.ofType, type27.ofType) : true;
|
|
10819
10819
|
}
|
|
10820
|
-
if ((0, _definition.isNonNullType)(
|
|
10820
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
10821
10821
|
return true;
|
|
10822
10822
|
}
|
|
10823
|
-
if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(
|
|
10824
|
-
return type1 !==
|
|
10823
|
+
if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type27)) {
|
|
10824
|
+
return type1 !== type27;
|
|
10825
10825
|
}
|
|
10826
10826
|
return false;
|
|
10827
10827
|
}
|
|
@@ -10915,11 +10915,11 @@ var require_OverlappingFieldsCanBeMergedRule = __commonJS({
|
|
|
10915
10915
|
return weaklyPresent ? true : weaklyPresent === result;
|
|
10916
10916
|
}
|
|
10917
10917
|
add(a3, b2, weaklyPresent) {
|
|
10918
|
-
const
|
|
10919
|
-
if (
|
|
10918
|
+
const map4 = this._data.get(a3);
|
|
10919
|
+
if (map4 === void 0) {
|
|
10920
10920
|
this._data.set(a3, /* @__PURE__ */ new Map([[b2, weaklyPresent]]));
|
|
10921
10921
|
} else {
|
|
10922
|
-
|
|
10922
|
+
map4.set(b2, weaklyPresent);
|
|
10923
10923
|
}
|
|
10924
10924
|
}
|
|
10925
10925
|
};
|
|
@@ -11002,12 +11002,12 @@ var require_PossibleFragmentSpreadsRule = __commonJS({
|
|
|
11002
11002
|
function getFragmentType(context2, name21) {
|
|
11003
11003
|
const frag = context2.getFragment(name21);
|
|
11004
11004
|
if (frag) {
|
|
11005
|
-
const
|
|
11005
|
+
const type27 = (0, _typeFromAST.typeFromAST)(
|
|
11006
11006
|
context2.getSchema(),
|
|
11007
11007
|
frag.typeCondition
|
|
11008
11008
|
);
|
|
11009
|
-
if ((0, _definition.isCompositeType)(
|
|
11010
|
-
return
|
|
11009
|
+
if ((0, _definition.isCompositeType)(type27)) {
|
|
11010
|
+
return type27;
|
|
11011
11011
|
}
|
|
11012
11012
|
}
|
|
11013
11013
|
}
|
|
@@ -11096,28 +11096,28 @@ var require_PossibleTypeExtensionsRule = __commonJS({
|
|
|
11096
11096
|
[_kinds.Kind.ENUM_TYPE_DEFINITION]: _kinds.Kind.ENUM_TYPE_EXTENSION,
|
|
11097
11097
|
[_kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION]: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION
|
|
11098
11098
|
};
|
|
11099
|
-
function typeToExtKind(
|
|
11100
|
-
if ((0, _definition.isScalarType)(
|
|
11099
|
+
function typeToExtKind(type27) {
|
|
11100
|
+
if ((0, _definition.isScalarType)(type27)) {
|
|
11101
11101
|
return _kinds.Kind.SCALAR_TYPE_EXTENSION;
|
|
11102
11102
|
}
|
|
11103
|
-
if ((0, _definition.isObjectType)(
|
|
11103
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
11104
11104
|
return _kinds.Kind.OBJECT_TYPE_EXTENSION;
|
|
11105
11105
|
}
|
|
11106
|
-
if ((0, _definition.isInterfaceType)(
|
|
11106
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
11107
11107
|
return _kinds.Kind.INTERFACE_TYPE_EXTENSION;
|
|
11108
11108
|
}
|
|
11109
|
-
if ((0, _definition.isUnionType)(
|
|
11109
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
11110
11110
|
return _kinds.Kind.UNION_TYPE_EXTENSION;
|
|
11111
11111
|
}
|
|
11112
|
-
if ((0, _definition.isEnumType)(
|
|
11112
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
11113
11113
|
return _kinds.Kind.ENUM_TYPE_EXTENSION;
|
|
11114
11114
|
}
|
|
11115
|
-
if ((0, _definition.isInputObjectType)(
|
|
11115
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
11116
11116
|
return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION;
|
|
11117
11117
|
}
|
|
11118
11118
|
(0, _invariant.invariant)(
|
|
11119
11119
|
false,
|
|
11120
|
-
"Unexpected type: " + (0, _inspect.inspect)(
|
|
11120
|
+
"Unexpected type: " + (0, _inspect.inspect)(type27)
|
|
11121
11121
|
);
|
|
11122
11122
|
}
|
|
11123
11123
|
function extensionKindToTypeName(kind) {
|
|
@@ -11266,13 +11266,13 @@ var require_ScalarLeafsRule = __commonJS({
|
|
|
11266
11266
|
function ScalarLeafsRule(context2) {
|
|
11267
11267
|
return {
|
|
11268
11268
|
Field(node) {
|
|
11269
|
-
const
|
|
11269
|
+
const type27 = context2.getType();
|
|
11270
11270
|
const selectionSet = node.selectionSet;
|
|
11271
|
-
if (
|
|
11272
|
-
if ((0, _definition.isLeafType)((0, _definition.getNamedType)(
|
|
11271
|
+
if (type27) {
|
|
11272
|
+
if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type27))) {
|
|
11273
11273
|
if (selectionSet) {
|
|
11274
11274
|
const fieldName = node.name.value;
|
|
11275
|
-
const typeStr = (0, _inspect.inspect)(
|
|
11275
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
11276
11276
|
context2.reportError(
|
|
11277
11277
|
new _GraphQLError.GraphQLError(
|
|
11278
11278
|
`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`,
|
|
@@ -11284,7 +11284,7 @@ var require_ScalarLeafsRule = __commonJS({
|
|
|
11284
11284
|
}
|
|
11285
11285
|
} else if (!selectionSet) {
|
|
11286
11286
|
const fieldName = node.name.value;
|
|
11287
|
-
const typeStr = (0, _inspect.inspect)(
|
|
11287
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
11288
11288
|
context2.reportError(
|
|
11289
11289
|
new _GraphQLError.GraphQLError(
|
|
11290
11290
|
`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`,
|
|
@@ -11295,7 +11295,7 @@ var require_ScalarLeafsRule = __commonJS({
|
|
|
11295
11295
|
);
|
|
11296
11296
|
} else if (selectionSet.selections.length === 0) {
|
|
11297
11297
|
const fieldName = node.name.value;
|
|
11298
|
-
const typeStr = (0, _inspect.inspect)(
|
|
11298
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
11299
11299
|
context2.reportError(
|
|
11300
11300
|
new _GraphQLError.GraphQLError(
|
|
11301
11301
|
`Field "${fieldName}" of type "${typeStr}" must have at least one field selected.`,
|
|
@@ -11374,8 +11374,8 @@ var require_coerceInputValue = __commonJS({
|
|
|
11374
11374
|
var _suggestionList = require_suggestionList();
|
|
11375
11375
|
var _GraphQLError = require_GraphQLError();
|
|
11376
11376
|
var _definition = require_definition();
|
|
11377
|
-
function coerceInputValue(inputValue,
|
|
11378
|
-
return coerceInputValueImpl(inputValue,
|
|
11377
|
+
function coerceInputValue(inputValue, type27, onError = defaultOnError) {
|
|
11378
|
+
return coerceInputValueImpl(inputValue, type27, onError, void 0);
|
|
11379
11379
|
}
|
|
11380
11380
|
function defaultOnError(path4, invalidValue, error48) {
|
|
11381
11381
|
let errorPrefix = "Invalid value " + (0, _inspect.inspect)(invalidValue);
|
|
@@ -11385,17 +11385,17 @@ var require_coerceInputValue = __commonJS({
|
|
|
11385
11385
|
error48.message = errorPrefix + ": " + error48.message;
|
|
11386
11386
|
throw error48;
|
|
11387
11387
|
}
|
|
11388
|
-
function coerceInputValueImpl(inputValue,
|
|
11389
|
-
if ((0, _definition.isNonNullType)(
|
|
11388
|
+
function coerceInputValueImpl(inputValue, type27, onError, path4) {
|
|
11389
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
11390
11390
|
if (inputValue != null) {
|
|
11391
|
-
return coerceInputValueImpl(inputValue,
|
|
11391
|
+
return coerceInputValueImpl(inputValue, type27.ofType, onError, path4);
|
|
11392
11392
|
}
|
|
11393
11393
|
onError(
|
|
11394
11394
|
(0, _Path.pathToArray)(path4),
|
|
11395
11395
|
inputValue,
|
|
11396
11396
|
new _GraphQLError.GraphQLError(
|
|
11397
11397
|
`Expected non-nullable type "${(0, _inspect.inspect)(
|
|
11398
|
-
|
|
11398
|
+
type27
|
|
11399
11399
|
)}" not to be null.`
|
|
11400
11400
|
)
|
|
11401
11401
|
);
|
|
@@ -11404,8 +11404,8 @@ var require_coerceInputValue = __commonJS({
|
|
|
11404
11404
|
if (inputValue == null) {
|
|
11405
11405
|
return null;
|
|
11406
11406
|
}
|
|
11407
|
-
if ((0, _definition.isListType)(
|
|
11408
|
-
const itemType =
|
|
11407
|
+
if ((0, _definition.isListType)(type27)) {
|
|
11408
|
+
const itemType = type27.ofType;
|
|
11409
11409
|
if ((0, _isIterableObject.isIterableObject)(inputValue)) {
|
|
11410
11410
|
return Array.from(inputValue, (itemValue, index) => {
|
|
11411
11411
|
const itemPath = (0, _Path.addPath)(path4, index, void 0);
|
|
@@ -11414,19 +11414,19 @@ var require_coerceInputValue = __commonJS({
|
|
|
11414
11414
|
}
|
|
11415
11415
|
return [coerceInputValueImpl(inputValue, itemType, onError, path4)];
|
|
11416
11416
|
}
|
|
11417
|
-
if ((0, _definition.isInputObjectType)(
|
|
11417
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
11418
11418
|
if (!(0, _isObjectLike.isObjectLike)(inputValue) || Array.isArray(inputValue)) {
|
|
11419
11419
|
onError(
|
|
11420
11420
|
(0, _Path.pathToArray)(path4),
|
|
11421
11421
|
inputValue,
|
|
11422
11422
|
new _GraphQLError.GraphQLError(
|
|
11423
|
-
`Expected type "${
|
|
11423
|
+
`Expected type "${type27.name}" to be an object.`
|
|
11424
11424
|
)
|
|
11425
11425
|
);
|
|
11426
11426
|
return;
|
|
11427
11427
|
}
|
|
11428
11428
|
const coercedValue = {};
|
|
11429
|
-
const fieldDefs =
|
|
11429
|
+
const fieldDefs = type27.getFields();
|
|
11430
11430
|
for (const field of Object.values(fieldDefs)) {
|
|
11431
11431
|
const fieldValue = inputValue[field.name];
|
|
11432
11432
|
if (fieldValue === void 0) {
|
|
@@ -11448,32 +11448,32 @@ var require_coerceInputValue = __commonJS({
|
|
|
11448
11448
|
fieldValue,
|
|
11449
11449
|
field.type,
|
|
11450
11450
|
onError,
|
|
11451
|
-
(0, _Path.addPath)(path4, field.name,
|
|
11451
|
+
(0, _Path.addPath)(path4, field.name, type27.name)
|
|
11452
11452
|
);
|
|
11453
11453
|
}
|
|
11454
11454
|
for (const fieldName of Object.keys(inputValue)) {
|
|
11455
11455
|
if (!fieldDefs[fieldName]) {
|
|
11456
11456
|
const suggestions = (0, _suggestionList.suggestionList)(
|
|
11457
11457
|
fieldName,
|
|
11458
|
-
Object.keys(
|
|
11458
|
+
Object.keys(type27.getFields())
|
|
11459
11459
|
);
|
|
11460
11460
|
onError(
|
|
11461
11461
|
(0, _Path.pathToArray)(path4),
|
|
11462
11462
|
inputValue,
|
|
11463
11463
|
new _GraphQLError.GraphQLError(
|
|
11464
|
-
`Field "${fieldName}" is not defined by type "${
|
|
11464
|
+
`Field "${fieldName}" is not defined by type "${type27.name}".` + (0, _didYouMean.didYouMean)(suggestions)
|
|
11465
11465
|
)
|
|
11466
11466
|
);
|
|
11467
11467
|
}
|
|
11468
11468
|
}
|
|
11469
|
-
if (
|
|
11469
|
+
if (type27.isOneOf) {
|
|
11470
11470
|
const keys = Object.keys(coercedValue);
|
|
11471
11471
|
if (keys.length !== 1) {
|
|
11472
11472
|
onError(
|
|
11473
11473
|
(0, _Path.pathToArray)(path4),
|
|
11474
11474
|
inputValue,
|
|
11475
11475
|
new _GraphQLError.GraphQLError(
|
|
11476
|
-
`Exactly one key must be specified for OneOf type "${
|
|
11476
|
+
`Exactly one key must be specified for OneOf type "${type27.name}".`
|
|
11477
11477
|
)
|
|
11478
11478
|
);
|
|
11479
11479
|
}
|
|
@@ -11489,10 +11489,10 @@ var require_coerceInputValue = __commonJS({
|
|
|
11489
11489
|
}
|
|
11490
11490
|
return coercedValue;
|
|
11491
11491
|
}
|
|
11492
|
-
if ((0, _definition.isLeafType)(
|
|
11492
|
+
if ((0, _definition.isLeafType)(type27)) {
|
|
11493
11493
|
let parseResult;
|
|
11494
11494
|
try {
|
|
11495
|
-
parseResult =
|
|
11495
|
+
parseResult = type27.parseValue(inputValue);
|
|
11496
11496
|
} catch (error48) {
|
|
11497
11497
|
if (error48 instanceof _GraphQLError.GraphQLError) {
|
|
11498
11498
|
onError((0, _Path.pathToArray)(path4), inputValue, error48);
|
|
@@ -11501,7 +11501,7 @@ var require_coerceInputValue = __commonJS({
|
|
|
11501
11501
|
(0, _Path.pathToArray)(path4),
|
|
11502
11502
|
inputValue,
|
|
11503
11503
|
new _GraphQLError.GraphQLError(
|
|
11504
|
-
`Expected type "${
|
|
11504
|
+
`Expected type "${type27.name}". ` + error48.message,
|
|
11505
11505
|
{
|
|
11506
11506
|
originalError: error48
|
|
11507
11507
|
}
|
|
@@ -11514,14 +11514,14 @@ var require_coerceInputValue = __commonJS({
|
|
|
11514
11514
|
onError(
|
|
11515
11515
|
(0, _Path.pathToArray)(path4),
|
|
11516
11516
|
inputValue,
|
|
11517
|
-
new _GraphQLError.GraphQLError(`Expected type "${
|
|
11517
|
+
new _GraphQLError.GraphQLError(`Expected type "${type27.name}".`)
|
|
11518
11518
|
);
|
|
11519
11519
|
}
|
|
11520
11520
|
return parseResult;
|
|
11521
11521
|
}
|
|
11522
11522
|
(0, _invariant.invariant)(
|
|
11523
11523
|
false,
|
|
11524
|
-
"Unexpected input type: " + (0, _inspect.inspect)(
|
|
11524
|
+
"Unexpected input type: " + (0, _inspect.inspect)(type27)
|
|
11525
11525
|
);
|
|
11526
11526
|
}
|
|
11527
11527
|
}
|
|
@@ -11540,7 +11540,7 @@ var require_valueFromAST = __commonJS({
|
|
|
11540
11540
|
var _keyMap = require_keyMap();
|
|
11541
11541
|
var _kinds = require_kinds();
|
|
11542
11542
|
var _definition = require_definition();
|
|
11543
|
-
function valueFromAST(valueNode,
|
|
11543
|
+
function valueFromAST(valueNode, type27, variables) {
|
|
11544
11544
|
if (!valueNode) {
|
|
11545
11545
|
return;
|
|
11546
11546
|
}
|
|
@@ -11550,22 +11550,22 @@ var require_valueFromAST = __commonJS({
|
|
|
11550
11550
|
return;
|
|
11551
11551
|
}
|
|
11552
11552
|
const variableValue = variables[variableName];
|
|
11553
|
-
if (variableValue === null && (0, _definition.isNonNullType)(
|
|
11553
|
+
if (variableValue === null && (0, _definition.isNonNullType)(type27)) {
|
|
11554
11554
|
return;
|
|
11555
11555
|
}
|
|
11556
11556
|
return variableValue;
|
|
11557
11557
|
}
|
|
11558
|
-
if ((0, _definition.isNonNullType)(
|
|
11558
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
11559
11559
|
if (valueNode.kind === _kinds.Kind.NULL) {
|
|
11560
11560
|
return;
|
|
11561
11561
|
}
|
|
11562
|
-
return valueFromAST(valueNode,
|
|
11562
|
+
return valueFromAST(valueNode, type27.ofType, variables);
|
|
11563
11563
|
}
|
|
11564
11564
|
if (valueNode.kind === _kinds.Kind.NULL) {
|
|
11565
11565
|
return null;
|
|
11566
11566
|
}
|
|
11567
|
-
if ((0, _definition.isListType)(
|
|
11568
|
-
const itemType =
|
|
11567
|
+
if ((0, _definition.isListType)(type27)) {
|
|
11568
|
+
const itemType = type27.ofType;
|
|
11569
11569
|
if (valueNode.kind === _kinds.Kind.LIST) {
|
|
11570
11570
|
const coercedValues = [];
|
|
11571
11571
|
for (const itemNode of valueNode.values) {
|
|
@@ -11590,7 +11590,7 @@ var require_valueFromAST = __commonJS({
|
|
|
11590
11590
|
}
|
|
11591
11591
|
return [coercedValue];
|
|
11592
11592
|
}
|
|
11593
|
-
if ((0, _definition.isInputObjectType)(
|
|
11593
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
11594
11594
|
if (valueNode.kind !== _kinds.Kind.OBJECT) {
|
|
11595
11595
|
return;
|
|
11596
11596
|
}
|
|
@@ -11599,7 +11599,7 @@ var require_valueFromAST = __commonJS({
|
|
|
11599
11599
|
valueNode.fields,
|
|
11600
11600
|
(field) => field.name.value
|
|
11601
11601
|
);
|
|
11602
|
-
for (const field of Object.values(
|
|
11602
|
+
for (const field of Object.values(type27.getFields())) {
|
|
11603
11603
|
const fieldNode = fieldNodes[field.name];
|
|
11604
11604
|
if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {
|
|
11605
11605
|
if (field.defaultValue !== void 0) {
|
|
@@ -11615,7 +11615,7 @@ var require_valueFromAST = __commonJS({
|
|
|
11615
11615
|
}
|
|
11616
11616
|
coercedObj[field.name] = fieldValue;
|
|
11617
11617
|
}
|
|
11618
|
-
if (
|
|
11618
|
+
if (type27.isOneOf) {
|
|
11619
11619
|
const keys = Object.keys(coercedObj);
|
|
11620
11620
|
if (keys.length !== 1) {
|
|
11621
11621
|
return;
|
|
@@ -11626,10 +11626,10 @@ var require_valueFromAST = __commonJS({
|
|
|
11626
11626
|
}
|
|
11627
11627
|
return coercedObj;
|
|
11628
11628
|
}
|
|
11629
|
-
if ((0, _definition.isLeafType)(
|
|
11629
|
+
if ((0, _definition.isLeafType)(type27)) {
|
|
11630
11630
|
let result;
|
|
11631
11631
|
try {
|
|
11632
|
-
result =
|
|
11632
|
+
result = type27.parseLiteral(valueNode, variables);
|
|
11633
11633
|
} catch (_error) {
|
|
11634
11634
|
return;
|
|
11635
11635
|
}
|
|
@@ -11640,7 +11640,7 @@ var require_valueFromAST = __commonJS({
|
|
|
11640
11640
|
}
|
|
11641
11641
|
(0, _invariant.invariant)(
|
|
11642
11642
|
false,
|
|
11643
|
-
"Unexpected input type: " + (0, _inspect.inspect)(
|
|
11643
|
+
"Unexpected input type: " + (0, _inspect.inspect)(type27)
|
|
11644
11644
|
);
|
|
11645
11645
|
}
|
|
11646
11646
|
function isMissingVariable(valueNode, variables) {
|
|
@@ -11961,12 +11961,12 @@ var require_collectFields = __commonJS({
|
|
|
11961
11961
|
}
|
|
11962
11962
|
}
|
|
11963
11963
|
function shouldIncludeNode(variableValues, node) {
|
|
11964
|
-
const
|
|
11964
|
+
const skip2 = (0, _values.getDirectiveValues)(
|
|
11965
11965
|
_directives.GraphQLSkipDirective,
|
|
11966
11966
|
node,
|
|
11967
11967
|
variableValues
|
|
11968
11968
|
);
|
|
11969
|
-
if ((
|
|
11969
|
+
if ((skip2 === null || skip2 === void 0 ? void 0 : skip2.if) === true) {
|
|
11970
11970
|
return false;
|
|
11971
11971
|
}
|
|
11972
11972
|
const include = (0, _values.getDirectiveValues)(
|
|
@@ -11979,7 +11979,7 @@ var require_collectFields = __commonJS({
|
|
|
11979
11979
|
}
|
|
11980
11980
|
return true;
|
|
11981
11981
|
}
|
|
11982
|
-
function doesFragmentConditionMatch(schema, fragment,
|
|
11982
|
+
function doesFragmentConditionMatch(schema, fragment, type27) {
|
|
11983
11983
|
const typeConditionNode = fragment.typeCondition;
|
|
11984
11984
|
if (!typeConditionNode) {
|
|
11985
11985
|
return true;
|
|
@@ -11988,11 +11988,11 @@ var require_collectFields = __commonJS({
|
|
|
11988
11988
|
schema,
|
|
11989
11989
|
typeConditionNode
|
|
11990
11990
|
);
|
|
11991
|
-
if (conditionalType ===
|
|
11991
|
+
if (conditionalType === type27) {
|
|
11992
11992
|
return true;
|
|
11993
11993
|
}
|
|
11994
11994
|
if ((0, _definition.isAbstractType)(conditionalType)) {
|
|
11995
|
-
return schema.isSubType(conditionalType,
|
|
11995
|
+
return schema.isSubType(conditionalType, type27);
|
|
11996
11996
|
}
|
|
11997
11997
|
return false;
|
|
11998
11998
|
}
|
|
@@ -12420,9 +12420,9 @@ var require_UniqueFieldDefinitionNamesRule = __commonJS({
|
|
|
12420
12420
|
return false;
|
|
12421
12421
|
}
|
|
12422
12422
|
}
|
|
12423
|
-
function hasField(
|
|
12424
|
-
if ((0, _definition.isObjectType)(
|
|
12425
|
-
return
|
|
12423
|
+
function hasField(type27, fieldName) {
|
|
12424
|
+
if ((0, _definition.isObjectType)(type27) || (0, _definition.isInterfaceType)(type27) || (0, _definition.isInputObjectType)(type27)) {
|
|
12425
|
+
return type27.getFields()[fieldName] != null;
|
|
12426
12426
|
}
|
|
12427
12427
|
return false;
|
|
12428
12428
|
}
|
|
@@ -12718,17 +12718,17 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12718
12718
|
variableDefinitions[definition.variable.name.value] = definition;
|
|
12719
12719
|
},
|
|
12720
12720
|
ListValue(node) {
|
|
12721
|
-
const
|
|
12721
|
+
const type27 = (0, _definition.getNullableType)(
|
|
12722
12722
|
context2.getParentInputType()
|
|
12723
12723
|
);
|
|
12724
|
-
if (!(0, _definition.isListType)(
|
|
12724
|
+
if (!(0, _definition.isListType)(type27)) {
|
|
12725
12725
|
isValidValueNode(context2, node);
|
|
12726
12726
|
return false;
|
|
12727
12727
|
}
|
|
12728
12728
|
},
|
|
12729
12729
|
ObjectValue(node) {
|
|
12730
|
-
const
|
|
12731
|
-
if (!(0, _definition.isInputObjectType)(
|
|
12730
|
+
const type27 = (0, _definition.getNamedType)(context2.getInputType());
|
|
12731
|
+
if (!(0, _definition.isInputObjectType)(type27)) {
|
|
12732
12732
|
isValidValueNode(context2, node);
|
|
12733
12733
|
return false;
|
|
12734
12734
|
}
|
|
@@ -12736,13 +12736,13 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12736
12736
|
node.fields,
|
|
12737
12737
|
(field) => field.name.value
|
|
12738
12738
|
);
|
|
12739
|
-
for (const fieldDef of Object.values(
|
|
12739
|
+
for (const fieldDef of Object.values(type27.getFields())) {
|
|
12740
12740
|
const fieldNode = fieldNodeMap[fieldDef.name];
|
|
12741
12741
|
if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {
|
|
12742
12742
|
const typeStr = (0, _inspect.inspect)(fieldDef.type);
|
|
12743
12743
|
context2.reportError(
|
|
12744
12744
|
new _GraphQLError.GraphQLError(
|
|
12745
|
-
`Field "${
|
|
12745
|
+
`Field "${type27.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`,
|
|
12746
12746
|
{
|
|
12747
12747
|
nodes: node
|
|
12748
12748
|
}
|
|
@@ -12750,8 +12750,8 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12750
12750
|
);
|
|
12751
12751
|
}
|
|
12752
12752
|
}
|
|
12753
|
-
if (
|
|
12754
|
-
validateOneOfInputObject(context2, node,
|
|
12753
|
+
if (type27.isOneOf) {
|
|
12754
|
+
validateOneOfInputObject(context2, node, type27, fieldNodeMap);
|
|
12755
12755
|
}
|
|
12756
12756
|
},
|
|
12757
12757
|
ObjectField(node) {
|
|
@@ -12775,12 +12775,12 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12775
12775
|
}
|
|
12776
12776
|
},
|
|
12777
12777
|
NullValue(node) {
|
|
12778
|
-
const
|
|
12779
|
-
if ((0, _definition.isNonNullType)(
|
|
12778
|
+
const type27 = context2.getInputType();
|
|
12779
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
12780
12780
|
context2.reportError(
|
|
12781
12781
|
new _GraphQLError.GraphQLError(
|
|
12782
12782
|
`Expected value of type "${(0, _inspect.inspect)(
|
|
12783
|
-
|
|
12783
|
+
type27
|
|
12784
12784
|
)}", found ${(0, _printer.print)(node)}.`,
|
|
12785
12785
|
{
|
|
12786
12786
|
nodes: node
|
|
@@ -12801,8 +12801,8 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12801
12801
|
if (!locationType) {
|
|
12802
12802
|
return;
|
|
12803
12803
|
}
|
|
12804
|
-
const
|
|
12805
|
-
if (!(0, _definition.isLeafType)(
|
|
12804
|
+
const type27 = (0, _definition.getNamedType)(locationType);
|
|
12805
|
+
if (!(0, _definition.isLeafType)(type27)) {
|
|
12806
12806
|
const typeStr = (0, _inspect.inspect)(locationType);
|
|
12807
12807
|
context2.reportError(
|
|
12808
12808
|
new _GraphQLError.GraphQLError(
|
|
@@ -12817,7 +12817,7 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12817
12817
|
return;
|
|
12818
12818
|
}
|
|
12819
12819
|
try {
|
|
12820
|
-
const parseResult =
|
|
12820
|
+
const parseResult = type27.parseLiteral(
|
|
12821
12821
|
node,
|
|
12822
12822
|
void 0
|
|
12823
12823
|
/* variables */
|
|
@@ -12854,14 +12854,14 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12854
12854
|
}
|
|
12855
12855
|
}
|
|
12856
12856
|
}
|
|
12857
|
-
function validateOneOfInputObject(context2, node,
|
|
12857
|
+
function validateOneOfInputObject(context2, node, type27, fieldNodeMap) {
|
|
12858
12858
|
var _fieldNodeMap$keys$;
|
|
12859
12859
|
const keys = Object.keys(fieldNodeMap);
|
|
12860
12860
|
const isNotExactlyOneField = keys.length !== 1;
|
|
12861
12861
|
if (isNotExactlyOneField) {
|
|
12862
12862
|
context2.reportError(
|
|
12863
12863
|
new _GraphQLError.GraphQLError(
|
|
12864
|
-
`OneOf Input Object "${
|
|
12864
|
+
`OneOf Input Object "${type27.name}" must specify exactly one key.`,
|
|
12865
12865
|
{
|
|
12866
12866
|
nodes: [node]
|
|
12867
12867
|
}
|
|
@@ -12874,7 +12874,7 @@ var require_ValuesOfCorrectTypeRule = __commonJS({
|
|
|
12874
12874
|
if (isNullLiteral) {
|
|
12875
12875
|
context2.reportError(
|
|
12876
12876
|
new _GraphQLError.GraphQLError(
|
|
12877
|
-
`Field "${
|
|
12877
|
+
`Field "${type27.name}.${keys[0]}" must be non-null.`,
|
|
12878
12878
|
{
|
|
12879
12879
|
nodes: [node]
|
|
12880
12880
|
}
|
|
@@ -12900,11 +12900,11 @@ var require_VariablesAreInputTypesRule = __commonJS({
|
|
|
12900
12900
|
function VariablesAreInputTypesRule(context2) {
|
|
12901
12901
|
return {
|
|
12902
12902
|
VariableDefinition(node) {
|
|
12903
|
-
const
|
|
12903
|
+
const type27 = (0, _typeFromAST.typeFromAST)(
|
|
12904
12904
|
context2.getSchema(),
|
|
12905
12905
|
node.type
|
|
12906
12906
|
);
|
|
12907
|
-
if (
|
|
12907
|
+
if (type27 !== void 0 && !(0, _definition.isInputType)(type27)) {
|
|
12908
12908
|
const variableName = node.variable.name.value;
|
|
12909
12909
|
const typeName = (0, _printer.print)(node.type);
|
|
12910
12910
|
context2.reportError(
|
|
@@ -12945,21 +12945,21 @@ var require_VariablesInAllowedPositionRule = __commonJS({
|
|
|
12945
12945
|
},
|
|
12946
12946
|
leave(operation) {
|
|
12947
12947
|
const usages = context2.getRecursiveVariableUsages(operation);
|
|
12948
|
-
for (const { node, type:
|
|
12948
|
+
for (const { node, type: type27, defaultValue, parentType } of usages) {
|
|
12949
12949
|
const varName = node.name.value;
|
|
12950
12950
|
const varDef = varDefMap[varName];
|
|
12951
|
-
if (varDef &&
|
|
12951
|
+
if (varDef && type27) {
|
|
12952
12952
|
const schema = context2.getSchema();
|
|
12953
12953
|
const varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type);
|
|
12954
12954
|
if (varType && !allowedVariableUsage(
|
|
12955
12955
|
schema,
|
|
12956
12956
|
varType,
|
|
12957
12957
|
varDef.defaultValue,
|
|
12958
|
-
|
|
12958
|
+
type27,
|
|
12959
12959
|
defaultValue
|
|
12960
12960
|
)) {
|
|
12961
12961
|
const varTypeStr = (0, _inspect.inspect)(varType);
|
|
12962
|
-
const typeStr = (0, _inspect.inspect)(
|
|
12962
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
12963
12963
|
context2.reportError(
|
|
12964
12964
|
new _GraphQLError.GraphQLError(
|
|
12965
12965
|
`Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`,
|
|
@@ -14086,9 +14086,9 @@ var require_execute = __commonJS({
|
|
|
14086
14086
|
const possibleTypes = info.schema.getPossibleTypes(abstractType);
|
|
14087
14087
|
const promisedIsTypeOfResults = [];
|
|
14088
14088
|
for (let i2 = 0; i2 < possibleTypes.length; i2++) {
|
|
14089
|
-
const
|
|
14090
|
-
if (
|
|
14091
|
-
const isTypeOfResult =
|
|
14089
|
+
const type27 = possibleTypes[i2];
|
|
14090
|
+
if (type27.isTypeOf) {
|
|
14091
|
+
const isTypeOfResult = type27.isTypeOf(value, contextValue, info);
|
|
14092
14092
|
if ((0, _isPromise.isPromise)(isTypeOfResult)) {
|
|
14093
14093
|
promisedIsTypeOfResults[i2] = isTypeOfResult;
|
|
14094
14094
|
} else if (isTypeOfResult) {
|
|
@@ -14096,7 +14096,7 @@ var require_execute = __commonJS({
|
|
|
14096
14096
|
Promise.allSettled(promisedIsTypeOfResults).catch(() => {
|
|
14097
14097
|
});
|
|
14098
14098
|
}
|
|
14099
|
-
return
|
|
14099
|
+
return type27.name;
|
|
14100
14100
|
}
|
|
14101
14101
|
}
|
|
14102
14102
|
}
|
|
@@ -15374,8 +15374,8 @@ var require_NoSchemaIntrospectionCustomRule = __commonJS({
|
|
|
15374
15374
|
function NoSchemaIntrospectionCustomRule(context2) {
|
|
15375
15375
|
return {
|
|
15376
15376
|
Field(node) {
|
|
15377
|
-
const
|
|
15378
|
-
if (
|
|
15377
|
+
const type27 = (0, _definition.getNamedType)(context2.getType());
|
|
15378
|
+
if (type27 && (0, _introspection.isIntrospectionType)(type27)) {
|
|
15379
15379
|
context2.reportError(
|
|
15380
15380
|
new _GraphQLError.GraphQLError(
|
|
15381
15381
|
`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`,
|
|
@@ -16064,13 +16064,13 @@ var require_buildClientSchema = __commonJS({
|
|
|
16064
16064
|
`Unknown type reference: ${(0, _inspect.inspect)(typeRef)}.`
|
|
16065
16065
|
);
|
|
16066
16066
|
}
|
|
16067
|
-
const
|
|
16068
|
-
if (!
|
|
16067
|
+
const type27 = typeMap[typeName];
|
|
16068
|
+
if (!type27) {
|
|
16069
16069
|
throw new Error(
|
|
16070
16070
|
`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`
|
|
16071
16071
|
);
|
|
16072
16072
|
}
|
|
16073
|
-
return
|
|
16073
|
+
return type27;
|
|
16074
16074
|
}
|
|
16075
16075
|
function getObjectType(typeRef) {
|
|
16076
16076
|
return (0, _definition.assertObjectType)(getNamedType(typeRef));
|
|
@@ -16078,24 +16078,24 @@ var require_buildClientSchema = __commonJS({
|
|
|
16078
16078
|
function getInterfaceType(typeRef) {
|
|
16079
16079
|
return (0, _definition.assertInterfaceType)(getNamedType(typeRef));
|
|
16080
16080
|
}
|
|
16081
|
-
function buildType(
|
|
16082
|
-
if (
|
|
16083
|
-
switch (
|
|
16081
|
+
function buildType(type27) {
|
|
16082
|
+
if (type27 != null && type27.name != null && type27.kind != null) {
|
|
16083
|
+
switch (type27.kind) {
|
|
16084
16084
|
case _introspection.TypeKind.SCALAR:
|
|
16085
|
-
return buildScalarDef(
|
|
16085
|
+
return buildScalarDef(type27);
|
|
16086
16086
|
case _introspection.TypeKind.OBJECT:
|
|
16087
|
-
return buildObjectDef(
|
|
16087
|
+
return buildObjectDef(type27);
|
|
16088
16088
|
case _introspection.TypeKind.INTERFACE:
|
|
16089
|
-
return buildInterfaceDef(
|
|
16089
|
+
return buildInterfaceDef(type27);
|
|
16090
16090
|
case _introspection.TypeKind.UNION:
|
|
16091
|
-
return buildUnionDef(
|
|
16091
|
+
return buildUnionDef(type27);
|
|
16092
16092
|
case _introspection.TypeKind.ENUM:
|
|
16093
|
-
return buildEnumDef(
|
|
16093
|
+
return buildEnumDef(type27);
|
|
16094
16094
|
case _introspection.TypeKind.INPUT_OBJECT:
|
|
16095
|
-
return buildInputObjectDef(
|
|
16095
|
+
return buildInputObjectDef(type27);
|
|
16096
16096
|
}
|
|
16097
16097
|
}
|
|
16098
|
-
const typeStr = (0, _inspect.inspect)(
|
|
16098
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
16099
16099
|
throw new Error(
|
|
16100
16100
|
`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`
|
|
16101
16101
|
);
|
|
@@ -16201,9 +16201,9 @@ var require_buildClientSchema = __commonJS({
|
|
|
16201
16201
|
);
|
|
16202
16202
|
}
|
|
16203
16203
|
function buildField(fieldIntrospection) {
|
|
16204
|
-
const
|
|
16205
|
-
if (!(0, _definition.isOutputType)(
|
|
16206
|
-
const typeStr = (0, _inspect.inspect)(
|
|
16204
|
+
const type27 = getType(fieldIntrospection.type);
|
|
16205
|
+
if (!(0, _definition.isOutputType)(type27)) {
|
|
16206
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
16207
16207
|
throw new Error(
|
|
16208
16208
|
`Introspection must provide output type for fields, but received: ${typeStr}.`
|
|
16209
16209
|
);
|
|
@@ -16217,7 +16217,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
16217
16217
|
return {
|
|
16218
16218
|
description: fieldIntrospection.description,
|
|
16219
16219
|
deprecationReason: fieldIntrospection.deprecationReason,
|
|
16220
|
-
type:
|
|
16220
|
+
type: type27,
|
|
16221
16221
|
args: buildInputValueDefMap(fieldIntrospection.args)
|
|
16222
16222
|
};
|
|
16223
16223
|
}
|
|
@@ -16229,20 +16229,20 @@ var require_buildClientSchema = __commonJS({
|
|
|
16229
16229
|
);
|
|
16230
16230
|
}
|
|
16231
16231
|
function buildInputValue(inputValueIntrospection) {
|
|
16232
|
-
const
|
|
16233
|
-
if (!(0, _definition.isInputType)(
|
|
16234
|
-
const typeStr = (0, _inspect.inspect)(
|
|
16232
|
+
const type27 = getType(inputValueIntrospection.type);
|
|
16233
|
+
if (!(0, _definition.isInputType)(type27)) {
|
|
16234
|
+
const typeStr = (0, _inspect.inspect)(type27);
|
|
16235
16235
|
throw new Error(
|
|
16236
16236
|
`Introspection must provide input type for arguments, but received: ${typeStr}.`
|
|
16237
16237
|
);
|
|
16238
16238
|
}
|
|
16239
16239
|
const defaultValue = inputValueIntrospection.defaultValue != null ? (0, _valueFromAST.valueFromAST)(
|
|
16240
16240
|
(0, _parser2.parseValue)(inputValueIntrospection.defaultValue),
|
|
16241
|
-
|
|
16241
|
+
type27
|
|
16242
16242
|
) : void 0;
|
|
16243
16243
|
return {
|
|
16244
16244
|
description: inputValueIntrospection.description,
|
|
16245
|
-
type:
|
|
16245
|
+
type: type27,
|
|
16246
16246
|
defaultValue,
|
|
16247
16247
|
deprecationReason: inputValueIntrospection.deprecationReason
|
|
16248
16248
|
};
|
|
@@ -16366,17 +16366,17 @@ var require_extendSchema = __commonJS({
|
|
|
16366
16366
|
extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),
|
|
16367
16367
|
assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false
|
|
16368
16368
|
};
|
|
16369
|
-
function replaceType(
|
|
16370
|
-
if ((0, _definition.isListType)(
|
|
16371
|
-
return new _definition.GraphQLList(replaceType(
|
|
16369
|
+
function replaceType(type27) {
|
|
16370
|
+
if ((0, _definition.isListType)(type27)) {
|
|
16371
|
+
return new _definition.GraphQLList(replaceType(type27.ofType));
|
|
16372
16372
|
}
|
|
16373
|
-
if ((0, _definition.isNonNullType)(
|
|
16374
|
-
return new _definition.GraphQLNonNull(replaceType(
|
|
16373
|
+
if ((0, _definition.isNonNullType)(type27)) {
|
|
16374
|
+
return new _definition.GraphQLNonNull(replaceType(type27.ofType));
|
|
16375
16375
|
}
|
|
16376
|
-
return replaceNamedType(
|
|
16376
|
+
return replaceNamedType(type27);
|
|
16377
16377
|
}
|
|
16378
|
-
function replaceNamedType(
|
|
16379
|
-
return typeMap[
|
|
16378
|
+
function replaceNamedType(type27) {
|
|
16379
|
+
return typeMap[type27.name];
|
|
16380
16380
|
}
|
|
16381
16381
|
function replaceDirective(directive) {
|
|
16382
16382
|
const config2 = directive.toConfig();
|
|
@@ -16385,36 +16385,36 @@ var require_extendSchema = __commonJS({
|
|
|
16385
16385
|
args: (0, _mapValue.mapValue)(config2.args, extendArg)
|
|
16386
16386
|
});
|
|
16387
16387
|
}
|
|
16388
|
-
function extendNamedType(
|
|
16389
|
-
if ((0, _introspection.isIntrospectionType)(
|
|
16390
|
-
return
|
|
16388
|
+
function extendNamedType(type27) {
|
|
16389
|
+
if ((0, _introspection.isIntrospectionType)(type27) || (0, _scalars.isSpecifiedScalarType)(type27)) {
|
|
16390
|
+
return type27;
|
|
16391
16391
|
}
|
|
16392
|
-
if ((0, _definition.isScalarType)(
|
|
16393
|
-
return extendScalarType(
|
|
16392
|
+
if ((0, _definition.isScalarType)(type27)) {
|
|
16393
|
+
return extendScalarType(type27);
|
|
16394
16394
|
}
|
|
16395
|
-
if ((0, _definition.isObjectType)(
|
|
16396
|
-
return extendObjectType(
|
|
16395
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
16396
|
+
return extendObjectType(type27);
|
|
16397
16397
|
}
|
|
16398
|
-
if ((0, _definition.isInterfaceType)(
|
|
16399
|
-
return extendInterfaceType(
|
|
16398
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
16399
|
+
return extendInterfaceType(type27);
|
|
16400
16400
|
}
|
|
16401
|
-
if ((0, _definition.isUnionType)(
|
|
16402
|
-
return extendUnionType(
|
|
16401
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
16402
|
+
return extendUnionType(type27);
|
|
16403
16403
|
}
|
|
16404
|
-
if ((0, _definition.isEnumType)(
|
|
16405
|
-
return extendEnumType(
|
|
16404
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
16405
|
+
return extendEnumType(type27);
|
|
16406
16406
|
}
|
|
16407
|
-
if ((0, _definition.isInputObjectType)(
|
|
16408
|
-
return extendInputObjectType(
|
|
16407
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
16408
|
+
return extendInputObjectType(type27);
|
|
16409
16409
|
}
|
|
16410
16410
|
(0, _invariant.invariant)(
|
|
16411
16411
|
false,
|
|
16412
|
-
"Unexpected type: " + (0, _inspect.inspect)(
|
|
16412
|
+
"Unexpected type: " + (0, _inspect.inspect)(type27)
|
|
16413
16413
|
);
|
|
16414
16414
|
}
|
|
16415
|
-
function extendInputObjectType(
|
|
16415
|
+
function extendInputObjectType(type27) {
|
|
16416
16416
|
var _typeExtensionsMap$co;
|
|
16417
|
-
const config2 =
|
|
16417
|
+
const config2 = type27.toConfig();
|
|
16418
16418
|
const extensions = (_typeExtensionsMap$co = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : [];
|
|
16419
16419
|
return new _definition.GraphQLInputObjectType({
|
|
16420
16420
|
...config2,
|
|
@@ -16428,19 +16428,19 @@ var require_extendSchema = __commonJS({
|
|
|
16428
16428
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
16429
16429
|
});
|
|
16430
16430
|
}
|
|
16431
|
-
function extendEnumType(
|
|
16431
|
+
function extendEnumType(type27) {
|
|
16432
16432
|
var _typeExtensionsMap$ty;
|
|
16433
|
-
const config2 =
|
|
16434
|
-
const extensions = (_typeExtensionsMap$ty = typeExtensionsMap[
|
|
16433
|
+
const config2 = type27.toConfig();
|
|
16434
|
+
const extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type27.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : [];
|
|
16435
16435
|
return new _definition.GraphQLEnumType({
|
|
16436
16436
|
...config2,
|
|
16437
16437
|
values: { ...config2.values, ...buildEnumValueMap(extensions) },
|
|
16438
16438
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
16439
16439
|
});
|
|
16440
16440
|
}
|
|
16441
|
-
function extendScalarType(
|
|
16441
|
+
function extendScalarType(type27) {
|
|
16442
16442
|
var _typeExtensionsMap$co2;
|
|
16443
|
-
const config2 =
|
|
16443
|
+
const config2 = type27.toConfig();
|
|
16444
16444
|
const extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : [];
|
|
16445
16445
|
let specifiedByURL = config2.specifiedByURL;
|
|
16446
16446
|
for (const extensionNode of extensions) {
|
|
@@ -16453,14 +16453,14 @@ var require_extendSchema = __commonJS({
|
|
|
16453
16453
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
16454
16454
|
});
|
|
16455
16455
|
}
|
|
16456
|
-
function extendObjectType(
|
|
16456
|
+
function extendObjectType(type27) {
|
|
16457
16457
|
var _typeExtensionsMap$co3;
|
|
16458
|
-
const config2 =
|
|
16458
|
+
const config2 = type27.toConfig();
|
|
16459
16459
|
const extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : [];
|
|
16460
16460
|
return new _definition.GraphQLObjectType({
|
|
16461
16461
|
...config2,
|
|
16462
16462
|
interfaces: () => [
|
|
16463
|
-
...
|
|
16463
|
+
...type27.getInterfaces().map(replaceNamedType),
|
|
16464
16464
|
...buildInterfaces(extensions)
|
|
16465
16465
|
],
|
|
16466
16466
|
fields: () => ({
|
|
@@ -16470,14 +16470,14 @@ var require_extendSchema = __commonJS({
|
|
|
16470
16470
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
16471
16471
|
});
|
|
16472
16472
|
}
|
|
16473
|
-
function extendInterfaceType(
|
|
16473
|
+
function extendInterfaceType(type27) {
|
|
16474
16474
|
var _typeExtensionsMap$co4;
|
|
16475
|
-
const config2 =
|
|
16475
|
+
const config2 = type27.toConfig();
|
|
16476
16476
|
const extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : [];
|
|
16477
16477
|
return new _definition.GraphQLInterfaceType({
|
|
16478
16478
|
...config2,
|
|
16479
16479
|
interfaces: () => [
|
|
16480
|
-
...
|
|
16480
|
+
...type27.getInterfaces().map(replaceNamedType),
|
|
16481
16481
|
...buildInterfaces(extensions)
|
|
16482
16482
|
],
|
|
16483
16483
|
fields: () => ({
|
|
@@ -16487,14 +16487,14 @@ var require_extendSchema = __commonJS({
|
|
|
16487
16487
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
16488
16488
|
});
|
|
16489
16489
|
}
|
|
16490
|
-
function extendUnionType(
|
|
16490
|
+
function extendUnionType(type27) {
|
|
16491
16491
|
var _typeExtensionsMap$co5;
|
|
16492
|
-
const config2 =
|
|
16492
|
+
const config2 = type27.toConfig();
|
|
16493
16493
|
const extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
16494
16494
|
return new _definition.GraphQLUnionType({
|
|
16495
16495
|
...config2,
|
|
16496
16496
|
types: () => [
|
|
16497
|
-
...
|
|
16497
|
+
...type27.getTypes().map(replaceNamedType),
|
|
16498
16498
|
...buildUnionTypes(extensions)
|
|
16499
16499
|
],
|
|
16500
16500
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -16527,11 +16527,11 @@ var require_extendSchema = __commonJS({
|
|
|
16527
16527
|
function getNamedType(node) {
|
|
16528
16528
|
var _stdTypeMap$name2;
|
|
16529
16529
|
const name21 = node.name.value;
|
|
16530
|
-
const
|
|
16531
|
-
if (
|
|
16530
|
+
const type27 = (_stdTypeMap$name2 = stdTypeMap[name21]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name21];
|
|
16531
|
+
if (type27 === void 0) {
|
|
16532
16532
|
throw new Error(`Unknown type: "${name21}".`);
|
|
16533
16533
|
}
|
|
16534
|
-
return
|
|
16534
|
+
return type27;
|
|
16535
16535
|
}
|
|
16536
16536
|
function getWrappedType(node) {
|
|
16537
16537
|
if (node.kind === _kinds.Kind.LIST_TYPE) {
|
|
@@ -16586,11 +16586,11 @@ var require_extendSchema = __commonJS({
|
|
|
16586
16586
|
const argConfigMap = /* @__PURE__ */ Object.create(null);
|
|
16587
16587
|
for (const arg of argsNodes) {
|
|
16588
16588
|
var _arg$description;
|
|
16589
|
-
const
|
|
16589
|
+
const type27 = getWrappedType(arg.type);
|
|
16590
16590
|
argConfigMap[arg.name.value] = {
|
|
16591
|
-
type:
|
|
16591
|
+
type: type27,
|
|
16592
16592
|
description: (_arg$description = arg.description) === null || _arg$description === void 0 ? void 0 : _arg$description.value,
|
|
16593
|
-
defaultValue: (0, _valueFromAST.valueFromAST)(arg.defaultValue,
|
|
16593
|
+
defaultValue: (0, _valueFromAST.valueFromAST)(arg.defaultValue, type27),
|
|
16594
16594
|
deprecationReason: getDeprecationReason(arg),
|
|
16595
16595
|
astNode: arg
|
|
16596
16596
|
};
|
|
@@ -16607,13 +16607,13 @@ var require_extendSchema = __commonJS({
|
|
|
16607
16607
|
);
|
|
16608
16608
|
for (const field of fieldsNodes) {
|
|
16609
16609
|
var _field$description2;
|
|
16610
|
-
const
|
|
16610
|
+
const type27 = getWrappedType(field.type);
|
|
16611
16611
|
inputFieldMap[field.name.value] = {
|
|
16612
|
-
type:
|
|
16612
|
+
type: type27,
|
|
16613
16613
|
description: (_field$description2 = field.description) === null || _field$description2 === void 0 ? void 0 : _field$description2.value,
|
|
16614
16614
|
defaultValue: (0, _valueFromAST.valueFromAST)(
|
|
16615
16615
|
field.defaultValue,
|
|
16616
|
-
|
|
16616
|
+
type27
|
|
16617
16617
|
),
|
|
16618
16618
|
deprecationReason: getDeprecationReason(field),
|
|
16619
16619
|
astNode: field
|
|
@@ -16743,7 +16743,7 @@ var require_extendSchema = __commonJS({
|
|
|
16743
16743
|
}
|
|
16744
16744
|
var stdTypeMap = (0, _keyMap.keyMap)(
|
|
16745
16745
|
[..._scalars.specifiedScalarTypes, ..._introspection.introspectionTypes],
|
|
16746
|
-
(
|
|
16746
|
+
(type27) => type27.name
|
|
16747
16747
|
);
|
|
16748
16748
|
function getDeprecationReason(node) {
|
|
16749
16749
|
const deprecated = (0, _values.getDirectiveValues)(
|
|
@@ -16802,19 +16802,19 @@ var require_buildASTSchema = __commonJS({
|
|
|
16802
16802
|
options
|
|
16803
16803
|
);
|
|
16804
16804
|
if (config2.astNode == null) {
|
|
16805
|
-
for (const
|
|
16806
|
-
switch (
|
|
16805
|
+
for (const type27 of config2.types) {
|
|
16806
|
+
switch (type27.name) {
|
|
16807
16807
|
// Note: While this could make early assertions to get the correctly
|
|
16808
16808
|
// typed values below, that would throw immediately while type system
|
|
16809
16809
|
// validation with validateSchema() will produce more actionable results.
|
|
16810
16810
|
case "Query":
|
|
16811
|
-
config2.query =
|
|
16811
|
+
config2.query = type27;
|
|
16812
16812
|
break;
|
|
16813
16813
|
case "Mutation":
|
|
16814
|
-
config2.mutation =
|
|
16814
|
+
config2.mutation = type27;
|
|
16815
16815
|
break;
|
|
16816
16816
|
case "Subscription":
|
|
16817
|
-
config2.subscription =
|
|
16817
|
+
config2.subscription = type27;
|
|
16818
16818
|
break;
|
|
16819
16819
|
}
|
|
16820
16820
|
}
|
|
@@ -16863,7 +16863,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16863
16863
|
const schemaConfig = schema.toConfig();
|
|
16864
16864
|
const typeMap = (0, _keyValMap.keyValMap)(
|
|
16865
16865
|
sortByName(schemaConfig.types),
|
|
16866
|
-
(
|
|
16866
|
+
(type27) => type27.name,
|
|
16867
16867
|
sortNamedType
|
|
16868
16868
|
);
|
|
16869
16869
|
return new _schema.GraphQLSchema({
|
|
@@ -16874,16 +16874,16 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16874
16874
|
mutation: replaceMaybeType(schemaConfig.mutation),
|
|
16875
16875
|
subscription: replaceMaybeType(schemaConfig.subscription)
|
|
16876
16876
|
});
|
|
16877
|
-
function replaceType(
|
|
16878
|
-
if ((0, _definition.isListType)(
|
|
16879
|
-
return new _definition.GraphQLList(replaceType(
|
|
16880
|
-
} else if ((0, _definition.isNonNullType)(
|
|
16881
|
-
return new _definition.GraphQLNonNull(replaceType(
|
|
16877
|
+
function replaceType(type27) {
|
|
16878
|
+
if ((0, _definition.isListType)(type27)) {
|
|
16879
|
+
return new _definition.GraphQLList(replaceType(type27.ofType));
|
|
16880
|
+
} else if ((0, _definition.isNonNullType)(type27)) {
|
|
16881
|
+
return new _definition.GraphQLNonNull(replaceType(type27.ofType));
|
|
16882
16882
|
}
|
|
16883
|
-
return replaceNamedType(
|
|
16883
|
+
return replaceNamedType(type27);
|
|
16884
16884
|
}
|
|
16885
|
-
function replaceNamedType(
|
|
16886
|
-
return typeMap[
|
|
16885
|
+
function replaceNamedType(type27) {
|
|
16886
|
+
return typeMap[type27.name];
|
|
16887
16887
|
}
|
|
16888
16888
|
function replaceMaybeType(maybeType) {
|
|
16889
16889
|
return maybeType && replaceNamedType(maybeType);
|
|
@@ -16915,42 +16915,42 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16915
16915
|
function sortTypes(array3) {
|
|
16916
16916
|
return sortByName(array3).map(replaceNamedType);
|
|
16917
16917
|
}
|
|
16918
|
-
function sortNamedType(
|
|
16919
|
-
if ((0, _definition.isScalarType)(
|
|
16920
|
-
return
|
|
16918
|
+
function sortNamedType(type27) {
|
|
16919
|
+
if ((0, _definition.isScalarType)(type27) || (0, _introspection.isIntrospectionType)(type27)) {
|
|
16920
|
+
return type27;
|
|
16921
16921
|
}
|
|
16922
|
-
if ((0, _definition.isObjectType)(
|
|
16923
|
-
const config2 =
|
|
16922
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
16923
|
+
const config2 = type27.toConfig();
|
|
16924
16924
|
return new _definition.GraphQLObjectType({
|
|
16925
16925
|
...config2,
|
|
16926
16926
|
interfaces: () => sortTypes(config2.interfaces),
|
|
16927
16927
|
fields: () => sortFields(config2.fields)
|
|
16928
16928
|
});
|
|
16929
16929
|
}
|
|
16930
|
-
if ((0, _definition.isInterfaceType)(
|
|
16931
|
-
const config2 =
|
|
16930
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
16931
|
+
const config2 = type27.toConfig();
|
|
16932
16932
|
return new _definition.GraphQLInterfaceType({
|
|
16933
16933
|
...config2,
|
|
16934
16934
|
interfaces: () => sortTypes(config2.interfaces),
|
|
16935
16935
|
fields: () => sortFields(config2.fields)
|
|
16936
16936
|
});
|
|
16937
16937
|
}
|
|
16938
|
-
if ((0, _definition.isUnionType)(
|
|
16939
|
-
const config2 =
|
|
16938
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
16939
|
+
const config2 = type27.toConfig();
|
|
16940
16940
|
return new _definition.GraphQLUnionType({
|
|
16941
16941
|
...config2,
|
|
16942
16942
|
types: () => sortTypes(config2.types)
|
|
16943
16943
|
});
|
|
16944
16944
|
}
|
|
16945
|
-
if ((0, _definition.isEnumType)(
|
|
16946
|
-
const config2 =
|
|
16945
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
16946
|
+
const config2 = type27.toConfig();
|
|
16947
16947
|
return new _definition.GraphQLEnumType({
|
|
16948
16948
|
...config2,
|
|
16949
16949
|
values: sortObjMap(config2.values, (value) => value)
|
|
16950
16950
|
});
|
|
16951
16951
|
}
|
|
16952
|
-
if ((0, _definition.isInputObjectType)(
|
|
16953
|
-
const config2 =
|
|
16952
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
16953
|
+
const config2 = type27.toConfig();
|
|
16954
16954
|
return new _definition.GraphQLInputObjectType({
|
|
16955
16955
|
...config2,
|
|
16956
16956
|
fields: () => sortInputFields(config2.fields)
|
|
@@ -16958,14 +16958,14 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16958
16958
|
}
|
|
16959
16959
|
(0, _invariant.invariant)(
|
|
16960
16960
|
false,
|
|
16961
|
-
"Unexpected type: " + (0, _inspect.inspect)(
|
|
16961
|
+
"Unexpected type: " + (0, _inspect.inspect)(type27)
|
|
16962
16962
|
);
|
|
16963
16963
|
}
|
|
16964
16964
|
}
|
|
16965
|
-
function sortObjMap(
|
|
16965
|
+
function sortObjMap(map4, sortValueFn) {
|
|
16966
16966
|
const sortedMap = /* @__PURE__ */ Object.create(null);
|
|
16967
|
-
for (const key of Object.keys(
|
|
16968
|
-
sortedMap[key] = sortValueFn(
|
|
16967
|
+
for (const key of Object.keys(map4).sort(_naturalCompare.naturalCompare)) {
|
|
16968
|
+
sortedMap[key] = sortValueFn(map4[key]);
|
|
16969
16969
|
}
|
|
16970
16970
|
return sortedMap;
|
|
16971
16971
|
}
|
|
@@ -17016,8 +17016,8 @@ var require_printSchema = __commonJS({
|
|
|
17016
17016
|
_introspection.isIntrospectionType
|
|
17017
17017
|
);
|
|
17018
17018
|
}
|
|
17019
|
-
function isDefinedType(
|
|
17020
|
-
return !(0, _scalars.isSpecifiedScalarType)(
|
|
17019
|
+
function isDefinedType(type27) {
|
|
17020
|
+
return !(0, _scalars.isSpecifiedScalarType)(type27) && !(0, _introspection.isIntrospectionType)(type27);
|
|
17021
17021
|
}
|
|
17022
17022
|
function printFilteredSchema(schema, directiveFilter, typeFilter) {
|
|
17023
17023
|
const directives = schema.getDirectives().filter(directiveFilter);
|
|
@@ -17025,7 +17025,7 @@ var require_printSchema = __commonJS({
|
|
|
17025
17025
|
return [
|
|
17026
17026
|
printSchemaDefinition(schema),
|
|
17027
17027
|
...directives.map((directive) => printDirective(directive)),
|
|
17028
|
-
...types.map((
|
|
17028
|
+
...types.map((type27) => printType(type27))
|
|
17029
17029
|
].filter(Boolean).join("\n\n");
|
|
17030
17030
|
}
|
|
17031
17031
|
function printSchemaDefinition(schema) {
|
|
@@ -17064,62 +17064,62 @@ ${operationTypes.join("\n")}
|
|
|
17064
17064
|
}
|
|
17065
17065
|
return true;
|
|
17066
17066
|
}
|
|
17067
|
-
function printType(
|
|
17068
|
-
if ((0, _definition.isScalarType)(
|
|
17069
|
-
return printScalar(
|
|
17067
|
+
function printType(type27) {
|
|
17068
|
+
if ((0, _definition.isScalarType)(type27)) {
|
|
17069
|
+
return printScalar(type27);
|
|
17070
17070
|
}
|
|
17071
|
-
if ((0, _definition.isObjectType)(
|
|
17072
|
-
return printObject(
|
|
17071
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
17072
|
+
return printObject(type27);
|
|
17073
17073
|
}
|
|
17074
|
-
if ((0, _definition.isInterfaceType)(
|
|
17075
|
-
return printInterface(
|
|
17074
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
17075
|
+
return printInterface(type27);
|
|
17076
17076
|
}
|
|
17077
|
-
if ((0, _definition.isUnionType)(
|
|
17078
|
-
return printUnion(
|
|
17077
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
17078
|
+
return printUnion(type27);
|
|
17079
17079
|
}
|
|
17080
|
-
if ((0, _definition.isEnumType)(
|
|
17081
|
-
return printEnum(
|
|
17080
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
17081
|
+
return printEnum(type27);
|
|
17082
17082
|
}
|
|
17083
|
-
if ((0, _definition.isInputObjectType)(
|
|
17084
|
-
return printInputObject(
|
|
17083
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
17084
|
+
return printInputObject(type27);
|
|
17085
17085
|
}
|
|
17086
17086
|
(0, _invariant.invariant)(
|
|
17087
17087
|
false,
|
|
17088
|
-
"Unexpected type: " + (0, _inspect.inspect)(
|
|
17088
|
+
"Unexpected type: " + (0, _inspect.inspect)(type27)
|
|
17089
17089
|
);
|
|
17090
17090
|
}
|
|
17091
|
-
function printScalar(
|
|
17092
|
-
return printDescription(
|
|
17091
|
+
function printScalar(type27) {
|
|
17092
|
+
return printDescription(type27) + `scalar ${type27.name}` + printSpecifiedByURL(type27);
|
|
17093
17093
|
}
|
|
17094
|
-
function printImplementedInterfaces(
|
|
17095
|
-
const interfaces =
|
|
17094
|
+
function printImplementedInterfaces(type27) {
|
|
17095
|
+
const interfaces = type27.getInterfaces();
|
|
17096
17096
|
return interfaces.length ? " implements " + interfaces.map((i2) => i2.name).join(" & ") : "";
|
|
17097
17097
|
}
|
|
17098
|
-
function printObject(
|
|
17099
|
-
return printDescription(
|
|
17098
|
+
function printObject(type27) {
|
|
17099
|
+
return printDescription(type27) + `type ${type27.name}` + printImplementedInterfaces(type27) + printFields(type27);
|
|
17100
17100
|
}
|
|
17101
|
-
function printInterface(
|
|
17102
|
-
return printDescription(
|
|
17101
|
+
function printInterface(type27) {
|
|
17102
|
+
return printDescription(type27) + `interface ${type27.name}` + printImplementedInterfaces(type27) + printFields(type27);
|
|
17103
17103
|
}
|
|
17104
|
-
function printUnion(
|
|
17105
|
-
const types =
|
|
17104
|
+
function printUnion(type27) {
|
|
17105
|
+
const types = type27.getTypes();
|
|
17106
17106
|
const possibleTypes = types.length ? " = " + types.join(" | ") : "";
|
|
17107
|
-
return printDescription(
|
|
17107
|
+
return printDescription(type27) + "union " + type27.name + possibleTypes;
|
|
17108
17108
|
}
|
|
17109
|
-
function printEnum(
|
|
17110
|
-
const values =
|
|
17109
|
+
function printEnum(type27) {
|
|
17110
|
+
const values = type27.getValues().map(
|
|
17111
17111
|
(value, i2) => printDescription(value, " ", !i2) + " " + value.name + printDeprecated(value.deprecationReason)
|
|
17112
17112
|
);
|
|
17113
|
-
return printDescription(
|
|
17113
|
+
return printDescription(type27) + `enum ${type27.name}` + printBlock(values);
|
|
17114
17114
|
}
|
|
17115
|
-
function printInputObject(
|
|
17116
|
-
const fields = Object.values(
|
|
17115
|
+
function printInputObject(type27) {
|
|
17116
|
+
const fields = Object.values(type27.getFields()).map(
|
|
17117
17117
|
(f2, i2) => printDescription(f2, " ", !i2) + " " + printInputValue(f2)
|
|
17118
17118
|
);
|
|
17119
|
-
return printDescription(
|
|
17119
|
+
return printDescription(type27) + `input ${type27.name}` + (type27.isOneOf ? " @oneOf" : "") + printBlock(fields);
|
|
17120
17120
|
}
|
|
17121
|
-
function printFields(
|
|
17122
|
-
const fields = Object.values(
|
|
17121
|
+
function printFields(type27) {
|
|
17122
|
+
const fields = Object.values(type27.getFields()).map(
|
|
17123
17123
|
(f2, i2) => printDescription(f2, " ", !i2) + " " + f2.name + printArgs(f2.args, " ") + ": " + String(f2.type) + printDeprecated(f2.deprecationReason)
|
|
17124
17124
|
);
|
|
17125
17125
|
return printBlock(fields);
|
|
@@ -17714,32 +17714,32 @@ var require_findBreakingChanges = __commonJS({
|
|
|
17714
17714
|
}
|
|
17715
17715
|
return (0, _definition.isNamedType)(newType) && oldType.name === newType.name;
|
|
17716
17716
|
}
|
|
17717
|
-
function typeKindName(
|
|
17718
|
-
if ((0, _definition.isScalarType)(
|
|
17717
|
+
function typeKindName(type27) {
|
|
17718
|
+
if ((0, _definition.isScalarType)(type27)) {
|
|
17719
17719
|
return "a Scalar type";
|
|
17720
17720
|
}
|
|
17721
|
-
if ((0, _definition.isObjectType)(
|
|
17721
|
+
if ((0, _definition.isObjectType)(type27)) {
|
|
17722
17722
|
return "an Object type";
|
|
17723
17723
|
}
|
|
17724
|
-
if ((0, _definition.isInterfaceType)(
|
|
17724
|
+
if ((0, _definition.isInterfaceType)(type27)) {
|
|
17725
17725
|
return "an Interface type";
|
|
17726
17726
|
}
|
|
17727
|
-
if ((0, _definition.isUnionType)(
|
|
17727
|
+
if ((0, _definition.isUnionType)(type27)) {
|
|
17728
17728
|
return "a Union type";
|
|
17729
17729
|
}
|
|
17730
|
-
if ((0, _definition.isEnumType)(
|
|
17730
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
17731
17731
|
return "an Enum type";
|
|
17732
17732
|
}
|
|
17733
|
-
if ((0, _definition.isInputObjectType)(
|
|
17733
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
17734
17734
|
return "an Input type";
|
|
17735
17735
|
}
|
|
17736
17736
|
(0, _invariant.invariant)(
|
|
17737
17737
|
false,
|
|
17738
|
-
"Unexpected type: " + (0, _inspect.inspect)(
|
|
17738
|
+
"Unexpected type: " + (0, _inspect.inspect)(type27)
|
|
17739
17739
|
);
|
|
17740
17740
|
}
|
|
17741
|
-
function stringifyValue(value,
|
|
17742
|
-
const ast = (0, _astFromValue.astFromValue)(value,
|
|
17741
|
+
function stringifyValue(value, type27) {
|
|
17742
|
+
const ast = (0, _astFromValue.astFromValue)(value, type27);
|
|
17743
17743
|
ast != null || (0, _invariant.invariant)(false);
|
|
17744
17744
|
return (0, _printer.print)((0, _sortValueNode.sortValueNode)(ast));
|
|
17745
17745
|
}
|
|
@@ -17792,78 +17792,78 @@ var require_resolveSchemaCoordinate = __commonJS({
|
|
|
17792
17792
|
}
|
|
17793
17793
|
function resolveTypeCoordinate(schema, schemaCoordinate) {
|
|
17794
17794
|
const typeName = schemaCoordinate.name.value;
|
|
17795
|
-
const
|
|
17796
|
-
if (
|
|
17795
|
+
const type27 = schema.getType(typeName);
|
|
17796
|
+
if (type27 == null) {
|
|
17797
17797
|
return;
|
|
17798
17798
|
}
|
|
17799
17799
|
return {
|
|
17800
17800
|
kind: "NamedType",
|
|
17801
|
-
type:
|
|
17801
|
+
type: type27
|
|
17802
17802
|
};
|
|
17803
17803
|
}
|
|
17804
17804
|
function resolveMemberCoordinate(schema, schemaCoordinate) {
|
|
17805
17805
|
const typeName = schemaCoordinate.name.value;
|
|
17806
|
-
const
|
|
17807
|
-
if (!
|
|
17806
|
+
const type27 = schema.getType(typeName);
|
|
17807
|
+
if (!type27) {
|
|
17808
17808
|
throw new Error(
|
|
17809
17809
|
`Expected ${(0, _inspect.inspect)(
|
|
17810
17810
|
typeName
|
|
17811
17811
|
)} to be defined as a type in the schema.`
|
|
17812
17812
|
);
|
|
17813
17813
|
}
|
|
17814
|
-
if (!(0, _definition.isEnumType)(
|
|
17814
|
+
if (!(0, _definition.isEnumType)(type27) && !(0, _definition.isInputObjectType)(type27) && !(0, _definition.isObjectType)(type27) && !(0, _definition.isInterfaceType)(type27)) {
|
|
17815
17815
|
throw new Error(
|
|
17816
17816
|
`Expected ${(0, _inspect.inspect)(
|
|
17817
17817
|
typeName
|
|
17818
17818
|
)} to be an Enum, Input Object, Object or Interface type.`
|
|
17819
17819
|
);
|
|
17820
17820
|
}
|
|
17821
|
-
if ((0, _definition.isEnumType)(
|
|
17821
|
+
if ((0, _definition.isEnumType)(type27)) {
|
|
17822
17822
|
const enumValueName = schemaCoordinate.memberName.value;
|
|
17823
|
-
const enumValue =
|
|
17823
|
+
const enumValue = type27.getValue(enumValueName);
|
|
17824
17824
|
if (enumValue == null) {
|
|
17825
17825
|
return;
|
|
17826
17826
|
}
|
|
17827
17827
|
return {
|
|
17828
17828
|
kind: "EnumValue",
|
|
17829
|
-
type:
|
|
17829
|
+
type: type27,
|
|
17830
17830
|
enumValue
|
|
17831
17831
|
};
|
|
17832
17832
|
}
|
|
17833
|
-
if ((0, _definition.isInputObjectType)(
|
|
17833
|
+
if ((0, _definition.isInputObjectType)(type27)) {
|
|
17834
17834
|
const inputFieldName = schemaCoordinate.memberName.value;
|
|
17835
|
-
const inputField =
|
|
17835
|
+
const inputField = type27.getFields()[inputFieldName];
|
|
17836
17836
|
if (inputField == null) {
|
|
17837
17837
|
return;
|
|
17838
17838
|
}
|
|
17839
17839
|
return {
|
|
17840
17840
|
kind: "InputField",
|
|
17841
|
-
type:
|
|
17841
|
+
type: type27,
|
|
17842
17842
|
inputField
|
|
17843
17843
|
};
|
|
17844
17844
|
}
|
|
17845
17845
|
const fieldName = schemaCoordinate.memberName.value;
|
|
17846
|
-
const field =
|
|
17846
|
+
const field = type27.getFields()[fieldName];
|
|
17847
17847
|
if (field == null) {
|
|
17848
17848
|
return;
|
|
17849
17849
|
}
|
|
17850
17850
|
return {
|
|
17851
17851
|
kind: "Field",
|
|
17852
|
-
type:
|
|
17852
|
+
type: type27,
|
|
17853
17853
|
field
|
|
17854
17854
|
};
|
|
17855
17855
|
}
|
|
17856
17856
|
function resolveArgumentCoordinate(schema, schemaCoordinate) {
|
|
17857
17857
|
const typeName = schemaCoordinate.name.value;
|
|
17858
|
-
const
|
|
17859
|
-
if (
|
|
17858
|
+
const type27 = schema.getType(typeName);
|
|
17859
|
+
if (type27 == null) {
|
|
17860
17860
|
throw new Error(
|
|
17861
17861
|
`Expected ${(0, _inspect.inspect)(
|
|
17862
17862
|
typeName
|
|
17863
17863
|
)} to be defined as a type in the schema.`
|
|
17864
17864
|
);
|
|
17865
17865
|
}
|
|
17866
|
-
if (!(0, _definition.isObjectType)(
|
|
17866
|
+
if (!(0, _definition.isObjectType)(type27) && !(0, _definition.isInterfaceType)(type27)) {
|
|
17867
17867
|
throw new Error(
|
|
17868
17868
|
`Expected ${(0, _inspect.inspect)(
|
|
17869
17869
|
typeName
|
|
@@ -17871,7 +17871,7 @@ var require_resolveSchemaCoordinate = __commonJS({
|
|
|
17871
17871
|
);
|
|
17872
17872
|
}
|
|
17873
17873
|
const fieldName = schemaCoordinate.fieldName.value;
|
|
17874
|
-
const field =
|
|
17874
|
+
const field = type27.getFields()[fieldName];
|
|
17875
17875
|
if (field == null) {
|
|
17876
17876
|
throw new Error(
|
|
17877
17877
|
`Expected ${(0, _inspect.inspect)(
|
|
@@ -17890,7 +17890,7 @@ var require_resolveSchemaCoordinate = __commonJS({
|
|
|
17890
17890
|
}
|
|
17891
17891
|
return {
|
|
17892
17892
|
kind: "FieldArgument",
|
|
17893
|
-
type:
|
|
17893
|
+
type: type27,
|
|
17894
17894
|
field,
|
|
17895
17895
|
fieldArgument
|
|
17896
17896
|
};
|
|
@@ -19518,9 +19518,9 @@ var require_err_helpers = __commonJS({
|
|
|
19518
19518
|
}
|
|
19519
19519
|
};
|
|
19520
19520
|
var stackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set());
|
|
19521
|
-
var _messageWithCauses = (err, seen,
|
|
19521
|
+
var _messageWithCauses = (err, seen, skip2) => {
|
|
19522
19522
|
if (!isErrorLike(err)) return "";
|
|
19523
|
-
const message =
|
|
19523
|
+
const message = skip2 ? "" : err.message || "";
|
|
19524
19524
|
if (seen.has(err)) {
|
|
19525
19525
|
return message + ": ...";
|
|
19526
19526
|
}
|
|
@@ -20573,14 +20573,14 @@ var require_quick_format_unescaped = __commonJS({
|
|
|
20573
20573
|
if (args[a3] === void 0) break;
|
|
20574
20574
|
if (lastPos < i2)
|
|
20575
20575
|
str += f2.slice(lastPos, i2);
|
|
20576
|
-
var
|
|
20577
|
-
if (
|
|
20576
|
+
var type27 = typeof args[a3];
|
|
20577
|
+
if (type27 === "string") {
|
|
20578
20578
|
str += "'" + args[a3] + "'";
|
|
20579
20579
|
lastPos = i2 + 2;
|
|
20580
20580
|
i2++;
|
|
20581
20581
|
break;
|
|
20582
20582
|
}
|
|
20583
|
-
if (
|
|
20583
|
+
if (type27 === "function") {
|
|
20584
20584
|
str += args[a3].name || "<anonymous>";
|
|
20585
20585
|
lastPos = i2 + 2;
|
|
20586
20586
|
i2++;
|
|
@@ -24752,8 +24752,8 @@ var require_cjs = __commonJS({
|
|
|
24752
24752
|
if (stringTag) {
|
|
24753
24753
|
return stringTag;
|
|
24754
24754
|
}
|
|
24755
|
-
const
|
|
24756
|
-
return
|
|
24755
|
+
const type27 = toStringObject.call(value);
|
|
24756
|
+
return type27.substring(8, type27.length - 1);
|
|
24757
24757
|
}
|
|
24758
24758
|
var { hasOwnProperty, propertyIsEnumerable } = Object.prototype;
|
|
24759
24759
|
function copyOwnDescriptor(original, clone2, property, state) {
|
|
@@ -24811,16 +24811,16 @@ var require_cjs = __commonJS({
|
|
|
24811
24811
|
function copyDate(date5, state) {
|
|
24812
24812
|
return new state.Constructor(date5.getTime());
|
|
24813
24813
|
}
|
|
24814
|
-
function copyMapLoose(
|
|
24814
|
+
function copyMapLoose(map4, state) {
|
|
24815
24815
|
const clone2 = new state.Constructor();
|
|
24816
|
-
state.cache.set(
|
|
24817
|
-
|
|
24816
|
+
state.cache.set(map4, clone2);
|
|
24817
|
+
map4.forEach((value, key) => {
|
|
24818
24818
|
clone2.set(key, state.copier(value, state));
|
|
24819
24819
|
});
|
|
24820
24820
|
return clone2;
|
|
24821
24821
|
}
|
|
24822
|
-
function copyMapStrict(
|
|
24823
|
-
return copyOwnPropertiesStrict(
|
|
24822
|
+
function copyMapStrict(map4, state) {
|
|
24823
|
+
return copyOwnPropertiesStrict(map4, copyMapLoose(map4, state), state);
|
|
24824
24824
|
}
|
|
24825
24825
|
function copyObjectLoose(object4, state) {
|
|
24826
24826
|
const clone2 = getCleanClone(state.prototype);
|
|
@@ -42489,8 +42489,8 @@ var require_applicability = __commonJS({
|
|
|
42489
42489
|
"use strict";
|
|
42490
42490
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
42491
42491
|
exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0;
|
|
42492
|
-
function schemaHasRulesForType({ schema, self: self2 },
|
|
42493
|
-
const group = self2.RULES.types[
|
|
42492
|
+
function schemaHasRulesForType({ schema, self: self2 }, type27) {
|
|
42493
|
+
const group = self2.RULES.types[type27];
|
|
42494
42494
|
return group && group !== true && shouldUseGroup(schema, group);
|
|
42495
42495
|
}
|
|
42496
42496
|
exports2.schemaHasRulesForType = schemaHasRulesForType;
|
|
@@ -43591,9 +43591,9 @@ var require_validate3 = __commonJS({
|
|
|
43591
43591
|
for (const keyword in rules) {
|
|
43592
43592
|
const rule = rules[keyword];
|
|
43593
43593
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it2.schema, rule)) {
|
|
43594
|
-
const { type:
|
|
43595
|
-
if (
|
|
43596
|
-
strictTypesError(it2, `missing type "${
|
|
43594
|
+
const { type: type27 } = rule.definition;
|
|
43595
|
+
if (type27.length && !type27.some((t4) => hasApplicableType(ts, t4))) {
|
|
43596
|
+
strictTypesError(it2, `missing type "${type27.join(",")}" for keyword "${keyword}"`);
|
|
43597
43597
|
}
|
|
43598
43598
|
}
|
|
43599
43599
|
}
|
|
@@ -51589,7 +51589,7 @@ var require_map = __commonJS({
|
|
|
51589
51589
|
exports2.map = void 0;
|
|
51590
51590
|
var lift_1 = require_lift();
|
|
51591
51591
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
51592
|
-
function
|
|
51592
|
+
function map4(project, thisArg) {
|
|
51593
51593
|
return lift_1.operate(function(source, subscriber) {
|
|
51594
51594
|
var index = 0;
|
|
51595
51595
|
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
|
|
@@ -51597,7 +51597,7 @@ var require_map = __commonJS({
|
|
|
51597
51597
|
}));
|
|
51598
51598
|
});
|
|
51599
51599
|
}
|
|
51600
|
-
exports2.map =
|
|
51600
|
+
exports2.map = map4;
|
|
51601
51601
|
}
|
|
51602
51602
|
});
|
|
51603
51603
|
|
|
@@ -55524,12 +55524,12 @@ var require_skip = __commonJS({
|
|
|
55524
55524
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
55525
55525
|
exports2.skip = void 0;
|
|
55526
55526
|
var filter_1 = require_filter();
|
|
55527
|
-
function
|
|
55527
|
+
function skip2(count) {
|
|
55528
55528
|
return filter_1.filter(function(_3, index) {
|
|
55529
55529
|
return count <= index;
|
|
55530
55530
|
});
|
|
55531
55531
|
}
|
|
55532
|
-
exports2.skip =
|
|
55532
|
+
exports2.skip = skip2;
|
|
55533
55533
|
}
|
|
55534
55534
|
});
|
|
55535
55535
|
|
|
@@ -60015,7 +60015,7 @@ var require_server = __commonJS({
|
|
|
60015
60015
|
session.once("close", function() {
|
|
60016
60016
|
http2Server[kHttp2ServerSessions].delete(session);
|
|
60017
60017
|
});
|
|
60018
|
-
session.once("frameError", function(
|
|
60018
|
+
session.once("frameError", function(type27, code, streamId) {
|
|
60019
60019
|
if (streamId === 0) {
|
|
60020
60020
|
http2Server[kHttp2ServerSessions].delete(session);
|
|
60021
60021
|
}
|
|
@@ -61859,8 +61859,8 @@ var require_reply = __commonJS({
|
|
|
61859
61859
|
this[kReplySerializer] = fn;
|
|
61860
61860
|
return this;
|
|
61861
61861
|
};
|
|
61862
|
-
Reply.prototype.type = function(
|
|
61863
|
-
this[kReplyHeaders]["content-type"] =
|
|
61862
|
+
Reply.prototype.type = function(type27) {
|
|
61863
|
+
this[kReplyHeaders]["content-type"] = type27;
|
|
61864
61864
|
return this;
|
|
61865
61865
|
};
|
|
61866
61866
|
Reply.prototype.redirect = function(url2, code) {
|
|
@@ -64610,7 +64610,7 @@ var require_content_type_parser = __commonJS({
|
|
|
64610
64610
|
if (!opts) opts = {};
|
|
64611
64611
|
if (!opts.bodyLimit) opts.bodyLimit = this[kBodyLimit];
|
|
64612
64612
|
if (Array.isArray(contentType2)) {
|
|
64613
|
-
contentType2.forEach((
|
|
64613
|
+
contentType2.forEach((type27) => this[kContentTypeParser].add(type27, opts, parser));
|
|
64614
64614
|
} else {
|
|
64615
64615
|
this[kContentTypeParser].add(contentType2, opts, parser);
|
|
64616
64616
|
}
|
|
@@ -64624,8 +64624,8 @@ var require_content_type_parser = __commonJS({
|
|
|
64624
64624
|
throw new FST_ERR_CTP_INSTANCE_ALREADY_STARTED("removeContentTypeParser");
|
|
64625
64625
|
}
|
|
64626
64626
|
if (Array.isArray(contentType2)) {
|
|
64627
|
-
for (const
|
|
64628
|
-
this[kContentTypeParser].remove(
|
|
64627
|
+
for (const type27 of contentType2) {
|
|
64628
|
+
this[kContentTypeParser].remove(type27);
|
|
64629
64629
|
}
|
|
64630
64630
|
} else {
|
|
64631
64631
|
this[kContentTypeParser].remove(contentType2);
|
|
@@ -66253,7 +66253,7 @@ var require_resolvers = __commonJS({
|
|
|
66253
66253
|
}
|
|
66254
66254
|
mergedSchema[keyword] = firstValue;
|
|
66255
66255
|
}
|
|
66256
|
-
function
|
|
66256
|
+
function skip2() {
|
|
66257
66257
|
}
|
|
66258
66258
|
function booleanAnd(keyword, values, mergedSchema) {
|
|
66259
66259
|
for (const value of values) {
|
|
@@ -66283,7 +66283,7 @@ var require_resolvers = __commonJS({
|
|
|
66283
66283
|
allEqual,
|
|
66284
66284
|
booleanAnd,
|
|
66285
66285
|
booleanOr,
|
|
66286
|
-
skip
|
|
66286
|
+
skip: skip2
|
|
66287
66287
|
};
|
|
66288
66288
|
}
|
|
66289
66289
|
});
|
|
@@ -67154,9 +67154,9 @@ ${contextFunctionCode}`,
|
|
|
67154
67154
|
context2.functions.push(functionCode);
|
|
67155
67155
|
return functionName;
|
|
67156
67156
|
}
|
|
67157
|
-
function buildArrayTypeCondition(
|
|
67157
|
+
function buildArrayTypeCondition(type27, accessor) {
|
|
67158
67158
|
let condition;
|
|
67159
|
-
switch (
|
|
67159
|
+
switch (type27) {
|
|
67160
67160
|
case "null":
|
|
67161
67161
|
condition = "value === null";
|
|
67162
67162
|
break;
|
|
@@ -67187,8 +67187,8 @@ ${contextFunctionCode}`,
|
|
|
67187
67187
|
condition = "Array.isArray(value)";
|
|
67188
67188
|
break;
|
|
67189
67189
|
default:
|
|
67190
|
-
if (Array.isArray(
|
|
67191
|
-
const conditions =
|
|
67190
|
+
if (Array.isArray(type27)) {
|
|
67191
|
+
const conditions = type27.map((subType) => {
|
|
67192
67192
|
return buildArrayTypeCondition(subType, accessor);
|
|
67193
67193
|
});
|
|
67194
67194
|
condition = `(${conditions.join(" || ")})`;
|
|
@@ -67203,11 +67203,11 @@ ${contextFunctionCode}`,
|
|
|
67203
67203
|
const schema = location.schema;
|
|
67204
67204
|
const types = schema.type.sort((t1) => t1 === "null" ? -1 : 1);
|
|
67205
67205
|
let code = "";
|
|
67206
|
-
types.forEach((
|
|
67207
|
-
location.schema = { ...location.schema, type:
|
|
67206
|
+
types.forEach((type27, index) => {
|
|
67207
|
+
location.schema = { ...location.schema, type: type27 };
|
|
67208
67208
|
const nestedResult = buildSingleTypeSerializer(context2, location, input);
|
|
67209
67209
|
const statement = index === 0 ? "if" : "else if";
|
|
67210
|
-
switch (
|
|
67210
|
+
switch (type27) {
|
|
67211
67211
|
case "null":
|
|
67212
67212
|
code += `
|
|
67213
67213
|
${statement} (${input} === null)
|
|
@@ -67247,7 +67247,7 @@ ${contextFunctionCode}`,
|
|
|
67247
67247
|
}
|
|
67248
67248
|
default: {
|
|
67249
67249
|
code += `
|
|
67250
|
-
${statement}(typeof ${input} === "${
|
|
67250
|
+
${statement}(typeof ${input} === "${type27}" || ${input} === null)
|
|
67251
67251
|
${nestedResult}
|
|
67252
67252
|
`;
|
|
67253
67253
|
break;
|
|
@@ -67317,8 +67317,8 @@ ${contextFunctionCode}`,
|
|
|
67317
67317
|
}
|
|
67318
67318
|
function buildConstSerializer(location, input) {
|
|
67319
67319
|
const schema = location.schema;
|
|
67320
|
-
const
|
|
67321
|
-
const hasNullType = Array.isArray(
|
|
67320
|
+
const type27 = schema.type;
|
|
67321
|
+
const hasNullType = Array.isArray(type27) && type27.includes("null");
|
|
67322
67322
|
let code = "";
|
|
67323
67323
|
if (hasNullType) {
|
|
67324
67324
|
code += `
|
|
@@ -67362,14 +67362,14 @@ ${contextFunctionCode}`,
|
|
|
67362
67362
|
function buildOneOf(context2, location, input) {
|
|
67363
67363
|
context2.validatorSchemasIds.add(location.schemaId);
|
|
67364
67364
|
const schema = location.schema;
|
|
67365
|
-
const
|
|
67366
|
-
const { [
|
|
67365
|
+
const type27 = schema.anyOf ? "anyOf" : "oneOf";
|
|
67366
|
+
const { [type27]: oneOfs, ...schemaWithoutAnyOf } = location.schema;
|
|
67367
67367
|
const locationWithoutOneOf = new Location(
|
|
67368
67368
|
schemaWithoutAnyOf,
|
|
67369
67369
|
location.schemaId,
|
|
67370
67370
|
location.jsonPointer
|
|
67371
67371
|
);
|
|
67372
|
-
const oneOfsLocation = location.getPropertyLocation(
|
|
67372
|
+
const oneOfsLocation = location.getPropertyLocation(type27);
|
|
67373
67373
|
let code = "";
|
|
67374
67374
|
for (let index = 0; index < oneOfs.length; index++) {
|
|
67375
67375
|
const optionLocation = oneOfsLocation.getPropertyLocation(index);
|
|
@@ -67485,7 +67485,7 @@ ${contextFunctionCode}`,
|
|
|
67485
67485
|
}
|
|
67486
67486
|
}
|
|
67487
67487
|
let code = "";
|
|
67488
|
-
const
|
|
67488
|
+
const type27 = schema.type;
|
|
67489
67489
|
const nullable2 = schema.nullable === true;
|
|
67490
67490
|
if (nullable2) {
|
|
67491
67491
|
code += `
|
|
@@ -67496,7 +67496,7 @@ ${contextFunctionCode}`,
|
|
|
67496
67496
|
}
|
|
67497
67497
|
if (schema.const !== void 0) {
|
|
67498
67498
|
code += buildConstSerializer(location, input);
|
|
67499
|
-
} else if (Array.isArray(
|
|
67499
|
+
} else if (Array.isArray(type27)) {
|
|
67500
67500
|
code += buildMultiTypeSerializer(context2, location, input);
|
|
67501
67501
|
} else {
|
|
67502
67502
|
code += buildSingleTypeSerializer(context2, location, input);
|
|
@@ -72155,9 +72155,9 @@ var require_fast_decode_uri_component = __commonJS({
|
|
|
72155
72155
|
var high = hexCodeToInt(uri[percentPosition + 1], 4);
|
|
72156
72156
|
var low = hexCodeToInt(uri[percentPosition + 2], 0);
|
|
72157
72157
|
var byte = high | low;
|
|
72158
|
-
var
|
|
72159
|
-
state = UTF8_DATA[256 + state +
|
|
72160
|
-
codepoint = codepoint << 6 | byte & UTF8_DATA[364 +
|
|
72158
|
+
var type27 = UTF8_DATA[byte];
|
|
72159
|
+
state = UTF8_DATA[256 + state + type27];
|
|
72160
|
+
codepoint = codepoint << 6 | byte & UTF8_DATA[364 + type27];
|
|
72161
72161
|
if (state === UTF8_ACCEPT) {
|
|
72162
72162
|
decoded += uri.slice(last, startOfOctets);
|
|
72163
72163
|
decoded += codepoint <= 65535 ? String.fromCharCode(codepoint) : String.fromCharCode(
|
|
@@ -72498,14 +72498,14 @@ var require_stringify = __commonJS({
|
|
|
72498
72498
|
"use strict";
|
|
72499
72499
|
var { encodeString } = require_querystring();
|
|
72500
72500
|
function getAsPrimitive(value) {
|
|
72501
|
-
const
|
|
72502
|
-
if (
|
|
72501
|
+
const type27 = typeof value;
|
|
72502
|
+
if (type27 === "string") {
|
|
72503
72503
|
return encodeString(value);
|
|
72504
|
-
} else if (
|
|
72504
|
+
} else if (type27 === "bigint") {
|
|
72505
72505
|
return value.toString();
|
|
72506
|
-
} else if (
|
|
72506
|
+
} else if (type27 === "boolean") {
|
|
72507
72507
|
return value ? "true" : "false";
|
|
72508
|
-
} else if (
|
|
72508
|
+
} else if (type27 === "number" && Number.isFinite(value)) {
|
|
72509
72509
|
return value < 1e21 ? "" + value : encodeString("" + value);
|
|
72510
72510
|
}
|
|
72511
72511
|
return "";
|
|
@@ -73135,14 +73135,14 @@ var require_write_set_tokens = __commonJS({
|
|
|
73135
73135
|
if (len !== set2.length) {
|
|
73136
73136
|
return false;
|
|
73137
73137
|
}
|
|
73138
|
-
const
|
|
73138
|
+
const map4 = lookup();
|
|
73139
73139
|
for (const elem of set2) {
|
|
73140
73140
|
if (elem.type === types_1.types.SET) {
|
|
73141
73141
|
return false;
|
|
73142
73142
|
}
|
|
73143
73143
|
const key = elem.type === types_1.types.CHAR ? elem.value : `${elem.from}-${elem.to}`;
|
|
73144
|
-
if (
|
|
73145
|
-
|
|
73144
|
+
if (map4[key]) {
|
|
73145
|
+
map4[key] = false;
|
|
73146
73146
|
} else {
|
|
73147
73147
|
return false;
|
|
73148
73148
|
}
|
|
@@ -73343,11 +73343,11 @@ var require_http_method = __commonJS({
|
|
|
73343
73343
|
storage: function() {
|
|
73344
73344
|
const handlers = /* @__PURE__ */ new Map();
|
|
73345
73345
|
return {
|
|
73346
|
-
get: (
|
|
73347
|
-
return handlers.get(
|
|
73346
|
+
get: (type27) => {
|
|
73347
|
+
return handlers.get(type27) || null;
|
|
73348
73348
|
},
|
|
73349
|
-
set: (
|
|
73350
|
-
handlers.set(
|
|
73349
|
+
set: (type27, store) => {
|
|
73350
|
+
handlers.set(type27, store);
|
|
73351
73351
|
}
|
|
73352
73352
|
};
|
|
73353
73353
|
},
|
|
@@ -79981,7 +79981,7 @@ var require_bytes = __commonJS({
|
|
|
79981
79981
|
module2.exports.parse = parse3;
|
|
79982
79982
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
79983
79983
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
79984
|
-
var
|
|
79984
|
+
var map4 = {
|
|
79985
79985
|
b: 1,
|
|
79986
79986
|
kb: 1 << 10,
|
|
79987
79987
|
mb: 1 << 20,
|
|
@@ -80009,22 +80009,22 @@ var require_bytes = __commonJS({
|
|
|
80009
80009
|
var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2;
|
|
80010
80010
|
var fixedDecimals = Boolean(options && options.fixedDecimals);
|
|
80011
80011
|
var unit = options && options.unit || "";
|
|
80012
|
-
if (!unit || !
|
|
80013
|
-
if (mag >=
|
|
80012
|
+
if (!unit || !map4[unit.toLowerCase()]) {
|
|
80013
|
+
if (mag >= map4.pb) {
|
|
80014
80014
|
unit = "PB";
|
|
80015
|
-
} else if (mag >=
|
|
80015
|
+
} else if (mag >= map4.tb) {
|
|
80016
80016
|
unit = "TB";
|
|
80017
|
-
} else if (mag >=
|
|
80017
|
+
} else if (mag >= map4.gb) {
|
|
80018
80018
|
unit = "GB";
|
|
80019
|
-
} else if (mag >=
|
|
80019
|
+
} else if (mag >= map4.mb) {
|
|
80020
80020
|
unit = "MB";
|
|
80021
|
-
} else if (mag >=
|
|
80021
|
+
} else if (mag >= map4.kb) {
|
|
80022
80022
|
unit = "KB";
|
|
80023
80023
|
} else {
|
|
80024
80024
|
unit = "B";
|
|
80025
80025
|
}
|
|
80026
80026
|
}
|
|
80027
|
-
var val = value /
|
|
80027
|
+
var val = value / map4[unit.toLowerCase()];
|
|
80028
80028
|
var str = val.toFixed(decimalPlaces);
|
|
80029
80029
|
if (!fixedDecimals) {
|
|
80030
80030
|
str = str.replace(formatDecimalsRegExp, "$1");
|
|
@@ -80056,7 +80056,7 @@ var require_bytes = __commonJS({
|
|
|
80056
80056
|
if (isNaN(floatValue)) {
|
|
80057
80057
|
return null;
|
|
80058
80058
|
}
|
|
80059
|
-
return Math.floor(
|
|
80059
|
+
return Math.floor(map4[unit] * floatValue);
|
|
80060
80060
|
}
|
|
80061
80061
|
}
|
|
80062
80062
|
});
|
|
@@ -80130,8 +80130,8 @@ var require_depd = __commonJS({
|
|
|
80130
80130
|
deprecate.property = wrapproperty;
|
|
80131
80131
|
return deprecate;
|
|
80132
80132
|
}
|
|
80133
|
-
function eehaslisteners(emitter,
|
|
80134
|
-
var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(
|
|
80133
|
+
function eehaslisteners(emitter, type27) {
|
|
80134
|
+
var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type27).length : emitter.listenerCount(type27);
|
|
80135
80135
|
return count > 0;
|
|
80136
80136
|
}
|
|
80137
80137
|
function isignored(namespace) {
|
|
@@ -80487,13 +80487,13 @@ var require_statuses = __commonJS({
|
|
|
80487
80487
|
504: true
|
|
80488
80488
|
};
|
|
80489
80489
|
function createMessageToStatusCodeMap(codes2) {
|
|
80490
|
-
var
|
|
80490
|
+
var map4 = {};
|
|
80491
80491
|
Object.keys(codes2).forEach(function forEachCode(code) {
|
|
80492
80492
|
var message = codes2[code];
|
|
80493
80493
|
var status2 = Number(code);
|
|
80494
|
-
|
|
80494
|
+
map4[message.toLowerCase()] = status2;
|
|
80495
80495
|
});
|
|
80496
|
-
return
|
|
80496
|
+
return map4;
|
|
80497
80497
|
}
|
|
80498
80498
|
function createStatusCodeList(codes2) {
|
|
80499
80499
|
return Object.keys(codes2).map(function mapCode(code) {
|
|
@@ -80611,18 +80611,18 @@ var require_http_errors = __commonJS({
|
|
|
80611
80611
|
var props = {};
|
|
80612
80612
|
for (var i2 = 0; i2 < arguments.length; i2++) {
|
|
80613
80613
|
var arg = arguments[i2];
|
|
80614
|
-
var
|
|
80615
|
-
if (
|
|
80614
|
+
var type27 = typeof arg;
|
|
80615
|
+
if (type27 === "object" && arg instanceof Error) {
|
|
80616
80616
|
err = arg;
|
|
80617
80617
|
status = err.status || err.statusCode || status;
|
|
80618
|
-
} else if (
|
|
80618
|
+
} else if (type27 === "number" && i2 === 0) {
|
|
80619
80619
|
status = arg;
|
|
80620
|
-
} else if (
|
|
80620
|
+
} else if (type27 === "string") {
|
|
80621
80621
|
msg = arg;
|
|
80622
|
-
} else if (
|
|
80622
|
+
} else if (type27 === "object") {
|
|
80623
80623
|
props = arg;
|
|
80624
80624
|
} else {
|
|
80625
|
-
throw new TypeError("argument #" + (i2 + 1) + " unsupported type " +
|
|
80625
|
+
throw new TypeError("argument #" + (i2 + 1) + " unsupported type " + type27);
|
|
80626
80626
|
}
|
|
80627
80627
|
}
|
|
80628
80628
|
if (typeof status === "number" && (status < 400 || status >= 600)) {
|
|
@@ -84779,11 +84779,11 @@ var require_content_type = __commonJS({
|
|
|
84779
84779
|
throw new TypeError("argument obj is required");
|
|
84780
84780
|
}
|
|
84781
84781
|
var parameters = obj.parameters;
|
|
84782
|
-
var
|
|
84783
|
-
if (!
|
|
84782
|
+
var type27 = obj.type;
|
|
84783
|
+
if (!type27 || !TYPE_REGEXP.test(type27)) {
|
|
84784
84784
|
throw new TypeError("invalid type");
|
|
84785
84785
|
}
|
|
84786
|
-
var string4 =
|
|
84786
|
+
var string4 = type27;
|
|
84787
84787
|
if (parameters && typeof parameters === "object") {
|
|
84788
84788
|
var param;
|
|
84789
84789
|
var params = Object.keys(parameters).sort();
|
|
@@ -84806,11 +84806,11 @@ var require_content_type = __commonJS({
|
|
|
84806
84806
|
throw new TypeError("argument string is required to be a string");
|
|
84807
84807
|
}
|
|
84808
84808
|
var index = header.indexOf(";");
|
|
84809
|
-
var
|
|
84810
|
-
if (!TYPE_REGEXP.test(
|
|
84809
|
+
var type27 = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
84810
|
+
if (!TYPE_REGEXP.test(type27)) {
|
|
84811
84811
|
throw new TypeError("invalid media type");
|
|
84812
84812
|
}
|
|
84813
|
-
var obj = new ContentType(
|
|
84813
|
+
var obj = new ContentType(type27.toLowerCase());
|
|
84814
84814
|
if (index !== -1) {
|
|
84815
84815
|
var key;
|
|
84816
84816
|
var match;
|
|
@@ -84859,9 +84859,9 @@ var require_content_type = __commonJS({
|
|
|
84859
84859
|
}
|
|
84860
84860
|
return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"';
|
|
84861
84861
|
}
|
|
84862
|
-
function ContentType(
|
|
84862
|
+
function ContentType(type27) {
|
|
84863
84863
|
this.parameters = /* @__PURE__ */ Object.create(null);
|
|
84864
|
-
this.type =
|
|
84864
|
+
this.type = type27;
|
|
84865
84865
|
}
|
|
84866
84866
|
}
|
|
84867
84867
|
});
|
|
@@ -91585,19 +91585,19 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
91585
91585
|
});
|
|
91586
91586
|
const disc = cached(() => {
|
|
91587
91587
|
const opts = def.options;
|
|
91588
|
-
const
|
|
91588
|
+
const map4 = /* @__PURE__ */ new Map();
|
|
91589
91589
|
for (const o of opts) {
|
|
91590
91590
|
const values = o._zod.propValues?.[def.discriminator];
|
|
91591
91591
|
if (!values || values.size === 0)
|
|
91592
91592
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
91593
91593
|
for (const v2 of values) {
|
|
91594
|
-
if (
|
|
91594
|
+
if (map4.has(v2)) {
|
|
91595
91595
|
throw new Error(`Duplicate discriminator value "${String(v2)}"`);
|
|
91596
91596
|
}
|
|
91597
|
-
|
|
91597
|
+
map4.set(v2, o);
|
|
91598
91598
|
}
|
|
91599
91599
|
}
|
|
91600
|
-
return
|
|
91600
|
+
return map4;
|
|
91601
91601
|
});
|
|
91602
91602
|
inst._zod.parse = (payload, ctx) => {
|
|
91603
91603
|
const input = payload.value;
|
|
@@ -101583,9 +101583,9 @@ var ZodIssueCode = {
|
|
|
101583
101583
|
invalid_value: "invalid_value",
|
|
101584
101584
|
custom: "custom"
|
|
101585
101585
|
};
|
|
101586
|
-
function setErrorMap(
|
|
101586
|
+
function setErrorMap(map4) {
|
|
101587
101587
|
config({
|
|
101588
|
-
customError:
|
|
101588
|
+
customError: map4
|
|
101589
101589
|
});
|
|
101590
101590
|
}
|
|
101591
101591
|
function getErrorMap() {
|
|
@@ -101765,9 +101765,9 @@ function convertBaseSchema(schema, ctx) {
|
|
|
101765
101765
|
if (schema.const !== void 0) {
|
|
101766
101766
|
return z3.literal(schema.const);
|
|
101767
101767
|
}
|
|
101768
|
-
const
|
|
101769
|
-
if (Array.isArray(
|
|
101770
|
-
const typeSchemas =
|
|
101768
|
+
const type27 = schema.type;
|
|
101769
|
+
if (Array.isArray(type27)) {
|
|
101770
|
+
const typeSchemas = type27.map((t4) => {
|
|
101771
101771
|
const typeSchema = { ...schema, type: t4 };
|
|
101772
101772
|
return convertBaseSchema(typeSchema, ctx);
|
|
101773
101773
|
});
|
|
@@ -101779,11 +101779,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
101779
101779
|
}
|
|
101780
101780
|
return z3.union(typeSchemas);
|
|
101781
101781
|
}
|
|
101782
|
-
if (!
|
|
101782
|
+
if (!type27) {
|
|
101783
101783
|
return z3.any();
|
|
101784
101784
|
}
|
|
101785
101785
|
let zodSchema2;
|
|
101786
|
-
switch (
|
|
101786
|
+
switch (type27) {
|
|
101787
101787
|
case "string": {
|
|
101788
101788
|
let stringSchema = z3.string();
|
|
101789
101789
|
if (schema.format) {
|
|
@@ -101850,7 +101850,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
101850
101850
|
}
|
|
101851
101851
|
case "number":
|
|
101852
101852
|
case "integer": {
|
|
101853
|
-
let numberSchema =
|
|
101853
|
+
let numberSchema = type27 === "integer" ? z3.number().int() : z3.number();
|
|
101854
101854
|
if (typeof schema.minimum === "number") {
|
|
101855
101855
|
numberSchema = numberSchema.min(schema.minimum);
|
|
101856
101856
|
}
|
|
@@ -101985,7 +101985,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
101985
101985
|
break;
|
|
101986
101986
|
}
|
|
101987
101987
|
default:
|
|
101988
|
-
throw new Error(`Unsupported type: ${
|
|
101988
|
+
throw new Error(`Unsupported type: ${type27}`);
|
|
101989
101989
|
}
|
|
101990
101990
|
if (schema.description) {
|
|
101991
101991
|
zodSchema2 = zodSchema2.describe(schema.description);
|
|
@@ -102471,8 +102471,8 @@ var makeIssue = (params) => {
|
|
|
102471
102471
|
}
|
|
102472
102472
|
let errorMessage = "";
|
|
102473
102473
|
const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
|
|
102474
|
-
for (const
|
|
102475
|
-
errorMessage =
|
|
102474
|
+
for (const map4 of maps) {
|
|
102475
|
+
errorMessage = map4(fullIssue, { data, defaultError: errorMessage }).message;
|
|
102476
102476
|
}
|
|
102477
102477
|
return {
|
|
102478
102478
|
...issueData,
|
|
@@ -104774,33 +104774,33 @@ ZodUnion2.create = (types, params) => {
|
|
|
104774
104774
|
...processCreateParams(params)
|
|
104775
104775
|
});
|
|
104776
104776
|
};
|
|
104777
|
-
var getDiscriminator = (
|
|
104778
|
-
if (
|
|
104779
|
-
return getDiscriminator(
|
|
104780
|
-
} else if (
|
|
104781
|
-
return getDiscriminator(
|
|
104782
|
-
} else if (
|
|
104783
|
-
return [
|
|
104784
|
-
} else if (
|
|
104785
|
-
return
|
|
104786
|
-
} else if (
|
|
104787
|
-
return util.objectValues(
|
|
104788
|
-
} else if (
|
|
104789
|
-
return getDiscriminator(
|
|
104790
|
-
} else if (
|
|
104777
|
+
var getDiscriminator = (type27) => {
|
|
104778
|
+
if (type27 instanceof ZodLazy2) {
|
|
104779
|
+
return getDiscriminator(type27.schema);
|
|
104780
|
+
} else if (type27 instanceof ZodEffects) {
|
|
104781
|
+
return getDiscriminator(type27.innerType());
|
|
104782
|
+
} else if (type27 instanceof ZodLiteral2) {
|
|
104783
|
+
return [type27.value];
|
|
104784
|
+
} else if (type27 instanceof ZodEnum2) {
|
|
104785
|
+
return type27.options;
|
|
104786
|
+
} else if (type27 instanceof ZodNativeEnum) {
|
|
104787
|
+
return util.objectValues(type27.enum);
|
|
104788
|
+
} else if (type27 instanceof ZodDefault2) {
|
|
104789
|
+
return getDiscriminator(type27._def.innerType);
|
|
104790
|
+
} else if (type27 instanceof ZodUndefined2) {
|
|
104791
104791
|
return [void 0];
|
|
104792
|
-
} else if (
|
|
104792
|
+
} else if (type27 instanceof ZodNull2) {
|
|
104793
104793
|
return [null];
|
|
104794
|
-
} else if (
|
|
104795
|
-
return [void 0, ...getDiscriminator(
|
|
104796
|
-
} else if (
|
|
104797
|
-
return [null, ...getDiscriminator(
|
|
104798
|
-
} else if (
|
|
104799
|
-
return getDiscriminator(
|
|
104800
|
-
} else if (
|
|
104801
|
-
return getDiscriminator(
|
|
104802
|
-
} else if (
|
|
104803
|
-
return getDiscriminator(
|
|
104794
|
+
} else if (type27 instanceof ZodOptional2) {
|
|
104795
|
+
return [void 0, ...getDiscriminator(type27.unwrap())];
|
|
104796
|
+
} else if (type27 instanceof ZodNullable2) {
|
|
104797
|
+
return [null, ...getDiscriminator(type27.unwrap())];
|
|
104798
|
+
} else if (type27 instanceof ZodBranded) {
|
|
104799
|
+
return getDiscriminator(type27.unwrap());
|
|
104800
|
+
} else if (type27 instanceof ZodReadonly2) {
|
|
104801
|
+
return getDiscriminator(type27.unwrap());
|
|
104802
|
+
} else if (type27 instanceof ZodCatch2) {
|
|
104803
|
+
return getDiscriminator(type27._def.innerType);
|
|
104804
104804
|
} else {
|
|
104805
104805
|
return [];
|
|
104806
104806
|
}
|
|
@@ -104860,8 +104860,8 @@ var ZodDiscriminatedUnion2 = class _ZodDiscriminatedUnion extends ZodType2 {
|
|
|
104860
104860
|
*/
|
|
104861
104861
|
static create(discriminator, options, params) {
|
|
104862
104862
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
104863
|
-
for (const
|
|
104864
|
-
const discriminatorValues = getDiscriminator(
|
|
104863
|
+
for (const type27 of options) {
|
|
104864
|
+
const discriminatorValues = getDiscriminator(type27.shape[discriminator]);
|
|
104865
104865
|
if (!discriminatorValues.length) {
|
|
104866
104866
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
104867
104867
|
}
|
|
@@ -104869,7 +104869,7 @@ var ZodDiscriminatedUnion2 = class _ZodDiscriminatedUnion extends ZodType2 {
|
|
|
104869
104869
|
if (optionsMap.has(value)) {
|
|
104870
104870
|
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
104871
104871
|
}
|
|
104872
|
-
optionsMap.set(value,
|
|
104872
|
+
optionsMap.set(value, type27);
|
|
104873
104873
|
}
|
|
104874
104874
|
}
|
|
104875
104875
|
return new _ZodDiscriminatedUnion({
|
|
@@ -105680,9 +105680,9 @@ var ZodOptional2 = class extends ZodType2 {
|
|
|
105680
105680
|
return this._def.innerType;
|
|
105681
105681
|
}
|
|
105682
105682
|
};
|
|
105683
|
-
ZodOptional2.create = (
|
|
105683
|
+
ZodOptional2.create = (type27, params) => {
|
|
105684
105684
|
return new ZodOptional2({
|
|
105685
|
-
innerType:
|
|
105685
|
+
innerType: type27,
|
|
105686
105686
|
typeName: ZodFirstPartyTypeKind2.ZodOptional,
|
|
105687
105687
|
...processCreateParams(params)
|
|
105688
105688
|
});
|
|
@@ -105699,9 +105699,9 @@ var ZodNullable2 = class extends ZodType2 {
|
|
|
105699
105699
|
return this._def.innerType;
|
|
105700
105700
|
}
|
|
105701
105701
|
};
|
|
105702
|
-
ZodNullable2.create = (
|
|
105702
|
+
ZodNullable2.create = (type27, params) => {
|
|
105703
105703
|
return new ZodNullable2({
|
|
105704
|
-
innerType:
|
|
105704
|
+
innerType: type27,
|
|
105705
105705
|
typeName: ZodFirstPartyTypeKind2.ZodNullable,
|
|
105706
105706
|
...processCreateParams(params)
|
|
105707
105707
|
});
|
|
@@ -105723,9 +105723,9 @@ var ZodDefault2 = class extends ZodType2 {
|
|
|
105723
105723
|
return this._def.innerType;
|
|
105724
105724
|
}
|
|
105725
105725
|
};
|
|
105726
|
-
ZodDefault2.create = (
|
|
105726
|
+
ZodDefault2.create = (type27, params) => {
|
|
105727
105727
|
return new ZodDefault2({
|
|
105728
|
-
innerType:
|
|
105728
|
+
innerType: type27,
|
|
105729
105729
|
typeName: ZodFirstPartyTypeKind2.ZodDefault,
|
|
105730
105730
|
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
|
105731
105731
|
...processCreateParams(params)
|
|
@@ -105776,9 +105776,9 @@ var ZodCatch2 = class extends ZodType2 {
|
|
|
105776
105776
|
return this._def.innerType;
|
|
105777
105777
|
}
|
|
105778
105778
|
};
|
|
105779
|
-
ZodCatch2.create = (
|
|
105779
|
+
ZodCatch2.create = (type27, params) => {
|
|
105780
105780
|
return new ZodCatch2({
|
|
105781
|
-
innerType:
|
|
105781
|
+
innerType: type27,
|
|
105782
105782
|
typeName: ZodFirstPartyTypeKind2.ZodCatch,
|
|
105783
105783
|
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
105784
105784
|
...processCreateParams(params)
|
|
@@ -105889,9 +105889,9 @@ var ZodReadonly2 = class extends ZodType2 {
|
|
|
105889
105889
|
return this._def.innerType;
|
|
105890
105890
|
}
|
|
105891
105891
|
};
|
|
105892
|
-
ZodReadonly2.create = (
|
|
105892
|
+
ZodReadonly2.create = (type27, params) => {
|
|
105893
105893
|
return new ZodReadonly2({
|
|
105894
|
-
innerType:
|
|
105894
|
+
innerType: type27,
|
|
105895
105895
|
typeName: ZodFirstPartyTypeKind2.ZodReadonly,
|
|
105896
105896
|
...processCreateParams(params)
|
|
105897
105897
|
});
|
|
@@ -106902,9 +106902,9 @@ function parseEnumDef(def) {
|
|
|
106902
106902
|
enum: Array.from(def.values)
|
|
106903
106903
|
};
|
|
106904
106904
|
}
|
|
106905
|
-
var isJsonSchema7AllOfType = (
|
|
106906
|
-
if ("type" in
|
|
106907
|
-
return "allOf" in
|
|
106905
|
+
var isJsonSchema7AllOfType = (type27) => {
|
|
106906
|
+
if ("type" in type27 && type27.type === "string") return false;
|
|
106907
|
+
return "allOf" in type27;
|
|
106908
106908
|
};
|
|
106909
106909
|
function parseIntersectionDef(def, refs) {
|
|
106910
106910
|
const allOf = [
|
|
@@ -107288,7 +107288,7 @@ function parseRecordDef(def, refs) {
|
|
|
107288
107288
|
})) != null ? _a210 : refs.allowedAdditionalProperties
|
|
107289
107289
|
};
|
|
107290
107290
|
if (((_b210 = def.keyType) == null ? void 0 : _b210._def.typeName) === ZodFirstPartyTypeKind2.ZodString && ((_c12 = def.keyType._def.checks) == null ? void 0 : _c12.length)) {
|
|
107291
|
-
const { type:
|
|
107291
|
+
const { type: type27, ...keyType } = parseStringDef(def.keyType._def, refs);
|
|
107292
107292
|
return {
|
|
107293
107293
|
...schema,
|
|
107294
107294
|
propertyNames: keyType
|
|
@@ -107301,7 +107301,7 @@ function parseRecordDef(def, refs) {
|
|
|
107301
107301
|
}
|
|
107302
107302
|
};
|
|
107303
107303
|
} else if (((_e7 = def.keyType) == null ? void 0 : _e7._def.typeName) === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && ((_f3 = def.keyType._def.type._def.checks) == null ? void 0 : _f3.length)) {
|
|
107304
|
-
const { type:
|
|
107304
|
+
const { type: type27, ...keyType } = parseBrandedDef(
|
|
107305
107305
|
def.keyType._def,
|
|
107306
107306
|
refs
|
|
107307
107307
|
);
|
|
@@ -107370,8 +107370,8 @@ function parseUnionDef(def, refs) {
|
|
|
107370
107370
|
(x3) => x3._def.typeName in primitiveMappings && (!x3._def.checks || !x3._def.checks.length)
|
|
107371
107371
|
)) {
|
|
107372
107372
|
const types = options.reduce((types2, x3) => {
|
|
107373
|
-
const
|
|
107374
|
-
return
|
|
107373
|
+
const type27 = primitiveMappings[x3._def.typeName];
|
|
107374
|
+
return type27 && !types2.includes(type27) ? [...types2, type27] : types2;
|
|
107375
107375
|
}, []);
|
|
107376
107376
|
return {
|
|
107377
107377
|
type: types.length > 1 ? types : types[0]
|
|
@@ -107379,12 +107379,12 @@ function parseUnionDef(def, refs) {
|
|
|
107379
107379
|
} else if (options.every((x3) => x3._def.typeName === "ZodLiteral" && !x3.description)) {
|
|
107380
107380
|
const types = options.reduce(
|
|
107381
107381
|
(acc, x3) => {
|
|
107382
|
-
const
|
|
107383
|
-
switch (
|
|
107382
|
+
const type27 = typeof x3._def.value;
|
|
107383
|
+
switch (type27) {
|
|
107384
107384
|
case "string":
|
|
107385
107385
|
case "number":
|
|
107386
107386
|
case "boolean":
|
|
107387
|
-
return [...acc,
|
|
107387
|
+
return [...acc, type27];
|
|
107388
107388
|
case "bigint":
|
|
107389
107389
|
return [...acc, "integer"];
|
|
107390
107390
|
case "object":
|
|
@@ -108866,8 +108866,8 @@ function extractResourceMetadataUrl(response) {
|
|
|
108866
108866
|
if (!header) {
|
|
108867
108867
|
return void 0;
|
|
108868
108868
|
}
|
|
108869
|
-
const [
|
|
108870
|
-
if (
|
|
108869
|
+
const [type27, scheme] = header.split(" ");
|
|
108870
|
+
if (type27.toLowerCase() !== "bearer" || !scheme) {
|
|
108871
108871
|
return void 0;
|
|
108872
108872
|
}
|
|
108873
108873
|
const regex = /resource_metadata="([^"]*)"/;
|
|
@@ -108998,7 +108998,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, {
|
|
|
108998
108998
|
var _a310;
|
|
108999
108999
|
const headers = { "MCP-Protocol-Version": protocolVersion };
|
|
109000
109000
|
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
|
|
109001
|
-
for (const { url: endpointUrl, type:
|
|
109001
|
+
for (const { url: endpointUrl, type: type27 } of urlsToTry) {
|
|
109002
109002
|
const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
|
|
109003
109003
|
if (!response) {
|
|
109004
109004
|
continue;
|
|
@@ -109008,10 +109008,10 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, {
|
|
|
109008
109008
|
continue;
|
|
109009
109009
|
}
|
|
109010
109010
|
throw new Error(
|
|
109011
|
-
`HTTP ${response.status} trying to load ${
|
|
109011
|
+
`HTTP ${response.status} trying to load ${type27 === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`
|
|
109012
109012
|
);
|
|
109013
109013
|
}
|
|
109014
|
-
if (
|
|
109014
|
+
if (type27 === "oauth") {
|
|
109015
109015
|
return OAuthMetadataSchema.parse(await response.json());
|
|
109016
109016
|
} else {
|
|
109017
109017
|
const metadata = OpenIdProviderDiscoveryMetadataSchema.parse(
|
|
@@ -112913,7 +112913,7 @@ var isCompatible = _makeCompatibilityCheck(VERSION4);
|
|
|
112913
112913
|
var major = VERSION4.split(".")[0];
|
|
112914
112914
|
var GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major);
|
|
112915
112915
|
var _global = _globalThis;
|
|
112916
|
-
function registerGlobal(
|
|
112916
|
+
function registerGlobal(type27, instance, diag, allowOverride) {
|
|
112917
112917
|
var _a51;
|
|
112918
112918
|
if (allowOverride === void 0) {
|
|
112919
112919
|
allowOverride = false;
|
|
@@ -112921,33 +112921,33 @@ function registerGlobal(type26, instance, diag, allowOverride) {
|
|
|
112921
112921
|
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a51 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a51 !== void 0 ? _a51 : {
|
|
112922
112922
|
version: VERSION4
|
|
112923
112923
|
};
|
|
112924
|
-
if (!allowOverride && api[
|
|
112925
|
-
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " +
|
|
112924
|
+
if (!allowOverride && api[type27]) {
|
|
112925
|
+
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type27);
|
|
112926
112926
|
diag.error(err.stack || err.message);
|
|
112927
112927
|
return false;
|
|
112928
112928
|
}
|
|
112929
112929
|
if (api.version !== VERSION4) {
|
|
112930
|
-
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " +
|
|
112930
|
+
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type27 + " does not match previously registered API v" + VERSION4);
|
|
112931
112931
|
diag.error(err.stack || err.message);
|
|
112932
112932
|
return false;
|
|
112933
112933
|
}
|
|
112934
|
-
api[
|
|
112935
|
-
diag.debug("@opentelemetry/api: Registered a global for " +
|
|
112934
|
+
api[type27] = instance;
|
|
112935
|
+
diag.debug("@opentelemetry/api: Registered a global for " + type27 + " v" + VERSION4 + ".");
|
|
112936
112936
|
return true;
|
|
112937
112937
|
}
|
|
112938
|
-
function getGlobal(
|
|
112938
|
+
function getGlobal(type27) {
|
|
112939
112939
|
var _a51, _b41;
|
|
112940
112940
|
var globalVersion = (_a51 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a51 === void 0 ? void 0 : _a51.version;
|
|
112941
112941
|
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
112942
112942
|
return;
|
|
112943
112943
|
}
|
|
112944
|
-
return (_b41 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b41 === void 0 ? void 0 : _b41[
|
|
112944
|
+
return (_b41 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b41 === void 0 ? void 0 : _b41[type27];
|
|
112945
112945
|
}
|
|
112946
|
-
function unregisterGlobal(
|
|
112947
|
-
diag.debug("@opentelemetry/api: Unregistering a global for " +
|
|
112946
|
+
function unregisterGlobal(type27, diag) {
|
|
112947
|
+
diag.debug("@opentelemetry/api: Unregistering a global for " + type27 + " v" + VERSION4 + ".");
|
|
112948
112948
|
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
112949
112949
|
if (api) {
|
|
112950
|
-
delete api[
|
|
112950
|
+
delete api[type27];
|
|
112951
112951
|
}
|
|
112952
112952
|
}
|
|
112953
112953
|
|
|
@@ -114588,8 +114588,8 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
|
114588
114588
|
};
|
|
114589
114589
|
}
|
|
114590
114590
|
let originalData;
|
|
114591
|
-
const
|
|
114592
|
-
switch (
|
|
114591
|
+
const type27 = part.type;
|
|
114592
|
+
switch (type27) {
|
|
114593
114593
|
case "image":
|
|
114594
114594
|
originalData = part.image;
|
|
114595
114595
|
break;
|
|
@@ -114597,7 +114597,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
|
114597
114597
|
originalData = part.data;
|
|
114598
114598
|
break;
|
|
114599
114599
|
default:
|
|
114600
|
-
throw new Error(`Unsupported part type: ${
|
|
114600
|
+
throw new Error(`Unsupported part type: ${type27}`);
|
|
114601
114601
|
}
|
|
114602
114602
|
const { data: convertedData, mediaType: convertedMediaType } = convertToLanguageModelV3DataContent(originalData);
|
|
114603
114603
|
let mediaType = convertedMediaType != null ? convertedMediaType : part.mediaType;
|
|
@@ -114609,7 +114609,7 @@ function convertPartToLanguageModelPart(part, downloadedAssets) {
|
|
|
114609
114609
|
mediaType != null ? mediaType : mediaType = downloadedFile.mediaType;
|
|
114610
114610
|
}
|
|
114611
114611
|
}
|
|
114612
|
-
switch (
|
|
114612
|
+
switch (type27) {
|
|
114613
114613
|
case "image": {
|
|
114614
114614
|
if (data instanceof Uint8Array || typeof data === "string") {
|
|
114615
114615
|
mediaType = (_a212 = detectMediaType({ data, signatures: imageMediaTypeSignatures })) != null ? _a212 : mediaType;
|
|
@@ -121561,12 +121561,12 @@ function prepareChatTools({
|
|
|
121561
121561
|
if (toolChoice == null) {
|
|
121562
121562
|
return { tools: openaiTools2, toolChoice: void 0, toolWarnings };
|
|
121563
121563
|
}
|
|
121564
|
-
const
|
|
121565
|
-
switch (
|
|
121564
|
+
const type27 = toolChoice.type;
|
|
121565
|
+
switch (type27) {
|
|
121566
121566
|
case "auto":
|
|
121567
121567
|
case "none":
|
|
121568
121568
|
case "required":
|
|
121569
|
-
return { tools: openaiTools2, toolChoice:
|
|
121569
|
+
return { tools: openaiTools2, toolChoice: type27, toolWarnings };
|
|
121570
121570
|
case "tool":
|
|
121571
121571
|
return {
|
|
121572
121572
|
tools: openaiTools2,
|
|
@@ -121579,7 +121579,7 @@ function prepareChatTools({
|
|
|
121579
121579
|
toolWarnings
|
|
121580
121580
|
};
|
|
121581
121581
|
default: {
|
|
121582
|
-
const _exhaustiveCheck =
|
|
121582
|
+
const _exhaustiveCheck = type27;
|
|
121583
121583
|
throw new UnsupportedFunctionalityError({
|
|
121584
121584
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
121585
121585
|
});
|
|
@@ -125136,12 +125136,12 @@ async function prepareResponsesTools({
|
|
|
125136
125136
|
if (toolChoice == null) {
|
|
125137
125137
|
return { tools: openaiTools2, toolChoice: void 0, toolWarnings };
|
|
125138
125138
|
}
|
|
125139
|
-
const
|
|
125140
|
-
switch (
|
|
125139
|
+
const type27 = toolChoice.type;
|
|
125140
|
+
switch (type27) {
|
|
125141
125141
|
case "auto":
|
|
125142
125142
|
case "none":
|
|
125143
125143
|
case "required":
|
|
125144
|
-
return { tools: openaiTools2, toolChoice:
|
|
125144
|
+
return { tools: openaiTools2, toolChoice: type27, toolWarnings };
|
|
125145
125145
|
case "tool": {
|
|
125146
125146
|
const resolvedToolName = (_a51 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _a51 : toolChoice.toolName;
|
|
125147
125147
|
return {
|
|
@@ -125151,7 +125151,7 @@ async function prepareResponsesTools({
|
|
|
125151
125151
|
};
|
|
125152
125152
|
}
|
|
125153
125153
|
default: {
|
|
125154
|
-
const _exhaustiveCheck =
|
|
125154
|
+
const _exhaustiveCheck = type27;
|
|
125155
125155
|
throw new UnsupportedFunctionalityError({
|
|
125156
125156
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
125157
125157
|
});
|
|
@@ -128496,8 +128496,8 @@ async function prepareTools({
|
|
|
128496
128496
|
betas
|
|
128497
128497
|
};
|
|
128498
128498
|
}
|
|
128499
|
-
const
|
|
128500
|
-
switch (
|
|
128499
|
+
const type27 = toolChoice.type;
|
|
128500
|
+
switch (type27) {
|
|
128501
128501
|
case "auto":
|
|
128502
128502
|
return {
|
|
128503
128503
|
tools: anthropicTools2,
|
|
@@ -128532,7 +128532,7 @@ async function prepareTools({
|
|
|
128532
128532
|
betas
|
|
128533
128533
|
};
|
|
128534
128534
|
default: {
|
|
128535
|
-
const _exhaustiveCheck =
|
|
128535
|
+
const _exhaustiveCheck = type27;
|
|
128536
128536
|
throw new UnsupportedFunctionalityError({
|
|
128537
128537
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
128538
128538
|
});
|
|
@@ -128814,8 +128814,8 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
128814
128814
|
for (let i2 = 0; i2 < blocks.length; i2++) {
|
|
128815
128815
|
const block = blocks[i2];
|
|
128816
128816
|
const isLastBlock = i2 === blocks.length - 1;
|
|
128817
|
-
const
|
|
128818
|
-
switch (
|
|
128817
|
+
const type27 = block.type;
|
|
128818
|
+
switch (type27) {
|
|
128819
128819
|
case "system": {
|
|
128820
128820
|
if (system != null) {
|
|
128821
128821
|
throw new UnsupportedFunctionalityError({
|
|
@@ -129487,7 +129487,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
129487
129487
|
break;
|
|
129488
129488
|
}
|
|
129489
129489
|
default: {
|
|
129490
|
-
const _exhaustiveCheck =
|
|
129490
|
+
const _exhaustiveCheck = type27;
|
|
129491
129491
|
throw new Error(`content type: ${_exhaustiveCheck}`);
|
|
129492
129492
|
}
|
|
129493
129493
|
}
|
|
@@ -132095,7 +132095,7 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema2, isRoot = true) {
|
|
|
132095
132095
|
return { type: "boolean", properties: {} };
|
|
132096
132096
|
}
|
|
132097
132097
|
const {
|
|
132098
|
-
type:
|
|
132098
|
+
type: type27,
|
|
132099
132099
|
description,
|
|
132100
132100
|
required: required2,
|
|
132101
132101
|
properties,
|
|
@@ -132115,10 +132115,10 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema2, isRoot = true) {
|
|
|
132115
132115
|
if (constValue !== void 0) {
|
|
132116
132116
|
result.enum = [constValue];
|
|
132117
132117
|
}
|
|
132118
|
-
if (
|
|
132119
|
-
if (Array.isArray(
|
|
132120
|
-
const hasNull =
|
|
132121
|
-
const nonNullTypes =
|
|
132118
|
+
if (type27) {
|
|
132119
|
+
if (Array.isArray(type27)) {
|
|
132120
|
+
const hasNull = type27.includes("null");
|
|
132121
|
+
const nonNullTypes = type27.filter((t4) => t4 !== "null");
|
|
132122
132122
|
if (nonNullTypes.length === 0) {
|
|
132123
132123
|
result.type = "null";
|
|
132124
132124
|
} else {
|
|
@@ -132128,7 +132128,7 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema2, isRoot = true) {
|
|
|
132128
132128
|
}
|
|
132129
132129
|
}
|
|
132130
132130
|
} else {
|
|
132131
|
-
result.type =
|
|
132131
|
+
result.type = type27;
|
|
132132
132132
|
}
|
|
132133
132133
|
}
|
|
132134
132134
|
if (enumValues !== void 0) {
|
|
@@ -132643,8 +132643,8 @@ function prepareTools2({
|
|
|
132643
132643
|
toolWarnings
|
|
132644
132644
|
};
|
|
132645
132645
|
}
|
|
132646
|
-
const
|
|
132647
|
-
switch (
|
|
132646
|
+
const type27 = toolChoice.type;
|
|
132647
|
+
switch (type27) {
|
|
132648
132648
|
case "auto":
|
|
132649
132649
|
return {
|
|
132650
132650
|
tools: [{ functionDeclarations }],
|
|
@@ -132675,7 +132675,7 @@ function prepareTools2({
|
|
|
132675
132675
|
toolWarnings
|
|
132676
132676
|
};
|
|
132677
132677
|
default: {
|
|
132678
|
-
const _exhaustiveCheck =
|
|
132678
|
+
const _exhaustiveCheck = type27;
|
|
132679
132679
|
throw new UnsupportedFunctionalityError({
|
|
132680
132680
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
132681
132681
|
});
|
|
@@ -135074,12 +135074,12 @@ function prepareResponsesTools2({
|
|
|
135074
135074
|
if (toolChoice == null) {
|
|
135075
135075
|
return { tools: ollamaTools, toolChoice: void 0, toolWarnings };
|
|
135076
135076
|
}
|
|
135077
|
-
const
|
|
135078
|
-
switch (
|
|
135077
|
+
const type27 = toolChoice.type;
|
|
135078
|
+
switch (type27) {
|
|
135079
135079
|
case "auto":
|
|
135080
135080
|
case "none":
|
|
135081
135081
|
case "required":
|
|
135082
|
-
return { tools: ollamaTools, toolChoice:
|
|
135082
|
+
return { tools: ollamaTools, toolChoice: type27, toolWarnings };
|
|
135083
135083
|
case "tool":
|
|
135084
135084
|
return {
|
|
135085
135085
|
tools: ollamaTools,
|
|
@@ -135087,7 +135087,7 @@ function prepareResponsesTools2({
|
|
|
135087
135087
|
toolWarnings
|
|
135088
135088
|
};
|
|
135089
135089
|
default: {
|
|
135090
|
-
const _exhaustiveCheck =
|
|
135090
|
+
const _exhaustiveCheck = type27;
|
|
135091
135091
|
throw new UnsupportedFunctionalityError({
|
|
135092
135092
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
135093
135093
|
});
|
|
@@ -135737,12 +135737,12 @@ function prepareTools3({
|
|
|
135737
135737
|
if (toolChoice == null) {
|
|
135738
135738
|
return { tools: openaiCompatTools, toolChoice: void 0, toolWarnings };
|
|
135739
135739
|
}
|
|
135740
|
-
const
|
|
135741
|
-
switch (
|
|
135740
|
+
const type27 = toolChoice.type;
|
|
135741
|
+
switch (type27) {
|
|
135742
135742
|
case "auto":
|
|
135743
135743
|
case "none":
|
|
135744
135744
|
case "required":
|
|
135745
|
-
return { tools: openaiCompatTools, toolChoice:
|
|
135745
|
+
return { tools: openaiCompatTools, toolChoice: type27, toolWarnings };
|
|
135746
135746
|
case "tool":
|
|
135747
135747
|
return {
|
|
135748
135748
|
tools: openaiCompatTools,
|
|
@@ -135753,7 +135753,7 @@ function prepareTools3({
|
|
|
135753
135753
|
toolWarnings
|
|
135754
135754
|
};
|
|
135755
135755
|
default: {
|
|
135756
|
-
const _exhaustiveCheck =
|
|
135756
|
+
const _exhaustiveCheck = type27;
|
|
135757
135757
|
throw new UnsupportedFunctionalityError({
|
|
135758
135758
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
135759
135759
|
});
|
|
@@ -138701,6 +138701,28 @@ var WorkspaceToolCatalogPublish = class extends NatsPublish {
|
|
|
138701
138701
|
};
|
|
138702
138702
|
NatsMessage.register(WorkspaceToolCatalogPublish);
|
|
138703
138703
|
|
|
138704
|
+
// ../common/src/messages/workspace.tool-definitions.publish.ts
|
|
138705
|
+
var type26 = "workspace-tool-definitions";
|
|
138706
|
+
var WorkspaceToolDefinitionsPublish = class extends NatsPublish {
|
|
138707
|
+
constructor() {
|
|
138708
|
+
super(...arguments);
|
|
138709
|
+
this.type = type26;
|
|
138710
|
+
}
|
|
138711
|
+
static {
|
|
138712
|
+
this.type = type26;
|
|
138713
|
+
}
|
|
138714
|
+
validate(data) {
|
|
138715
|
+
return typeof data.workspaceId === "string" && data.workspaceId.length > 0 && Array.isArray(data.tools);
|
|
138716
|
+
}
|
|
138717
|
+
getSubject() {
|
|
138718
|
+
return `${this.data.workspaceId}.${type26}`;
|
|
138719
|
+
}
|
|
138720
|
+
static subscribeToWorkspace(workspaceId) {
|
|
138721
|
+
return `${workspaceId}.${type26}`;
|
|
138722
|
+
}
|
|
138723
|
+
};
|
|
138724
|
+
NatsMessage.register(WorkspaceToolDefinitionsPublish);
|
|
138725
|
+
|
|
138704
138726
|
// ../common/src/graphql/dgraph.resolvers.types.ts
|
|
138705
138727
|
var dgraph_resolvers_types_exports = {};
|
|
138706
138728
|
__export(dgraph_resolvers_types_exports, {
|
|
@@ -141275,10 +141297,10 @@ function parseEnumDef2(def) {
|
|
|
141275
141297
|
}
|
|
141276
141298
|
|
|
141277
141299
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@4.3.6/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
141278
|
-
var isJsonSchema7AllOfType2 = (
|
|
141279
|
-
if ("type" in
|
|
141300
|
+
var isJsonSchema7AllOfType2 = (type27) => {
|
|
141301
|
+
if ("type" in type27 && type27.type === "string")
|
|
141280
141302
|
return false;
|
|
141281
|
-
return "allOf" in
|
|
141303
|
+
return "allOf" in type27;
|
|
141282
141304
|
};
|
|
141283
141305
|
function parseIntersectionDef2(def, refs) {
|
|
141284
141306
|
const allOf = [
|
|
@@ -141691,7 +141713,7 @@ function parseRecordDef2(def, refs) {
|
|
|
141691
141713
|
return schema;
|
|
141692
141714
|
}
|
|
141693
141715
|
if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
141694
|
-
const { type:
|
|
141716
|
+
const { type: type27, ...keyType } = parseStringDef2(def.keyType._def, refs);
|
|
141695
141717
|
return {
|
|
141696
141718
|
...schema,
|
|
141697
141719
|
propertyNames: keyType
|
|
@@ -141704,7 +141726,7 @@ function parseRecordDef2(def, refs) {
|
|
|
141704
141726
|
}
|
|
141705
141727
|
};
|
|
141706
141728
|
} else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
141707
|
-
const { type:
|
|
141729
|
+
const { type: type27, ...keyType } = parseBrandedDef2(def.keyType._def, refs);
|
|
141708
141730
|
return {
|
|
141709
141731
|
...schema,
|
|
141710
141732
|
propertyNames: keyType
|
|
@@ -141786,20 +141808,20 @@ function parseUnionDef2(def, refs) {
|
|
|
141786
141808
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
141787
141809
|
if (options.every((x3) => x3._def.typeName in primitiveMappings2 && (!x3._def.checks || !x3._def.checks.length))) {
|
|
141788
141810
|
const types = options.reduce((types2, x3) => {
|
|
141789
|
-
const
|
|
141790
|
-
return
|
|
141811
|
+
const type27 = primitiveMappings2[x3._def.typeName];
|
|
141812
|
+
return type27 && !types2.includes(type27) ? [...types2, type27] : types2;
|
|
141791
141813
|
}, []);
|
|
141792
141814
|
return {
|
|
141793
141815
|
type: types.length > 1 ? types : types[0]
|
|
141794
141816
|
};
|
|
141795
141817
|
} else if (options.every((x3) => x3._def.typeName === "ZodLiteral" && !x3.description)) {
|
|
141796
141818
|
const types = options.reduce((acc, x3) => {
|
|
141797
|
-
const
|
|
141798
|
-
switch (
|
|
141819
|
+
const type27 = typeof x3._def.value;
|
|
141820
|
+
switch (type27) {
|
|
141799
141821
|
case "string":
|
|
141800
141822
|
case "number":
|
|
141801
141823
|
case "boolean":
|
|
141802
|
-
return [...acc,
|
|
141824
|
+
return [...acc, type27];
|
|
141803
141825
|
case "bigint":
|
|
141804
141826
|
return [...acc, "integer"];
|
|
141805
141827
|
case "object":
|
|
@@ -144577,12 +144599,17 @@ var __param9 = function(paramIndex, decorator) {
|
|
|
144577
144599
|
var _a31;
|
|
144578
144600
|
var _b25;
|
|
144579
144601
|
var DEFAULT_AWAIT_CATALOG_TIMEOUT_MS = 5e3;
|
|
144602
|
+
var WATCHER_RECONNECT_DELAY_MS = 5e3;
|
|
144580
144603
|
var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
144581
144604
|
constructor(loggerService, cacheService) {
|
|
144582
144605
|
this.cacheService = cacheService;
|
|
144583
144606
|
this.subjects = /* @__PURE__ */ new Map();
|
|
144607
|
+
this.toolDefsSubjects = /* @__PURE__ */ new Map();
|
|
144584
144608
|
this.watchSubscriptions = /* @__PURE__ */ new Map();
|
|
144609
|
+
this.toolDefsWatchSubscriptions = /* @__PURE__ */ new Map();
|
|
144585
144610
|
this.watching = /* @__PURE__ */ new Set();
|
|
144611
|
+
this.watchingToolDefs = /* @__PURE__ */ new Set();
|
|
144612
|
+
this.stopped = false;
|
|
144586
144613
|
this.logger = loggerService.getLogger("runtime-catalog");
|
|
144587
144614
|
}
|
|
144588
144615
|
getSubject(workspaceId) {
|
|
@@ -144591,13 +144618,26 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144591
144618
|
}
|
|
144592
144619
|
return this.subjects.get(workspaceId);
|
|
144593
144620
|
}
|
|
144621
|
+
getToolDefsSubject(workspaceId) {
|
|
144622
|
+
if (!this.toolDefsSubjects.has(workspaceId)) {
|
|
144623
|
+
this.toolDefsSubjects.set(workspaceId, new import_rxjs.BehaviorSubject([]));
|
|
144624
|
+
}
|
|
144625
|
+
return this.toolDefsSubjects.get(workspaceId);
|
|
144626
|
+
}
|
|
144594
144627
|
observeCatalog(workspaceId) {
|
|
144595
144628
|
this.ensureWatching(workspaceId);
|
|
144596
144629
|
return this.getSubject(workspaceId).pipe((0, import_rxjs.map)((s) => s.catalog));
|
|
144597
144630
|
}
|
|
144631
|
+
observeMcpToolDefinitions(workspaceId) {
|
|
144632
|
+
this.ensureWatchingToolDefs(workspaceId);
|
|
144633
|
+
return this.getToolDefsSubject(workspaceId).asObservable();
|
|
144634
|
+
}
|
|
144598
144635
|
getCatalog(workspaceId) {
|
|
144599
144636
|
return this.subjects.get(workspaceId)?.getValue().catalog ?? null;
|
|
144600
144637
|
}
|
|
144638
|
+
getMcpToolDefinitions(workspaceId) {
|
|
144639
|
+
return this.toolDefsSubjects.get(workspaceId)?.getValue() ?? [];
|
|
144640
|
+
}
|
|
144601
144641
|
findEntryByToolId(workspaceId, toolId) {
|
|
144602
144642
|
return this.subjects.get(workspaceId)?.getValue().entries.find((e2) => e2.toolId === toolId);
|
|
144603
144643
|
}
|
|
@@ -144608,6 +144648,8 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144608
144648
|
lazyAttach(workspaceId) {
|
|
144609
144649
|
this.getSubject(workspaceId);
|
|
144610
144650
|
this.ensureWatching(workspaceId);
|
|
144651
|
+
this.getToolDefsSubject(workspaceId);
|
|
144652
|
+
this.ensureWatchingToolDefs(workspaceId);
|
|
144611
144653
|
}
|
|
144612
144654
|
/** Returns the current catalog if cached; otherwise waits up to `timeoutMs` for the watcher's
|
|
144613
144655
|
* first delivery (NATS KV watch replays history on attach, so a published catalog arrives
|
|
@@ -144628,6 +144670,7 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144628
144670
|
}
|
|
144629
144671
|
}
|
|
144630
144672
|
stopAll() {
|
|
144673
|
+
this.stopped = true;
|
|
144631
144674
|
for (const [workspaceId, subscription] of this.watchSubscriptions) {
|
|
144632
144675
|
try {
|
|
144633
144676
|
subscription.unsubscribe();
|
|
@@ -144641,6 +144684,19 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144641
144684
|
subject.complete();
|
|
144642
144685
|
}
|
|
144643
144686
|
this.subjects.clear();
|
|
144687
|
+
for (const [workspaceId, subscription] of this.toolDefsWatchSubscriptions) {
|
|
144688
|
+
try {
|
|
144689
|
+
subscription.unsubscribe();
|
|
144690
|
+
} catch (err) {
|
|
144691
|
+
this.logger.warn({ event: "tool_defs_watcher_stop_failed", workspaceId, err }, "Failed to stop tool defs watcher");
|
|
144692
|
+
}
|
|
144693
|
+
}
|
|
144694
|
+
this.toolDefsWatchSubscriptions.clear();
|
|
144695
|
+
this.watchingToolDefs.clear();
|
|
144696
|
+
for (const subject of this.toolDefsSubjects.values()) {
|
|
144697
|
+
subject.complete();
|
|
144698
|
+
}
|
|
144699
|
+
this.toolDefsSubjects.clear();
|
|
144644
144700
|
}
|
|
144645
144701
|
/** Idempotent — only one watcher per workspaceId. On failure, removes from the watching
|
|
144646
144702
|
* set so the next access retries. */
|
|
@@ -144653,6 +144709,15 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144653
144709
|
this.logger.error({ event: "catalog_watcher_died", workspaceId, err }, "Workspace catalog watcher died unexpectedly \u2014 will retry on next access");
|
|
144654
144710
|
});
|
|
144655
144711
|
}
|
|
144712
|
+
ensureWatchingToolDefs(workspaceId) {
|
|
144713
|
+
if (this.watchingToolDefs.has(workspaceId))
|
|
144714
|
+
return;
|
|
144715
|
+
this.watchingToolDefs.add(workspaceId);
|
|
144716
|
+
this.startWatchingToolDefs(workspaceId).catch((err) => {
|
|
144717
|
+
this.watchingToolDefs.delete(workspaceId);
|
|
144718
|
+
this.logger.error({ event: "tool_defs_watcher_died", workspaceId, err }, "Workspace tool definitions watcher died unexpectedly \u2014 will retry on next access");
|
|
144719
|
+
});
|
|
144720
|
+
}
|
|
144656
144721
|
async startWatching(workspaceId) {
|
|
144657
144722
|
const key = WorkspaceToolCatalogPublish.subscribeToWorkspace(workspaceId);
|
|
144658
144723
|
this.logger.info({ event: "catalog_watcher_starting", workspaceId, key }, "Starting workspace catalog watcher");
|
|
@@ -144682,8 +144747,54 @@ var RuntimeCatalogService = class RuntimeCatalogService2 {
|
|
|
144682
144747
|
} finally {
|
|
144683
144748
|
this.watching.delete(workspaceId);
|
|
144684
144749
|
this.watchSubscriptions.delete(workspaceId);
|
|
144750
|
+
this.scheduleReconnect(workspaceId, "catalog");
|
|
144685
144751
|
}
|
|
144686
144752
|
}
|
|
144753
|
+
async startWatchingToolDefs(workspaceId) {
|
|
144754
|
+
const key = WorkspaceToolDefinitionsPublish.subscribeToWorkspace(workspaceId);
|
|
144755
|
+
this.logger.info({ event: "tool_defs_watcher_starting", workspaceId, key }, "Starting workspace tool definitions watcher");
|
|
144756
|
+
const subscription = await this.cacheService.watch(CACHE_BUCKETS.EPHEMERAL, { key });
|
|
144757
|
+
this.toolDefsWatchSubscriptions.set(workspaceId, subscription);
|
|
144758
|
+
try {
|
|
144759
|
+
for await (const event of subscription) {
|
|
144760
|
+
try {
|
|
144761
|
+
if (event.operation !== "PUT" || !event.value)
|
|
144762
|
+
continue;
|
|
144763
|
+
const msg = NatsMessage.fromRawData(event.value);
|
|
144764
|
+
if (msg instanceof WorkspaceToolDefinitionsPublish) {
|
|
144765
|
+
this.getToolDefsSubject(workspaceId).next(msg.data.tools ?? []);
|
|
144766
|
+
this.logger.info({ event: "tool_defs_updated", workspaceId, toolCount: msg.data.tools?.length ?? 0 }, "Updated workspace MCP tool definitions");
|
|
144767
|
+
} else if (msg instanceof ErrorResponse) {
|
|
144768
|
+
this.logger.error({ event: "tool_defs_parse_error", workspaceId, error: msg.data.error }, "Failed to parse workspace tool definitions");
|
|
144769
|
+
} else {
|
|
144770
|
+
this.logger.warn({ event: "tool_defs_unknown_message", workspaceId, msgType: msg?.type ?? "unknown" }, "Unexpected message type on workspace tool definitions subject");
|
|
144771
|
+
}
|
|
144772
|
+
} catch (err) {
|
|
144773
|
+
this.logger.error({ event: "tool_defs_event_error", workspaceId, err }, "Error processing tool definitions event");
|
|
144774
|
+
}
|
|
144775
|
+
}
|
|
144776
|
+
} finally {
|
|
144777
|
+
this.watchingToolDefs.delete(workspaceId);
|
|
144778
|
+
this.toolDefsWatchSubscriptions.delete(workspaceId);
|
|
144779
|
+
this.scheduleReconnect(workspaceId, "toolDefs");
|
|
144780
|
+
}
|
|
144781
|
+
}
|
|
144782
|
+
/** A NATS KV watcher exiting (clean close or error) leaves the runtime with stale data for
|
|
144783
|
+
* the lifetime of the process. Re-attach after a short delay so the runtime self-heals. */
|
|
144784
|
+
scheduleReconnect(workspaceId, kind) {
|
|
144785
|
+
if (this.stopped)
|
|
144786
|
+
return;
|
|
144787
|
+
this.logger.warn({ event: "watcher_exited", workspaceId, kind }, `Workspace ${kind} watcher exited \u2014 reconnecting in ${WATCHER_RECONNECT_DELAY_MS} ms`);
|
|
144788
|
+
setTimeout(() => {
|
|
144789
|
+
if (this.stopped)
|
|
144790
|
+
return;
|
|
144791
|
+
if (kind === "catalog") {
|
|
144792
|
+
this.ensureWatching(workspaceId);
|
|
144793
|
+
} else {
|
|
144794
|
+
this.ensureWatchingToolDefs(workspaceId);
|
|
144795
|
+
}
|
|
144796
|
+
}, WATCHER_RECONNECT_DELAY_MS);
|
|
144797
|
+
}
|
|
144687
144798
|
};
|
|
144688
144799
|
RuntimeCatalogService = __decorate10([
|
|
144689
144800
|
W(),
|
|
@@ -145893,15 +146004,15 @@ var _f;
|
|
|
145893
146004
|
var _g;
|
|
145894
146005
|
var _h;
|
|
145895
146006
|
function buildSkillToolMap(catalog) {
|
|
145896
|
-
const
|
|
146007
|
+
const map4 = /* @__PURE__ */ new Map();
|
|
145897
146008
|
if (!catalog)
|
|
145898
|
-
return
|
|
146009
|
+
return map4;
|
|
145899
146010
|
for (const skill of catalog.skills) {
|
|
145900
146011
|
for (const toolName of skill.toolNames) {
|
|
145901
|
-
|
|
146012
|
+
map4.set(toolName, skill.id);
|
|
145902
146013
|
}
|
|
145903
146014
|
}
|
|
145904
|
-
return
|
|
146015
|
+
return map4;
|
|
145905
146016
|
}
|
|
145906
146017
|
var SkillService = class SkillService2 extends LifecycleService {
|
|
145907
146018
|
constructor(loggerService, natsService, cacheService, identity, scriptService, delegateService, fileService, skillContentService, staticToolRegistry, runtimeCatalogService) {
|
|
@@ -145919,15 +146030,20 @@ var SkillService = class SkillService2 extends LifecycleService {
|
|
|
145919
146030
|
this.name = "skill";
|
|
145920
146031
|
this.tools = new import_rxjs2.BehaviorSubject(null);
|
|
145921
146032
|
this.currentCacheSubscription = null;
|
|
146033
|
+
this.toolDefsRxSubscription = null;
|
|
146034
|
+
this.toolDefsActive = false;
|
|
145922
146035
|
this.logger = this.loggerService.getLogger(`${this.name}`);
|
|
145923
146036
|
}
|
|
145924
146037
|
async initialize() {
|
|
145925
146038
|
this.logger.info(`Starting skill service for ${this.identity.name}`);
|
|
145926
146039
|
this.runtimeCatalogService?.lazyAttach(this.identity.workspaceId);
|
|
146040
|
+
this.subscribeToToolDefs();
|
|
145927
146041
|
await this.subscribeToTools();
|
|
145928
146042
|
}
|
|
145929
146043
|
async shutdown() {
|
|
145930
146044
|
this.logger.info(`Stopping skill service for ${this.identity.name}`);
|
|
146045
|
+
this.toolDefsRxSubscription?.unsubscribe();
|
|
146046
|
+
this.toolDefsRxSubscription = null;
|
|
145931
146047
|
this.unsubscribeCurrent();
|
|
145932
146048
|
}
|
|
145933
146049
|
unsubscribeCurrent() {
|
|
@@ -145941,6 +146057,40 @@ var SkillService = class SkillService2 extends LifecycleService {
|
|
|
145941
146057
|
this.logger.warn(`Failed to unsubscribe from cache: ${error48}`);
|
|
145942
146058
|
}
|
|
145943
146059
|
}
|
|
146060
|
+
/** Subscribes to workspace tool definitions from RuntimeCatalogService. When tool defs arrive
|
|
146061
|
+
* (on connect or on catalog change), recomputes this.tools from static tools + new defs.
|
|
146062
|
+
* This is the primary path for new runtimes; the legacy UserListToolsPublish watcher remains
|
|
146063
|
+
* as a fallback for backward compatibility with old backend versions. */
|
|
146064
|
+
subscribeToToolDefs() {
|
|
146065
|
+
if (!this.runtimeCatalogService)
|
|
146066
|
+
return;
|
|
146067
|
+
const toolDefs$ = this.runtimeCatalogService.observeMcpToolDefinitions(this.identity.workspaceId);
|
|
146068
|
+
this.toolDefsRxSubscription = toolDefs$.pipe((0, import_rxjs2.skip)(1), (0, import_rxjs2.map)((defs) => this.buildToolsFromDefs(defs))).subscribe({
|
|
146069
|
+
next: (tools) => {
|
|
146070
|
+
this.toolDefsActive = true;
|
|
146071
|
+
this.tools.next(tools);
|
|
146072
|
+
this.logger.debug(`Updated ${tools.length - this.prepareStaticTools().length} mcp tools from workspace tool definitions for workspace ${this.identity.workspaceId}`);
|
|
146073
|
+
},
|
|
146074
|
+
error: (err) => {
|
|
146075
|
+
this.logger.error({ event: "tool_defs_subscription_error", err }, "Tool definitions subscription errored");
|
|
146076
|
+
}
|
|
146077
|
+
});
|
|
146078
|
+
}
|
|
146079
|
+
buildToolsFromDefs(defs) {
|
|
146080
|
+
const mcpTools = defs.map((def) => ({
|
|
146081
|
+
name: def.name,
|
|
146082
|
+
title: def.name,
|
|
146083
|
+
description: def.description,
|
|
146084
|
+
inputSchema: def.inputSchema,
|
|
146085
|
+
annotations: def.annotations,
|
|
146086
|
+
__routing: {
|
|
146087
|
+
type: "mcp-tool",
|
|
146088
|
+
workspaceId: this.identity.workspaceId,
|
|
146089
|
+
id: def.id
|
|
146090
|
+
}
|
|
146091
|
+
}));
|
|
146092
|
+
return [...this.prepareStaticTools(), ...mcpTools];
|
|
146093
|
+
}
|
|
145944
146094
|
async subscribeToTools() {
|
|
145945
146095
|
this.unsubscribeCurrent();
|
|
145946
146096
|
const userSubject = UserListToolsPublish.subscribeToUser(this.identity.id, this.identity.workspaceId);
|
|
@@ -145956,6 +146106,10 @@ var SkillService = class SkillService2 extends LifecycleService {
|
|
|
145956
146106
|
}
|
|
145957
146107
|
const message = NatsMessage.fromRawData(event.value);
|
|
145958
146108
|
if (message instanceof UserListToolsPublish) {
|
|
146109
|
+
if (this.toolDefsActive) {
|
|
146110
|
+
this.logger.debug(`Ignoring legacy UserListToolsPublish (${message.data.mcpTools.length} tools) \u2014 tool-defs path is authoritative`);
|
|
146111
|
+
continue;
|
|
146112
|
+
}
|
|
145959
146113
|
const mcpTools = message.data.mcpTools.map((tool2) => this.parseMcpTool(tool2));
|
|
145960
146114
|
const staticTools = this.prepareStaticTools();
|
|
145961
146115
|
this.tools.next([...staticTools, ...mcpTools]);
|
|
@@ -151810,8 +151964,8 @@ function extractWWWAuthenticateParams(res) {
|
|
|
151810
151964
|
if (!authenticateHeader) {
|
|
151811
151965
|
return {};
|
|
151812
151966
|
}
|
|
151813
|
-
const [
|
|
151814
|
-
if (
|
|
151967
|
+
const [type27, scheme] = authenticateHeader.split(" ");
|
|
151968
|
+
if (type27.toLowerCase() !== "bearer" || !scheme) {
|
|
151815
151969
|
return {};
|
|
151816
151970
|
}
|
|
151817
151971
|
const resourceMetadataMatch = extractFieldFromWwwAuth(res, "resource_metadata") || void 0;
|
|
@@ -151943,7 +152097,7 @@ async function discoverAuthorizationServerMetadata2(authorizationServerUrl, { fe
|
|
|
151943
152097
|
Accept: "application/json"
|
|
151944
152098
|
};
|
|
151945
152099
|
const urlsToTry = buildDiscoveryUrls2(authorizationServerUrl);
|
|
151946
|
-
for (const { url: endpointUrl, type:
|
|
152100
|
+
for (const { url: endpointUrl, type: type27 } of urlsToTry) {
|
|
151947
152101
|
const response = await fetchWithCorsRetry2(endpointUrl, headers, fetchFn);
|
|
151948
152102
|
if (!response) {
|
|
151949
152103
|
continue;
|
|
@@ -151953,9 +152107,9 @@ async function discoverAuthorizationServerMetadata2(authorizationServerUrl, { fe
|
|
|
151953
152107
|
if (response.status >= 400 && response.status < 500) {
|
|
151954
152108
|
continue;
|
|
151955
152109
|
}
|
|
151956
|
-
throw new Error(`HTTP ${response.status} trying to load ${
|
|
152110
|
+
throw new Error(`HTTP ${response.status} trying to load ${type27 === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
|
|
151957
152111
|
}
|
|
151958
|
-
if (
|
|
152112
|
+
if (type27 === "oauth") {
|
|
151959
152113
|
return OAuthMetadataSchema2.parse(await response.json());
|
|
151960
152114
|
} else {
|
|
151961
152115
|
return OpenIdProviderDiscoveryMetadataSchema2.parse(await response.json());
|
|
@@ -152521,9 +152675,9 @@ var ErrorEvent = class extends Event {
|
|
|
152521
152675
|
* @param type - The type of the event (should be "error")
|
|
152522
152676
|
* @param errorEventInitDict - Optional properties to include in the error event
|
|
152523
152677
|
*/
|
|
152524
|
-
constructor(
|
|
152678
|
+
constructor(type27, errorEventInitDict) {
|
|
152525
152679
|
var _a51, _b41;
|
|
152526
|
-
super(
|
|
152680
|
+
super(type27), this.code = (_a51 = errorEventInitDict == null ? void 0 : errorEventInitDict.code) != null ? _a51 : void 0, this.message = (_b41 = errorEventInitDict == null ? void 0 : errorEventInitDict.message) != null ? _b41 : void 0;
|
|
152527
152681
|
}
|
|
152528
152682
|
/**
|
|
152529
152683
|
* Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,
|
|
@@ -152718,13 +152872,13 @@ var EventSource = class extends EventTarget {
|
|
|
152718
152872
|
set onopen(value) {
|
|
152719
152873
|
__privateSet(this, _onOpen, value);
|
|
152720
152874
|
}
|
|
152721
|
-
addEventListener(
|
|
152875
|
+
addEventListener(type27, listener, options) {
|
|
152722
152876
|
const listen = listener;
|
|
152723
|
-
super.addEventListener(
|
|
152877
|
+
super.addEventListener(type27, listen, options);
|
|
152724
152878
|
}
|
|
152725
|
-
removeEventListener(
|
|
152879
|
+
removeEventListener(type27, listener, options) {
|
|
152726
152880
|
const listen = listener;
|
|
152727
|
-
super.removeEventListener(
|
|
152881
|
+
super.removeEventListener(type27, listen, options);
|
|
152728
152882
|
}
|
|
152729
152883
|
/**
|
|
152730
152884
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|