@settlemint/sdk-mcp 2.6.2-prdbaefab2 → 2.6.2-prdd413399
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/mcp.js +478 -400
- package/dist/mcp.js.map +13 -14
- package/package.json +6 -6
package/dist/mcp.js
CHANGED
|
@@ -17550,7 +17550,7 @@ var require_main2 = __commonJS((exports, module) => {
|
|
|
17550
17550
|
};
|
|
17551
17551
|
});
|
|
17552
17552
|
|
|
17553
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
17553
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/error.js
|
|
17554
17554
|
var require_error = __commonJS((exports) => {
|
|
17555
17555
|
class CommanderError extends Error {
|
|
17556
17556
|
constructor(exitCode, code, message) {
|
|
@@ -17574,7 +17574,7 @@ var require_error = __commonJS((exports) => {
|
|
|
17574
17574
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
17575
17575
|
});
|
|
17576
17576
|
|
|
17577
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
17577
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/argument.js
|
|
17578
17578
|
var require_argument = __commonJS((exports) => {
|
|
17579
17579
|
var { InvalidArgumentError } = require_error();
|
|
17580
17580
|
|
|
@@ -17600,7 +17600,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
17600
17600
|
this._name = name;
|
|
17601
17601
|
break;
|
|
17602
17602
|
}
|
|
17603
|
-
if (this._name.
|
|
17603
|
+
if (this._name.endsWith("...")) {
|
|
17604
17604
|
this.variadic = true;
|
|
17605
17605
|
this._name = this._name.slice(0, -3);
|
|
17606
17606
|
}
|
|
@@ -17608,11 +17608,12 @@ var require_argument = __commonJS((exports) => {
|
|
|
17608
17608
|
name() {
|
|
17609
17609
|
return this._name;
|
|
17610
17610
|
}
|
|
17611
|
-
|
|
17611
|
+
_collectValue(value, previous) {
|
|
17612
17612
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
17613
17613
|
return [value];
|
|
17614
17614
|
}
|
|
17615
|
-
|
|
17615
|
+
previous.push(value);
|
|
17616
|
+
return previous;
|
|
17616
17617
|
}
|
|
17617
17618
|
default(value, description) {
|
|
17618
17619
|
this.defaultValue = value;
|
|
@@ -17630,7 +17631,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
17630
17631
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
17631
17632
|
}
|
|
17632
17633
|
if (this.variadic) {
|
|
17633
|
-
return this.
|
|
17634
|
+
return this._collectValue(arg, previous);
|
|
17634
17635
|
}
|
|
17635
17636
|
return arg;
|
|
17636
17637
|
};
|
|
@@ -17653,7 +17654,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
17653
17654
|
exports.humanReadableArgName = humanReadableArgName;
|
|
17654
17655
|
});
|
|
17655
17656
|
|
|
17656
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
17657
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/help.js
|
|
17657
17658
|
var require_help = __commonJS((exports) => {
|
|
17658
17659
|
var { humanReadableArgName } = require_argument();
|
|
17659
17660
|
|
|
@@ -18010,7 +18011,7 @@ ${itemIndentStr}`);
|
|
|
18010
18011
|
exports.stripColor = stripColor;
|
|
18011
18012
|
});
|
|
18012
18013
|
|
|
18013
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
18014
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/option.js
|
|
18014
18015
|
var require_option = __commonJS((exports) => {
|
|
18015
18016
|
var { InvalidArgumentError } = require_error();
|
|
18016
18017
|
|
|
@@ -18077,11 +18078,12 @@ var require_option = __commonJS((exports) => {
|
|
|
18077
18078
|
this.hidden = !!hide;
|
|
18078
18079
|
return this;
|
|
18079
18080
|
}
|
|
18080
|
-
|
|
18081
|
+
_collectValue(value, previous) {
|
|
18081
18082
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
18082
18083
|
return [value];
|
|
18083
18084
|
}
|
|
18084
|
-
|
|
18085
|
+
previous.push(value);
|
|
18086
|
+
return previous;
|
|
18085
18087
|
}
|
|
18086
18088
|
choices(values) {
|
|
18087
18089
|
this.argChoices = values.slice();
|
|
@@ -18090,7 +18092,7 @@ var require_option = __commonJS((exports) => {
|
|
|
18090
18092
|
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
18091
18093
|
}
|
|
18092
18094
|
if (this.variadic) {
|
|
18093
|
-
return this.
|
|
18095
|
+
return this._collectValue(arg, previous);
|
|
18094
18096
|
}
|
|
18095
18097
|
return arg;
|
|
18096
18098
|
};
|
|
@@ -18193,7 +18195,7 @@ var require_option = __commonJS((exports) => {
|
|
|
18193
18195
|
exports.DualOptions = DualOptions;
|
|
18194
18196
|
});
|
|
18195
18197
|
|
|
18196
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
18198
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/suggestSimilar.js
|
|
18197
18199
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
18198
18200
|
var maxDistance = 3;
|
|
18199
18201
|
function editDistance(a, b) {
|
|
@@ -18266,7 +18268,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
18266
18268
|
exports.suggestSimilar = suggestSimilar;
|
|
18267
18269
|
});
|
|
18268
18270
|
|
|
18269
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
18271
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/lib/command.js
|
|
18270
18272
|
var require_command = __commonJS((exports) => {
|
|
18271
18273
|
var EventEmitter2 = __require("node:events").EventEmitter;
|
|
18272
18274
|
var childProcess = __require("node:child_process");
|
|
@@ -18396,7 +18398,10 @@ var require_command = __commonJS((exports) => {
|
|
|
18396
18398
|
configureOutput(configuration) {
|
|
18397
18399
|
if (configuration === undefined)
|
|
18398
18400
|
return this._outputConfiguration;
|
|
18399
|
-
this._outputConfiguration =
|
|
18401
|
+
this._outputConfiguration = {
|
|
18402
|
+
...this._outputConfiguration,
|
|
18403
|
+
...configuration
|
|
18404
|
+
};
|
|
18400
18405
|
return this;
|
|
18401
18406
|
}
|
|
18402
18407
|
showHelpAfterError(displayHelp = true) {
|
|
@@ -18445,7 +18450,7 @@ var require_command = __commonJS((exports) => {
|
|
|
18445
18450
|
}
|
|
18446
18451
|
addArgument(argument) {
|
|
18447
18452
|
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
18448
|
-
if (previousArgument
|
|
18453
|
+
if (previousArgument?.variadic) {
|
|
18449
18454
|
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
18450
18455
|
}
|
|
18451
18456
|
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
@@ -18600,7 +18605,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
18600
18605
|
if (val !== null && option.parseArg) {
|
|
18601
18606
|
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
18602
18607
|
} else if (val !== null && option.variadic) {
|
|
18603
|
-
val = option.
|
|
18608
|
+
val = option._collectValue(val, oldValue);
|
|
18604
18609
|
}
|
|
18605
18610
|
if (val == null) {
|
|
18606
18611
|
if (option.negate) {
|
|
@@ -18975,7 +18980,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
18975
18980
|
this.processedArgs = processedArgs;
|
|
18976
18981
|
}
|
|
18977
18982
|
_chainOrCall(promise3, fn) {
|
|
18978
|
-
if (promise3
|
|
18983
|
+
if (promise3?.then && typeof promise3.then === "function") {
|
|
18979
18984
|
return promise3.then(() => fn());
|
|
18980
18985
|
}
|
|
18981
18986
|
return fn();
|
|
@@ -19052,7 +19057,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19052
19057
|
promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
|
|
19053
19058
|
return promiseChain;
|
|
19054
19059
|
}
|
|
19055
|
-
if (this.parent
|
|
19060
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
19056
19061
|
checkForUnknownOptions();
|
|
19057
19062
|
this._processArguments();
|
|
19058
19063
|
this.parent.emit(commandEvent, operands, unknown3);
|
|
@@ -19114,11 +19119,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19114
19119
|
cmd._checkForConflictingLocalOptions();
|
|
19115
19120
|
});
|
|
19116
19121
|
}
|
|
19117
|
-
parseOptions(
|
|
19122
|
+
parseOptions(args) {
|
|
19118
19123
|
const operands = [];
|
|
19119
19124
|
const unknown3 = [];
|
|
19120
19125
|
let dest = operands;
|
|
19121
|
-
const args = argv.slice();
|
|
19122
19126
|
function maybeOption(arg) {
|
|
19123
19127
|
return arg.length > 1 && arg[0] === "-";
|
|
19124
19128
|
}
|
|
@@ -19128,12 +19132,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19128
19132
|
return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
|
|
19129
19133
|
};
|
|
19130
19134
|
let activeVariadicOption = null;
|
|
19131
|
-
|
|
19132
|
-
|
|
19135
|
+
let activeGroup = null;
|
|
19136
|
+
let i = 0;
|
|
19137
|
+
while (i < args.length || activeGroup) {
|
|
19138
|
+
const arg = activeGroup ?? args[i++];
|
|
19139
|
+
activeGroup = null;
|
|
19133
19140
|
if (arg === "--") {
|
|
19134
19141
|
if (dest === unknown3)
|
|
19135
19142
|
dest.push(arg);
|
|
19136
|
-
dest.push(...args);
|
|
19143
|
+
dest.push(...args.slice(i));
|
|
19137
19144
|
break;
|
|
19138
19145
|
}
|
|
19139
19146
|
if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
|
|
@@ -19145,14 +19152,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19145
19152
|
const option = this._findOption(arg);
|
|
19146
19153
|
if (option) {
|
|
19147
19154
|
if (option.required) {
|
|
19148
|
-
const value = args
|
|
19155
|
+
const value = args[i++];
|
|
19149
19156
|
if (value === undefined)
|
|
19150
19157
|
this.optionMissingArgument(option);
|
|
19151
19158
|
this.emit(`option:${option.name()}`, value);
|
|
19152
19159
|
} else if (option.optional) {
|
|
19153
19160
|
let value = null;
|
|
19154
|
-
if (args.length
|
|
19155
|
-
value = args
|
|
19161
|
+
if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
|
|
19162
|
+
value = args[i++];
|
|
19156
19163
|
}
|
|
19157
19164
|
this.emit(`option:${option.name()}`, value);
|
|
19158
19165
|
} else {
|
|
@@ -19169,7 +19176,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19169
19176
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
19170
19177
|
} else {
|
|
19171
19178
|
this.emit(`option:${option.name()}`);
|
|
19172
|
-
|
|
19179
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
19173
19180
|
}
|
|
19174
19181
|
continue;
|
|
19175
19182
|
}
|
|
@@ -19188,25 +19195,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19188
19195
|
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown3.length === 0) {
|
|
19189
19196
|
if (this._findCommand(arg)) {
|
|
19190
19197
|
operands.push(arg);
|
|
19191
|
-
|
|
19192
|
-
unknown3.push(...args);
|
|
19198
|
+
unknown3.push(...args.slice(i));
|
|
19193
19199
|
break;
|
|
19194
19200
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
19195
|
-
operands.push(arg);
|
|
19196
|
-
if (args.length > 0)
|
|
19197
|
-
operands.push(...args);
|
|
19201
|
+
operands.push(arg, ...args.slice(i));
|
|
19198
19202
|
break;
|
|
19199
19203
|
} else if (this._defaultCommandName) {
|
|
19200
|
-
unknown3.push(arg);
|
|
19201
|
-
if (args.length > 0)
|
|
19202
|
-
unknown3.push(...args);
|
|
19204
|
+
unknown3.push(arg, ...args.slice(i));
|
|
19203
19205
|
break;
|
|
19204
19206
|
}
|
|
19205
19207
|
}
|
|
19206
19208
|
if (this._passThroughOptions) {
|
|
19207
|
-
dest.push(arg);
|
|
19208
|
-
if (args.length > 0)
|
|
19209
|
-
dest.push(...args);
|
|
19209
|
+
dest.push(arg, ...args.slice(i));
|
|
19210
19210
|
break;
|
|
19211
19211
|
}
|
|
19212
19212
|
dest.push(arg);
|
|
@@ -19623,7 +19623,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
19623
19623
|
exports.useColor = useColor;
|
|
19624
19624
|
});
|
|
19625
19625
|
|
|
19626
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
19626
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/index.js
|
|
19627
19627
|
var require_commander = __commonJS((exports) => {
|
|
19628
19628
|
var { Argument } = require_argument();
|
|
19629
19629
|
var { Command } = require_command();
|
|
@@ -48436,7 +48436,7 @@ var coerce = {
|
|
|
48436
48436
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
48437
48437
|
};
|
|
48438
48438
|
var NEVER = INVALID;
|
|
48439
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
48439
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
48440
48440
|
var LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
48441
48441
|
var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
48442
48442
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -48517,12 +48517,19 @@ var CancelledNotificationSchema = NotificationSchema.extend({
|
|
|
48517
48517
|
reason: exports_external.string().optional()
|
|
48518
48518
|
})
|
|
48519
48519
|
});
|
|
48520
|
+
var IconSchema = exports_external.object({
|
|
48521
|
+
src: exports_external.string(),
|
|
48522
|
+
mimeType: exports_external.optional(exports_external.string()),
|
|
48523
|
+
sizes: exports_external.optional(exports_external.string())
|
|
48524
|
+
}).passthrough();
|
|
48520
48525
|
var BaseMetadataSchema = exports_external.object({
|
|
48521
48526
|
name: exports_external.string(),
|
|
48522
48527
|
title: exports_external.optional(exports_external.string())
|
|
48523
48528
|
}).passthrough();
|
|
48524
48529
|
var ImplementationSchema = BaseMetadataSchema.extend({
|
|
48525
|
-
version: exports_external.string()
|
|
48530
|
+
version: exports_external.string(),
|
|
48531
|
+
websiteUrl: exports_external.optional(exports_external.string()),
|
|
48532
|
+
icons: exports_external.optional(exports_external.array(IconSchema))
|
|
48526
48533
|
});
|
|
48527
48534
|
var ClientCapabilitiesSchema = exports_external.object({
|
|
48528
48535
|
experimental: exports_external.optional(exports_external.object({}).passthrough()),
|
|
@@ -48609,6 +48616,7 @@ var ResourceSchema = BaseMetadataSchema.extend({
|
|
|
48609
48616
|
uri: exports_external.string(),
|
|
48610
48617
|
description: exports_external.optional(exports_external.string()),
|
|
48611
48618
|
mimeType: exports_external.optional(exports_external.string()),
|
|
48619
|
+
icons: exports_external.optional(exports_external.array(IconSchema)),
|
|
48612
48620
|
_meta: exports_external.optional(exports_external.object({}).passthrough())
|
|
48613
48621
|
});
|
|
48614
48622
|
var ResourceTemplateSchema = BaseMetadataSchema.extend({
|
|
@@ -48667,6 +48675,7 @@ var PromptArgumentSchema = exports_external.object({
|
|
|
48667
48675
|
var PromptSchema = BaseMetadataSchema.extend({
|
|
48668
48676
|
description: exports_external.optional(exports_external.string()),
|
|
48669
48677
|
arguments: exports_external.optional(exports_external.array(PromptArgumentSchema)),
|
|
48678
|
+
icons: exports_external.optional(exports_external.array(IconSchema)),
|
|
48670
48679
|
_meta: exports_external.optional(exports_external.object({}).passthrough())
|
|
48671
48680
|
});
|
|
48672
48681
|
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
@@ -48745,6 +48754,7 @@ var ToolSchema = BaseMetadataSchema.extend({
|
|
|
48745
48754
|
required: exports_external.optional(exports_external.array(exports_external.string()))
|
|
48746
48755
|
}).passthrough()),
|
|
48747
48756
|
annotations: exports_external.optional(ToolAnnotationsSchema),
|
|
48757
|
+
icons: exports_external.optional(exports_external.array(IconSchema)),
|
|
48748
48758
|
_meta: exports_external.optional(exports_external.object({}).passthrough())
|
|
48749
48759
|
});
|
|
48750
48760
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
@@ -48986,7 +48996,7 @@ class McpError extends Error {
|
|
|
48986
48996
|
}
|
|
48987
48997
|
}
|
|
48988
48998
|
|
|
48989
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
48999
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
48990
49000
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
48991
49001
|
|
|
48992
49002
|
class Protocol {
|
|
@@ -49326,7 +49336,7 @@ function mergeCapabilities(base, additional) {
|
|
|
49326
49336
|
}, { ...base });
|
|
49327
49337
|
}
|
|
49328
49338
|
|
|
49329
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
49339
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
49330
49340
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
49331
49341
|
|
|
49332
49342
|
class Server extends Protocol {
|
|
@@ -49353,7 +49363,7 @@ class Server extends Protocol {
|
|
|
49353
49363
|
const transportSessionId = extra.sessionId || ((_a2 = extra.requestInfo) === null || _a2 === undefined ? undefined : _a2.headers["mcp-session-id"]) || undefined;
|
|
49354
49364
|
const { level } = request.params;
|
|
49355
49365
|
const parseResult = LoggingLevelSchema.safeParse(level);
|
|
49356
|
-
if (
|
|
49366
|
+
if (parseResult.success) {
|
|
49357
49367
|
this._loggingLevels.set(transportSessionId, parseResult.data);
|
|
49358
49368
|
}
|
|
49359
49369
|
return {};
|
|
@@ -49504,7 +49514,7 @@ class Server extends Protocol {
|
|
|
49504
49514
|
}
|
|
49505
49515
|
async sendLoggingMessage(params, sessionId) {
|
|
49506
49516
|
if (this._capabilities.logging) {
|
|
49507
|
-
if (!
|
|
49517
|
+
if (!this.isMessageIgnored(params.level, sessionId)) {
|
|
49508
49518
|
return this.notification({ method: "notifications/message", params });
|
|
49509
49519
|
}
|
|
49510
49520
|
}
|
|
@@ -50764,7 +50774,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
50764
50774
|
}
|
|
50765
50775
|
return combined;
|
|
50766
50776
|
};
|
|
50767
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
50777
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
50768
50778
|
var McpZodTypeKind;
|
|
50769
50779
|
(function(McpZodTypeKind2) {
|
|
50770
50780
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
@@ -50817,7 +50827,7 @@ function processCreateParams2(params) {
|
|
|
50817
50827
|
return { errorMap: customMap, description };
|
|
50818
50828
|
}
|
|
50819
50829
|
|
|
50820
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
50830
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
50821
50831
|
class McpServer {
|
|
50822
50832
|
constructor(serverInfo, options) {
|
|
50823
50833
|
this._registeredResources = {};
|
|
@@ -50856,7 +50866,8 @@ class McpServer {
|
|
|
50856
50866
|
inputSchema: tool.inputSchema ? zodToJsonSchema(tool.inputSchema, {
|
|
50857
50867
|
strictUnions: true
|
|
50858
50868
|
}) : EMPTY_OBJECT_JSON_SCHEMA,
|
|
50859
|
-
annotations: tool.annotations
|
|
50869
|
+
annotations: tool.annotations,
|
|
50870
|
+
_meta: tool._meta
|
|
50860
50871
|
};
|
|
50861
50872
|
if (tool.outputSchema) {
|
|
50862
50873
|
toolDefinition.outputSchema = zodToJsonSchema(tool.outputSchema, { strictUnions: true });
|
|
@@ -51221,13 +51232,14 @@ class McpServer {
|
|
|
51221
51232
|
this._registeredPrompts[name] = registeredPrompt;
|
|
51222
51233
|
return registeredPrompt;
|
|
51223
51234
|
}
|
|
51224
|
-
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, callback) {
|
|
51235
|
+
_createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, _meta, callback) {
|
|
51225
51236
|
const registeredTool = {
|
|
51226
51237
|
title,
|
|
51227
51238
|
description,
|
|
51228
51239
|
inputSchema: inputSchema === undefined ? undefined : exports_external.object(inputSchema),
|
|
51229
51240
|
outputSchema: outputSchema === undefined ? undefined : exports_external.object(outputSchema),
|
|
51230
51241
|
annotations,
|
|
51242
|
+
_meta,
|
|
51231
51243
|
callback,
|
|
51232
51244
|
enabled: true,
|
|
51233
51245
|
disable: () => registeredTool.update({ enabled: false }),
|
|
@@ -51249,6 +51261,8 @@ class McpServer {
|
|
|
51249
51261
|
registeredTool.callback = updates.callback;
|
|
51250
51262
|
if (typeof updates.annotations !== "undefined")
|
|
51251
51263
|
registeredTool.annotations = updates.annotations;
|
|
51264
|
+
if (typeof updates._meta !== "undefined")
|
|
51265
|
+
registeredTool._meta = updates._meta;
|
|
51252
51266
|
if (typeof updates.enabled !== "undefined")
|
|
51253
51267
|
registeredTool.enabled = updates.enabled;
|
|
51254
51268
|
this.sendToolListChanged();
|
|
@@ -51282,14 +51296,14 @@ class McpServer {
|
|
|
51282
51296
|
}
|
|
51283
51297
|
}
|
|
51284
51298
|
const callback = rest[0];
|
|
51285
|
-
return this._createRegisteredTool(name, undefined, description, inputSchema, outputSchema, annotations, callback);
|
|
51299
|
+
return this._createRegisteredTool(name, undefined, description, inputSchema, outputSchema, annotations, undefined, callback);
|
|
51286
51300
|
}
|
|
51287
51301
|
registerTool(name, config, cb) {
|
|
51288
51302
|
if (this._registeredTools[name]) {
|
|
51289
51303
|
throw new Error(`Tool ${name} is already registered`);
|
|
51290
51304
|
}
|
|
51291
|
-
const { title, description, inputSchema, outputSchema, annotations } = config;
|
|
51292
|
-
return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, cb);
|
|
51305
|
+
const { title, description, inputSchema, outputSchema, annotations, _meta } = config;
|
|
51306
|
+
return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, _meta, cb);
|
|
51293
51307
|
}
|
|
51294
51308
|
prompt(name, ...rest) {
|
|
51295
51309
|
if (this._registeredPrompts[name]) {
|
|
@@ -51377,10 +51391,10 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
51377
51391
|
}
|
|
51378
51392
|
};
|
|
51379
51393
|
|
|
51380
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
51394
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
51381
51395
|
import process2 from "node:process";
|
|
51382
51396
|
|
|
51383
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
51397
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
51384
51398
|
class ReadBuffer {
|
|
51385
51399
|
append(chunk) {
|
|
51386
51400
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
@@ -51410,7 +51424,7 @@ function serializeMessage(message) {
|
|
|
51410
51424
|
`;
|
|
51411
51425
|
}
|
|
51412
51426
|
|
|
51413
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.
|
|
51427
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
51414
51428
|
class StdioServerTransport {
|
|
51415
51429
|
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
51416
51430
|
this._stdin = _stdin;
|
|
@@ -69182,7 +69196,7 @@ var DotEnvSchema2 = exports_external2.object({
|
|
|
69182
69196
|
var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
|
|
69183
69197
|
var IdSchema2 = exports_external2.union([exports_external2.string().uuid(), exports_external2.string().regex(/^[0-9a-fA-F]{24}$/)]);
|
|
69184
69198
|
|
|
69185
|
-
// ../../node_modules/.bun/commander@14.0.
|
|
69199
|
+
// ../../node_modules/.bun/commander@14.0.1/node_modules/commander/esm.mjs
|
|
69186
69200
|
var import__2 = __toESM(require_commander(), 1);
|
|
69187
69201
|
var {
|
|
69188
69202
|
program,
|
|
@@ -74120,8 +74134,8 @@ function collectSchemaParts(sources) {
|
|
|
74120
74134
|
};
|
|
74121
74135
|
}
|
|
74122
74136
|
|
|
74123
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
74124
|
-
var
|
|
74137
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/index.js
|
|
74138
|
+
var import_graphql54 = __toESM(require_graphql2(), 1);
|
|
74125
74139
|
var import_isomorphic_ws3 = __toESM(require_ws(), 1);
|
|
74126
74140
|
// ../../node_modules/.bun/@envelop+core@5.3.0/node_modules/@envelop/core/esm/document-string-map.js
|
|
74127
74141
|
var documentStringMap = new WeakMap;
|
|
@@ -74133,7 +74147,7 @@ function getDocumentString(document, print5) {
|
|
|
74133
74147
|
}
|
|
74134
74148
|
return documentSource;
|
|
74135
74149
|
}
|
|
74136
|
-
// ../../node_modules/.bun/@graphql-tools+executor-common@0.0
|
|
74150
|
+
// ../../node_modules/.bun/@graphql-tools+executor-common@1.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-common/dist/index.js
|
|
74137
74151
|
var import_graphql45 = __toESM(require_graphql2(), 1);
|
|
74138
74152
|
var defaultPrintFn = memoize1(function defaultPrintFn2(document) {
|
|
74139
74153
|
return import_graphql45.stripIgnoredCharacters(getDocumentString(document, import_graphql45.print));
|
|
@@ -74722,7 +74736,7 @@ function isFatalInternalCloseCode(code) {
|
|
|
74722
74736
|
function isWebSocket(val) {
|
|
74723
74737
|
return typeof val === "function" && "constructor" in val && "CLOSED" in val && "CLOSING" in val && "CONNECTING" in val && "OPEN" in val;
|
|
74724
74738
|
}
|
|
74725
|
-
// ../../node_modules/.bun/@graphql-tools+executor-graphql-ws@
|
|
74739
|
+
// ../../node_modules/.bun/@graphql-tools+executor-graphql-ws@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-graphql-ws/dist/index.js
|
|
74726
74740
|
var import_isomorphic_ws = __toESM(require_ws(), 1);
|
|
74727
74741
|
function isClient(client) {
|
|
74728
74742
|
return "subscribe" in client;
|
|
@@ -74787,7 +74801,7 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
|
|
|
74787
74801
|
return executor2;
|
|
74788
74802
|
}
|
|
74789
74803
|
|
|
74790
|
-
// ../../node_modules/.bun/@graphql-hive+signal@
|
|
74804
|
+
// ../../node_modules/.bun/@graphql-hive+signal@2.0.0/node_modules/@graphql-hive/signal/dist/index.js
|
|
74791
74805
|
var isNode = !globalThis.Bun && globalThis.process?.release?.name === "node";
|
|
74792
74806
|
var anySignalRegistry = isNode ? new FinalizationRegistry((cb) => cb()) : null;
|
|
74793
74807
|
var controllerInSignalSy = Symbol("CONTROLLER_IN_SIGNAL");
|
|
@@ -74839,24 +74853,6 @@ function abortSignalAny(signals) {
|
|
|
74839
74853
|
return ctrl.signal;
|
|
74840
74854
|
}
|
|
74841
74855
|
|
|
74842
|
-
// ../../node_modules/.bun/@graphql-tools+executor-common@0.0.4+ded46c799560c44e/node_modules/@graphql-tools/executor-common/dist/index.js
|
|
74843
|
-
var import_graphql46 = __toESM(require_graphql2(), 1);
|
|
74844
|
-
var defaultPrintFn3 = memoize1(function defaultPrintFn22(document) {
|
|
74845
|
-
return import_graphql46.stripIgnoredCharacters(getDocumentString(document, import_graphql46.print));
|
|
74846
|
-
});
|
|
74847
|
-
function serializeExecutionRequest2({
|
|
74848
|
-
executionRequest,
|
|
74849
|
-
excludeQuery,
|
|
74850
|
-
printFn = defaultPrintFn3
|
|
74851
|
-
}) {
|
|
74852
|
-
return {
|
|
74853
|
-
query: excludeQuery ? undefined : printFn(executionRequest.document),
|
|
74854
|
-
variables: (executionRequest.variables && Object.keys(executionRequest.variables).length) > 0 ? executionRequest.variables : undefined,
|
|
74855
|
-
operationName: executionRequest.operationName ? executionRequest.operationName : undefined,
|
|
74856
|
-
extensions: executionRequest.extensions && Object.keys(executionRequest.extensions).length > 0 ? executionRequest.extensions : undefined
|
|
74857
|
-
};
|
|
74858
|
-
}
|
|
74859
|
-
|
|
74860
74856
|
// ../../node_modules/.bun/@whatwg-node+fetch@0.10.10/node_modules/@whatwg-node/fetch/dist/node-ponyfill.js
|
|
74861
74857
|
var createNodePonyfill = require_create_node_ponyfill();
|
|
74862
74858
|
var shouldSkipPonyfill = require_shouldSkipPonyfill();
|
|
@@ -75944,8 +75940,8 @@ function latest(contenders) {
|
|
|
75944
75940
|
});
|
|
75945
75941
|
}
|
|
75946
75942
|
|
|
75947
|
-
// ../../node_modules/.bun/@graphql-tools+executor-http@
|
|
75948
|
-
var
|
|
75943
|
+
// ../../node_modules/.bun/@graphql-tools+executor-http@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-http/dist/index.js
|
|
75944
|
+
var import_graphql46 = __toESM(require_graphql2(), 1);
|
|
75949
75945
|
|
|
75950
75946
|
// ../../node_modules/.bun/meros@1.3.1/node_modules/meros/browser/index.mjs
|
|
75951
75947
|
async function e(e2, t) {
|
|
@@ -76040,7 +76036,7 @@ async function e2(e3, t) {
|
|
|
76040
76036
|
}(e3, `--${i}`, t);
|
|
76041
76037
|
}
|
|
76042
76038
|
|
|
76043
|
-
// ../../node_modules/.bun/@graphql-tools+executor-http@
|
|
76039
|
+
// ../../node_modules/.bun/@graphql-tools+executor-http@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-http/dist/index.js
|
|
76044
76040
|
function isPlainObject2(value) {
|
|
76045
76041
|
if (typeof value !== "object" || value === null) {
|
|
76046
76042
|
return false;
|
|
@@ -76186,7 +76182,7 @@ function isBlob(obj) {
|
|
|
76186
76182
|
return typeof obj.arrayBuffer === "function";
|
|
76187
76183
|
}
|
|
76188
76184
|
function createGraphQLErrorForAbort(reason, extensions) {
|
|
76189
|
-
if (reason instanceof
|
|
76185
|
+
if (reason instanceof import_graphql46.GraphQLError) {
|
|
76190
76186
|
return reason;
|
|
76191
76187
|
}
|
|
76192
76188
|
if (reason?.name === "TimeoutError") {
|
|
@@ -76237,7 +76233,8 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76237
76233
|
return new Repeater((push2, stop2) => {
|
|
76238
76234
|
const decoder = new $TextDecoder;
|
|
76239
76235
|
const reader = body.getReader();
|
|
76240
|
-
|
|
76236
|
+
let closed = false;
|
|
76237
|
+
reader.closed.then(() => closed = true).catch((reason) => closed = reason);
|
|
76241
76238
|
stop2.then(() => {
|
|
76242
76239
|
subscriptionCtrl?.abort();
|
|
76243
76240
|
if (body.locked) {
|
|
@@ -76255,7 +76252,24 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76255
76252
|
if (!body?.locked) {
|
|
76256
76253
|
return stop2();
|
|
76257
76254
|
}
|
|
76258
|
-
|
|
76255
|
+
let done, chunk;
|
|
76256
|
+
try {
|
|
76257
|
+
const result = await reader.read();
|
|
76258
|
+
done = result.done;
|
|
76259
|
+
chunk = result.value;
|
|
76260
|
+
} catch (err) {
|
|
76261
|
+
if (signal?.aborted) {
|
|
76262
|
+
await push2(createResultForAbort(signal.reason));
|
|
76263
|
+
return stop2();
|
|
76264
|
+
}
|
|
76265
|
+
const errErr = err instanceof Error ? err : new Error(String(err));
|
|
76266
|
+
await push2({
|
|
76267
|
+
errors: [
|
|
76268
|
+
createGraphQLError(errErr.message, { originalError: errErr })
|
|
76269
|
+
]
|
|
76270
|
+
});
|
|
76271
|
+
return stop2();
|
|
76272
|
+
}
|
|
76259
76273
|
if (done) {
|
|
76260
76274
|
return stop2();
|
|
76261
76275
|
}
|
|
@@ -76272,11 +76286,15 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76272
76286
|
const data = JSON.parse(dataStr);
|
|
76273
76287
|
await push2(data.payload || data);
|
|
76274
76288
|
}
|
|
76275
|
-
const event = msg.split("event:")[1]?.trim()
|
|
76289
|
+
const event = msg.split("event:")[1]?.trim().split(`
|
|
76290
|
+
`)[0]?.trim();
|
|
76276
76291
|
if (event === "complete") {
|
|
76277
76292
|
return stop2();
|
|
76278
76293
|
}
|
|
76279
76294
|
}
|
|
76295
|
+
if (closed) {
|
|
76296
|
+
return stop2();
|
|
76297
|
+
}
|
|
76280
76298
|
return pump();
|
|
76281
76299
|
}
|
|
76282
76300
|
return pump();
|
|
@@ -76344,10 +76362,10 @@ function prepareGETUrl({
|
|
|
76344
76362
|
const finalUrl = urlObj.toString().replace(dummyHostname, "");
|
|
76345
76363
|
return finalUrl;
|
|
76346
76364
|
}
|
|
76365
|
+
var inflightRequests = /* @__PURE__ */ new Map;
|
|
76347
76366
|
function buildHTTPExecutor(options) {
|
|
76348
|
-
const printFn = options?.print ??
|
|
76367
|
+
const printFn = options?.print ?? defaultPrintFn;
|
|
76349
76368
|
let disposeCtrl;
|
|
76350
|
-
const serviceName = options?.serviceName;
|
|
76351
76369
|
const baseExecutor = (request, excludeQuery) => {
|
|
76352
76370
|
disposeCtrl ||= new AbortController;
|
|
76353
76371
|
if (disposeCtrl.signal.aborted) {
|
|
@@ -76369,12 +76387,34 @@ function buildHTTPExecutor(options) {
|
|
|
76369
76387
|
} else {
|
|
76370
76388
|
method ||= "POST";
|
|
76371
76389
|
}
|
|
76372
|
-
|
|
76390
|
+
let endpoint;
|
|
76391
|
+
if (request.extensions?.endpoint) {
|
|
76392
|
+
if (typeof request.extensions.endpoint === "string") {
|
|
76393
|
+
endpoint = request.extensions.endpoint;
|
|
76394
|
+
}
|
|
76395
|
+
if (typeof request.extensions.endpoint === "function") {
|
|
76396
|
+
endpoint = request.extensions.endpoint(request);
|
|
76397
|
+
}
|
|
76398
|
+
}
|
|
76399
|
+
if (!endpoint) {
|
|
76400
|
+
if (typeof options?.endpoint === "string") {
|
|
76401
|
+
endpoint = options.endpoint;
|
|
76402
|
+
}
|
|
76403
|
+
if (typeof options?.endpoint === "function") {
|
|
76404
|
+
endpoint = options.endpoint(request);
|
|
76405
|
+
}
|
|
76406
|
+
}
|
|
76407
|
+
if (!endpoint) {
|
|
76408
|
+
endpoint = "/graphql";
|
|
76409
|
+
}
|
|
76410
|
+
let isCustomHeader = false;
|
|
76373
76411
|
const headers = { accept };
|
|
76374
76412
|
if (options?.headers) {
|
|
76413
|
+
isCustomHeader = true;
|
|
76375
76414
|
Object.assign(headers, typeof options?.headers === "function" ? options.headers(request) : options?.headers);
|
|
76376
76415
|
}
|
|
76377
76416
|
if (request.extensions?.headers) {
|
|
76417
|
+
isCustomHeader = true;
|
|
76378
76418
|
const { headers: headersFromExtensions, ...restExtensions } = request.extensions;
|
|
76379
76419
|
Object.assign(headers, headersFromExtensions);
|
|
76380
76420
|
request.extensions = restExtensions;
|
|
@@ -76395,15 +76435,13 @@ function buildHTTPExecutor(options) {
|
|
|
76395
76435
|
}
|
|
76396
76436
|
const signal = abortSignalAny(signals);
|
|
76397
76437
|
const upstreamErrorExtensions = {
|
|
76398
|
-
code: "DOWNSTREAM_SERVICE_ERROR",
|
|
76399
|
-
serviceName,
|
|
76400
76438
|
request: {
|
|
76401
76439
|
method
|
|
76402
76440
|
}
|
|
76403
76441
|
};
|
|
76404
76442
|
const query = printFn(request.document);
|
|
76405
76443
|
let serializeFn = function serialize() {
|
|
76406
|
-
return
|
|
76444
|
+
return serializeExecutionRequest({
|
|
76407
76445
|
executionRequest: request,
|
|
76408
76446
|
excludeQuery,
|
|
76409
76447
|
printFn
|
|
@@ -76417,7 +76455,7 @@ function buildHTTPExecutor(options) {
|
|
|
76417
76455
|
version: 1,
|
|
76418
76456
|
sha256Hash
|
|
76419
76457
|
};
|
|
76420
|
-
return
|
|
76458
|
+
return serializeExecutionRequest({
|
|
76421
76459
|
executionRequest: {
|
|
76422
76460
|
...request,
|
|
76423
76461
|
extensions
|
|
@@ -76448,23 +76486,129 @@ function buildHTTPExecutor(options) {
|
|
|
76448
76486
|
]
|
|
76449
76487
|
};
|
|
76450
76488
|
}
|
|
76451
|
-
|
|
76489
|
+
function handleInflightRequest(inflightRequestOptions, context, info) {
|
|
76490
|
+
if (options?.deduplicateInflightRequests === false) {
|
|
76491
|
+
return runInflightRequest();
|
|
76492
|
+
}
|
|
76493
|
+
function runInflightRequest() {
|
|
76494
|
+
return handleMaybePromise(() => fetchFn(inflightRequestOptions.url, {
|
|
76495
|
+
method: inflightRequestOptions.method,
|
|
76496
|
+
headers: inflightRequestOptions.headers,
|
|
76497
|
+
body: inflightRequestOptions.body,
|
|
76498
|
+
credentials: inflightRequestOptions.credentials,
|
|
76499
|
+
signal: inflightRequestOptions.signal
|
|
76500
|
+
}, context, info), (fetchResult) => handleMaybePromise(() => {
|
|
76501
|
+
upstreamErrorExtensions.response ||= {};
|
|
76502
|
+
upstreamErrorExtensions.response.status = fetchResult.status;
|
|
76503
|
+
upstreamErrorExtensions.response.statusText = fetchResult.statusText;
|
|
76504
|
+
Object.defineProperty(upstreamErrorExtensions.response, "headers", {
|
|
76505
|
+
get() {
|
|
76506
|
+
return Object.fromEntries(fetchResult.headers.entries());
|
|
76507
|
+
}
|
|
76508
|
+
});
|
|
76509
|
+
if (options?.retry != null && !fetchResult.status.toString().startsWith("2")) {
|
|
76510
|
+
throw new Error(fetchResult.statusText || `Upstream HTTP Error: ${fetchResult.status}`);
|
|
76511
|
+
}
|
|
76512
|
+
const contentType = fetchResult.headers.get("content-type");
|
|
76513
|
+
if (contentType?.includes("text/event-stream")) {
|
|
76514
|
+
return handleEventStreamResponse(fetchResult, subscriptionCtrl, signal);
|
|
76515
|
+
} else if (contentType?.includes("multipart/mixed")) {
|
|
76516
|
+
return handleMultipartMixedResponse(fetchResult);
|
|
76517
|
+
}
|
|
76518
|
+
return fetchResult.text();
|
|
76519
|
+
}, (result) => {
|
|
76520
|
+
if (typeof result === "string") {
|
|
76521
|
+
upstreamErrorExtensions.response ||= {};
|
|
76522
|
+
upstreamErrorExtensions.response.body = result;
|
|
76523
|
+
if (result) {
|
|
76524
|
+
try {
|
|
76525
|
+
const parsedResult = JSON.parse(result);
|
|
76526
|
+
upstreamErrorExtensions.response.body = parsedResult;
|
|
76527
|
+
if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
|
|
76528
|
+
const message = `Unexpected empty "data" and "errors" fields in result: ${result}`;
|
|
76529
|
+
return {
|
|
76530
|
+
errors: [
|
|
76531
|
+
createGraphQLError(message, {
|
|
76532
|
+
originalError: new Error(message),
|
|
76533
|
+
extensions: upstreamErrorExtensions
|
|
76534
|
+
})
|
|
76535
|
+
]
|
|
76536
|
+
};
|
|
76537
|
+
}
|
|
76538
|
+
if (Array.isArray(parsedResult.errors)) {
|
|
76539
|
+
return {
|
|
76540
|
+
...parsedResult,
|
|
76541
|
+
errors: parsedResult.errors.map(({
|
|
76542
|
+
message,
|
|
76543
|
+
...options2
|
|
76544
|
+
}) => createGraphQLError(message, options2))
|
|
76545
|
+
};
|
|
76546
|
+
}
|
|
76547
|
+
return parsedResult;
|
|
76548
|
+
} catch (e3) {
|
|
76549
|
+
return {
|
|
76550
|
+
errors: [
|
|
76551
|
+
createGraphQLError(`Unexpected response: ${JSON.stringify(result)}`, {
|
|
76552
|
+
extensions: upstreamErrorExtensions,
|
|
76553
|
+
originalError: e3
|
|
76554
|
+
})
|
|
76555
|
+
]
|
|
76556
|
+
};
|
|
76557
|
+
}
|
|
76558
|
+
} else {
|
|
76559
|
+
const message = "No response returned";
|
|
76560
|
+
return {
|
|
76561
|
+
errors: [
|
|
76562
|
+
createGraphQLError(message, {
|
|
76563
|
+
extensions: upstreamErrorExtensions,
|
|
76564
|
+
originalError: new Error(message)
|
|
76565
|
+
})
|
|
76566
|
+
]
|
|
76567
|
+
};
|
|
76568
|
+
}
|
|
76569
|
+
} else {
|
|
76570
|
+
return result;
|
|
76571
|
+
}
|
|
76572
|
+
}, handleError), handleError);
|
|
76573
|
+
}
|
|
76574
|
+
if (typeof inflightRequestOptions.body === "object") {
|
|
76575
|
+
return runInflightRequest();
|
|
76576
|
+
}
|
|
76577
|
+
let inflightRequestId = `${inflightRequestOptions.url}|${inflightRequestOptions.method}`;
|
|
76578
|
+
if (inflightRequestOptions.body) {
|
|
76579
|
+
inflightRequestId += `|${inflightRequestOptions.body}`;
|
|
76580
|
+
}
|
|
76581
|
+
if (isCustomHeader) {
|
|
76582
|
+
inflightRequestId += `|${JSON.stringify(inflightRequestOptions.headers)}`;
|
|
76583
|
+
}
|
|
76584
|
+
let inflightRequest = inflightRequests.get(inflightRequestId);
|
|
76585
|
+
if (!inflightRequest) {
|
|
76586
|
+
inflightRequest = runInflightRequest();
|
|
76587
|
+
if (isPromise(inflightRequest)) {
|
|
76588
|
+
inflightRequests.set(inflightRequestId, inflightRequest);
|
|
76589
|
+
inflightRequest.finally(() => {
|
|
76590
|
+
inflightRequests.delete(inflightRequestId);
|
|
76591
|
+
});
|
|
76592
|
+
}
|
|
76593
|
+
}
|
|
76594
|
+
return inflightRequest;
|
|
76595
|
+
}
|
|
76596
|
+
return handleMaybePromise(() => serializeFn(), (body) => {
|
|
76452
76597
|
switch (method) {
|
|
76453
76598
|
case "GET": {
|
|
76454
76599
|
const finalUrl = prepareGETUrl({
|
|
76455
76600
|
baseUrl: endpoint,
|
|
76456
76601
|
body
|
|
76457
76602
|
});
|
|
76458
|
-
const
|
|
76603
|
+
const inflightRequestOptions = {
|
|
76604
|
+
url: finalUrl,
|
|
76459
76605
|
method: "GET",
|
|
76460
76606
|
headers,
|
|
76461
|
-
signal
|
|
76607
|
+
signal,
|
|
76608
|
+
credentials: options?.credentials
|
|
76462
76609
|
};
|
|
76463
|
-
if (options?.credentials != null) {
|
|
76464
|
-
fetchOptions.credentials = options.credentials;
|
|
76465
|
-
}
|
|
76466
76610
|
upstreamErrorExtensions.request.url = finalUrl;
|
|
76467
|
-
return
|
|
76611
|
+
return handleInflightRequest(inflightRequestOptions, request.context, request.info);
|
|
76468
76612
|
}
|
|
76469
76613
|
case "POST": {
|
|
76470
76614
|
upstreamErrorExtensions.request.body = body;
|
|
@@ -76476,95 +76620,19 @@ function buildHTTPExecutor(options) {
|
|
|
76476
76620
|
upstreamErrorExtensions.request.body = body2;
|
|
76477
76621
|
headers["content-type"] = "application/json";
|
|
76478
76622
|
}
|
|
76479
|
-
const
|
|
76623
|
+
const inflightRequestOptions = {
|
|
76624
|
+
url: endpoint,
|
|
76480
76625
|
method: "POST",
|
|
76481
76626
|
body: body2,
|
|
76482
76627
|
headers,
|
|
76628
|
+
credentials: options?.credentials,
|
|
76483
76629
|
signal
|
|
76484
76630
|
};
|
|
76485
|
-
|
|
76486
|
-
fetchOptions.credentials = options.credentials;
|
|
76487
|
-
}
|
|
76488
|
-
return fetchFn(endpoint, fetchOptions, request.context, request.info);
|
|
76631
|
+
return handleInflightRequest(inflightRequestOptions, request.context, request.info);
|
|
76489
76632
|
}, handleError);
|
|
76490
76633
|
}
|
|
76491
76634
|
}
|
|
76492
|
-
},
|
|
76493
|
-
upstreamErrorExtensions.response ||= {};
|
|
76494
|
-
upstreamErrorExtensions.response.status = fetchResult.status;
|
|
76495
|
-
upstreamErrorExtensions.response.statusText = fetchResult.statusText;
|
|
76496
|
-
Object.defineProperty(upstreamErrorExtensions.response, "headers", {
|
|
76497
|
-
get() {
|
|
76498
|
-
return Object.fromEntries(fetchResult.headers.entries());
|
|
76499
|
-
}
|
|
76500
|
-
});
|
|
76501
|
-
if (options?.retry != null && !fetchResult.status.toString().startsWith("2")) {
|
|
76502
|
-
throw new Error(fetchResult.statusText || `Upstream HTTP Error: ${fetchResult.status}`);
|
|
76503
|
-
}
|
|
76504
|
-
const contentType = fetchResult.headers.get("content-type");
|
|
76505
|
-
if (contentType?.includes("text/event-stream")) {
|
|
76506
|
-
return handleEventStreamResponse(fetchResult, subscriptionCtrl, signal);
|
|
76507
|
-
} else if (contentType?.includes("multipart/mixed")) {
|
|
76508
|
-
return handleMultipartMixedResponse(fetchResult);
|
|
76509
|
-
}
|
|
76510
|
-
return fetchResult.text();
|
|
76511
|
-
}, (result) => {
|
|
76512
|
-
if (typeof result === "string") {
|
|
76513
|
-
upstreamErrorExtensions.response ||= {};
|
|
76514
|
-
upstreamErrorExtensions.response.body = result;
|
|
76515
|
-
if (result) {
|
|
76516
|
-
try {
|
|
76517
|
-
const parsedResult = JSON.parse(result);
|
|
76518
|
-
upstreamErrorExtensions.response.body = parsedResult;
|
|
76519
|
-
if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
|
|
76520
|
-
return {
|
|
76521
|
-
errors: [
|
|
76522
|
-
createGraphQLError('Unexpected empty "data" and "errors" fields in result: ' + result, {
|
|
76523
|
-
extensions: upstreamErrorExtensions
|
|
76524
|
-
})
|
|
76525
|
-
]
|
|
76526
|
-
};
|
|
76527
|
-
}
|
|
76528
|
-
if (Array.isArray(parsedResult.errors)) {
|
|
76529
|
-
return {
|
|
76530
|
-
...parsedResult,
|
|
76531
|
-
errors: parsedResult.errors.map(({
|
|
76532
|
-
message,
|
|
76533
|
-
...options2
|
|
76534
|
-
}) => createGraphQLError(message, {
|
|
76535
|
-
...options2,
|
|
76536
|
-
extensions: {
|
|
76537
|
-
code: "DOWNSTREAM_SERVICE_ERROR",
|
|
76538
|
-
serviceName,
|
|
76539
|
-
...options2.extensions || {}
|
|
76540
|
-
}
|
|
76541
|
-
}))
|
|
76542
|
-
};
|
|
76543
|
-
}
|
|
76544
|
-
return parsedResult;
|
|
76545
|
-
} catch (e3) {
|
|
76546
|
-
return {
|
|
76547
|
-
errors: [
|
|
76548
|
-
createGraphQLError(`Unexpected response: ${JSON.stringify(result)}`, {
|
|
76549
|
-
extensions: upstreamErrorExtensions,
|
|
76550
|
-
originalError: e3
|
|
76551
|
-
})
|
|
76552
|
-
]
|
|
76553
|
-
};
|
|
76554
|
-
}
|
|
76555
|
-
} else {
|
|
76556
|
-
return {
|
|
76557
|
-
errors: [
|
|
76558
|
-
createGraphQLError("No response returned", {
|
|
76559
|
-
extensions: upstreamErrorExtensions
|
|
76560
|
-
})
|
|
76561
|
-
]
|
|
76562
|
-
};
|
|
76563
|
-
}
|
|
76564
|
-
} else {
|
|
76565
|
-
return result;
|
|
76566
|
-
}
|
|
76567
|
-
}, handleError), handleError), handleError);
|
|
76635
|
+
}, handleError);
|
|
76568
76636
|
};
|
|
76569
76637
|
let executor2 = baseExecutor;
|
|
76570
76638
|
if (options?.apq != null) {
|
|
@@ -76658,7 +76726,7 @@ function coerceFetchError(e3, {
|
|
|
76658
76726
|
}
|
|
76659
76727
|
|
|
76660
76728
|
// ../../node_modules/.bun/@graphql-tools+executor-legacy-ws@1.1.19+ded46c799560c44e/node_modules/@graphql-tools/executor-legacy-ws/esm/index.js
|
|
76661
|
-
var
|
|
76729
|
+
var import_graphql47 = __toESM(require_graphql2(), 1);
|
|
76662
76730
|
var import_isomorphic_ws2 = __toESM(require_ws(), 1);
|
|
76663
76731
|
var LEGACY_WS;
|
|
76664
76732
|
(function(LEGACY_WS2) {
|
|
@@ -76746,7 +76814,7 @@ function buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options) {
|
|
|
76746
76814
|
type: LEGACY_WS.START,
|
|
76747
76815
|
id,
|
|
76748
76816
|
payload: {
|
|
76749
|
-
query:
|
|
76817
|
+
query: import_graphql47.print(request.document),
|
|
76750
76818
|
variables: request.variables,
|
|
76751
76819
|
operationName: request.operationName
|
|
76752
76820
|
}
|
|
@@ -76802,11 +76870,11 @@ function buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options) {
|
|
|
76802
76870
|
return executor2;
|
|
76803
76871
|
}
|
|
76804
76872
|
|
|
76805
|
-
// ../../node_modules/.bun/@graphql-tools+delegate@
|
|
76806
|
-
var
|
|
76873
|
+
// ../../node_modules/.bun/@graphql-tools+delegate@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/delegate/dist/index.js
|
|
76874
|
+
var import_graphql52 = __toESM(require_graphql2(), 1);
|
|
76807
76875
|
|
|
76808
76876
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/execute.js
|
|
76809
|
-
var
|
|
76877
|
+
var import_graphql49 = __toESM(require_graphql2(), 1);
|
|
76810
76878
|
|
|
76811
76879
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/coerceError.js
|
|
76812
76880
|
function coerceError(error43) {
|
|
@@ -76932,7 +77000,7 @@ function promiseForObject(object3, signal, signalPromise) {
|
|
|
76932
77000
|
}
|
|
76933
77001
|
|
|
76934
77002
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/values.js
|
|
76935
|
-
var
|
|
77003
|
+
var import_graphql48 = __toESM(require_graphql2(), 1);
|
|
76936
77004
|
function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
76937
77005
|
const errors5 = [];
|
|
76938
77006
|
const maxErrors = options?.maxErrors;
|
|
@@ -76955,16 +77023,16 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
76955
77023
|
const coercedValues = {};
|
|
76956
77024
|
for (const varDefNode of varDefNodes) {
|
|
76957
77025
|
const varName = varDefNode.variable.name.value;
|
|
76958
|
-
const varType =
|
|
76959
|
-
if (!
|
|
76960
|
-
const varTypeStr =
|
|
77026
|
+
const varType = import_graphql48.typeFromAST(schema, varDefNode.type);
|
|
77027
|
+
if (!import_graphql48.isInputType(varType)) {
|
|
77028
|
+
const varTypeStr = import_graphql48.print(varDefNode.type);
|
|
76961
77029
|
onError(createGraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { nodes: varDefNode.type }));
|
|
76962
77030
|
continue;
|
|
76963
77031
|
}
|
|
76964
77032
|
if (!hasOwnProperty(inputs, varName)) {
|
|
76965
77033
|
if (varDefNode.defaultValue) {
|
|
76966
|
-
coercedValues[varName] =
|
|
76967
|
-
} else if (
|
|
77034
|
+
coercedValues[varName] = import_graphql48.valueFromAST(varDefNode.defaultValue, varType);
|
|
77035
|
+
} else if (import_graphql48.isNonNullType(varType)) {
|
|
76968
77036
|
const varTypeStr = inspect(varType);
|
|
76969
77037
|
onError(createGraphQLError(`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, {
|
|
76970
77038
|
nodes: varDefNode
|
|
@@ -76973,14 +77041,14 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
76973
77041
|
continue;
|
|
76974
77042
|
}
|
|
76975
77043
|
const value = inputs[varName];
|
|
76976
|
-
if (value === null &&
|
|
77044
|
+
if (value === null && import_graphql48.isNonNullType(varType)) {
|
|
76977
77045
|
const varTypeStr = inspect(varType);
|
|
76978
77046
|
onError(createGraphQLError(`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, {
|
|
76979
77047
|
nodes: varDefNode
|
|
76980
77048
|
}));
|
|
76981
77049
|
continue;
|
|
76982
77050
|
}
|
|
76983
|
-
coercedValues[varName] =
|
|
77051
|
+
coercedValues[varName] = import_graphql48.coerceInputValue(value, varType, (path2, invalidValue, error43) => {
|
|
76984
77052
|
let prefix = `Variable "$${varName}" got invalid value ` + inspect(invalidValue);
|
|
76985
77053
|
if (path2.length > 0) {
|
|
76986
77054
|
prefix += ` at "${varName}${printPathArray(path2)}"`;
|
|
@@ -77046,7 +77114,7 @@ function buildResponse(data, errors5) {
|
|
|
77046
77114
|
var getFragmentsFromDocument = memoize1(function getFragmentsFromDocument2(document) {
|
|
77047
77115
|
const fragments = Object.create(null);
|
|
77048
77116
|
for (const definition of document.definitions) {
|
|
77049
|
-
if (definition.kind ===
|
|
77117
|
+
if (definition.kind === import_graphql49.Kind.FRAGMENT_DEFINITION) {
|
|
77050
77118
|
fragments[definition.name.value] = definition;
|
|
77051
77119
|
}
|
|
77052
77120
|
}
|
|
@@ -77055,12 +77123,12 @@ var getFragmentsFromDocument = memoize1(function getFragmentsFromDocument2(docum
|
|
|
77055
77123
|
function buildExecutionContext(args) {
|
|
77056
77124
|
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, signal } = args;
|
|
77057
77125
|
signal?.throwIfAborted();
|
|
77058
|
-
|
|
77126
|
+
import_graphql49.assertValidSchema(schema);
|
|
77059
77127
|
const fragments = getFragmentsFromDocument(document);
|
|
77060
77128
|
let operation;
|
|
77061
77129
|
for (const definition of document.definitions) {
|
|
77062
77130
|
switch (definition.kind) {
|
|
77063
|
-
case
|
|
77131
|
+
case import_graphql49.Kind.OPERATION_DEFINITION:
|
|
77064
77132
|
if (operationName == null) {
|
|
77065
77133
|
if (operation !== undefined) {
|
|
77066
77134
|
return [
|
|
@@ -77242,14 +77310,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path2, asyncPa
|
|
|
77242
77310
|
let result2;
|
|
77243
77311
|
for (let rawErrorItem of rawError.errors) {
|
|
77244
77312
|
rawErrorItem = coerceError(rawErrorItem);
|
|
77245
|
-
const error44 =
|
|
77313
|
+
const error44 = import_graphql49.locatedError(rawErrorItem, fieldNodes, pathToArray(path2));
|
|
77246
77314
|
result2 = handleFieldError(error44, returnType, errors5);
|
|
77247
77315
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77248
77316
|
}
|
|
77249
77317
|
return result2;
|
|
77250
77318
|
}
|
|
77251
77319
|
rawError = coerceError(rawError);
|
|
77252
|
-
const error43 =
|
|
77320
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(path2));
|
|
77253
77321
|
const handledError = handleFieldError(error43, returnType, errors5);
|
|
77254
77322
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77255
77323
|
return handledError;
|
|
@@ -77261,14 +77329,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path2, asyncPa
|
|
|
77261
77329
|
let result;
|
|
77262
77330
|
for (let rawErrorItem of rawError.errors) {
|
|
77263
77331
|
rawErrorItem = coerceError(rawErrorItem);
|
|
77264
|
-
const error44 =
|
|
77332
|
+
const error44 = import_graphql49.locatedError(rawErrorItem, fieldNodes, pathToArray(path2));
|
|
77265
77333
|
result = handleFieldError(error44, returnType, errors5);
|
|
77266
77334
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77267
77335
|
}
|
|
77268
77336
|
return result;
|
|
77269
77337
|
}
|
|
77270
77338
|
const coercedError = coerceError(rawError);
|
|
77271
|
-
const error43 =
|
|
77339
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(path2));
|
|
77272
77340
|
const handledError = handleFieldError(error43, returnType, errors5);
|
|
77273
77341
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77274
77342
|
return handledError;
|
|
@@ -77291,7 +77359,7 @@ function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path2) {
|
|
|
77291
77359
|
}
|
|
77292
77360
|
var CRITICAL_ERROR = "CRITICAL_ERROR";
|
|
77293
77361
|
function handleFieldError(error43, returnType, errors5) {
|
|
77294
|
-
if (
|
|
77362
|
+
if (import_graphql49.isNonNullType(returnType)) {
|
|
77295
77363
|
throw error43;
|
|
77296
77364
|
}
|
|
77297
77365
|
if (error43.extensions?.[CRITICAL_ERROR]) {
|
|
@@ -77304,7 +77372,7 @@ function completeValue(exeContext, returnType, fieldNodes, info, path2, result,
|
|
|
77304
77372
|
if (result instanceof Error) {
|
|
77305
77373
|
throw result;
|
|
77306
77374
|
}
|
|
77307
|
-
if (
|
|
77375
|
+
if (import_graphql49.isNonNullType(returnType)) {
|
|
77308
77376
|
const completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77309
77377
|
if (completed === null) {
|
|
77310
77378
|
throw new Error(`Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`);
|
|
@@ -77314,16 +77382,16 @@ function completeValue(exeContext, returnType, fieldNodes, info, path2, result,
|
|
|
77314
77382
|
if (result == null) {
|
|
77315
77383
|
return null;
|
|
77316
77384
|
}
|
|
77317
|
-
if (
|
|
77385
|
+
if (import_graphql49.isListType(returnType)) {
|
|
77318
77386
|
return completeListValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77319
77387
|
}
|
|
77320
|
-
if (
|
|
77388
|
+
if (import_graphql49.isLeafType(returnType)) {
|
|
77321
77389
|
return completeLeafValue(returnType, result);
|
|
77322
77390
|
}
|
|
77323
|
-
if (
|
|
77391
|
+
if (import_graphql49.isAbstractType(returnType)) {
|
|
77324
77392
|
return completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77325
77393
|
}
|
|
77326
|
-
if (
|
|
77394
|
+
if (import_graphql49.isObjectType(returnType)) {
|
|
77327
77395
|
return completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77328
77396
|
}
|
|
77329
77397
|
console.assert(false, "Cannot complete value of unexpected output type: " + inspect(returnType));
|
|
@@ -77332,7 +77400,7 @@ function getStreamValues(exeContext, fieldNodes, path2) {
|
|
|
77332
77400
|
if (typeof path2.key === "number") {
|
|
77333
77401
|
return;
|
|
77334
77402
|
}
|
|
77335
|
-
const stream2 =
|
|
77403
|
+
const stream2 = import_graphql49.getDirectiveValues(GraphQLStreamDirective, fieldNodes[0], exeContext.variableValues);
|
|
77336
77404
|
if (!stream2) {
|
|
77337
77405
|
return;
|
|
77338
77406
|
}
|
|
@@ -77372,7 +77440,7 @@ async function completeAsyncIteratorValue(exeContext, itemType, fieldNodes, info
|
|
|
77372
77440
|
}
|
|
77373
77441
|
} catch (rawError) {
|
|
77374
77442
|
const coercedError = coerceError(rawError);
|
|
77375
|
-
const error43 =
|
|
77443
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77376
77444
|
completedResults.push(handleFieldError(error43, itemType, errors5));
|
|
77377
77445
|
break;
|
|
77378
77446
|
}
|
|
@@ -77423,7 +77491,7 @@ function completeListItemValue(item, completedResults, errors5, exeContext, item
|
|
|
77423
77491
|
if (isPromise(completedItem)) {
|
|
77424
77492
|
completedResults.push(completedItem.then(undefined, (rawError) => {
|
|
77425
77493
|
rawError = coerceError(rawError);
|
|
77426
|
-
const error43 =
|
|
77494
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77427
77495
|
const handledError = handleFieldError(error43, itemType, errors5);
|
|
77428
77496
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77429
77497
|
return handledError;
|
|
@@ -77433,7 +77501,7 @@ function completeListItemValue(item, completedResults, errors5, exeContext, item
|
|
|
77433
77501
|
completedResults.push(completedItem);
|
|
77434
77502
|
} catch (rawError) {
|
|
77435
77503
|
const coercedError = coerceError(rawError);
|
|
77436
|
-
const error43 =
|
|
77504
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77437
77505
|
const handledError = handleFieldError(error43, itemType, errors5);
|
|
77438
77506
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77439
77507
|
completedResults.push(handledError);
|
|
@@ -77445,7 +77513,7 @@ function completeLeafValue(returnType, result) {
|
|
|
77445
77513
|
try {
|
|
77446
77514
|
serializedResult = returnType.serialize(result);
|
|
77447
77515
|
} catch (err) {
|
|
77448
|
-
if (err instanceof
|
|
77516
|
+
if (err instanceof import_graphql49.GraphQLError) {
|
|
77449
77517
|
throw new Error(err.message);
|
|
77450
77518
|
}
|
|
77451
77519
|
throw err;
|
|
@@ -77468,8 +77536,8 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
77468
77536
|
if (runtimeTypeName == null) {
|
|
77469
77537
|
throw createGraphQLError(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: fieldNodes });
|
|
77470
77538
|
}
|
|
77471
|
-
if (
|
|
77472
|
-
if (
|
|
77539
|
+
if (import_graphql49.isObjectType(runtimeTypeName)) {
|
|
77540
|
+
if (import_graphql49.versionInfo.major >= 16) {
|
|
77473
77541
|
throw createGraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");
|
|
77474
77542
|
}
|
|
77475
77543
|
runtimeTypeName = runtimeTypeName.name;
|
|
@@ -77481,7 +77549,7 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
77481
77549
|
if (runtimeType == null) {
|
|
77482
77550
|
throw createGraphQLError(`Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: fieldNodes });
|
|
77483
77551
|
}
|
|
77484
|
-
if (!
|
|
77552
|
+
if (!import_graphql49.isObjectType(runtimeType)) {
|
|
77485
77553
|
throw createGraphQLError(`Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: fieldNodes });
|
|
77486
77554
|
}
|
|
77487
77555
|
if (!exeContext.schema.isSubType(returnType, runtimeType)) {
|
|
@@ -77674,12 +77742,12 @@ function executeSubscription(exeContext) {
|
|
|
77674
77742
|
const result = resolveFn(rootValue, args, contextValue, info);
|
|
77675
77743
|
if (isPromise(result)) {
|
|
77676
77744
|
return result.then((result2) => assertEventStream(result2, exeContext.signal, exeContext.onSignalAbort)).then(undefined, (error43) => {
|
|
77677
|
-
throw
|
|
77745
|
+
throw import_graphql49.locatedError(error43, fieldNodes, pathToArray(path2));
|
|
77678
77746
|
});
|
|
77679
77747
|
}
|
|
77680
77748
|
return assertEventStream(result, exeContext.signal, exeContext.onSignalAbort);
|
|
77681
77749
|
} catch (error43) {
|
|
77682
|
-
throw
|
|
77750
|
+
throw import_graphql49.locatedError(error43, fieldNodes, pathToArray(path2));
|
|
77683
77751
|
}
|
|
77684
77752
|
}
|
|
77685
77753
|
function assertEventStream(result, signal, onSignalAbort) {
|
|
@@ -77745,7 +77813,7 @@ function executeStreamField(path2, itemPath, item, exeContext, fieldNodes, info,
|
|
|
77745
77813
|
if (isPromise(completedItem)) {
|
|
77746
77814
|
completedItem = completedItem.then(undefined, (rawError) => {
|
|
77747
77815
|
rawError = coerceError(rawError);
|
|
77748
|
-
const error43 =
|
|
77816
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77749
77817
|
const handledError = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77750
77818
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77751
77819
|
return handledError;
|
|
@@ -77753,7 +77821,7 @@ function executeStreamField(path2, itemPath, item, exeContext, fieldNodes, info,
|
|
|
77753
77821
|
}
|
|
77754
77822
|
} catch (rawError) {
|
|
77755
77823
|
const coercedError = coerceError(rawError);
|
|
77756
|
-
const error43 =
|
|
77824
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77757
77825
|
completedItem = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77758
77826
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77759
77827
|
}
|
|
@@ -77787,7 +77855,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77787
77855
|
item = value;
|
|
77788
77856
|
} catch (rawError) {
|
|
77789
77857
|
const coercedError = coerceError(rawError);
|
|
77790
|
-
const error43 =
|
|
77858
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77791
77859
|
const value = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77792
77860
|
return { done: true, value };
|
|
77793
77861
|
}
|
|
@@ -77796,7 +77864,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77796
77864
|
completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item, asyncPayloadRecord);
|
|
77797
77865
|
if (isPromise(completedItem)) {
|
|
77798
77866
|
completedItem = completedItem.then(undefined, (rawError) => {
|
|
77799
|
-
const error43 =
|
|
77867
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77800
77868
|
const handledError = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77801
77869
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77802
77870
|
return handledError;
|
|
@@ -77804,7 +77872,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77804
77872
|
}
|
|
77805
77873
|
return { done: false, value: completedItem };
|
|
77806
77874
|
} catch (rawError) {
|
|
77807
|
-
const error43 =
|
|
77875
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77808
77876
|
const value = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77809
77877
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77810
77878
|
return { done: false, value };
|
|
@@ -78049,20 +78117,20 @@ function isStreamPayload(asyncPayload) {
|
|
|
78049
78117
|
}
|
|
78050
78118
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
78051
78119
|
const fieldName = fieldNode.name.value;
|
|
78052
|
-
if (fieldName ===
|
|
78053
|
-
return
|
|
78054
|
-
} else if (fieldName ===
|
|
78055
|
-
return
|
|
78056
|
-
} else if (fieldName ===
|
|
78057
|
-
return
|
|
78120
|
+
if (fieldName === import_graphql49.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
78121
|
+
return import_graphql49.SchemaMetaFieldDef;
|
|
78122
|
+
} else if (fieldName === import_graphql49.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
78123
|
+
return import_graphql49.TypeMetaFieldDef;
|
|
78124
|
+
} else if (fieldName === import_graphql49.TypeNameMetaFieldDef.name) {
|
|
78125
|
+
return import_graphql49.TypeNameMetaFieldDef;
|
|
78058
78126
|
}
|
|
78059
78127
|
return parentType.getFields()[fieldName];
|
|
78060
78128
|
}
|
|
78061
78129
|
|
|
78062
78130
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/normalizedExecutor.js
|
|
78063
|
-
var
|
|
78131
|
+
var import_graphql50 = __toESM(require_graphql2(), 1);
|
|
78064
78132
|
function normalizedExecutor(args) {
|
|
78065
|
-
const operationAST =
|
|
78133
|
+
const operationAST = import_graphql50.getOperationAST(args.document, args.operationName);
|
|
78066
78134
|
if (operationAST == null) {
|
|
78067
78135
|
throw new Error("Must provide an operation.");
|
|
78068
78136
|
}
|
|
@@ -78090,9 +78158,9 @@ var executorFromSchema = memoize1(function executorFromSchema2(schema) {
|
|
|
78090
78158
|
};
|
|
78091
78159
|
});
|
|
78092
78160
|
|
|
78093
|
-
// ../../node_modules/.bun/@graphql-tools+batch-execute@
|
|
78161
|
+
// ../../node_modules/.bun/@graphql-tools+batch-execute@10.0.0+ded46c799560c44e/node_modules/@graphql-tools/batch-execute/dist/index.js
|
|
78094
78162
|
var import_dataloader = __toESM(require_dataloader(), 1);
|
|
78095
|
-
var
|
|
78163
|
+
var import_graphql51 = __toESM(require_graphql2(), 1);
|
|
78096
78164
|
function createPrefix(index) {
|
|
78097
78165
|
return `_v${index}_`;
|
|
78098
78166
|
}
|
|
@@ -78128,6 +78196,10 @@ function parseKeyFromPath(path2) {
|
|
|
78128
78196
|
};
|
|
78129
78197
|
}
|
|
78130
78198
|
function mergeRequests(requests, extensionsReducer) {
|
|
78199
|
+
if (requests.length === 1) {
|
|
78200
|
+
return requests[0];
|
|
78201
|
+
}
|
|
78202
|
+
const subgraphName = requests[0].subgraphName;
|
|
78131
78203
|
const mergedVariables = /* @__PURE__ */ Object.create(null);
|
|
78132
78204
|
const mergedVariableDefinitions = [];
|
|
78133
78205
|
const mergedSelections = [];
|
|
@@ -78158,24 +78230,25 @@ function mergeRequests(requests, extensionsReducer) {
|
|
|
78158
78230
|
}
|
|
78159
78231
|
const operationType = firstRequest.operationType ?? getOperationASTFromRequest(firstRequest).operation;
|
|
78160
78232
|
const mergedOperationDefinition = {
|
|
78161
|
-
kind:
|
|
78233
|
+
kind: import_graphql51.Kind.OPERATION_DEFINITION,
|
|
78162
78234
|
operation: operationType,
|
|
78163
78235
|
variableDefinitions: mergedVariableDefinitions,
|
|
78164
78236
|
selectionSet: {
|
|
78165
|
-
kind:
|
|
78237
|
+
kind: import_graphql51.Kind.SELECTION_SET,
|
|
78166
78238
|
selections: mergedSelections
|
|
78167
78239
|
}
|
|
78168
78240
|
};
|
|
78169
78241
|
const operationName = firstRequest.operationName ?? firstRequest.info?.operation?.name?.value;
|
|
78170
78242
|
if (operationName) {
|
|
78171
78243
|
mergedOperationDefinition.name = {
|
|
78172
|
-
kind:
|
|
78244
|
+
kind: import_graphql51.Kind.NAME,
|
|
78173
78245
|
value: operationName
|
|
78174
78246
|
};
|
|
78175
78247
|
}
|
|
78176
78248
|
return {
|
|
78249
|
+
subgraphName,
|
|
78177
78250
|
document: {
|
|
78178
|
-
kind:
|
|
78251
|
+
kind: import_graphql51.Kind.DOCUMENT,
|
|
78179
78252
|
definitions: [mergedOperationDefinition, ...mergedFragmentDefinitions]
|
|
78180
78253
|
},
|
|
78181
78254
|
variables: mergedVariables,
|
|
@@ -78201,13 +78274,13 @@ function prefixRequest(prefix, request) {
|
|
|
78201
78274
|
const fragmentSpreadImpl = {};
|
|
78202
78275
|
let hasFragments = false;
|
|
78203
78276
|
if (hasFragmentDefinitionsOrVariables) {
|
|
78204
|
-
prefixedDocument =
|
|
78205
|
-
[
|
|
78206
|
-
[
|
|
78277
|
+
prefixedDocument = import_graphql51.visit(prefixedDocument, {
|
|
78278
|
+
[import_graphql51.Kind.VARIABLE]: prefixNode,
|
|
78279
|
+
[import_graphql51.Kind.FRAGMENT_DEFINITION](node) {
|
|
78207
78280
|
hasFragments = true;
|
|
78208
78281
|
return prefixNode(node);
|
|
78209
78282
|
},
|
|
78210
|
-
[
|
|
78283
|
+
[import_graphql51.Kind.FRAGMENT_SPREAD]: (node) => {
|
|
78211
78284
|
node = prefixNodeName(node, prefix);
|
|
78212
78285
|
fragmentSpreadImpl[node.name.value] = true;
|
|
78213
78286
|
return node;
|
|
@@ -78235,7 +78308,7 @@ function prefixRequest(prefix, request) {
|
|
|
78235
78308
|
}
|
|
78236
78309
|
function aliasTopLevelFields(prefix, document) {
|
|
78237
78310
|
const transformer = {
|
|
78238
|
-
[
|
|
78311
|
+
[import_graphql51.Kind.OPERATION_DEFINITION]: (def) => {
|
|
78239
78312
|
const { selections } = def.selectionSet;
|
|
78240
78313
|
return {
|
|
78241
78314
|
...def,
|
|
@@ -78246,20 +78319,20 @@ function aliasTopLevelFields(prefix, document) {
|
|
|
78246
78319
|
};
|
|
78247
78320
|
}
|
|
78248
78321
|
};
|
|
78249
|
-
return
|
|
78250
|
-
[
|
|
78322
|
+
return import_graphql51.visit(document, transformer, {
|
|
78323
|
+
[import_graphql51.Kind.DOCUMENT]: [`definitions`]
|
|
78251
78324
|
});
|
|
78252
78325
|
}
|
|
78253
78326
|
function aliasFieldsInSelection(prefix, selections, document) {
|
|
78254
78327
|
return selections.map((selection) => {
|
|
78255
78328
|
switch (selection.kind) {
|
|
78256
|
-
case
|
|
78329
|
+
case import_graphql51.Kind.INLINE_FRAGMENT:
|
|
78257
78330
|
return aliasFieldsInInlineFragment(prefix, selection, document);
|
|
78258
|
-
case
|
|
78331
|
+
case import_graphql51.Kind.FRAGMENT_SPREAD: {
|
|
78259
78332
|
const inlineFragment = inlineFragmentSpread(selection, document);
|
|
78260
78333
|
return aliasFieldsInInlineFragment(prefix, inlineFragment, document);
|
|
78261
78334
|
}
|
|
78262
|
-
case
|
|
78335
|
+
case import_graphql51.Kind.FIELD:
|
|
78263
78336
|
default:
|
|
78264
78337
|
return aliasField(selection, prefix);
|
|
78265
78338
|
}
|
|
@@ -78282,7 +78355,7 @@ function inlineFragmentSpread(spread, document) {
|
|
|
78282
78355
|
}
|
|
78283
78356
|
const { typeCondition, selectionSet } = fragment;
|
|
78284
78357
|
return {
|
|
78285
|
-
kind:
|
|
78358
|
+
kind: import_graphql51.Kind.INLINE_FRAGMENT,
|
|
78286
78359
|
typeCondition,
|
|
78287
78360
|
selectionSet,
|
|
78288
78361
|
directives: spread.directives
|
|
@@ -78308,10 +78381,10 @@ function aliasField(field, aliasPrefix) {
|
|
|
78308
78381
|
};
|
|
78309
78382
|
}
|
|
78310
78383
|
function isOperationDefinition(def) {
|
|
78311
|
-
return def.kind ===
|
|
78384
|
+
return def.kind === import_graphql51.Kind.OPERATION_DEFINITION;
|
|
78312
78385
|
}
|
|
78313
78386
|
function isFragmentDefinition(def) {
|
|
78314
|
-
return def.kind ===
|
|
78387
|
+
return def.kind === import_graphql51.Kind.FRAGMENT_DEFINITION;
|
|
78315
78388
|
}
|
|
78316
78389
|
function splitResult({ data, errors: errors5 }, numResults) {
|
|
78317
78390
|
const splitResults = new Array(numResults);
|
|
@@ -78407,7 +78480,7 @@ var getBatchingExecutor = memoize2of4(function getBatchingExecutor2(_context, ex
|
|
|
78407
78480
|
return createBatchingExecutor(executor2, dataLoaderOptions, extensionsReducer);
|
|
78408
78481
|
});
|
|
78409
78482
|
|
|
78410
|
-
// ../../node_modules/.bun/@graphql-tools+delegate@
|
|
78483
|
+
// ../../node_modules/.bun/@graphql-tools+delegate@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/delegate/dist/index.js
|
|
78411
78484
|
var applySchemaTransforms = memoize2(function applySchemaTransforms2(originalWrappingSchema, subschemaConfig) {
|
|
78412
78485
|
const schemaTransforms = subschemaConfig.transforms;
|
|
78413
78486
|
if (schemaTransforms == null) {
|
|
@@ -78505,14 +78578,14 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object3,
|
|
|
78505
78578
|
const nullResult = {};
|
|
78506
78579
|
for (const [responseKey, fieldNodes] of fields2) {
|
|
78507
78580
|
const combinedPath = [...path2, responseKey];
|
|
78508
|
-
if (resolverResult instanceof
|
|
78581
|
+
if (resolverResult instanceof import_graphql52.GraphQLError) {
|
|
78509
78582
|
if (resolverResult.message.includes("Cannot return null for non-nullable field")) {
|
|
78510
78583
|
nullResult[responseKey] = null;
|
|
78511
78584
|
} else {
|
|
78512
78585
|
nullResult[responseKey] = relocatedError(resolverResult, combinedPath);
|
|
78513
78586
|
}
|
|
78514
78587
|
} else if (resolverResult instanceof Error) {
|
|
78515
|
-
nullResult[responseKey] =
|
|
78588
|
+
nullResult[responseKey] = import_graphql52.locatedError(resolverResult, fieldNodes, combinedPath);
|
|
78516
78589
|
} else {
|
|
78517
78590
|
nullResult[responseKey] = null;
|
|
78518
78591
|
}
|
|
@@ -78531,7 +78604,7 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object3,
|
|
|
78531
78604
|
}
|
|
78532
78605
|
const existingPropValue = object3[responseKey];
|
|
78533
78606
|
const sourcePropValue = resolverResult[responseKey];
|
|
78534
|
-
if (responseKey === "__typename" && existingPropValue !== sourcePropValue &&
|
|
78607
|
+
if (responseKey === "__typename" && existingPropValue !== sourcePropValue && import_graphql52.isAbstractType(subschema.transformedSchema.getType(sourcePropValue))) {
|
|
78535
78608
|
continue;
|
|
78536
78609
|
}
|
|
78537
78610
|
if (sourcePropValue != null || existingPropValue == null) {
|
|
@@ -78578,22 +78651,22 @@ function executeDelegationStage(mergedTypeInfo, delegationMap, object3, context,
|
|
|
78578
78651
|
}
|
|
78579
78652
|
}
|
|
78580
78653
|
function resolveExternalValue(result, unpathedErrors, subschema, context, info, returnType = getReturnType$1(info), skipTypeMerging) {
|
|
78581
|
-
const type =
|
|
78654
|
+
const type = import_graphql52.getNullableType(returnType);
|
|
78582
78655
|
if (result instanceof Error) {
|
|
78583
78656
|
return result;
|
|
78584
78657
|
}
|
|
78585
78658
|
if (result == null) {
|
|
78586
78659
|
return reportUnpathedErrorsViaNull(unpathedErrors);
|
|
78587
78660
|
}
|
|
78588
|
-
if (
|
|
78661
|
+
if (import_graphql52.isLeafType(type)) {
|
|
78589
78662
|
try {
|
|
78590
78663
|
return type.parseValue(result);
|
|
78591
78664
|
} catch {
|
|
78592
78665
|
return null;
|
|
78593
78666
|
}
|
|
78594
|
-
} else if (
|
|
78667
|
+
} else if (import_graphql52.isCompositeType(type)) {
|
|
78595
78668
|
return handleMaybePromise(() => resolveExternalObject(type, result, unpathedErrors, subschema, context, info, skipTypeMerging), (result2) => {
|
|
78596
|
-
if (info &&
|
|
78669
|
+
if (info && import_graphql52.isAbstractType(type)) {
|
|
78597
78670
|
if (result2.__typename != null) {
|
|
78598
78671
|
const resolvedType = info.schema.getType(result2.__typename);
|
|
78599
78672
|
if (!resolvedType) {
|
|
@@ -78604,7 +78677,7 @@ function resolveExternalValue(result, unpathedErrors, subschema, context, info,
|
|
|
78604
78677
|
}
|
|
78605
78678
|
return result2;
|
|
78606
78679
|
});
|
|
78607
|
-
} else if (
|
|
78680
|
+
} else if (import_graphql52.isListType(type)) {
|
|
78608
78681
|
if (Array.isArray(result)) {
|
|
78609
78682
|
return resolveExternalList(type, result, unpathedErrors, subschema, context, info, skipTypeMerging);
|
|
78610
78683
|
}
|
|
@@ -78651,9 +78724,9 @@ function reportUnpathedErrorsViaNull(unpathedErrors) {
|
|
|
78651
78724
|
if (unreportedErrors.length) {
|
|
78652
78725
|
const unreportedError = unreportedErrors[0];
|
|
78653
78726
|
if (unreportedErrors.length === 1 && unreportedError) {
|
|
78654
|
-
return
|
|
78727
|
+
return import_graphql52.locatedError(unreportedError, undefined, unreportedError.path);
|
|
78655
78728
|
}
|
|
78656
|
-
return new AggregateError(unreportedErrors.map((e3) =>
|
|
78729
|
+
return new AggregateError(unreportedErrors.map((e3) => import_graphql52.locatedError(e3, undefined, unreportedError?.path)), unreportedErrors.map((error43) => error43.message).join(`,
|
|
78657
78730
|
`));
|
|
78658
78731
|
}
|
|
78659
78732
|
}
|
|
@@ -78678,7 +78751,7 @@ function checkResultAndHandleErrors(result = {
|
|
|
78678
78751
|
skipTypeMerging,
|
|
78679
78752
|
onLocatedError
|
|
78680
78753
|
} = delegationContext;
|
|
78681
|
-
const { data, unpathedErrors } = mergeDataAndErrors(result.data == null ? undefined : result.data[responseKey], result.errors == null ? [] : result.errors, info != null && info.path ?
|
|
78754
|
+
const { data, unpathedErrors } = mergeDataAndErrors(result.data == null ? undefined : result.data[responseKey], result.errors == null ? [] : result.errors, info != null && info.path ? import_graphql52.responsePathAsArray(info.path) : undefined, onLocatedError);
|
|
78682
78755
|
return resolveExternalValue(data, unpathedErrors, subschema, context, info, returnType, skipTypeMerging);
|
|
78683
78756
|
}
|
|
78684
78757
|
function mergeDataAndErrors(data, errors5, path2, onLocatedError, index = 1) {
|
|
@@ -78747,10 +78820,10 @@ function getDocumentMetadata(document) {
|
|
|
78747
78820
|
const fragmentNames = /* @__PURE__ */ new Set;
|
|
78748
78821
|
for (let i = 0;i < document.definitions.length; i++) {
|
|
78749
78822
|
const def = document.definitions[i];
|
|
78750
|
-
if (def?.kind ===
|
|
78823
|
+
if (def?.kind === import_graphql52.Kind.FRAGMENT_DEFINITION) {
|
|
78751
78824
|
fragments.push(def);
|
|
78752
78825
|
fragmentNames.add(def.name.value);
|
|
78753
|
-
} else if (def?.kind ===
|
|
78826
|
+
} else if (def?.kind === import_graphql52.Kind.OPERATION_DEFINITION) {
|
|
78754
78827
|
operations.push(def);
|
|
78755
78828
|
}
|
|
78756
78829
|
}
|
|
@@ -78761,32 +78834,32 @@ function getDocumentMetadata(document) {
|
|
|
78761
78834
|
};
|
|
78762
78835
|
}
|
|
78763
78836
|
var getTypeInfo = memoize1(function getTypeInfo2(schema) {
|
|
78764
|
-
return new
|
|
78837
|
+
return new import_graphql52.TypeInfo(schema);
|
|
78765
78838
|
});
|
|
78766
78839
|
var getTypeInfoWithType = memoize2(function getTypeInfoWithType2(schema, type) {
|
|
78767
|
-
return
|
|
78840
|
+
return import_graphql52.versionInfo.major < 16 ? new import_graphql52.TypeInfo(schema, undefined, type) : new import_graphql52.TypeInfo(schema, type);
|
|
78768
78841
|
});
|
|
78769
78842
|
function updateArgument2(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value) {
|
|
78770
78843
|
argumentNodes[argName] = {
|
|
78771
|
-
kind:
|
|
78844
|
+
kind: import_graphql52.Kind.ARGUMENT,
|
|
78772
78845
|
name: {
|
|
78773
|
-
kind:
|
|
78846
|
+
kind: import_graphql52.Kind.NAME,
|
|
78774
78847
|
value: argName
|
|
78775
78848
|
},
|
|
78776
78849
|
value: {
|
|
78777
|
-
kind:
|
|
78850
|
+
kind: import_graphql52.Kind.VARIABLE,
|
|
78778
78851
|
name: {
|
|
78779
|
-
kind:
|
|
78852
|
+
kind: import_graphql52.Kind.NAME,
|
|
78780
78853
|
value: varName
|
|
78781
78854
|
}
|
|
78782
78855
|
}
|
|
78783
78856
|
};
|
|
78784
78857
|
variableDefinitionsMap[varName] = {
|
|
78785
|
-
kind:
|
|
78858
|
+
kind: import_graphql52.Kind.VARIABLE_DEFINITION,
|
|
78786
78859
|
variable: {
|
|
78787
|
-
kind:
|
|
78860
|
+
kind: import_graphql52.Kind.VARIABLE,
|
|
78788
78861
|
name: {
|
|
78789
|
-
kind:
|
|
78862
|
+
kind: import_graphql52.Kind.NAME,
|
|
78790
78863
|
value: varName
|
|
78791
78864
|
}
|
|
78792
78865
|
},
|
|
@@ -78846,13 +78919,13 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78846
78919
|
fragmentSet = collectedFragmentSet;
|
|
78847
78920
|
const variableDefinitions = (operation.variableDefinitions ?? []).filter((variable) => operationOrFragmentVariables.indexOf(variable.variable.name.value) !== -1);
|
|
78848
78921
|
if (operation.operation === "subscription") {
|
|
78849
|
-
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !==
|
|
78922
|
+
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !== import_graphql52.Kind.FIELD || selection.name.value !== "__typename");
|
|
78850
78923
|
}
|
|
78851
|
-
if (selectionSet.selections.length === 1 && selectionSet.selections[0] && selectionSet.selections[0].kind ===
|
|
78924
|
+
if (selectionSet.selections.length === 1 && selectionSet.selections[0] && selectionSet.selections[0].kind === import_graphql52.Kind.FIELD && selectionSet.selections[0].name.value === "__typename") {
|
|
78852
78925
|
continue;
|
|
78853
78926
|
}
|
|
78854
78927
|
newOperations.push({
|
|
78855
|
-
kind:
|
|
78928
|
+
kind: import_graphql52.Kind.OPERATION_DEFINITION,
|
|
78856
78929
|
operation: operation.operation,
|
|
78857
78930
|
name: operation.name,
|
|
78858
78931
|
directives: operation.directives,
|
|
@@ -78868,14 +78941,14 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78868
78941
|
});
|
|
78869
78942
|
}
|
|
78870
78943
|
let newDocument = {
|
|
78871
|
-
kind:
|
|
78944
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
78872
78945
|
definitions: [...newOperations, ...newFragments]
|
|
78873
78946
|
};
|
|
78874
78947
|
const stitchingInfo = delegationContext.info?.schema?.extensions?.["stitchingInfo"];
|
|
78875
78948
|
if (stitchingInfo != null) {
|
|
78876
78949
|
const typeInfo = getTypeInfo(targetSchema);
|
|
78877
|
-
newDocument =
|
|
78878
|
-
[
|
|
78950
|
+
newDocument = import_graphql52.visit(newDocument, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
78951
|
+
[import_graphql52.Kind.FIELD](fieldNode) {
|
|
78879
78952
|
const parentType = typeInfo.getParentType();
|
|
78880
78953
|
if (parentType) {
|
|
78881
78954
|
const parentTypeName = parentType.name;
|
|
@@ -78888,7 +78961,7 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78888
78961
|
return {
|
|
78889
78962
|
...fieldNode,
|
|
78890
78963
|
selectionSet: {
|
|
78891
|
-
kind:
|
|
78964
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
78892
78965
|
selections: [
|
|
78893
78966
|
...providedSelection.selections,
|
|
78894
78967
|
...fieldNode.selectionSet?.selections ?? []
|
|
@@ -78934,7 +79007,7 @@ function finalizeGatewayRequest(originalRequest, delegationContext, onOverlappin
|
|
|
78934
79007
|
};
|
|
78935
79008
|
}
|
|
78936
79009
|
function isTypeNameField(selection) {
|
|
78937
|
-
return selection.kind ===
|
|
79010
|
+
return selection.kind === import_graphql52.Kind.FIELD && !selection.alias && selection.name.value === "__typename";
|
|
78938
79011
|
}
|
|
78939
79012
|
function filterTypenameFields(selections) {
|
|
78940
79013
|
let hasTypeNameField = false;
|
|
@@ -78960,7 +79033,7 @@ function addVariablesToRootFields(targetSchema, operations, args) {
|
|
|
78960
79033
|
const type = getDefinedRootType(targetSchema, operation.operation);
|
|
78961
79034
|
const newSelections = [];
|
|
78962
79035
|
for (const selection of operation.selectionSet.selections) {
|
|
78963
|
-
if (selection.kind ===
|
|
79036
|
+
if (selection.kind === import_graphql52.Kind.FIELD) {
|
|
78964
79037
|
const argumentNodes = selection.arguments ?? [];
|
|
78965
79038
|
const argumentNodeMap = argumentNodes.reduce((prev, argument) => ({
|
|
78966
79039
|
...prev,
|
|
@@ -78979,7 +79052,7 @@ function addVariablesToRootFields(targetSchema, operations, args) {
|
|
|
78979
79052
|
}
|
|
78980
79053
|
}
|
|
78981
79054
|
const newSelectionSet = {
|
|
78982
|
-
kind:
|
|
79055
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
78983
79056
|
selections: newSelections
|
|
78984
79057
|
};
|
|
78985
79058
|
return {
|
|
@@ -79027,9 +79100,9 @@ function collectFragmentVariables(targetSchema, fragmentSet, validFragments, val
|
|
|
79027
79100
|
if (name && !(name in fragmentSet)) {
|
|
79028
79101
|
fragmentSet[name] = true;
|
|
79029
79102
|
newFragments.push({
|
|
79030
|
-
kind:
|
|
79103
|
+
kind: import_graphql52.Kind.FRAGMENT_DEFINITION,
|
|
79031
79104
|
name: {
|
|
79032
|
-
kind:
|
|
79105
|
+
kind: import_graphql52.Kind.NAME,
|
|
79033
79106
|
value: name
|
|
79034
79107
|
},
|
|
79035
79108
|
typeCondition: fragment.typeCondition,
|
|
@@ -79069,8 +79142,8 @@ function finalizeSelectionSet(schema, type, validFragments, selectionSet, onOver
|
|
|
79069
79142
|
const seenNonNullableMap = /* @__PURE__ */ new WeakMap;
|
|
79070
79143
|
const seenNullableMap = /* @__PURE__ */ new WeakMap;
|
|
79071
79144
|
const filteredSelectionSet = filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOverlappingAliases, usedFragments, seenNonNullableMap, seenNullableMap);
|
|
79072
|
-
|
|
79073
|
-
[
|
|
79145
|
+
import_graphql52.visit(filteredSelectionSet, {
|
|
79146
|
+
[import_graphql52.Kind.VARIABLE]: (variableNode) => {
|
|
79074
79147
|
usedVariables.push(variableNode.name.value);
|
|
79075
79148
|
}
|
|
79076
79149
|
}, variablesVisitorKeys);
|
|
@@ -79081,11 +79154,11 @@ function finalizeSelectionSet(schema, type, validFragments, selectionSet, onOver
|
|
|
79081
79154
|
};
|
|
79082
79155
|
}
|
|
79083
79156
|
function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOverlappingAliases, usedFragments, seenNonNullableMap, seenNullableMap) {
|
|
79084
|
-
return
|
|
79085
|
-
[
|
|
79157
|
+
return import_graphql52.visit(selectionSet, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79158
|
+
[import_graphql52.Kind.FIELD]: {
|
|
79086
79159
|
enter: (node) => {
|
|
79087
79160
|
const parentType = typeInfo.getParentType();
|
|
79088
|
-
if (
|
|
79161
|
+
if (import_graphql52.isObjectType(parentType) || import_graphql52.isInterfaceType(parentType)) {
|
|
79089
79162
|
const field = typeInfo.getFieldDef();
|
|
79090
79163
|
if (!field) {
|
|
79091
79164
|
return null;
|
|
@@ -79110,18 +79183,18 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79110
79183
|
}
|
|
79111
79184
|
}
|
|
79112
79185
|
}
|
|
79113
|
-
if (
|
|
79186
|
+
if (import_graphql52.isUnionType(parentType) && typeInfo.getType() == null) {
|
|
79114
79187
|
const possibleTypeNames = [];
|
|
79115
79188
|
const fieldName = node.name.value;
|
|
79116
79189
|
for (const memberType of parentType.getTypes()) {
|
|
79117
79190
|
const memberFields = memberType.getFields();
|
|
79118
79191
|
const possibleField = memberFields[fieldName];
|
|
79119
79192
|
if (possibleField != null) {
|
|
79120
|
-
const namedType =
|
|
79121
|
-
if (node.selectionSet?.selections?.length &&
|
|
79193
|
+
const namedType = import_graphql52.getNamedType(possibleField.type);
|
|
79194
|
+
if (node.selectionSet?.selections?.length && import_graphql52.isLeafType(namedType)) {
|
|
79122
79195
|
continue;
|
|
79123
79196
|
}
|
|
79124
|
-
if (!node.selectionSet?.selections?.length &&
|
|
79197
|
+
if (!node.selectionSet?.selections?.length && import_graphql52.isCompositeType(namedType)) {
|
|
79125
79198
|
continue;
|
|
79126
79199
|
}
|
|
79127
79200
|
possibleTypeNames.push(memberType.name);
|
|
@@ -79131,16 +79204,16 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79131
79204
|
const spreads = possibleTypeNames.map((possibleTypeName) => {
|
|
79132
79205
|
if (!node.selectionSet?.selections) {
|
|
79133
79206
|
return {
|
|
79134
|
-
kind:
|
|
79207
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79135
79208
|
typeCondition: {
|
|
79136
|
-
kind:
|
|
79209
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79137
79210
|
name: {
|
|
79138
|
-
kind:
|
|
79211
|
+
kind: import_graphql52.Kind.NAME,
|
|
79139
79212
|
value: possibleTypeName
|
|
79140
79213
|
}
|
|
79141
79214
|
},
|
|
79142
79215
|
selectionSet: {
|
|
79143
|
-
kind:
|
|
79216
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79144
79217
|
selections: [node]
|
|
79145
79218
|
}
|
|
79146
79219
|
};
|
|
@@ -79155,16 +79228,16 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79155
79228
|
return;
|
|
79156
79229
|
}
|
|
79157
79230
|
return {
|
|
79158
|
-
kind:
|
|
79231
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79159
79232
|
typeCondition: {
|
|
79160
|
-
kind:
|
|
79233
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79161
79234
|
name: {
|
|
79162
|
-
kind:
|
|
79235
|
+
kind: import_graphql52.Kind.NAME,
|
|
79163
79236
|
value: possibleTypeName
|
|
79164
79237
|
}
|
|
79165
79238
|
},
|
|
79166
79239
|
selectionSet: {
|
|
79167
|
-
kind:
|
|
79240
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79168
79241
|
selections: [
|
|
79169
79242
|
{
|
|
79170
79243
|
...node,
|
|
@@ -79188,11 +79261,11 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79188
79261
|
if (type == null) {
|
|
79189
79262
|
return null;
|
|
79190
79263
|
}
|
|
79191
|
-
const namedType =
|
|
79264
|
+
const namedType = import_graphql52.getNamedType(type);
|
|
79192
79265
|
if (schema.getType(namedType.name) == null) {
|
|
79193
79266
|
return null;
|
|
79194
79267
|
}
|
|
79195
|
-
if (
|
|
79268
|
+
if (import_graphql52.isObjectType(namedType) || import_graphql52.isInterfaceType(namedType)) {
|
|
79196
79269
|
const selections = node.selectionSet != null ? node.selectionSet.selections : null;
|
|
79197
79270
|
if (selections == null || selections.length === 0) {
|
|
79198
79271
|
return null;
|
|
@@ -79201,7 +79274,7 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79201
79274
|
return;
|
|
79202
79275
|
}
|
|
79203
79276
|
},
|
|
79204
|
-
[
|
|
79277
|
+
[import_graphql52.Kind.FRAGMENT_SPREAD]: {
|
|
79205
79278
|
enter: (node) => {
|
|
79206
79279
|
if (!(node.name.value in validFragments)) {
|
|
79207
79280
|
return null;
|
|
@@ -79215,15 +79288,15 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79215
79288
|
return;
|
|
79216
79289
|
}
|
|
79217
79290
|
},
|
|
79218
|
-
[
|
|
79291
|
+
[import_graphql52.Kind.SELECTION_SET]: {
|
|
79219
79292
|
enter: (node, _key, _parent, _path) => {
|
|
79220
79293
|
const parentType = typeInfo.getParentType();
|
|
79221
79294
|
const { hasTypeNameField, selections } = filterTypenameFields(node.selections);
|
|
79222
|
-
if (hasTypeNameField || parentType != null &&
|
|
79295
|
+
if (hasTypeNameField || parentType != null && import_graphql52.isAbstractType(parentType)) {
|
|
79223
79296
|
selections.unshift({
|
|
79224
|
-
kind:
|
|
79297
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79225
79298
|
name: {
|
|
79226
|
-
kind:
|
|
79299
|
+
kind: import_graphql52.Kind.NAME,
|
|
79227
79300
|
value: "__typename"
|
|
79228
79301
|
}
|
|
79229
79302
|
});
|
|
@@ -79234,12 +79307,12 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79234
79307
|
};
|
|
79235
79308
|
}
|
|
79236
79309
|
},
|
|
79237
|
-
[
|
|
79310
|
+
[import_graphql52.Kind.INLINE_FRAGMENT]: {
|
|
79238
79311
|
enter: (node) => {
|
|
79239
79312
|
if (node.typeCondition != null) {
|
|
79240
79313
|
const parentType = typeInfo.getParentType();
|
|
79241
79314
|
const innerType = schema.getType(node.typeCondition.name.value);
|
|
79242
|
-
if (
|
|
79315
|
+
if (import_graphql52.isUnionType(parentType) && parentType.getTypes().some((t) => t.name === innerType?.name)) {
|
|
79243
79316
|
return node;
|
|
79244
79317
|
}
|
|
79245
79318
|
if (!implementsAbstractType(schema, parentType, innerType)) {
|
|
@@ -79273,13 +79346,13 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79273
79346
|
selectionSet: {
|
|
79274
79347
|
...selection.selectionSet,
|
|
79275
79348
|
selections: selection.selectionSet.selections.map((subSelection) => {
|
|
79276
|
-
if (subSelection.kind ===
|
|
79349
|
+
if (subSelection.kind === import_graphql52.Kind.FIELD) {
|
|
79277
79350
|
const fieldName = subSelection.name.value;
|
|
79278
79351
|
if (!subSelection.alias) {
|
|
79279
79352
|
const field = selectionTypeFields[fieldName];
|
|
79280
79353
|
if (field) {
|
|
79281
79354
|
let currentNullable;
|
|
79282
|
-
if (
|
|
79355
|
+
if (import_graphql52.isNullableType(field.type)) {
|
|
79283
79356
|
seenNullable.add(fieldName);
|
|
79284
79357
|
currentNullable = true;
|
|
79285
79358
|
} else {
|
|
@@ -79291,7 +79364,7 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79291
79364
|
return {
|
|
79292
79365
|
...subSelection,
|
|
79293
79366
|
alias: {
|
|
79294
|
-
kind:
|
|
79367
|
+
kind: import_graphql52.Kind.NAME,
|
|
79295
79368
|
value: currentNullable ? `_nullable_${fieldName}` : `_nonNullable_${fieldName}`
|
|
79296
79369
|
}
|
|
79297
79370
|
};
|
|
@@ -79353,7 +79426,7 @@ function prepareGatewayDocument(originalDocument, transformedSchema, returnType,
|
|
|
79353
79426
|
const { expandedFragments, fragmentReplacements } = getExpandedFragments(fragments, fragmentNames, possibleTypesMap);
|
|
79354
79427
|
const typeInfo = getTypeInfo(transformedSchema);
|
|
79355
79428
|
const expandedDocument = {
|
|
79356
|
-
kind:
|
|
79429
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
79357
79430
|
definitions: [...operations, ...fragments, ...expandedFragments]
|
|
79358
79431
|
};
|
|
79359
79432
|
const visitorKeyMap = {
|
|
@@ -79364,8 +79437,8 @@ function prepareGatewayDocument(originalDocument, transformedSchema, returnType,
|
|
|
79364
79437
|
InlineFragment: ["selectionSet"],
|
|
79365
79438
|
FragmentDefinition: ["selectionSet"]
|
|
79366
79439
|
};
|
|
79367
|
-
return
|
|
79368
|
-
[
|
|
79440
|
+
return import_graphql52.visit(expandedDocument, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79441
|
+
[import_graphql52.Kind.SELECTION_SET]: (node) => visitSelectionSet(node, fragmentReplacements, transformedSchema, typeInfo, possibleTypesMap, reversePossibleTypesMap2, interfaceExtensionsMap, fieldNodesByType, fieldNodesByField, dynamicSelectionSetsByField, infoSchema, visitedSelections)
|
|
79369
79442
|
}), visitorKeyMap);
|
|
79370
79443
|
}
|
|
79371
79444
|
var getExtraPossibleTypesFn = memoize2(function getExtraPossibleTypes(transformedSchema, infoSchema) {
|
|
@@ -79376,7 +79449,7 @@ var getExtraPossibleTypesFn = memoize2(function getExtraPossibleTypes(transforme
|
|
|
79376
79449
|
extraTypesForSubschema = /* @__PURE__ */ new Set;
|
|
79377
79450
|
const gatewayType = infoSchema.getType(typeName);
|
|
79378
79451
|
const subschemaType = transformedSchema.getType(typeName);
|
|
79379
|
-
if (
|
|
79452
|
+
if (import_graphql52.isAbstractType(gatewayType) && import_graphql52.isAbstractType(subschemaType)) {
|
|
79380
79453
|
const possibleTypes = infoSchema.getPossibleTypes(gatewayType);
|
|
79381
79454
|
const possibleTypesInSubschema = transformedSchema.getPossibleTypes(subschemaType);
|
|
79382
79455
|
for (const possibleType of possibleTypes) {
|
|
@@ -79399,7 +79472,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79399
79472
|
const newSelections = /* @__PURE__ */ new Set;
|
|
79400
79473
|
const maybeType = typeInfo.getParentType();
|
|
79401
79474
|
if (maybeType != null) {
|
|
79402
|
-
const parentType =
|
|
79475
|
+
const parentType = import_graphql52.getNamedType(maybeType);
|
|
79403
79476
|
const parentTypeName = parentType.name;
|
|
79404
79477
|
const fieldNodes = fieldNodesByType[parentTypeName];
|
|
79405
79478
|
if (fieldNodes) {
|
|
@@ -79410,7 +79483,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79410
79483
|
const interfaceExtensions = interfaceExtensionsMap[parentType.name];
|
|
79411
79484
|
const interfaceExtensionFields = [];
|
|
79412
79485
|
for (const selection of node.selections) {
|
|
79413
|
-
if (selection.kind ===
|
|
79486
|
+
if (selection.kind === import_graphql52.Kind.INLINE_FRAGMENT) {
|
|
79414
79487
|
if (selection.typeCondition != null) {
|
|
79415
79488
|
if (!visitedSelections.has(selection)) {
|
|
79416
79489
|
visitedSelections.add(selection);
|
|
@@ -79421,19 +79494,19 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79421
79494
|
newSelections.add({
|
|
79422
79495
|
...selection,
|
|
79423
79496
|
typeCondition: {
|
|
79424
|
-
kind:
|
|
79497
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79425
79498
|
name: {
|
|
79426
|
-
kind:
|
|
79499
|
+
kind: import_graphql52.Kind.NAME,
|
|
79427
79500
|
value: extraPossibleTypeName
|
|
79428
79501
|
}
|
|
79429
79502
|
}
|
|
79430
79503
|
});
|
|
79431
79504
|
}
|
|
79432
79505
|
const typeInSubschema = transformedSchema.getType(typeName);
|
|
79433
|
-
if (
|
|
79506
|
+
if (import_graphql52.isObjectType(typeInSubschema) || import_graphql52.isInterfaceType(typeInSubschema)) {
|
|
79434
79507
|
const fieldMap = typeInSubschema.getFields();
|
|
79435
79508
|
for (const subSelection of selection.selectionSet.selections) {
|
|
79436
|
-
if (subSelection.kind ===
|
|
79509
|
+
if (subSelection.kind === import_graphql52.Kind.FIELD) {
|
|
79437
79510
|
const fieldName = subSelection.name.value;
|
|
79438
79511
|
const field = fieldMap[fieldName];
|
|
79439
79512
|
if (!field) {
|
|
@@ -79470,7 +79543,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79470
79543
|
} else {
|
|
79471
79544
|
newSelections.add(selection);
|
|
79472
79545
|
}
|
|
79473
|
-
} else if (selection.kind ===
|
|
79546
|
+
} else if (selection.kind === import_graphql52.Kind.FRAGMENT_SPREAD) {
|
|
79474
79547
|
const fragmentName = selection.name.value;
|
|
79475
79548
|
if (!fragmentReplacements[fragmentName]) {
|
|
79476
79549
|
newSelections.add(selection);
|
|
@@ -79481,9 +79554,9 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79481
79554
|
const maybeReplacementType = transformedSchema.getType(typeName);
|
|
79482
79555
|
if (maybeReplacementType != null && implementsAbstractType(transformedSchema, parentType, maybeType)) {
|
|
79483
79556
|
newSelections.add({
|
|
79484
|
-
kind:
|
|
79557
|
+
kind: import_graphql52.Kind.FRAGMENT_SPREAD,
|
|
79485
79558
|
name: {
|
|
79486
|
-
kind:
|
|
79559
|
+
kind: import_graphql52.Kind.NAME,
|
|
79487
79560
|
value: replacement.fragmentName
|
|
79488
79561
|
}
|
|
79489
79562
|
});
|
|
@@ -79491,7 +79564,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79491
79564
|
}
|
|
79492
79565
|
} else {
|
|
79493
79566
|
const fieldName = selection.name.value;
|
|
79494
|
-
if (
|
|
79567
|
+
if (import_graphql52.isAbstractType(parentType)) {
|
|
79495
79568
|
const fieldNodesForTypeName = fieldNodesByField[parentTypeName]?.["__typename"];
|
|
79496
79569
|
if (fieldNodesForTypeName) {
|
|
79497
79570
|
for (const fieldNode of fieldNodesForTypeName) {
|
|
@@ -79523,9 +79596,9 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79523
79596
|
}
|
|
79524
79597
|
if (reversePossibleTypesMap2[parentType.name]) {
|
|
79525
79598
|
newSelections.add({
|
|
79526
|
-
kind:
|
|
79599
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79527
79600
|
name: {
|
|
79528
|
-
kind:
|
|
79601
|
+
kind: import_graphql52.Kind.NAME,
|
|
79529
79602
|
value: "__typename"
|
|
79530
79603
|
}
|
|
79531
79604
|
});
|
|
@@ -79535,7 +79608,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79535
79608
|
if (possibleTypes != null) {
|
|
79536
79609
|
for (const possibleType of possibleTypes) {
|
|
79537
79610
|
newSelections.add(generateInlineFragment(possibleType, {
|
|
79538
|
-
kind:
|
|
79611
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79539
79612
|
selections: interfaceExtensionFields
|
|
79540
79613
|
}));
|
|
79541
79614
|
}
|
|
@@ -79563,11 +79636,11 @@ function addDependenciesNestedly(fieldNode, seenFieldNames, fieldNodesByField, n
|
|
|
79563
79636
|
}
|
|
79564
79637
|
function generateInlineFragment(typeName, selectionSet) {
|
|
79565
79638
|
return {
|
|
79566
|
-
kind:
|
|
79639
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79567
79640
|
typeCondition: {
|
|
79568
|
-
kind:
|
|
79641
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79569
79642
|
name: {
|
|
79570
|
-
kind:
|
|
79643
|
+
kind: import_graphql52.Kind.NAME,
|
|
79571
79644
|
value: typeName
|
|
79572
79645
|
}
|
|
79573
79646
|
},
|
|
@@ -79581,9 +79654,9 @@ var getSchemaMetaData = memoize2((sourceSchema, targetSchema) => {
|
|
|
79581
79654
|
const interfaceExtensionsMap = /* @__PURE__ */ Object.create(null);
|
|
79582
79655
|
for (const typeName in typeMap) {
|
|
79583
79656
|
const type = typeMap[typeName];
|
|
79584
|
-
if (
|
|
79657
|
+
if (import_graphql52.isAbstractType(type)) {
|
|
79585
79658
|
const targetType = targetTypeMap[typeName];
|
|
79586
|
-
if (
|
|
79659
|
+
if (import_graphql52.isInterfaceType(type) && import_graphql52.isInterfaceType(targetType)) {
|
|
79587
79660
|
const targetTypeFields = targetType.getFields();
|
|
79588
79661
|
const sourceTypeFields = type.getFields();
|
|
79589
79662
|
const extensionFields = /* @__PURE__ */ Object.create(null);
|
|
@@ -79598,7 +79671,7 @@ var getSchemaMetaData = memoize2((sourceSchema, targetSchema) => {
|
|
|
79598
79671
|
interfaceExtensionsMap[typeName] = extensionFields;
|
|
79599
79672
|
}
|
|
79600
79673
|
}
|
|
79601
|
-
if (interfaceExtensionsMap[typeName] || !
|
|
79674
|
+
if (interfaceExtensionsMap[typeName] || !import_graphql52.isAbstractType(targetType)) {
|
|
79602
79675
|
const implementations = sourceSchema.getPossibleTypes(type);
|
|
79603
79676
|
possibleTypesMap[typeName] = [];
|
|
79604
79677
|
for (const impl of implementations) {
|
|
@@ -79655,15 +79728,15 @@ function getExpandedFragments(fragments, fragmentNames, possibleTypesMap) {
|
|
|
79655
79728
|
const name = generateFragmentName(possibleTypeName);
|
|
79656
79729
|
fragmentNames.add(name);
|
|
79657
79730
|
expandedFragments.push({
|
|
79658
|
-
kind:
|
|
79731
|
+
kind: import_graphql52.Kind.FRAGMENT_DEFINITION,
|
|
79659
79732
|
name: {
|
|
79660
|
-
kind:
|
|
79733
|
+
kind: import_graphql52.Kind.NAME,
|
|
79661
79734
|
value: name
|
|
79662
79735
|
},
|
|
79663
79736
|
typeCondition: {
|
|
79664
|
-
kind:
|
|
79737
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79665
79738
|
name: {
|
|
79666
|
-
kind:
|
|
79739
|
+
kind: import_graphql52.Kind.NAME,
|
|
79667
79740
|
value: possibleTypeName
|
|
79668
79741
|
}
|
|
79669
79742
|
},
|
|
@@ -79682,11 +79755,11 @@ function getExpandedFragments(fragments, fragmentNames, possibleTypesMap) {
|
|
|
79682
79755
|
};
|
|
79683
79756
|
}
|
|
79684
79757
|
function wrapConcreteTypes(returnType, targetSchema, document) {
|
|
79685
|
-
const namedType =
|
|
79686
|
-
if (
|
|
79758
|
+
const namedType = import_graphql52.getNamedType(returnType);
|
|
79759
|
+
if (import_graphql52.isLeafType(namedType)) {
|
|
79687
79760
|
return document;
|
|
79688
79761
|
}
|
|
79689
|
-
let possibleTypes =
|
|
79762
|
+
let possibleTypes = import_graphql52.isAbstractType(namedType) ? targetSchema.getPossibleTypes(namedType) : [namedType];
|
|
79690
79763
|
if (possibleTypes.length === 0) {
|
|
79691
79764
|
possibleTypes = [namedType];
|
|
79692
79765
|
}
|
|
@@ -79699,29 +79772,29 @@ function wrapConcreteTypes(returnType, targetSchema, document) {
|
|
|
79699
79772
|
InlineFragment: ["selectionSet"],
|
|
79700
79773
|
FragmentDefinition: ["selectionSet"]
|
|
79701
79774
|
};
|
|
79702
|
-
return
|
|
79703
|
-
[
|
|
79775
|
+
return import_graphql52.visit(document, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79776
|
+
[import_graphql52.Kind.FRAGMENT_DEFINITION]: (node) => {
|
|
79704
79777
|
const typeName = node.typeCondition.name.value;
|
|
79705
79778
|
if (!rootTypeNames.has(typeName)) {
|
|
79706
79779
|
return false;
|
|
79707
79780
|
}
|
|
79708
79781
|
return;
|
|
79709
79782
|
},
|
|
79710
|
-
[
|
|
79783
|
+
[import_graphql52.Kind.FIELD]: (node) => {
|
|
79711
79784
|
const fieldType = typeInfo.getType();
|
|
79712
79785
|
if (fieldType) {
|
|
79713
|
-
const fieldNamedType =
|
|
79714
|
-
if (
|
|
79786
|
+
const fieldNamedType = import_graphql52.getNamedType(fieldType);
|
|
79787
|
+
if (import_graphql52.isAbstractType(fieldNamedType) && fieldNamedType.name !== namedType.name && possibleTypes.length > 0) {
|
|
79715
79788
|
return {
|
|
79716
79789
|
...node,
|
|
79717
79790
|
selectionSet: {
|
|
79718
|
-
kind:
|
|
79791
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79719
79792
|
selections: possibleTypes.map((possibleType) => ({
|
|
79720
|
-
kind:
|
|
79793
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79721
79794
|
typeCondition: {
|
|
79722
|
-
kind:
|
|
79795
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79723
79796
|
name: {
|
|
79724
|
-
kind:
|
|
79797
|
+
kind: import_graphql52.Kind.NAME,
|
|
79725
79798
|
value: possibleType.name
|
|
79726
79799
|
}
|
|
79727
79800
|
},
|
|
@@ -79807,6 +79880,7 @@ function getDelegatingOperation(parentType, schema) {
|
|
|
79807
79880
|
return "query";
|
|
79808
79881
|
}
|
|
79809
79882
|
function createRequest({
|
|
79883
|
+
subgraphName,
|
|
79810
79884
|
sourceSchema,
|
|
79811
79885
|
sourceParentType,
|
|
79812
79886
|
sourceFieldName,
|
|
@@ -79836,7 +79910,7 @@ function createRequest({
|
|
|
79836
79910
|
}
|
|
79837
79911
|
}
|
|
79838
79912
|
newSelectionSet = selections.length ? {
|
|
79839
|
-
kind:
|
|
79913
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79840
79914
|
selections
|
|
79841
79915
|
} : undefined;
|
|
79842
79916
|
const args = fieldNodes?.[0]?.arguments;
|
|
@@ -79852,7 +79926,7 @@ function createRequest({
|
|
|
79852
79926
|
for (const def of variableDefinitions) {
|
|
79853
79927
|
const varName = def.variable.name.value;
|
|
79854
79928
|
variableDefinitionMap[varName] = def;
|
|
79855
|
-
const varType =
|
|
79929
|
+
const varType = import_graphql52.typeFromAST(sourceSchema, def.type);
|
|
79856
79930
|
const serializedValue = serializeInputValue(varType, variableValues?.[varName]);
|
|
79857
79931
|
if (serializedValue !== undefined) {
|
|
79858
79932
|
newVariables[varName] = serializedValue;
|
|
@@ -79868,26 +79942,26 @@ function createRequest({
|
|
|
79868
79942
|
throw new Error(`Either "targetFieldName" or a non empty "fieldNodes" array must be provided.`);
|
|
79869
79943
|
}
|
|
79870
79944
|
const rootfieldNode = {
|
|
79871
|
-
kind:
|
|
79945
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79872
79946
|
arguments: Object.values(argumentNodeMap),
|
|
79873
79947
|
name: {
|
|
79874
|
-
kind:
|
|
79948
|
+
kind: import_graphql52.Kind.NAME,
|
|
79875
79949
|
value: rootFieldName
|
|
79876
79950
|
},
|
|
79877
79951
|
selectionSet: newSelectionSet,
|
|
79878
79952
|
directives: fieldNode?.directives
|
|
79879
79953
|
};
|
|
79880
79954
|
const operationName = targetOperationName ? {
|
|
79881
|
-
kind:
|
|
79955
|
+
kind: import_graphql52.Kind.NAME,
|
|
79882
79956
|
value: targetOperationName
|
|
79883
79957
|
} : undefined;
|
|
79884
79958
|
const operationDefinition = {
|
|
79885
|
-
kind:
|
|
79959
|
+
kind: import_graphql52.Kind.OPERATION_DEFINITION,
|
|
79886
79960
|
name: operationName,
|
|
79887
79961
|
operation: targetOperation,
|
|
79888
79962
|
variableDefinitions: Object.values(variableDefinitionMap),
|
|
79889
79963
|
selectionSet: {
|
|
79890
|
-
kind:
|
|
79964
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79891
79965
|
selections: [rootfieldNode]
|
|
79892
79966
|
}
|
|
79893
79967
|
};
|
|
@@ -79901,10 +79975,11 @@ function createRequest({
|
|
|
79901
79975
|
}
|
|
79902
79976
|
}
|
|
79903
79977
|
const document = {
|
|
79904
|
-
kind:
|
|
79978
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
79905
79979
|
definitions
|
|
79906
79980
|
};
|
|
79907
79981
|
return {
|
|
79982
|
+
subgraphName,
|
|
79908
79983
|
document,
|
|
79909
79984
|
variables: newVariables,
|
|
79910
79985
|
rootValue: targetRootValue,
|
|
@@ -79937,7 +80012,7 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
79937
80012
|
}
|
|
79938
80013
|
const responseKey = getResponseKeyFromInfo(info);
|
|
79939
80014
|
if (!isExternalObject(parent)) {
|
|
79940
|
-
return
|
|
80015
|
+
return import_graphql52.defaultFieldResolver(parent, args, context, info);
|
|
79941
80016
|
}
|
|
79942
80017
|
if (!Object.prototype.hasOwnProperty.call(parent, responseKey)) {
|
|
79943
80018
|
const leftOver = getPlanLeftOverFromParent(parent);
|
|
@@ -80007,7 +80082,7 @@ function handleLeftOver(parent, context, info, leftOver) {
|
|
|
80007
80082
|
}
|
|
80008
80083
|
if (selectionSets2.size) {
|
|
80009
80084
|
const selectionSet = {
|
|
80010
|
-
kind:
|
|
80085
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
80011
80086
|
selections: Array.from(selectionSets2).flatMap((selectionSet2) => selectionSet2.selections)
|
|
80012
80087
|
};
|
|
80013
80088
|
handleMaybePromise(() => flattenPromise(parent), (flattenedParent) => {
|
|
@@ -80025,7 +80100,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80025
80100
|
if (resolver) {
|
|
80026
80101
|
Object.assign(leftOverParent, flattenedParent);
|
|
80027
80102
|
const selectionSet2 = {
|
|
80028
|
-
kind:
|
|
80103
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
80029
80104
|
selections: missingFieldNodes
|
|
80030
80105
|
};
|
|
80031
80106
|
handleMaybePromise(() => resolver(leftOverParent, context, info, possibleSubschema, selectionSet2, info.parentType, info.parentType), (resolverResult) => {
|
|
@@ -80035,7 +80110,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80035
80110
|
}
|
|
80036
80111
|
} else {
|
|
80037
80112
|
for (const selectionNode of selectionSet.selections) {
|
|
80038
|
-
if (selectionNode.kind ===
|
|
80113
|
+
if (selectionNode.kind === import_graphql52.Kind.FIELD && selectionNode.selectionSet?.selections?.length) {
|
|
80039
80114
|
const responseKey = selectionNode.alias?.value ?? selectionNode.name.value;
|
|
80040
80115
|
const nestedParent = flattenedParent[responseKey];
|
|
80041
80116
|
const nestedSelectionSet = selectionNode.selectionSet;
|
|
@@ -80053,7 +80128,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80053
80128
|
if (resolver) {
|
|
80054
80129
|
const res = await resolver(nestedParentItem, context, info, subschema, selectionSet2, info.parentType, info.parentType);
|
|
80055
80130
|
if (res) {
|
|
80056
|
-
handleResolverResult(res, subschema, selectionSet2, nestedParentItem, nestedParentItem[FIELD_SUBSCHEMA_MAP_SYMBOL] ||= /* @__PURE__ */ new Map, info,
|
|
80131
|
+
handleResolverResult(res, subschema, selectionSet2, nestedParentItem, nestedParentItem[FIELD_SUBSCHEMA_MAP_SYMBOL] ||= /* @__PURE__ */ new Map, info, import_graphql52.responsePathAsArray(info.path), nestedParentItem[UNPATHED_ERRORS_SYMBOL] ||= []);
|
|
80057
80132
|
}
|
|
80058
80133
|
}
|
|
80059
80134
|
}
|
|
@@ -80076,7 +80151,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80076
80151
|
}
|
|
80077
80152
|
}
|
|
80078
80153
|
function handleDeferredResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOver, context, info) {
|
|
80079
|
-
handleResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOverParent[FIELD_SUBSCHEMA_MAP_SYMBOL], info,
|
|
80154
|
+
handleResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOverParent[FIELD_SUBSCHEMA_MAP_SYMBOL], info, import_graphql52.responsePathAsArray(info.path), leftOverParent[UNPATHED_ERRORS_SYMBOL]);
|
|
80080
80155
|
const deferredFields = leftOver.missingFieldsParentDeferredMap.get(leftOverParent);
|
|
80081
80156
|
if (deferredFields) {
|
|
80082
80157
|
for (const [responseKey, deferred] of deferredFields) {
|
|
@@ -80118,7 +80193,7 @@ function parentSatisfiedSelectionSet(parent, selectionSet) {
|
|
|
80118
80193
|
}
|
|
80119
80194
|
const subschemas = /* @__PURE__ */ new Set;
|
|
80120
80195
|
for (const selection of selectionSet.selections) {
|
|
80121
|
-
if (selection.kind ===
|
|
80196
|
+
if (selection.kind === import_graphql52.Kind.FIELD) {
|
|
80122
80197
|
const responseKey = selection.alias?.value ?? selection.name.value;
|
|
80123
80198
|
if (parent[responseKey] === undefined) {
|
|
80124
80199
|
return;
|
|
@@ -80141,7 +80216,7 @@ function parentSatisfiedSelectionSet(parent, selectionSet) {
|
|
|
80141
80216
|
subschemas.add(subschema);
|
|
80142
80217
|
}
|
|
80143
80218
|
}
|
|
80144
|
-
} else if (selection.kind ===
|
|
80219
|
+
} else if (selection.kind === import_graphql52.Kind.INLINE_FRAGMENT) {
|
|
80145
80220
|
const inlineSatisfied = parentSatisfiedSelectionSet(parent, selection.selectionSet);
|
|
80146
80221
|
if (inlineSatisfied === undefined) {
|
|
80147
80222
|
return;
|
|
@@ -80205,6 +80280,7 @@ function delegateToSchema(options) {
|
|
|
80205
80280
|
context
|
|
80206
80281
|
} = options;
|
|
80207
80282
|
const request = createRequest({
|
|
80283
|
+
subgraphName: schema.name,
|
|
80208
80284
|
sourceSchema: info.schema,
|
|
80209
80285
|
sourceParentType: info.parentType,
|
|
80210
80286
|
sourceFieldName: info.fieldName,
|
|
@@ -80242,7 +80318,7 @@ function delegateRequest(options) {
|
|
|
80242
80318
|
}
|
|
80243
80319
|
return handleMaybePromise(() => getExecutor(delegationContext)(processedRequest), function handleExecutorResult(executorResult) {
|
|
80244
80320
|
if (isAsyncIterable(executorResult)) {
|
|
80245
|
-
if (delegationContext.operation === "query" &&
|
|
80321
|
+
if (delegationContext.operation === "query" && import_graphql52.isListType(delegationContext.returnType)) {
|
|
80246
80322
|
return new Repeater(async (push2, stop2) => {
|
|
80247
80323
|
const pushed = /* @__PURE__ */ new WeakSet;
|
|
80248
80324
|
let stopped = false;
|
|
@@ -80353,7 +80429,7 @@ function getDelegationContext({
|
|
|
80353
80429
|
};
|
|
80354
80430
|
}
|
|
80355
80431
|
function validateRequest(delegationContext, document) {
|
|
80356
|
-
const errors5 =
|
|
80432
|
+
const errors5 = import_graphql52.validate(delegationContext.targetSchema, document);
|
|
80357
80433
|
if (errors5.length > 0) {
|
|
80358
80434
|
if (errors5.length > 1) {
|
|
80359
80435
|
const combinedError = new AggregateError(errors5, errors5.map((error210) => error210.message).join(`,
|
|
@@ -80377,8 +80453,8 @@ function getExecutor(delegationContext) {
|
|
|
80377
80453
|
return executor2;
|
|
80378
80454
|
}
|
|
80379
80455
|
|
|
80380
|
-
// ../../node_modules/.bun/@graphql-tools+wrap@
|
|
80381
|
-
var
|
|
80456
|
+
// ../../node_modules/.bun/@graphql-tools+wrap@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/wrap/dist/index.js
|
|
80457
|
+
var import_graphql53 = __toESM(require_graphql2(), 1);
|
|
80382
80458
|
function generateProxyingResolvers(subschemaConfig) {
|
|
80383
80459
|
const targetSchema = subschemaConfig.schema;
|
|
80384
80460
|
const createProxyingResolver = subschemaConfig.createProxyingResolver ?? defaultCreateProxyingResolver;
|
|
@@ -80464,21 +80540,21 @@ function createWrappingSchema(schema, proxyingResolvers) {
|
|
|
80464
80540
|
},
|
|
80465
80541
|
[MapperKind.OBJECT_TYPE]: (type) => {
|
|
80466
80542
|
const config3 = type.toConfig();
|
|
80467
|
-
return new
|
|
80543
|
+
return new import_graphql53.GraphQLObjectType({
|
|
80468
80544
|
...config3,
|
|
80469
80545
|
isTypeOf: undefined
|
|
80470
80546
|
});
|
|
80471
80547
|
},
|
|
80472
80548
|
[MapperKind.INTERFACE_TYPE]: (type) => {
|
|
80473
80549
|
const config3 = type.toConfig();
|
|
80474
|
-
return new
|
|
80550
|
+
return new import_graphql53.GraphQLInterfaceType({
|
|
80475
80551
|
...config3,
|
|
80476
80552
|
resolveType: undefined
|
|
80477
80553
|
});
|
|
80478
80554
|
},
|
|
80479
80555
|
[MapperKind.UNION_TYPE]: (type) => {
|
|
80480
80556
|
const config3 = type.toConfig();
|
|
80481
|
-
return new
|
|
80557
|
+
return new import_graphql53.GraphQLUnionType({
|
|
80482
80558
|
...config3,
|
|
80483
80559
|
resolveType: undefined
|
|
80484
80560
|
});
|
|
@@ -80492,14 +80568,14 @@ function createWrappingSchema(schema, proxyingResolvers) {
|
|
|
80492
80568
|
});
|
|
80493
80569
|
}
|
|
80494
80570
|
var getTypeInfo3 = memoize1(function getTypeInfo22(schema) {
|
|
80495
|
-
return new
|
|
80571
|
+
return new import_graphql53.TypeInfo(schema);
|
|
80496
80572
|
});
|
|
80497
80573
|
memoize2(function getTypeInfoWithType22(schema, type) {
|
|
80498
|
-
return
|
|
80574
|
+
return import_graphql53.versionInfo.major < 16 ? new import_graphql53.TypeInfo(schema, undefined, type) : new import_graphql53.TypeInfo(schema, type);
|
|
80499
80575
|
});
|
|
80500
80576
|
function getSchemaFromIntrospection(introspectionResult, options) {
|
|
80501
80577
|
if (introspectionResult?.data?.__schema) {
|
|
80502
|
-
return
|
|
80578
|
+
return import_graphql53.buildClientSchema(introspectionResult.data, options);
|
|
80503
80579
|
}
|
|
80504
80580
|
if (introspectionResult?.errors) {
|
|
80505
80581
|
const graphqlErrors = introspectionResult.errors.map((error43) => createGraphQLError(error43.message, error43));
|
|
@@ -80513,7 +80589,7 @@ function getSchemaFromIntrospection(introspectionResult, options) {
|
|
|
80513
80589
|
${inspect(introspectionResult)}`);
|
|
80514
80590
|
}
|
|
80515
80591
|
function schemaFromExecutor(executor2, context, options) {
|
|
80516
|
-
const parsedIntrospectionQuery =
|
|
80592
|
+
const parsedIntrospectionQuery = import_graphql53.parse(import_graphql53.getIntrospectionQuery(options), options);
|
|
80517
80593
|
return handleMaybePromise(() => handleMaybePromise(() => executor2({
|
|
80518
80594
|
document: parsedIntrospectionQuery,
|
|
80519
80595
|
context
|
|
@@ -80526,10 +80602,10 @@ function schemaFromExecutor(executor2, context, options) {
|
|
|
80526
80602
|
}), (introspection) => getSchemaFromIntrospection(introspection, options));
|
|
80527
80603
|
}
|
|
80528
80604
|
|
|
80529
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80605
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/defaultAsyncFetch.js
|
|
80530
80606
|
var defaultAsyncFetch = $fetch;
|
|
80531
80607
|
|
|
80532
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80608
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/defaultSyncFetch.js
|
|
80533
80609
|
var import_sync_fetch = __toESM(require_sync_fetch(), 1);
|
|
80534
80610
|
var defaultSyncFetch = (input, init) => {
|
|
80535
80611
|
if (typeof input === "string") {
|
|
@@ -80540,7 +80616,7 @@ var defaultSyncFetch = (input, init) => {
|
|
|
80540
80616
|
return import_sync_fetch.default(input, init);
|
|
80541
80617
|
};
|
|
80542
80618
|
|
|
80543
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80619
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/index.js
|
|
80544
80620
|
var asyncImport = (moduleName) => import(`${moduleName}`);
|
|
80545
80621
|
var syncImport = (moduleName) => __require(`${moduleName}`);
|
|
80546
80622
|
var SubscriptionProtocol;
|
|
@@ -80692,7 +80768,7 @@ class UrlLoader {
|
|
|
80692
80768
|
if (!source.schema && !source.document && !source.rawSDL) {
|
|
80693
80769
|
throw new Error(`Invalid SDL response`);
|
|
80694
80770
|
}
|
|
80695
|
-
source.schema = source.schema || (source.document ?
|
|
80771
|
+
source.schema = source.schema || (source.document ? import_graphql54.buildASTSchema(source.document, options) : source.rawSDL ? import_graphql54.buildSchema(source.rawSDL, options) : undefined);
|
|
80696
80772
|
} else {
|
|
80697
80773
|
executor2 = this.getExecutorAsync(pointer, options);
|
|
80698
80774
|
source.schema = await schemaFromExecutor(executor2, {}, options);
|
|
@@ -80726,7 +80802,7 @@ class UrlLoader {
|
|
|
80726
80802
|
if (!source.schema && !source.document && !source.rawSDL) {
|
|
80727
80803
|
throw new Error(`Invalid SDL response`);
|
|
80728
80804
|
}
|
|
80729
|
-
source.schema = source.schema || (source.document ?
|
|
80805
|
+
source.schema = source.schema || (source.document ? import_graphql54.buildASTSchema(source.document, options) : source.rawSDL ? import_graphql54.buildSchema(source.rawSDL, options) : undefined);
|
|
80730
80806
|
} else {
|
|
80731
80807
|
executor2 = this.getExecutorSync(pointer, options);
|
|
80732
80808
|
source.schema = schemaFromExecutor(executor2, {}, options);
|
|
@@ -82135,7 +82211,7 @@ var portalQueries = (server, env3) => {
|
|
|
82135
82211
|
var package_default = {
|
|
82136
82212
|
name: "@settlemint/sdk-mcp",
|
|
82137
82213
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
82138
|
-
version: "2.6.2-
|
|
82214
|
+
version: "2.6.2-prdd413399",
|
|
82139
82215
|
type: "module",
|
|
82140
82216
|
private: false,
|
|
82141
82217
|
license: "FSL-1.1-MIT",
|
|
@@ -82176,11 +82252,11 @@ var package_default = {
|
|
|
82176
82252
|
dependencies: {
|
|
82177
82253
|
"@commander-js/extra-typings": "14.0.0",
|
|
82178
82254
|
"@graphql-tools/load": "8.1.2",
|
|
82179
|
-
"@graphql-tools/url-loader": "
|
|
82180
|
-
"@modelcontextprotocol/sdk": "1.
|
|
82181
|
-
"@settlemint/sdk-js": "2.6.2-
|
|
82182
|
-
"@settlemint/sdk-utils": "2.6.2-
|
|
82183
|
-
commander: "14.0.
|
|
82255
|
+
"@graphql-tools/url-loader": "9.0.0",
|
|
82256
|
+
"@modelcontextprotocol/sdk": "1.18.0",
|
|
82257
|
+
"@settlemint/sdk-js": "2.6.2-prdd413399",
|
|
82258
|
+
"@settlemint/sdk-utils": "2.6.2-prdd413399",
|
|
82259
|
+
commander: "14.0.1",
|
|
82184
82260
|
graphql: "16.11.0",
|
|
82185
82261
|
zod: "^4",
|
|
82186
82262
|
"zod-to-json-schema": "^3.23.0"
|
|
@@ -82999,7 +83075,7 @@ var registerBlockchainConcepts = (server) => {
|
|
|
82999
83075
|
};
|
|
83000
83076
|
|
|
83001
83077
|
// src/utils/sdl.ts
|
|
83002
|
-
var
|
|
83078
|
+
var import_graphql55 = __toESM(require_graphql2(), 1);
|
|
83003
83079
|
var processFieldTypes = (fields2, schema, collectedTypes) => {
|
|
83004
83080
|
for (const field of Object.values(fields2)) {
|
|
83005
83081
|
collectCustomTypes(field.type, schema, collectedTypes);
|
|
@@ -83020,7 +83096,7 @@ var collectCustomTypes = (type, schema, collectedTypes = new Set) => {
|
|
|
83020
83096
|
return collectedTypes;
|
|
83021
83097
|
}
|
|
83022
83098
|
collectedTypes.add(typeName);
|
|
83023
|
-
if (
|
|
83099
|
+
if (import_graphql55.isInputObjectType(schemaType) || import_graphql55.isObjectType(schemaType)) {
|
|
83024
83100
|
const fields2 = schemaType.getFields();
|
|
83025
83101
|
processFieldTypes(fields2, schema, collectedTypes);
|
|
83026
83102
|
}
|
|
@@ -83030,7 +83106,7 @@ var generateTypeSDL = (typeName, schema) => {
|
|
|
83030
83106
|
const type = schema[typeName];
|
|
83031
83107
|
if (!type)
|
|
83032
83108
|
return "";
|
|
83033
|
-
if (
|
|
83109
|
+
if (import_graphql55.isInputObjectType(type)) {
|
|
83034
83110
|
const fields2 = type.getFields();
|
|
83035
83111
|
const fieldSDLs = Object.values(fields2).map((field) => ` ${field.name}: ${field.type}`).join(`
|
|
83036
83112
|
`);
|
|
@@ -83038,7 +83114,7 @@ var generateTypeSDL = (typeName, schema) => {
|
|
|
83038
83114
|
${fieldSDLs}
|
|
83039
83115
|
}`;
|
|
83040
83116
|
}
|
|
83041
|
-
if (
|
|
83117
|
+
if (import_graphql55.isObjectType(type)) {
|
|
83042
83118
|
const fields2 = type.getFields();
|
|
83043
83119
|
const fieldSDLs = Object.values(fields2).map((field) => {
|
|
83044
83120
|
const args = field.args.length > 0 ? `(${field.args.map((arg) => `${arg.name}: ${arg.type}`).join(", ")})` : "";
|
|
@@ -83539,7 +83615,7 @@ var parseRawRequestArgs = (queryOrOptions, variables, requestHeaders) => {
|
|
|
83539
83615
|
};
|
|
83540
83616
|
|
|
83541
83617
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/legacy/lib/graphql.js
|
|
83542
|
-
var
|
|
83618
|
+
var import_graphql56 = __toESM(require_graphql2(), 1);
|
|
83543
83619
|
|
|
83544
83620
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/lib/http.js
|
|
83545
83621
|
var ACCEPT_HEADER = `Accept`;
|
|
@@ -83607,12 +83683,12 @@ var parseExecutionResult = (result) => {
|
|
|
83607
83683
|
var isRequestResultHaveErrors = (result) => result._tag === `Batch` ? result.executionResults.some(isExecutionResultHaveErrors) : isExecutionResultHaveErrors(result.executionResult);
|
|
83608
83684
|
var isExecutionResultHaveErrors = (result) => Array.isArray(result.errors) ? result.errors.length > 0 : Boolean(result.errors);
|
|
83609
83685
|
var isOperationDefinitionNode = (definition) => {
|
|
83610
|
-
return typeof definition === `object` && definition !== null && `kind` in definition && definition.kind ===
|
|
83686
|
+
return typeof definition === `object` && definition !== null && `kind` in definition && definition.kind === import_graphql56.Kind.OPERATION_DEFINITION;
|
|
83611
83687
|
};
|
|
83612
83688
|
|
|
83613
83689
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/legacy/helpers/analyzeDocument.js
|
|
83690
|
+
var import_graphql58 = __toESM(require_graphql2(), 1);
|
|
83614
83691
|
var import_graphql59 = __toESM(require_graphql2(), 1);
|
|
83615
|
-
var import_graphql60 = __toESM(require_graphql2(), 1);
|
|
83616
83692
|
var extractOperationName = (document) => {
|
|
83617
83693
|
let operationName = undefined;
|
|
83618
83694
|
const defs = document.definitions.filter(isOperationDefinitionNode);
|
|
@@ -83630,13 +83706,13 @@ var extractIsMutation = (document) => {
|
|
|
83630
83706
|
return isMutation;
|
|
83631
83707
|
};
|
|
83632
83708
|
var analyzeDocument = (document, excludeOperationName) => {
|
|
83633
|
-
const expression = typeof document === `string` ? document :
|
|
83709
|
+
const expression = typeof document === `string` ? document : import_graphql59.print(document);
|
|
83634
83710
|
let isMutation = false;
|
|
83635
83711
|
let operationName = undefined;
|
|
83636
83712
|
if (excludeOperationName) {
|
|
83637
83713
|
return { expression, isMutation, operationName };
|
|
83638
83714
|
}
|
|
83639
|
-
const docNode = tryCatch(() => typeof document === `string` ?
|
|
83715
|
+
const docNode = tryCatch(() => typeof document === `string` ? import_graphql58.parse(document) : document);
|
|
83640
83716
|
if (docNode instanceof Error) {
|
|
83641
83717
|
return { expression, isMutation, operationName };
|
|
83642
83718
|
}
|
|
@@ -84910,6 +84986,7 @@ var createBlockchainNetwork = graphql(`
|
|
|
84910
84986
|
$quorumGenesis: QuorumGenesisInput
|
|
84911
84987
|
$externalNodes: [BlockchainNetworkExternalNodeInput!]
|
|
84912
84988
|
$privateKeyId: ID
|
|
84989
|
+
$includePredeployedContracts: Boolean
|
|
84913
84990
|
) {
|
|
84914
84991
|
createBlockchainNetwork(
|
|
84915
84992
|
applicationId: $applicationId
|
|
@@ -84938,6 +85015,7 @@ var createBlockchainNetwork = graphql(`
|
|
|
84938
85015
|
quorumGenesis: $quorumGenesis
|
|
84939
85016
|
externalNodes: $externalNodes
|
|
84940
85017
|
keyMaterial: $privateKeyId
|
|
85018
|
+
includePredeployedContracts: $includePredeployedContracts
|
|
84941
85019
|
) {
|
|
84942
85020
|
...BlockchainNetwork
|
|
84943
85021
|
}
|
|
@@ -88246,4 +88324,4 @@ await main().catch((error44) => {
|
|
|
88246
88324
|
process.exit(1);
|
|
88247
88325
|
});
|
|
88248
88326
|
|
|
88249
|
-
//# debugId=
|
|
88327
|
+
//# debugId=219E27CC2DD8CC5C64756E2164756E21
|