nexocord 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENCE → LICENSE} +3 -3
- package/README.md +193 -58
- package/dist/bin/cli.js +4382 -2903
- package/dist/cli/commands/build.command.d.ts +3 -0
- package/dist/cli/commands/build.command.d.ts.map +1 -0
- package/dist/cli/commands/create.command.d.ts +3 -0
- package/dist/cli/commands/create.command.d.ts.map +1 -0
- package/dist/cli/commands/dev.command.d.ts +3 -0
- package/dist/cli/commands/dev.command.d.ts.map +1 -0
- package/dist/cli/commands/doctor.command.d.ts +3 -0
- package/dist/cli/commands/doctor.command.d.ts.map +1 -0
- package/dist/cli/commands/info.command.d.ts +3 -0
- package/dist/cli/commands/info.command.d.ts.map +1 -0
- package/dist/cli/commands/init.command.d.ts +3 -0
- package/dist/cli/commands/init.command.d.ts.map +1 -0
- package/dist/cli/commands/start.command.d.ts +3 -0
- package/dist/cli/commands/start.command.d.ts.map +1 -0
- package/dist/cli/commands/update.command.d.ts +3 -0
- package/dist/cli/commands/update.command.d.ts.map +1 -0
- package/dist/cli/create/flow.d.ts +7 -0
- package/dist/cli/create/flow.d.ts.map +1 -0
- package/dist/cli/create/install.d.ts +1 -1
- package/dist/cli/create/install.d.ts.map +1 -1
- package/dist/cli/create/prompts.d.ts +4 -4
- package/dist/cli/create/prompts.d.ts.map +1 -1
- package/dist/cli/errors.d.ts +7 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/logger.d.ts +8 -5
- package/dist/cli/logger.d.ts.map +1 -1
- package/dist/cli/runner.d.ts +3 -3
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runtime.d.ts +3 -2
- package/dist/cli/runtime.d.ts.map +1 -1
- package/dist/cli/services/build/flow.d.ts +2 -0
- package/dist/cli/services/build/flow.d.ts.map +1 -0
- package/dist/cli/services/create/flow.d.ts +2 -0
- package/dist/cli/services/create/flow.d.ts.map +1 -0
- package/dist/cli/services/create/generator.d.ts +14 -0
- package/dist/cli/services/create/generator.d.ts.map +1 -0
- package/dist/cli/services/create/install.d.ts +3 -0
- package/dist/cli/services/create/install.d.ts.map +1 -0
- package/dist/cli/services/create/prompts.d.ts +12 -0
- package/dist/cli/services/create/prompts.d.ts.map +1 -0
- package/dist/{create/templates/bun-ts → cli/services/create/templates/bun-js}/README.md +7 -7
- package/dist/cli/services/create/templates/bun-js/src/commands/utils/ping.tpl +10 -0
- package/dist/cli/services/create/templates/bun-js/src/events/ready.tpl +9 -0
- package/dist/cli/services/create/templates/bun-js/src/index.tpl +12 -0
- package/dist/{create/templates/bun-js → cli/services/create/templates/bun-ts}/README.md +7 -7
- package/dist/{create/templates/node-js → cli/services/create/templates/bun-ts}/src/commands/utils/ping.tpl +9 -9
- package/dist/cli/services/create/templates/bun-ts/src/events/ready.tpl +9 -0
- package/dist/cli/services/create/templates/bun-ts/src/index.tpl +12 -0
- package/dist/{create/templates/node-ts → cli/services/create/templates/node-js}/README.md +7 -7
- package/dist/cli/services/create/templates/node-js/src/commands/utils/ping.tpl +10 -0
- package/dist/cli/services/create/templates/node-js/src/events/ready.tpl +9 -0
- package/dist/cli/services/create/templates/node-js/src/index.tpl +12 -0
- package/dist/{create/templates/node-js → cli/services/create/templates/node-ts}/README.md +7 -7
- package/dist/{create → cli/services/create}/templates/node-ts/src/commands/utils/ping.tpl +9 -9
- package/dist/cli/services/create/templates/node-ts/src/events/ready.tpl +9 -0
- package/dist/cli/services/create/templates/node-ts/src/index.tpl +12 -0
- package/dist/cli/services/dev/flow.d.ts +5 -0
- package/dist/cli/services/dev/flow.d.ts.map +1 -0
- package/dist/cli/services/doctor/flow.d.ts +2 -0
- package/dist/cli/services/doctor/flow.d.ts.map +1 -0
- package/dist/cli/services/info/flow.d.ts +2 -0
- package/dist/cli/services/info/flow.d.ts.map +1 -0
- package/dist/cli/services/init/flow.d.ts +4 -0
- package/dist/cli/services/init/flow.d.ts.map +1 -0
- package/dist/cli/services/init/project.d.ts +15 -0
- package/dist/cli/services/init/project.d.ts.map +1 -0
- package/dist/cli/services/init/types.d.ts +20 -0
- package/dist/cli/services/init/types.d.ts.map +1 -0
- package/dist/cli/services/start/flow.d.ts +2 -0
- package/dist/cli/services/start/flow.d.ts.map +1 -0
- package/dist/cli/services/update/flow.d.ts +2 -0
- package/dist/cli/services/update/flow.d.ts.map +1 -0
- package/dist/cli/utils.d.ts +17 -3
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/core/app.d.ts +1 -1
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/client/ExtendedClient.d.ts +3 -3
- package/dist/core/client/ExtendedClient.d.ts.map +1 -1
- package/dist/core/client/Interactions/autocomplete.d.ts +2 -1
- package/dist/core/client/Interactions/autocomplete.d.ts.map +1 -1
- package/dist/core/client/Interactions/command.d.ts +2 -1
- package/dist/core/client/Interactions/command.d.ts.map +1 -1
- package/dist/core/client/Interactions/index.d.ts +2 -1
- package/dist/core/client/Interactions/index.d.ts.map +1 -1
- package/dist/core/client/Interactions/responder.d.ts +2 -1
- package/dist/core/client/Interactions/responder.d.ts.map +1 -1
- package/dist/core/client/bootstrap.d.ts.map +1 -1
- package/dist/core/creators/command.d.ts +3 -0
- package/dist/core/creators/command.d.ts.map +1 -0
- package/dist/core/creators/context.d.ts +16 -0
- package/dist/core/creators/context.d.ts.map +1 -0
- package/dist/core/creators/events.d.ts +4 -0
- package/dist/core/creators/events.d.ts.map +1 -0
- package/dist/core/creators/index.d.ts +7 -0
- package/dist/core/creators/index.d.ts.map +1 -0
- package/dist/core/creators/option.d.ts +132 -0
- package/dist/core/creators/option.d.ts.map +1 -0
- package/dist/core/creators/responder.d.ts +3 -0
- package/dist/core/creators/responder.d.ts.map +1 -0
- package/dist/core/creators/subcommand.d.ts +2 -0
- package/dist/core/creators/subcommand.d.ts.map +1 -0
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/modules/Responders/manager.d.ts.map +1 -1
- package/dist/core/modules/Responders/route.d.ts.map +1 -1
- package/dist/core/modules/Responders/session.d.ts.map +1 -1
- package/dist/core/modules/commands/context.d.ts +14 -0
- package/dist/core/modules/commands/context.d.ts.map +1 -0
- package/dist/core/modules/commands/handler.d.ts +5 -5
- package/dist/core/modules/commands/handler.d.ts.map +1 -1
- package/dist/core/modules/commands/manager.d.ts +1 -1
- package/dist/core/modules/commands/manager.d.ts.map +1 -1
- package/dist/core/modules/events/handler.d.ts +4 -4
- package/dist/core/modules/events/handler.d.ts.map +1 -1
- package/dist/core/modules/events/manager.d.ts +1 -1
- package/dist/core/modules/events/manager.d.ts.map +1 -1
- package/dist/core/modules/index.d.ts +1 -1
- package/dist/core/modules/responders/manager.d.ts +8 -0
- package/dist/core/modules/responders/manager.d.ts.map +1 -0
- package/dist/core/modules/responders/route.d.ts +13 -0
- package/dist/core/modules/responders/route.d.ts.map +1 -0
- package/dist/core/modules/responders/session.d.ts +9 -0
- package/dist/core/modules/responders/session.d.ts.map +1 -0
- package/dist/core/settings.d.ts +1 -1
- package/dist/core/settings.d.ts.map +1 -1
- package/dist/core/types/Command.d.ts +2 -2
- package/dist/core/types/Command.d.ts.map +1 -1
- package/dist/core/types/Event.d.ts +2 -2
- package/dist/core/types/Responder.d.ts +8 -6
- package/dist/core/types/Responder.d.ts.map +1 -1
- package/dist/core/types/Run.d.ts +6 -5
- package/dist/core/types/Run.d.ts.map +1 -1
- package/dist/core/types/Settings.d.ts +3 -3
- package/dist/core/types/Settings.d.ts.map +1 -1
- package/dist/core/types/Ui.d.ts +91 -12
- package/dist/core/types/Ui.d.ts.map +1 -1
- package/dist/core/types/index.js +1042 -446
- package/dist/core/ui/builders.d.ts +76 -0
- package/dist/core/ui/builders.d.ts.map +1 -0
- package/dist/core/ui/index.d.ts +1 -4
- package/dist/core/ui/index.d.ts.map +1 -1
- package/dist/core/ui/index.js +1462 -1036
- package/dist/core/ui/normalize.d.ts +13 -0
- package/dist/core/ui/normalize.d.ts.map +1 -0
- package/dist/core/ui/validate.d.ts +14 -0
- package/dist/core/ui/validate.d.ts.map +1 -0
- package/dist/core/utils/Cooldown.d.ts.map +1 -1
- package/dist/core/utils/Responder.d.ts +4 -4
- package/dist/core/utils/Responder.d.ts.map +1 -1
- package/dist/core/utils/cooldown.d.ts +9 -0
- package/dist/core/utils/cooldown.d.ts.map +1 -0
- package/dist/core/utils/extensions.d.ts +1 -1
- package/dist/core/utils/extensions.d.ts.map +1 -1
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/core/utils/index.js +148 -89
- package/dist/core/utils/logger.d.ts +12 -0
- package/dist/core/utils/logger.d.ts.map +1 -0
- package/dist/core/utils/responder.d.ts +5 -0
- package/dist/core/utils/responder.d.ts.map +1 -0
- package/dist/index.cjs +3638 -2037
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3594 -1979
- package/package.json +13 -18
- package/dist/cli/create/create.d.ts +0 -2
- package/dist/cli/create/create.d.ts.map +0 -1
- package/dist/cli/create/index.d.ts +0 -2
- package/dist/cli/create/index.d.ts.map +0 -1
- package/dist/commands/create.command.d.ts +0 -3
- package/dist/commands/create.command.d.ts.map +0 -1
- package/dist/commands/dev.command.d.ts +0 -3
- package/dist/commands/dev.command.d.ts.map +0 -1
- package/dist/commands/start.command.d.ts +0 -3
- package/dist/commands/start.command.d.ts.map +0 -1
- package/dist/core/creators.d.ts +0 -4
- package/dist/core/creators.d.ts.map +0 -1
- package/dist/core/ui/builders/container.d.ts +0 -44
- package/dist/core/ui/builders/container.d.ts.map +0 -1
- package/dist/core/ui/builders/index.d.ts +0 -41
- package/dist/core/ui/builders/index.d.ts.map +0 -1
- package/dist/core/ui/builders/primitives.d.ts +0 -134
- package/dist/core/ui/builders/primitives.d.ts.map +0 -1
- package/dist/core/ui/builders/select.d.ts +0 -61
- package/dist/core/ui/builders/select.d.ts.map +0 -1
- package/dist/core/ui/constants/index.d.ts +0 -4
- package/dist/core/ui/constants/index.d.ts.map +0 -1
- package/dist/core/ui/constants/limits.d.ts +0 -19
- package/dist/core/ui/constants/limits.d.ts.map +0 -1
- package/dist/core/ui/constants/patterns.d.ts +0 -7
- package/dist/core/ui/constants/patterns.d.ts.map +0 -1
- package/dist/core/ui/constants/symbols.d.ts +0 -7
- package/dist/core/ui/constants/symbols.d.ts.map +0 -1
- package/dist/core/ui/normalizers/button.d.ts +0 -25
- package/dist/core/ui/normalizers/button.d.ts.map +0 -1
- package/dist/core/ui/normalizers/container.d.ts +0 -68
- package/dist/core/ui/normalizers/container.d.ts.map +0 -1
- package/dist/core/ui/normalizers/index.d.ts +0 -6
- package/dist/core/ui/normalizers/index.d.ts.map +0 -1
- package/dist/core/ui/normalizers/media.d.ts +0 -17
- package/dist/core/ui/normalizers/media.d.ts.map +0 -1
- package/dist/core/ui/normalizers/select.d.ts +0 -45
- package/dist/core/ui/normalizers/select.d.ts.map +0 -1
- package/dist/core/ui/types/button.d.ts +0 -11
- package/dist/core/ui/types/button.d.ts.map +0 -1
- package/dist/core/ui/types/container.d.ts +0 -53
- package/dist/core/ui/types/container.d.ts.map +0 -1
- package/dist/core/ui/types/index.d.ts +0 -8
- package/dist/core/ui/types/index.d.ts.map +0 -1
- package/dist/core/ui/types/media.d.ts +0 -29
- package/dist/core/ui/types/media.d.ts.map +0 -1
- package/dist/core/ui/types/message.d.ts +0 -15
- package/dist/core/ui/types/message.d.ts.map +0 -1
- package/dist/core/ui/types/render.d.ts +0 -7
- package/dist/core/ui/types/render.d.ts.map +0 -1
- package/dist/core/ui/types/row.d.ts +0 -10
- package/dist/core/ui/types/row.d.ts.map +0 -1
- package/dist/core/ui/types/select.d.ts +0 -42
- package/dist/core/ui/types/select.d.ts.map +0 -1
- package/dist/core/ui/utils/applySelectBase.d.ts +0 -21
- package/dist/core/ui/utils/applySelectBase.d.ts.map +0 -1
- package/dist/core/ui/utils/formatList.d.ts +0 -12
- package/dist/core/ui/utils/formatList.d.ts.map +0 -1
- package/dist/core/ui/utils/formatText.d.ts +0 -46
- package/dist/core/ui/utils/formatText.d.ts.map +0 -1
- package/dist/core/ui/utils/getAttachmentName.d.ts +0 -8
- package/dist/core/ui/utils/getAttachmentName.d.ts.map +0 -1
- package/dist/core/ui/utils/index.d.ts +0 -7
- package/dist/core/ui/utils/index.d.ts.map +0 -1
- package/dist/core/ui/utils/resolveSelectBase.d.ts +0 -16
- package/dist/core/ui/utils/resolveSelectBase.d.ts.map +0 -1
- package/dist/core/ui/utils/splitContainerArgs.d.ts +0 -12
- package/dist/core/ui/utils/splitContainerArgs.d.ts.map +0 -1
- package/dist/core/ui/validators/button.d.ts +0 -8
- package/dist/core/ui/validators/button.d.ts.map +0 -1
- package/dist/core/ui/validators/container.d.ts +0 -51
- package/dist/core/ui/validators/container.d.ts.map +0 -1
- package/dist/core/ui/validators/index.d.ts +0 -18
- package/dist/core/ui/validators/index.d.ts.map +0 -1
- package/dist/core/ui/validators/select.d.ts +0 -8
- package/dist/core/ui/validators/select.d.ts.map +0 -1
- package/dist/create/generator.d.ts +0 -10
- package/dist/create/generator.d.ts.map +0 -1
- package/dist/create/prompts.d.ts +0 -8
- package/dist/create/prompts.d.ts.map +0 -1
- package/dist/create/templates/bun-js/src/commands/utils/ping.tpl +0 -10
- package/dist/create/templates/bun-js/src/events/ready.tpl +0 -10
- package/dist/create/templates/bun-js/src/index.tpl +0 -11
- package/dist/create/templates/bun-ts/src/commands/utils/ping.tpl +0 -10
- package/dist/create/templates/bun-ts/src/events/ready.tpl +0 -10
- package/dist/create/templates/bun-ts/src/index.tpl +0 -11
- package/dist/create/templates/node-js/src/events/ready.tpl +0 -10
- package/dist/create/templates/node-js/src/index.tpl +0 -11
- package/dist/create/templates/node-ts/src/events/ready.tpl +0 -10
- package/dist/create/templates/node-ts/src/index.tpl +0 -11
package/dist/core/ui/index.js
CHANGED
|
@@ -2291,10 +2291,46 @@ var require_request = __commonJS((exports, module) => {
|
|
|
2291
2291
|
return false;
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
|
-
onUpgrade(statusCode, headers, socket) {
|
|
2294
|
+
onUpgrade(statusCode, headers, socket, statusText = "") {
|
|
2295
|
+
this.onFinally();
|
|
2295
2296
|
assert(!this.aborted);
|
|
2296
2297
|
assert(!this.completed);
|
|
2297
|
-
|
|
2298
|
+
if (statusCode !== null) {
|
|
2299
|
+
this.#publishUpgradeHeaders(statusCode, headers, statusText);
|
|
2300
|
+
}
|
|
2301
|
+
const result = this[kHandler].onUpgrade(statusCode, headers, socket);
|
|
2302
|
+
if (!this.aborted) {
|
|
2303
|
+
this.completed = true;
|
|
2304
|
+
if (statusCode !== null) {
|
|
2305
|
+
this.#publishUpgradeTrailers();
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
return result;
|
|
2309
|
+
}
|
|
2310
|
+
onUpgradeResponse(statusCode, headers, parseHeaders, statusText = "") {
|
|
2311
|
+
assert(!this.aborted);
|
|
2312
|
+
assert(this.completed);
|
|
2313
|
+
if (channels.headers.hasSubscribers) {
|
|
2314
|
+
this.#publishUpgradeHeaders(statusCode, parseHeaders(headers), statusText);
|
|
2315
|
+
}
|
|
2316
|
+
this.#publishUpgradeTrailers();
|
|
2317
|
+
}
|
|
2318
|
+
onUpgradeError(error) {
|
|
2319
|
+
assert(!this.aborted);
|
|
2320
|
+
assert(this.completed);
|
|
2321
|
+
if (channels.error.hasSubscribers) {
|
|
2322
|
+
channels.error.publish({ request: this, error });
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
#publishUpgradeHeaders(statusCode, headers, statusText) {
|
|
2326
|
+
if (channels.headers.hasSubscribers) {
|
|
2327
|
+
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
#publishUpgradeTrailers() {
|
|
2331
|
+
if (channels.trailers.hasSubscribers) {
|
|
2332
|
+
channels.trailers.publish({ request: this, trailers: [] });
|
|
2333
|
+
}
|
|
2298
2334
|
}
|
|
2299
2335
|
onComplete(trailers) {
|
|
2300
2336
|
this.onFinally();
|
|
@@ -2361,7 +2397,11 @@ var require_request = __commonJS((exports, module) => {
|
|
|
2361
2397
|
} else if (typeof val[i] === "object") {
|
|
2362
2398
|
throw new InvalidArgumentError(`invalid ${key} header`);
|
|
2363
2399
|
} else {
|
|
2364
|
-
|
|
2400
|
+
const str = `${val[i]}`;
|
|
2401
|
+
if (!isValidHeaderValue(str)) {
|
|
2402
|
+
throw new InvalidArgumentError(`invalid ${key} header`);
|
|
2403
|
+
}
|
|
2404
|
+
arr.push(str);
|
|
2365
2405
|
}
|
|
2366
2406
|
}
|
|
2367
2407
|
val = arr;
|
|
@@ -2373,6 +2413,9 @@ var require_request = __commonJS((exports, module) => {
|
|
|
2373
2413
|
val = "";
|
|
2374
2414
|
} else {
|
|
2375
2415
|
val = `${val}`;
|
|
2416
|
+
if (!isValidHeaderValue(val)) {
|
|
2417
|
+
throw new InvalidArgumentError(`invalid ${key} header`);
|
|
2418
|
+
}
|
|
2376
2419
|
}
|
|
2377
2420
|
if (headerName === "host") {
|
|
2378
2421
|
if (request.host !== null) {
|
|
@@ -2478,14 +2521,22 @@ var require_dispatcher_base = __commonJS((exports, module) => {
|
|
|
2478
2521
|
var kOnDestroyed = Symbol("onDestroyed");
|
|
2479
2522
|
var kOnClosed = Symbol("onClosed");
|
|
2480
2523
|
var kInterceptedDispatch = Symbol("Intercepted Dispatch");
|
|
2524
|
+
var kWebSocketOptions = Symbol("webSocketOptions");
|
|
2481
2525
|
|
|
2482
2526
|
class DispatcherBase extends Dispatcher {
|
|
2483
|
-
constructor() {
|
|
2527
|
+
constructor(opts) {
|
|
2484
2528
|
super();
|
|
2485
2529
|
this[kDestroyed] = false;
|
|
2486
2530
|
this[kOnDestroyed] = null;
|
|
2487
2531
|
this[kClosed] = false;
|
|
2488
2532
|
this[kOnClosed] = [];
|
|
2533
|
+
this[kWebSocketOptions] = opts?.webSocket ?? {};
|
|
2534
|
+
}
|
|
2535
|
+
get webSocketOptions() {
|
|
2536
|
+
return {
|
|
2537
|
+
maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,
|
|
2538
|
+
maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024
|
|
2539
|
+
};
|
|
2489
2540
|
}
|
|
2490
2541
|
get destroyed() {
|
|
2491
2542
|
return this[kDestroyed];
|
|
@@ -5743,6 +5794,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
5743
5794
|
RequestContentLengthMismatchError,
|
|
5744
5795
|
ResponseContentLengthMismatchError,
|
|
5745
5796
|
RequestAbortedError,
|
|
5797
|
+
InvalidArgumentError,
|
|
5746
5798
|
HeadersTimeoutError,
|
|
5747
5799
|
HeadersOverflowError,
|
|
5748
5800
|
SocketError,
|
|
@@ -5789,6 +5841,9 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
5789
5841
|
var FastBuffer = Buffer[Symbol.species];
|
|
5790
5842
|
var addListener = util.addListener;
|
|
5791
5843
|
var removeAllListeners = util.removeAllListeners;
|
|
5844
|
+
var kIdleSocketValidation = Symbol("kIdleSocketValidation");
|
|
5845
|
+
var kIdleSocketValidationTimeout = Symbol("kIdleSocketValidationTimeout");
|
|
5846
|
+
var kSocketUsed = Symbol("kSocketUsed");
|
|
5792
5847
|
var extractBody;
|
|
5793
5848
|
async function lazyllhttp() {
|
|
5794
5849
|
const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : undefined;
|
|
@@ -5950,24 +6005,55 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
5950
6005
|
currentBufferRef = null;
|
|
5951
6006
|
}
|
|
5952
6007
|
const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr;
|
|
5953
|
-
if (ret
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
|
|
5964
|
-
}
|
|
5965
|
-
throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset));
|
|
6008
|
+
if (ret !== constants.ERROR.OK) {
|
|
6009
|
+
const body = data.subarray(offset);
|
|
6010
|
+
if (ret === constants.ERROR.PAUSED_UPGRADE) {
|
|
6011
|
+
this.onUpgrade(body);
|
|
6012
|
+
} else if (ret === constants.ERROR.PAUSED) {
|
|
6013
|
+
this.paused = true;
|
|
6014
|
+
socket.unshift(body);
|
|
6015
|
+
} else {
|
|
6016
|
+
throw this.createError(ret, body);
|
|
6017
|
+
}
|
|
5966
6018
|
}
|
|
5967
6019
|
} catch (err) {
|
|
5968
6020
|
util.destroy(socket, err);
|
|
5969
6021
|
}
|
|
5970
6022
|
}
|
|
6023
|
+
finish() {
|
|
6024
|
+
assert(currentParser === null);
|
|
6025
|
+
assert(this.ptr != null);
|
|
6026
|
+
assert(!this.paused);
|
|
6027
|
+
const { llhttp } = this;
|
|
6028
|
+
let ret;
|
|
6029
|
+
try {
|
|
6030
|
+
currentParser = this;
|
|
6031
|
+
ret = llhttp.llhttp_finish(this.ptr);
|
|
6032
|
+
} finally {
|
|
6033
|
+
currentParser = null;
|
|
6034
|
+
}
|
|
6035
|
+
if (ret === constants.ERROR.OK) {
|
|
6036
|
+
return null;
|
|
6037
|
+
}
|
|
6038
|
+
if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
|
|
6039
|
+
this.paused = true;
|
|
6040
|
+
return null;
|
|
6041
|
+
}
|
|
6042
|
+
return this.createError(ret, EMPTY_BUF);
|
|
6043
|
+
}
|
|
6044
|
+
createError(ret, data) {
|
|
6045
|
+
const { llhttp, contentLength, bytesRead } = this;
|
|
6046
|
+
if (contentLength && bytesRead !== parseInt(contentLength, 10)) {
|
|
6047
|
+
return new ResponseContentLengthMismatchError;
|
|
6048
|
+
}
|
|
6049
|
+
const ptr = llhttp.llhttp_get_error_reason(this.ptr);
|
|
6050
|
+
let message = "";
|
|
6051
|
+
if (ptr) {
|
|
6052
|
+
const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
|
|
6053
|
+
message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
|
|
6054
|
+
}
|
|
6055
|
+
return new HTTPParserError(message, constants.ERROR[ret], data);
|
|
6056
|
+
}
|
|
5971
6057
|
destroy() {
|
|
5972
6058
|
assert(this.ptr != null);
|
|
5973
6059
|
assert(currentParser == null);
|
|
@@ -5987,6 +6073,10 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
5987
6073
|
if (socket.destroyed) {
|
|
5988
6074
|
return -1;
|
|
5989
6075
|
}
|
|
6076
|
+
if (client[kRunning] === 0) {
|
|
6077
|
+
util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
|
|
6078
|
+
return -1;
|
|
6079
|
+
}
|
|
5990
6080
|
const request = client[kQueue][client[kRunningIdx]];
|
|
5991
6081
|
if (!request) {
|
|
5992
6082
|
return -1;
|
|
@@ -6030,7 +6120,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6030
6120
|
}
|
|
6031
6121
|
}
|
|
6032
6122
|
onUpgrade(head) {
|
|
6033
|
-
const { upgrade, client, socket, headers, statusCode } = this;
|
|
6123
|
+
const { upgrade, client, socket, headers, statusCode, statusText } = this;
|
|
6034
6124
|
assert(upgrade);
|
|
6035
6125
|
assert(client[kSocket] === socket);
|
|
6036
6126
|
assert(!socket.destroyed);
|
|
@@ -6055,9 +6145,10 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6055
6145
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
6056
6146
|
client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade"));
|
|
6057
6147
|
try {
|
|
6058
|
-
request.onUpgrade(statusCode, headers, socket);
|
|
6059
|
-
} catch (
|
|
6060
|
-
util.
|
|
6148
|
+
request.onUpgrade(statusCode, headers, socket, statusText);
|
|
6149
|
+
} catch (error) {
|
|
6150
|
+
util.errorRequest(client, request, error);
|
|
6151
|
+
util.destroy(socket, error);
|
|
6061
6152
|
}
|
|
6062
6153
|
client[kResume]();
|
|
6063
6154
|
}
|
|
@@ -6066,6 +6157,10 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6066
6157
|
if (socket.destroyed) {
|
|
6067
6158
|
return -1;
|
|
6068
6159
|
}
|
|
6160
|
+
if (client[kRunning] === 0) {
|
|
6161
|
+
util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
|
|
6162
|
+
return -1;
|
|
6163
|
+
}
|
|
6069
6164
|
const request = client[kQueue][client[kRunningIdx]];
|
|
6070
6165
|
if (!request) {
|
|
6071
6166
|
return -1;
|
|
@@ -6187,6 +6282,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6187
6282
|
}
|
|
6188
6283
|
request.onComplete(headers);
|
|
6189
6284
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
6285
|
+
socket[kSocketUsed] = true;
|
|
6190
6286
|
if (socket[kWriting]) {
|
|
6191
6287
|
assert(client[kRunning] === 0);
|
|
6192
6288
|
util.destroy(socket, new InformationalError("reset"));
|
|
@@ -6230,12 +6326,19 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6230
6326
|
socket[kWriting] = false;
|
|
6231
6327
|
socket[kReset] = false;
|
|
6232
6328
|
socket[kBlocking] = false;
|
|
6329
|
+
socket[kIdleSocketValidation] = 0;
|
|
6330
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
6331
|
+
socket[kSocketUsed] = false;
|
|
6233
6332
|
socket[kParser] = new Parser(client, socket, llhttpInstance);
|
|
6234
6333
|
addListener(socket, "error", function(err) {
|
|
6235
6334
|
assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
6236
6335
|
const parser = this[kParser];
|
|
6237
6336
|
if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) {
|
|
6238
|
-
parser.
|
|
6337
|
+
const parserErr = parser.finish();
|
|
6338
|
+
if (parserErr) {
|
|
6339
|
+
this[kError] = parserErr;
|
|
6340
|
+
this[kClient][kOnError](parserErr);
|
|
6341
|
+
}
|
|
6239
6342
|
return;
|
|
6240
6343
|
}
|
|
6241
6344
|
this[kError] = err;
|
|
@@ -6250,7 +6353,10 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6250
6353
|
addListener(socket, "end", function() {
|
|
6251
6354
|
const parser = this[kParser];
|
|
6252
6355
|
if (parser.statusCode && !parser.shouldKeepAlive) {
|
|
6253
|
-
parser.
|
|
6356
|
+
const parserErr = parser.finish();
|
|
6357
|
+
if (parserErr) {
|
|
6358
|
+
util.destroy(this, parserErr);
|
|
6359
|
+
}
|
|
6254
6360
|
return;
|
|
6255
6361
|
}
|
|
6256
6362
|
util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this)));
|
|
@@ -6258,9 +6364,10 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6258
6364
|
addListener(socket, "close", function() {
|
|
6259
6365
|
const client2 = this[kClient];
|
|
6260
6366
|
const parser = this[kParser];
|
|
6367
|
+
clearIdleSocketValidation(this);
|
|
6261
6368
|
if (parser) {
|
|
6262
6369
|
if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
|
|
6263
|
-
parser.
|
|
6370
|
+
this[kError] = parser.finish() || this[kError];
|
|
6264
6371
|
}
|
|
6265
6372
|
this[kParser].destroy();
|
|
6266
6373
|
this[kParser] = null;
|
|
@@ -6309,7 +6416,7 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6309
6416
|
return socket.destroyed;
|
|
6310
6417
|
},
|
|
6311
6418
|
busy(request) {
|
|
6312
|
-
if (socket[kWriting] || socket[kReset] || socket[kBlocking]) {
|
|
6419
|
+
if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) {
|
|
6313
6420
|
return true;
|
|
6314
6421
|
}
|
|
6315
6422
|
if (request) {
|
|
@@ -6327,6 +6434,23 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6327
6434
|
}
|
|
6328
6435
|
};
|
|
6329
6436
|
}
|
|
6437
|
+
function clearIdleSocketValidation(socket) {
|
|
6438
|
+
if (socket[kIdleSocketValidationTimeout]) {
|
|
6439
|
+
clearImmediate(socket[kIdleSocketValidationTimeout]);
|
|
6440
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
6441
|
+
}
|
|
6442
|
+
socket[kIdleSocketValidation] = 0;
|
|
6443
|
+
}
|
|
6444
|
+
function scheduleIdleSocketValidation(client, socket) {
|
|
6445
|
+
socket[kIdleSocketValidation] = 1;
|
|
6446
|
+
socket[kIdleSocketValidationTimeout] = setImmediate(() => {
|
|
6447
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
6448
|
+
socket[kIdleSocketValidation] = 2;
|
|
6449
|
+
if (client[kSocket] === socket && !socket.destroyed) {
|
|
6450
|
+
client[kResume]();
|
|
6451
|
+
}
|
|
6452
|
+
});
|
|
6453
|
+
}
|
|
6330
6454
|
function resumeH1(client) {
|
|
6331
6455
|
const socket = client[kSocket];
|
|
6332
6456
|
if (socket && !socket.destroyed) {
|
|
@@ -6339,6 +6463,29 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6339
6463
|
socket.ref();
|
|
6340
6464
|
socket[kNoRef] = false;
|
|
6341
6465
|
}
|
|
6466
|
+
if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {
|
|
6467
|
+
if (socket[kIdleSocketValidation] === 0) {
|
|
6468
|
+
scheduleIdleSocketValidation(client, socket);
|
|
6469
|
+
socket[kParser].readMore();
|
|
6470
|
+
if (socket.destroyed) {
|
|
6471
|
+
return;
|
|
6472
|
+
}
|
|
6473
|
+
return;
|
|
6474
|
+
}
|
|
6475
|
+
if (socket[kIdleSocketValidation] === 1) {
|
|
6476
|
+
socket[kParser].readMore();
|
|
6477
|
+
if (socket.destroyed) {
|
|
6478
|
+
return;
|
|
6479
|
+
}
|
|
6480
|
+
return;
|
|
6481
|
+
}
|
|
6482
|
+
}
|
|
6483
|
+
if (client[kRunning] === 0) {
|
|
6484
|
+
socket[kParser].readMore();
|
|
6485
|
+
if (socket.destroyed) {
|
|
6486
|
+
return;
|
|
6487
|
+
}
|
|
6488
|
+
}
|
|
6342
6489
|
if (client[kSize] === 0) {
|
|
6343
6490
|
if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) {
|
|
6344
6491
|
socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE);
|
|
@@ -6369,8 +6516,16 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6369
6516
|
}
|
|
6370
6517
|
body = bodyStream.stream;
|
|
6371
6518
|
contentLength = bodyStream.length;
|
|
6372
|
-
} else if (util.isBlobLike(body) && request.contentType == null
|
|
6373
|
-
|
|
6519
|
+
} else if (util.isBlobLike(body) && request.contentType == null) {
|
|
6520
|
+
const contentType = body.type;
|
|
6521
|
+
if (contentType) {
|
|
6522
|
+
const contentTypeValue = `${contentType}`;
|
|
6523
|
+
if (!util.isValidHeaderValue(contentTypeValue)) {
|
|
6524
|
+
util.errorRequest(client, request, new InvalidArgumentError("invalid content-type header"));
|
|
6525
|
+
return false;
|
|
6526
|
+
}
|
|
6527
|
+
headers.push("content-type", contentTypeValue);
|
|
6528
|
+
}
|
|
6374
6529
|
}
|
|
6375
6530
|
if (body && typeof body.read === "function") {
|
|
6376
6531
|
body.read(0);
|
|
@@ -6391,11 +6546,18 @@ var require_client_h1 = __commonJS((exports, module) => {
|
|
|
6391
6546
|
process.emitWarning(new RequestContentLengthMismatchError);
|
|
6392
6547
|
}
|
|
6393
6548
|
const socket = client[kSocket];
|
|
6394
|
-
|
|
6395
|
-
|
|
6549
|
+
clearIdleSocketValidation(socket);
|
|
6550
|
+
const abort = (error) => {
|
|
6551
|
+
if (request.aborted) {
|
|
6552
|
+
return;
|
|
6553
|
+
}
|
|
6554
|
+
if (request.completed) {
|
|
6555
|
+
if (request.upgrade || request.method === "CONNECT") {
|
|
6556
|
+
util.destroy(socket, new InformationalError("aborted"));
|
|
6557
|
+
}
|
|
6396
6558
|
return;
|
|
6397
6559
|
}
|
|
6398
|
-
util.errorRequest(client, request,
|
|
6560
|
+
util.errorRequest(client, request, error || new RequestAbortedError);
|
|
6399
6561
|
util.destroy(body);
|
|
6400
6562
|
util.destroy(socket, new InformationalError("aborted"));
|
|
6401
6563
|
};
|
|
@@ -6754,6 +6916,7 @@ ${len.toString(16)}\r
|
|
|
6754
6916
|
// node_modules/undici/lib/dispatcher/client-h2.js
|
|
6755
6917
|
var require_client_h2 = __commonJS((exports, module) => {
|
|
6756
6918
|
var assert = __require("node:assert");
|
|
6919
|
+
var { errorMonitor } = __require("node:events");
|
|
6757
6920
|
var { pipeline } = __require("node:stream");
|
|
6758
6921
|
var util = require_util();
|
|
6759
6922
|
var {
|
|
@@ -6814,6 +6977,10 @@ var require_client_h2 = __commonJS((exports, module) => {
|
|
|
6814
6977
|
}
|
|
6815
6978
|
return result;
|
|
6816
6979
|
}
|
|
6980
|
+
function parseH2ResponseHeaders(headers) {
|
|
6981
|
+
const { [HTTP2_HEADER_STATUS]: _statusCode, ...realHeaders } = headers;
|
|
6982
|
+
return parseH2Headers(realHeaders);
|
|
6983
|
+
}
|
|
6817
6984
|
async function connectH2(client, socket) {
|
|
6818
6985
|
client[kSocket] = socket;
|
|
6819
6986
|
if (!h2ExperimentalWarned) {
|
|
@@ -6977,16 +7144,22 @@ var require_client_h2 = __commonJS((exports, module) => {
|
|
|
6977
7144
|
const { hostname, port } = client[kUrl];
|
|
6978
7145
|
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`;
|
|
6979
7146
|
headers[HTTP2_HEADER_METHOD] = method;
|
|
6980
|
-
const abort = (
|
|
6981
|
-
if (request.aborted
|
|
7147
|
+
const abort = (error) => {
|
|
7148
|
+
if (request.aborted) {
|
|
6982
7149
|
return;
|
|
6983
7150
|
}
|
|
6984
|
-
|
|
6985
|
-
|
|
7151
|
+
if (request.completed) {
|
|
7152
|
+
if (method === "CONNECT" && stream != null) {
|
|
7153
|
+
util.destroy(stream, error || new RequestAbortedError);
|
|
7154
|
+
}
|
|
7155
|
+
return;
|
|
7156
|
+
}
|
|
7157
|
+
error = error || new RequestAbortedError;
|
|
7158
|
+
util.errorRequest(client, request, error);
|
|
6986
7159
|
if (stream != null) {
|
|
6987
|
-
util.destroy(stream,
|
|
7160
|
+
util.destroy(stream, error);
|
|
6988
7161
|
}
|
|
6989
|
-
util.destroy(body,
|
|
7162
|
+
util.destroy(body, error);
|
|
6990
7163
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
6991
7164
|
client[kResume]();
|
|
6992
7165
|
};
|
|
@@ -7001,18 +7174,42 @@ var require_client_h2 = __commonJS((exports, module) => {
|
|
|
7001
7174
|
if (method === "CONNECT") {
|
|
7002
7175
|
session.ref();
|
|
7003
7176
|
stream = session.request(headers, { endStream: false, signal });
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7177
|
+
let upgradeResponseFinished = false;
|
|
7178
|
+
const onResponse = (headers2) => {
|
|
7179
|
+
upgradeResponseFinished = true;
|
|
7180
|
+
stream.off(errorMonitor, onUpgradeError);
|
|
7181
|
+
request.onUpgradeResponse(Number(headers2[HTTP2_HEADER_STATUS]), headers2, parseH2ResponseHeaders);
|
|
7182
|
+
};
|
|
7183
|
+
const onUpgradeError = (error) => {
|
|
7184
|
+
upgradeResponseFinished = true;
|
|
7185
|
+
stream.off("response", onResponse);
|
|
7186
|
+
request.onUpgradeError(error);
|
|
7187
|
+
};
|
|
7188
|
+
const onReady = () => {
|
|
7189
|
+
try {
|
|
7010
7190
|
request.onUpgrade(null, null, stream);
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7191
|
+
} catch (error) {
|
|
7192
|
+
stream.off("response", onResponse);
|
|
7193
|
+
abort(error);
|
|
7194
|
+
return;
|
|
7195
|
+
}
|
|
7196
|
+
if (request.aborted) {
|
|
7197
|
+
return;
|
|
7198
|
+
}
|
|
7199
|
+
stream.off("error", abort);
|
|
7200
|
+
stream.once(errorMonitor, onUpgradeError);
|
|
7201
|
+
client[kQueue][client[kRunningIdx]++] = null;
|
|
7202
|
+
};
|
|
7203
|
+
stream.once("response", onResponse);
|
|
7204
|
+
stream.once("error", abort);
|
|
7205
|
+
++session[kOpenStreams];
|
|
7206
|
+
onReady();
|
|
7015
7207
|
stream.once("close", () => {
|
|
7208
|
+
if (!upgradeResponseFinished && request.completed) {
|
|
7209
|
+
stream.off("response", onResponse);
|
|
7210
|
+
stream.off(errorMonitor, onUpgradeError);
|
|
7211
|
+
request.onUpgradeError(new InformationalError(`HTTP/2: "stream error" received - code ${stream.rstCode}`));
|
|
7212
|
+
}
|
|
7016
7213
|
session[kOpenStreams] -= 1;
|
|
7017
7214
|
if (session[kOpenStreams] === 0)
|
|
7018
7215
|
session.unref();
|
|
@@ -7502,9 +7699,10 @@ var require_client = __commonJS((exports, module) => {
|
|
|
7502
7699
|
autoSelectFamily,
|
|
7503
7700
|
autoSelectFamilyAttemptTimeout,
|
|
7504
7701
|
maxConcurrentStreams,
|
|
7505
|
-
allowH2
|
|
7702
|
+
allowH2,
|
|
7703
|
+
webSocket
|
|
7506
7704
|
} = {}) {
|
|
7507
|
-
super();
|
|
7705
|
+
super({ webSocket });
|
|
7508
7706
|
if (keepAlive !== undefined) {
|
|
7509
7707
|
throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead");
|
|
7510
7708
|
}
|
|
@@ -8001,8 +8199,8 @@ var require_pool_base = __commonJS((exports, module) => {
|
|
|
8001
8199
|
var kStats = Symbol("stats");
|
|
8002
8200
|
|
|
8003
8201
|
class PoolBase extends DispatcherBase {
|
|
8004
|
-
constructor() {
|
|
8005
|
-
super();
|
|
8202
|
+
constructor(opts) {
|
|
8203
|
+
super(opts);
|
|
8006
8204
|
this[kQueue] = new FixedQueue;
|
|
8007
8205
|
this[kClients] = [];
|
|
8008
8206
|
this[kQueued] = 0;
|
|
@@ -8171,7 +8369,6 @@ var require_pool = __commonJS((exports, module) => {
|
|
|
8171
8369
|
allowH2,
|
|
8172
8370
|
...options
|
|
8173
8371
|
} = {}) {
|
|
8174
|
-
super();
|
|
8175
8372
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
8176
8373
|
throw new InvalidArgumentError("invalid connections");
|
|
8177
8374
|
}
|
|
@@ -8192,6 +8389,7 @@ var require_pool = __commonJS((exports, module) => {
|
|
|
8192
8389
|
...connect
|
|
8193
8390
|
});
|
|
8194
8391
|
}
|
|
8392
|
+
super(options);
|
|
8195
8393
|
this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [];
|
|
8196
8394
|
this[kConnections] = connections || null;
|
|
8197
8395
|
this[kUrl] = util.parseOrigin(origin);
|
|
@@ -8388,7 +8586,6 @@ var require_agent = __commonJS((exports, module) => {
|
|
|
8388
8586
|
|
|
8389
8587
|
class Agent extends DispatcherBase {
|
|
8390
8588
|
constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
|
|
8391
|
-
super();
|
|
8392
8589
|
if (typeof factory !== "function") {
|
|
8393
8590
|
throw new InvalidArgumentError("factory must be a function.");
|
|
8394
8591
|
}
|
|
@@ -8398,6 +8595,7 @@ var require_agent = __commonJS((exports, module) => {
|
|
|
8398
8595
|
if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
|
|
8399
8596
|
throw new InvalidArgumentError("maxRedirections must be a positive number");
|
|
8400
8597
|
}
|
|
8598
|
+
super(options);
|
|
8401
8599
|
if (connect && typeof connect !== "function") {
|
|
8402
8600
|
connect = { ...connect };
|
|
8403
8601
|
}
|
|
@@ -8825,6 +9023,24 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8825
9023
|
const current = Date.now();
|
|
8826
9024
|
return new Date(retryAfter).getTime() - current;
|
|
8827
9025
|
}
|
|
9026
|
+
function validatePartialResponseContentLength(headers, range, statusCode, retryCount) {
|
|
9027
|
+
const contentLength = headers["content-length"];
|
|
9028
|
+
if (contentLength == null) {
|
|
9029
|
+
return null;
|
|
9030
|
+
}
|
|
9031
|
+
if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) {
|
|
9032
|
+
return null;
|
|
9033
|
+
}
|
|
9034
|
+
const length = Number(contentLength);
|
|
9035
|
+
const expectedLength = range.end - range.start + 1;
|
|
9036
|
+
if (!Number.isFinite(length) || length !== expectedLength) {
|
|
9037
|
+
return new RequestRetryError("Content-Length mismatch", statusCode, {
|
|
9038
|
+
headers,
|
|
9039
|
+
data: { count: retryCount }
|
|
9040
|
+
});
|
|
9041
|
+
}
|
|
9042
|
+
return null;
|
|
9043
|
+
}
|
|
8828
9044
|
|
|
8829
9045
|
class RetryHandler {
|
|
8830
9046
|
constructor(opts, handlers) {
|
|
@@ -8872,6 +9088,7 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8872
9088
|
this.end = null;
|
|
8873
9089
|
this.etag = null;
|
|
8874
9090
|
this.resume = null;
|
|
9091
|
+
this.headersSent = false;
|
|
8875
9092
|
this.handler.onConnect((reason) => {
|
|
8876
9093
|
this.aborted = true;
|
|
8877
9094
|
if (this.abort) {
|
|
@@ -8881,6 +9098,14 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8881
9098
|
}
|
|
8882
9099
|
});
|
|
8883
9100
|
}
|
|
9101
|
+
checkpointResponseEnd(headers, resume) {
|
|
9102
|
+
if (this.end == null && this.opts.method !== "HEAD") {
|
|
9103
|
+
const contentLength = headers["content-length"];
|
|
9104
|
+
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
|
9105
|
+
assert(this.end == null || Number.isFinite(this.end), "invalid content-length");
|
|
9106
|
+
}
|
|
9107
|
+
this.resume = this.end != null ? resume : null;
|
|
9108
|
+
}
|
|
8884
9109
|
onRequestSent() {
|
|
8885
9110
|
if (this.handler.onRequestSent) {
|
|
8886
9111
|
this.handler.onRequestSent();
|
|
@@ -8943,7 +9168,9 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8943
9168
|
const headers = parseHeaders(rawHeaders);
|
|
8944
9169
|
this.retryCount += 1;
|
|
8945
9170
|
if (statusCode >= 300) {
|
|
8946
|
-
if (this.retryOpts.statusCodes.includes(statusCode) === false) {
|
|
9171
|
+
if (!this.headersSent && this.retryOpts.statusCodes.includes(statusCode) === false) {
|
|
9172
|
+
this.headersSent = true;
|
|
9173
|
+
this.checkpointResponseEnd(headers, resume);
|
|
8947
9174
|
return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage);
|
|
8948
9175
|
} else {
|
|
8949
9176
|
this.abort(new RequestRetryError("Request failed", statusCode, {
|
|
@@ -8979,9 +9206,19 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8979
9206
|
}));
|
|
8980
9207
|
return false;
|
|
8981
9208
|
}
|
|
9209
|
+
const contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount);
|
|
9210
|
+
if (contentLengthError != null) {
|
|
9211
|
+
this.abort(contentLengthError);
|
|
9212
|
+
return false;
|
|
9213
|
+
}
|
|
8982
9214
|
const { start, size, end = size - 1 } = contentRange;
|
|
8983
|
-
|
|
8984
|
-
|
|
9215
|
+
if (this.start !== start || this.end != null && this.end !== end) {
|
|
9216
|
+
this.abort(new RequestRetryError("Content-Range mismatch", statusCode, {
|
|
9217
|
+
headers,
|
|
9218
|
+
data: { count: this.retryCount }
|
|
9219
|
+
}));
|
|
9220
|
+
return false;
|
|
9221
|
+
}
|
|
8985
9222
|
this.resume = resume;
|
|
8986
9223
|
return true;
|
|
8987
9224
|
}
|
|
@@ -8989,8 +9226,14 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
8989
9226
|
if (statusCode === 206) {
|
|
8990
9227
|
const range = parseRangeHeader(headers["content-range"]);
|
|
8991
9228
|
if (range == null) {
|
|
9229
|
+
this.headersSent = true;
|
|
8992
9230
|
return this.handler.onHeaders(statusCode, rawHeaders, resume, statusMessage);
|
|
8993
9231
|
}
|
|
9232
|
+
const contentLengthError = validatePartialResponseContentLength(headers, range, statusCode, this.retryCount);
|
|
9233
|
+
if (contentLengthError != null) {
|
|
9234
|
+
this.abort(contentLengthError);
|
|
9235
|
+
return false;
|
|
9236
|
+
}
|
|
8994
9237
|
const { start, size, end = size - 1 } = range;
|
|
8995
9238
|
assert(start != null && Number.isFinite(start), "content-range mismatch");
|
|
8996
9239
|
assert(end != null && Number.isFinite(end), "invalid content-length");
|
|
@@ -9004,6 +9247,7 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
9004
9247
|
assert(Number.isFinite(this.start));
|
|
9005
9248
|
assert(this.end == null || Number.isFinite(this.end), "invalid content-length");
|
|
9006
9249
|
this.resume = resume;
|
|
9250
|
+
this.headersSent = true;
|
|
9007
9251
|
this.etag = headers.etag != null ? headers.etag : null;
|
|
9008
9252
|
if (this.etag != null && this.etag.startsWith("W/")) {
|
|
9009
9253
|
this.etag = null;
|
|
@@ -9026,7 +9270,7 @@ var require_retry_handler = __commonJS((exports, module) => {
|
|
|
9026
9270
|
return this.handler.onComplete(rawTrailers);
|
|
9027
9271
|
}
|
|
9028
9272
|
onError(err) {
|
|
9029
|
-
if (this.aborted || isDisturbed(this.opts.body)) {
|
|
9273
|
+
if (this.aborted || isDisturbed(this.opts.body) || this.headersSent && this.resume == null) {
|
|
9030
9274
|
return this.handler.onError(err);
|
|
9031
9275
|
}
|
|
9032
9276
|
if (this.retryCount - this.retryCountCheckpoint > 0) {
|
|
@@ -13556,7 +13800,7 @@ var require_fetch = __commonJS((exports, module) => {
|
|
|
13556
13800
|
request.cache = "no-store";
|
|
13557
13801
|
}
|
|
13558
13802
|
const newConnection = forceNewConnection ? "yes" : "no";
|
|
13559
|
-
if (request.mode === "websocket") {}
|
|
13803
|
+
if (request.mode === "websocket") {} else {}
|
|
13560
13804
|
let requestBody = null;
|
|
13561
13805
|
if (request.body == null && fetchParams.processRequestEndOfBody) {
|
|
13562
13806
|
queueMicrotask(() => fetchParams.processRequestEndOfBody());
|
|
@@ -15273,13 +15517,45 @@ var require_util6 = __commonJS((exports, module) => {
|
|
|
15273
15517
|
function validateCookiePath(path) {
|
|
15274
15518
|
for (let i = 0;i < path.length; ++i) {
|
|
15275
15519
|
const code = path.charCodeAt(i);
|
|
15276
|
-
if (code < 32 || code
|
|
15520
|
+
if (code < 32 || code > 126 || code === 59) {
|
|
15277
15521
|
throw new Error("Invalid cookie path");
|
|
15278
15522
|
}
|
|
15279
15523
|
}
|
|
15280
15524
|
}
|
|
15525
|
+
function isLetterOrDigit(code) {
|
|
15526
|
+
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
15527
|
+
}
|
|
15281
15528
|
function validateCookieDomain(domain) {
|
|
15282
|
-
if (domain
|
|
15529
|
+
if (domain === " ") {
|
|
15530
|
+
return;
|
|
15531
|
+
}
|
|
15532
|
+
if (domain.length > 255) {
|
|
15533
|
+
throw new Error("Invalid cookie domain");
|
|
15534
|
+
}
|
|
15535
|
+
let labelLength = 0;
|
|
15536
|
+
for (let i = 0;i < domain.length; ++i) {
|
|
15537
|
+
const code = domain.charCodeAt(i);
|
|
15538
|
+
if (code === 46) {
|
|
15539
|
+
if (labelLength === 0) {
|
|
15540
|
+
throw new Error("Invalid cookie domain");
|
|
15541
|
+
}
|
|
15542
|
+
if (domain.charCodeAt(i - 1) === 45) {
|
|
15543
|
+
throw new Error("Invalid cookie domain");
|
|
15544
|
+
}
|
|
15545
|
+
labelLength = 0;
|
|
15546
|
+
continue;
|
|
15547
|
+
}
|
|
15548
|
+
if (labelLength === 0 && !isLetterOrDigit(code)) {
|
|
15549
|
+
throw new Error("Invalid cookie domain");
|
|
15550
|
+
}
|
|
15551
|
+
if (!isLetterOrDigit(code) && code !== 45) {
|
|
15552
|
+
throw new Error("Invalid cookie domain");
|
|
15553
|
+
}
|
|
15554
|
+
if (++labelLength > 63) {
|
|
15555
|
+
throw new Error("Invalid cookie domain");
|
|
15556
|
+
}
|
|
15557
|
+
}
|
|
15558
|
+
if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 45) {
|
|
15283
15559
|
throw new Error("Invalid cookie domain");
|
|
15284
15560
|
}
|
|
15285
15561
|
}
|
|
@@ -15362,7 +15638,11 @@ var require_util6 = __commonJS((exports, module) => {
|
|
|
15362
15638
|
throw new Error("Invalid unparsed");
|
|
15363
15639
|
}
|
|
15364
15640
|
const [key, ...value] = part.split("=");
|
|
15365
|
-
|
|
15641
|
+
const trimmedKey = key.trim();
|
|
15642
|
+
const joinedValue = value.join("=");
|
|
15643
|
+
validateCookieName(trimmedKey);
|
|
15644
|
+
validateCookieValue(joinedValue);
|
|
15645
|
+
out.push(`${trimmedKey}=${joinedValue}`);
|
|
15366
15646
|
}
|
|
15367
15647
|
return out.join("; ");
|
|
15368
15648
|
}
|
|
@@ -15477,18 +15757,14 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
15477
15757
|
} else if (attributeNameLowercase === "httponly") {
|
|
15478
15758
|
cookieAttributeList.httpOnly = true;
|
|
15479
15759
|
} else if (attributeNameLowercase === "samesite") {
|
|
15480
|
-
let enforcement = "Default";
|
|
15481
15760
|
const attributeValueLowercase = attributeValue.toLowerCase();
|
|
15482
|
-
if (attributeValueLowercase
|
|
15483
|
-
|
|
15484
|
-
}
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
if (attributeValueLowercase.includes("lax")) {
|
|
15489
|
-
enforcement = "Lax";
|
|
15761
|
+
if (attributeValueLowercase === "none") {
|
|
15762
|
+
cookieAttributeList.sameSite = "None";
|
|
15763
|
+
} else if (attributeValueLowercase === "strict") {
|
|
15764
|
+
cookieAttributeList.sameSite = "Strict";
|
|
15765
|
+
} else if (attributeValueLowercase === "lax") {
|
|
15766
|
+
cookieAttributeList.sameSite = "Lax";
|
|
15490
15767
|
}
|
|
15491
|
-
cookieAttributeList.sameSite = enforcement;
|
|
15492
15768
|
} else {
|
|
15493
15769
|
cookieAttributeList.unparsed ??= [];
|
|
15494
15770
|
cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`);
|
|
@@ -16263,7 +16539,7 @@ var require_connection = __commonJS((exports, module) => {
|
|
|
16263
16539
|
const secProtocol = response.headersList.get("Sec-WebSocket-Protocol");
|
|
16264
16540
|
if (secProtocol !== null) {
|
|
16265
16541
|
const requestProtocols = getDecodeSplit("sec-websocket-protocol", request.headersList);
|
|
16266
|
-
if (!requestProtocols.includes(secProtocol)) {
|
|
16542
|
+
if (requestProtocols === null || !requestProtocols.includes(secProtocol)) {
|
|
16267
16543
|
failWebsocketConnection(ws, "Protocol was not set in the opening handshake.");
|
|
16268
16544
|
return;
|
|
16269
16545
|
}
|
|
@@ -16365,22 +16641,17 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
16365
16641
|
var tail = Buffer.from([0, 0, 255, 255]);
|
|
16366
16642
|
var kBuffer = Symbol("kBuffer");
|
|
16367
16643
|
var kLength = Symbol("kLength");
|
|
16368
|
-
var kDefaultMaxDecompressedSize = 4 * 1024 * 1024;
|
|
16369
16644
|
|
|
16370
16645
|
class PerMessageDeflate {
|
|
16371
16646
|
#inflate;
|
|
16372
16647
|
#options = {};
|
|
16373
|
-
#
|
|
16374
|
-
|
|
16375
|
-
constructor(extensions) {
|
|
16648
|
+
#maxPayloadSize = 0;
|
|
16649
|
+
constructor(extensions, options) {
|
|
16376
16650
|
this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover");
|
|
16377
16651
|
this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits");
|
|
16652
|
+
this.#maxPayloadSize = options.maxPayloadSize;
|
|
16378
16653
|
}
|
|
16379
16654
|
decompress(chunk, fin, callback) {
|
|
16380
|
-
if (this.#aborted) {
|
|
16381
|
-
callback(new MessageSizeExceededError);
|
|
16382
|
-
return;
|
|
16383
|
-
}
|
|
16384
16655
|
if (!this.#inflate) {
|
|
16385
16656
|
let windowBits = Z_DEFAULT_WINDOWBITS;
|
|
16386
16657
|
if (this.#options.serverMaxWindowBits) {
|
|
@@ -16399,20 +16670,12 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
16399
16670
|
this.#inflate[kBuffer] = [];
|
|
16400
16671
|
this.#inflate[kLength] = 0;
|
|
16401
16672
|
this.#inflate.on("data", (data) => {
|
|
16402
|
-
if (this.#aborted) {
|
|
16403
|
-
return;
|
|
16404
|
-
}
|
|
16405
16673
|
this.#inflate[kLength] += data.length;
|
|
16406
|
-
if (this.#inflate[kLength] >
|
|
16407
|
-
|
|
16674
|
+
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
|
16675
|
+
callback(new MessageSizeExceededError);
|
|
16408
16676
|
this.#inflate.removeAllListeners();
|
|
16409
16677
|
this.#inflate.destroy();
|
|
16410
16678
|
this.#inflate = null;
|
|
16411
|
-
if (this.#currentCallback) {
|
|
16412
|
-
const cb = this.#currentCallback;
|
|
16413
|
-
this.#currentCallback = null;
|
|
16414
|
-
cb(new MessageSizeExceededError);
|
|
16415
|
-
}
|
|
16416
16679
|
return;
|
|
16417
16680
|
}
|
|
16418
16681
|
this.#inflate[kBuffer].push(data);
|
|
@@ -16422,19 +16685,17 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
16422
16685
|
callback(err);
|
|
16423
16686
|
});
|
|
16424
16687
|
}
|
|
16425
|
-
this.#currentCallback = callback;
|
|
16426
16688
|
this.#inflate.write(chunk);
|
|
16427
16689
|
if (fin) {
|
|
16428
16690
|
this.#inflate.write(tail);
|
|
16429
16691
|
}
|
|
16430
16692
|
this.#inflate.flush(() => {
|
|
16431
|
-
if (
|
|
16693
|
+
if (!this.#inflate) {
|
|
16432
16694
|
return;
|
|
16433
16695
|
}
|
|
16434
16696
|
const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]);
|
|
16435
16697
|
this.#inflate[kBuffer].length = 0;
|
|
16436
16698
|
this.#inflate[kLength] = 0;
|
|
16437
|
-
this.#currentCallback = null;
|
|
16438
16699
|
callback(null, full);
|
|
16439
16700
|
});
|
|
16440
16701
|
}
|
|
@@ -16462,21 +16723,31 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16462
16723
|
var { WebsocketFrameSend } = require_frame();
|
|
16463
16724
|
var { closeWebSocketConnection } = require_connection();
|
|
16464
16725
|
var { PerMessageDeflate } = require_permessage_deflate();
|
|
16726
|
+
var { MessageSizeExceededError } = require_errors();
|
|
16727
|
+
function failWebsocketConnectionWithCode(ws, code, reason) {
|
|
16728
|
+
closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason));
|
|
16729
|
+
failWebsocketConnection(ws, reason);
|
|
16730
|
+
}
|
|
16465
16731
|
|
|
16466
16732
|
class ByteParser extends Writable {
|
|
16467
16733
|
#buffers = [];
|
|
16734
|
+
#fragmentsBytes = 0;
|
|
16468
16735
|
#byteOffset = 0;
|
|
16469
16736
|
#loop = false;
|
|
16470
16737
|
#state = parserStates.INFO;
|
|
16471
16738
|
#info = {};
|
|
16472
16739
|
#fragments = [];
|
|
16473
16740
|
#extensions;
|
|
16474
|
-
|
|
16741
|
+
#maxFragments;
|
|
16742
|
+
#maxPayloadSize;
|
|
16743
|
+
constructor(ws, extensions, options = {}) {
|
|
16475
16744
|
super();
|
|
16476
16745
|
this.ws = ws;
|
|
16477
16746
|
this.#extensions = extensions == null ? new Map : extensions;
|
|
16747
|
+
this.#maxFragments = options.maxFragments ?? 0;
|
|
16748
|
+
this.#maxPayloadSize = options.maxPayloadSize ?? 0;
|
|
16478
16749
|
if (this.#extensions.has("permessage-deflate")) {
|
|
16479
|
-
this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions));
|
|
16750
|
+
this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options));
|
|
16480
16751
|
}
|
|
16481
16752
|
}
|
|
16482
16753
|
_write(chunk, _, callback) {
|
|
@@ -16485,6 +16756,13 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16485
16756
|
this.#loop = true;
|
|
16486
16757
|
this.run(callback);
|
|
16487
16758
|
}
|
|
16759
|
+
#validatePayloadLength() {
|
|
16760
|
+
if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
16761
|
+
failWebsocketConnectionWithCode(this.ws, 1009, "Payload size exceeds maximum allowed size");
|
|
16762
|
+
return false;
|
|
16763
|
+
}
|
|
16764
|
+
return true;
|
|
16765
|
+
}
|
|
16488
16766
|
run(callback) {
|
|
16489
16767
|
while (this.#loop) {
|
|
16490
16768
|
if (this.#state === parserStates.INFO) {
|
|
@@ -16539,6 +16817,9 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16539
16817
|
if (payloadLength <= 125) {
|
|
16540
16818
|
this.#info.payloadLength = payloadLength;
|
|
16541
16819
|
this.#state = parserStates.READ_DATA;
|
|
16820
|
+
if (!this.#validatePayloadLength()) {
|
|
16821
|
+
return;
|
|
16822
|
+
}
|
|
16542
16823
|
} else if (payloadLength === 126) {
|
|
16543
16824
|
this.#state = parserStates.PAYLOADLENGTH_16;
|
|
16544
16825
|
} else if (payloadLength === 127) {
|
|
@@ -16559,6 +16840,9 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16559
16840
|
const buffer = this.consume(2);
|
|
16560
16841
|
this.#info.payloadLength = buffer.readUInt16BE(0);
|
|
16561
16842
|
this.#state = parserStates.READ_DATA;
|
|
16843
|
+
if (!this.#validatePayloadLength()) {
|
|
16844
|
+
return;
|
|
16845
|
+
}
|
|
16562
16846
|
} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
|
|
16563
16847
|
if (this.#byteOffset < 8) {
|
|
16564
16848
|
return callback();
|
|
@@ -16572,6 +16856,9 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16572
16856
|
}
|
|
16573
16857
|
this.#info.payloadLength = lower;
|
|
16574
16858
|
this.#state = parserStates.READ_DATA;
|
|
16859
|
+
if (!this.#validatePayloadLength()) {
|
|
16860
|
+
return;
|
|
16861
|
+
}
|
|
16575
16862
|
} else if (this.#state === parserStates.READ_DATA) {
|
|
16576
16863
|
if (this.#byteOffset < this.#info.payloadLength) {
|
|
16577
16864
|
return callback();
|
|
@@ -16582,30 +16869,40 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16582
16869
|
this.#state = parserStates.INFO;
|
|
16583
16870
|
} else {
|
|
16584
16871
|
if (!this.#info.compressed) {
|
|
16585
|
-
this
|
|
16872
|
+
if (!this.writeFragments(body)) {
|
|
16873
|
+
return;
|
|
16874
|
+
}
|
|
16875
|
+
if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
16876
|
+
failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message);
|
|
16877
|
+
return;
|
|
16878
|
+
}
|
|
16586
16879
|
if (!this.#info.fragmented && this.#info.fin) {
|
|
16587
|
-
|
|
16588
|
-
websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage);
|
|
16589
|
-
this.#fragments.length = 0;
|
|
16880
|
+
websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments());
|
|
16590
16881
|
}
|
|
16591
16882
|
this.#state = parserStates.INFO;
|
|
16592
16883
|
} else {
|
|
16593
16884
|
this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error, data) => {
|
|
16594
16885
|
if (error) {
|
|
16595
|
-
|
|
16886
|
+
const code = error instanceof MessageSizeExceededError ? 1009 : 1007;
|
|
16887
|
+
failWebsocketConnectionWithCode(this.ws, code, error.message);
|
|
16888
|
+
return;
|
|
16889
|
+
}
|
|
16890
|
+
if (!this.writeFragments(data)) {
|
|
16891
|
+
return;
|
|
16892
|
+
}
|
|
16893
|
+
if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
16894
|
+
failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message);
|
|
16596
16895
|
return;
|
|
16597
16896
|
}
|
|
16598
|
-
this.#fragments.push(data);
|
|
16599
16897
|
if (!this.#info.fin) {
|
|
16600
16898
|
this.#state = parserStates.INFO;
|
|
16601
16899
|
this.#loop = true;
|
|
16602
16900
|
this.run(callback);
|
|
16603
16901
|
return;
|
|
16604
16902
|
}
|
|
16605
|
-
websocketMessageReceived(this.ws, this.#info.binaryType,
|
|
16903
|
+
websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments());
|
|
16606
16904
|
this.#loop = true;
|
|
16607
16905
|
this.#state = parserStates.INFO;
|
|
16608
|
-
this.#fragments.length = 0;
|
|
16609
16906
|
this.run(callback);
|
|
16610
16907
|
});
|
|
16611
16908
|
this.#loop = false;
|
|
@@ -16645,6 +16942,26 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
16645
16942
|
this.#byteOffset -= n;
|
|
16646
16943
|
return buffer;
|
|
16647
16944
|
}
|
|
16945
|
+
writeFragments(fragment) {
|
|
16946
|
+
if (this.#maxFragments > 0 && this.#fragments.length === this.#maxFragments) {
|
|
16947
|
+
failWebsocketConnectionWithCode(this.ws, 1008, "Too many message fragments");
|
|
16948
|
+
return false;
|
|
16949
|
+
}
|
|
16950
|
+
this.#fragmentsBytes += fragment.length;
|
|
16951
|
+
this.#fragments.push(fragment);
|
|
16952
|
+
return true;
|
|
16953
|
+
}
|
|
16954
|
+
consumeFragments() {
|
|
16955
|
+
const fragments = this.#fragments;
|
|
16956
|
+
if (fragments.length === 1) {
|
|
16957
|
+
this.#fragmentsBytes = 0;
|
|
16958
|
+
return fragments.shift();
|
|
16959
|
+
}
|
|
16960
|
+
const output = Buffer.concat(fragments, this.#fragmentsBytes);
|
|
16961
|
+
this.#fragments = [];
|
|
16962
|
+
this.#fragmentsBytes = 0;
|
|
16963
|
+
return output;
|
|
16964
|
+
}
|
|
16648
16965
|
parseCloseBody(data) {
|
|
16649
16966
|
assert(data.length !== 1);
|
|
16650
16967
|
let code;
|
|
@@ -17034,7 +17351,13 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
17034
17351
|
}
|
|
17035
17352
|
#onConnectionEstablished(response, parsedExtensions) {
|
|
17036
17353
|
this[kResponse] = response;
|
|
17037
|
-
const
|
|
17354
|
+
const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions;
|
|
17355
|
+
const maxFragments = webSocketOptions?.maxFragments;
|
|
17356
|
+
const maxPayloadSize = webSocketOptions?.maxPayloadSize;
|
|
17357
|
+
const parser = new ByteParser(this, parsedExtensions, {
|
|
17358
|
+
maxFragments,
|
|
17359
|
+
maxPayloadSize
|
|
17360
|
+
});
|
|
17038
17361
|
parser.on("drain", onParserDrain);
|
|
17039
17362
|
parser.on("error", onParserError.bind(this));
|
|
17040
17363
|
response.socket.ws = this;
|
|
@@ -17181,14 +17504,51 @@ var require_eventsource_stream = __commonJS((exports, module) => {
|
|
|
17181
17504
|
var CR = 13;
|
|
17182
17505
|
var COLON = 58;
|
|
17183
17506
|
var SPACE = 32;
|
|
17507
|
+
var DATA = Buffer.from("data");
|
|
17508
|
+
var EVENT = Buffer.from("event");
|
|
17509
|
+
var ID = Buffer.from("id");
|
|
17510
|
+
var RETRY = Buffer.from("retry");
|
|
17511
|
+
function isASCIINumberBytes(buffer, start) {
|
|
17512
|
+
if (start >= buffer.length) {
|
|
17513
|
+
return false;
|
|
17514
|
+
}
|
|
17515
|
+
for (let i = start;i < buffer.length; i++) {
|
|
17516
|
+
if (buffer[i] < 48 || buffer[i] > 57) {
|
|
17517
|
+
return false;
|
|
17518
|
+
}
|
|
17519
|
+
}
|
|
17520
|
+
return true;
|
|
17521
|
+
}
|
|
17522
|
+
function isValidLastEventIdBytes(buffer, start) {
|
|
17523
|
+
for (let i = start;i < buffer.length; i++) {
|
|
17524
|
+
if (buffer[i] === 0) {
|
|
17525
|
+
return false;
|
|
17526
|
+
}
|
|
17527
|
+
}
|
|
17528
|
+
return true;
|
|
17529
|
+
}
|
|
17530
|
+
function isFieldName(line, length, field) {
|
|
17531
|
+
if (length !== field.length) {
|
|
17532
|
+
return false;
|
|
17533
|
+
}
|
|
17534
|
+
for (let i = 0;i < length; i++) {
|
|
17535
|
+
if (line[i] !== field[i]) {
|
|
17536
|
+
return false;
|
|
17537
|
+
}
|
|
17538
|
+
}
|
|
17539
|
+
return true;
|
|
17540
|
+
}
|
|
17184
17541
|
|
|
17185
17542
|
class EventSourceStream extends Transform {
|
|
17186
17543
|
state = null;
|
|
17187
17544
|
checkBOM = true;
|
|
17188
17545
|
crlfCheck = false;
|
|
17189
17546
|
eventEndCheck = false;
|
|
17190
|
-
|
|
17547
|
+
chunks = [];
|
|
17548
|
+
chunkIndex = 0;
|
|
17191
17549
|
pos = 0;
|
|
17550
|
+
lineChunkIndex = 0;
|
|
17551
|
+
linePos = 0;
|
|
17192
17552
|
event = {
|
|
17193
17553
|
data: undefined,
|
|
17194
17554
|
event: undefined,
|
|
@@ -17208,63 +17568,30 @@ var require_eventsource_stream = __commonJS((exports, module) => {
|
|
|
17208
17568
|
callback();
|
|
17209
17569
|
return;
|
|
17210
17570
|
}
|
|
17211
|
-
|
|
17212
|
-
this.buffer = Buffer.concat([this.buffer, chunk]);
|
|
17213
|
-
} else {
|
|
17214
|
-
this.buffer = chunk;
|
|
17215
|
-
}
|
|
17571
|
+
this.chunks.push(chunk);
|
|
17216
17572
|
if (this.checkBOM) {
|
|
17217
|
-
|
|
17218
|
-
|
|
17219
|
-
|
|
17220
|
-
callback();
|
|
17221
|
-
return;
|
|
17222
|
-
}
|
|
17223
|
-
this.checkBOM = false;
|
|
17224
|
-
callback();
|
|
17225
|
-
return;
|
|
17226
|
-
case 2:
|
|
17227
|
-
if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) {
|
|
17228
|
-
callback();
|
|
17229
|
-
return;
|
|
17230
|
-
}
|
|
17231
|
-
this.checkBOM = false;
|
|
17232
|
-
break;
|
|
17233
|
-
case 3:
|
|
17234
|
-
if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) {
|
|
17235
|
-
this.buffer = Buffer.alloc(0);
|
|
17236
|
-
this.checkBOM = false;
|
|
17237
|
-
callback();
|
|
17238
|
-
return;
|
|
17239
|
-
}
|
|
17240
|
-
this.checkBOM = false;
|
|
17241
|
-
break;
|
|
17242
|
-
default:
|
|
17243
|
-
if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) {
|
|
17244
|
-
this.buffer = this.buffer.subarray(3);
|
|
17245
|
-
}
|
|
17246
|
-
this.checkBOM = false;
|
|
17247
|
-
break;
|
|
17573
|
+
if (this.handleBOM()) {
|
|
17574
|
+
callback();
|
|
17575
|
+
return;
|
|
17248
17576
|
}
|
|
17249
17577
|
}
|
|
17250
|
-
while (this.
|
|
17578
|
+
while (this.hasCurrentByte()) {
|
|
17579
|
+
const byte = this.currentByte();
|
|
17251
17580
|
if (this.eventEndCheck) {
|
|
17252
17581
|
if (this.crlfCheck) {
|
|
17253
|
-
if (
|
|
17254
|
-
this.buffer = this.buffer.subarray(this.pos + 1);
|
|
17255
|
-
this.pos = 0;
|
|
17582
|
+
if (byte === LF) {
|
|
17256
17583
|
this.crlfCheck = false;
|
|
17584
|
+
this.consumeCurrentByte();
|
|
17257
17585
|
continue;
|
|
17258
17586
|
}
|
|
17259
17587
|
this.crlfCheck = false;
|
|
17260
17588
|
}
|
|
17261
|
-
if (
|
|
17262
|
-
if (
|
|
17589
|
+
if (byte === LF || byte === CR) {
|
|
17590
|
+
if (byte === CR) {
|
|
17263
17591
|
this.crlfCheck = true;
|
|
17264
17592
|
}
|
|
17265
|
-
this.
|
|
17266
|
-
this.
|
|
17267
|
-
if (this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
|
|
17593
|
+
this.consumeCurrentByte();
|
|
17594
|
+
if (this.hasPendingEvent()) {
|
|
17268
17595
|
this.processEvent(this.event);
|
|
17269
17596
|
}
|
|
17270
17597
|
this.clearEvent();
|
|
@@ -17273,17 +17600,16 @@ var require_eventsource_stream = __commonJS((exports, module) => {
|
|
|
17273
17600
|
this.eventEndCheck = false;
|
|
17274
17601
|
continue;
|
|
17275
17602
|
}
|
|
17276
|
-
if (
|
|
17277
|
-
if (
|
|
17603
|
+
if (byte === LF || byte === CR) {
|
|
17604
|
+
if (byte === CR) {
|
|
17278
17605
|
this.crlfCheck = true;
|
|
17279
17606
|
}
|
|
17280
|
-
this.parseLine(this.
|
|
17281
|
-
this.
|
|
17282
|
-
this.pos = 0;
|
|
17607
|
+
this.parseLine(this.readLine(), this.event);
|
|
17608
|
+
this.consumeCurrentByte();
|
|
17283
17609
|
this.eventEndCheck = true;
|
|
17284
17610
|
continue;
|
|
17285
17611
|
}
|
|
17286
|
-
this.
|
|
17612
|
+
this.advanceCursor();
|
|
17287
17613
|
}
|
|
17288
17614
|
callback();
|
|
17289
17615
|
}
|
|
@@ -17295,43 +17621,42 @@ var require_eventsource_stream = __commonJS((exports, module) => {
|
|
|
17295
17621
|
if (colonPosition === 0) {
|
|
17296
17622
|
return;
|
|
17297
17623
|
}
|
|
17298
|
-
let
|
|
17299
|
-
let
|
|
17624
|
+
let fieldLength = line.length;
|
|
17625
|
+
let valueStart = line.length;
|
|
17300
17626
|
if (colonPosition !== -1) {
|
|
17301
|
-
|
|
17302
|
-
|
|
17627
|
+
fieldLength = colonPosition;
|
|
17628
|
+
valueStart = colonPosition + 1;
|
|
17303
17629
|
if (line[valueStart] === SPACE) {
|
|
17304
17630
|
++valueStart;
|
|
17305
17631
|
}
|
|
17306
|
-
value = line.subarray(valueStart).toString("utf8");
|
|
17307
|
-
} else {
|
|
17308
|
-
field = line.toString("utf8");
|
|
17309
|
-
value = "";
|
|
17310
17632
|
}
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17315
|
-
|
|
17316
|
-
|
|
17633
|
+
if (isFieldName(line, fieldLength, DATA)) {
|
|
17634
|
+
const value = line.toString("utf8", valueStart);
|
|
17635
|
+
if (event.data === undefined) {
|
|
17636
|
+
event.data = value;
|
|
17637
|
+
} else {
|
|
17638
|
+
event.data += `
|
|
17317
17639
|
${value}`;
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
|
|
17640
|
+
}
|
|
17641
|
+
return;
|
|
17642
|
+
}
|
|
17643
|
+
if (isFieldName(line, fieldLength, RETRY)) {
|
|
17644
|
+
if (isASCIINumberBytes(line, valueStart)) {
|
|
17645
|
+
event.retry = line.toString("utf8", valueStart);
|
|
17646
|
+
}
|
|
17647
|
+
return;
|
|
17648
|
+
}
|
|
17649
|
+
if (isFieldName(line, fieldLength, ID)) {
|
|
17650
|
+
if (isValidLastEventIdBytes(line, valueStart)) {
|
|
17651
|
+
event.id = line.toString("utf8", valueStart);
|
|
17652
|
+
}
|
|
17653
|
+
return;
|
|
17654
|
+
}
|
|
17655
|
+
if (isFieldName(line, fieldLength, EVENT)) {
|
|
17656
|
+
const value = line.toString("utf8", valueStart);
|
|
17657
|
+
if (value.length > 0) {
|
|
17658
|
+
event.event = value;
|
|
17659
|
+
}
|
|
17335
17660
|
}
|
|
17336
17661
|
}
|
|
17337
17662
|
processEvent(event) {
|
|
@@ -17353,12 +17678,120 @@ ${value}`;
|
|
|
17353
17678
|
}
|
|
17354
17679
|
}
|
|
17355
17680
|
clearEvent() {
|
|
17356
|
-
this.event =
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17681
|
+
this.event.data = undefined;
|
|
17682
|
+
this.event.event = undefined;
|
|
17683
|
+
this.event.id = undefined;
|
|
17684
|
+
this.event.retry = undefined;
|
|
17685
|
+
}
|
|
17686
|
+
hasPendingEvent() {
|
|
17687
|
+
return this.event.data !== undefined || this.event.event !== undefined || this.event.id !== undefined || this.event.retry !== undefined;
|
|
17688
|
+
}
|
|
17689
|
+
hasCurrentByte() {
|
|
17690
|
+
return this.chunkIndex < this.chunks.length && this.pos < this.chunks[this.chunkIndex].length;
|
|
17691
|
+
}
|
|
17692
|
+
currentByte() {
|
|
17693
|
+
return this.chunks[this.chunkIndex][this.pos];
|
|
17694
|
+
}
|
|
17695
|
+
consumeCurrentByte() {
|
|
17696
|
+
this.advanceCursor();
|
|
17697
|
+
this.syncLineStartToCursor();
|
|
17698
|
+
}
|
|
17699
|
+
advanceCursor() {
|
|
17700
|
+
this.pos++;
|
|
17701
|
+
while (this.chunkIndex < this.chunks.length && this.pos >= this.chunks[this.chunkIndex].length) {
|
|
17702
|
+
this.chunkIndex++;
|
|
17703
|
+
this.pos = 0;
|
|
17704
|
+
}
|
|
17705
|
+
}
|
|
17706
|
+
syncLineStartToCursor() {
|
|
17707
|
+
this.lineChunkIndex = this.chunkIndex;
|
|
17708
|
+
this.linePos = this.pos;
|
|
17709
|
+
this.dropConsumedChunks();
|
|
17710
|
+
}
|
|
17711
|
+
dropConsumedChunks() {
|
|
17712
|
+
while (this.lineChunkIndex > 0) {
|
|
17713
|
+
this.chunks.shift();
|
|
17714
|
+
this.lineChunkIndex--;
|
|
17715
|
+
this.chunkIndex--;
|
|
17716
|
+
}
|
|
17717
|
+
if (this.chunkIndex === this.chunks.length) {
|
|
17718
|
+
this.chunks.length = 0;
|
|
17719
|
+
this.chunkIndex = 0;
|
|
17720
|
+
this.pos = 0;
|
|
17721
|
+
this.lineChunkIndex = 0;
|
|
17722
|
+
this.linePos = 0;
|
|
17723
|
+
}
|
|
17724
|
+
}
|
|
17725
|
+
readLine() {
|
|
17726
|
+
if (this.lineChunkIndex === this.chunkIndex) {
|
|
17727
|
+
return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos);
|
|
17728
|
+
}
|
|
17729
|
+
const chunks = [];
|
|
17730
|
+
let length = 0;
|
|
17731
|
+
for (let i = this.lineChunkIndex;i <= this.chunkIndex; i++) {
|
|
17732
|
+
const chunk = this.chunks[i];
|
|
17733
|
+
const start = i === this.lineChunkIndex ? this.linePos : 0;
|
|
17734
|
+
const end = i === this.chunkIndex ? this.pos : chunk.length;
|
|
17735
|
+
const slice = chunk.subarray(start, end);
|
|
17736
|
+
length += slice.length;
|
|
17737
|
+
chunks.push(slice);
|
|
17738
|
+
}
|
|
17739
|
+
return Buffer.concat(chunks, length);
|
|
17740
|
+
}
|
|
17741
|
+
peekBufferedByte(offset) {
|
|
17742
|
+
let chunkIndex = this.lineChunkIndex;
|
|
17743
|
+
let pos = this.linePos;
|
|
17744
|
+
while (chunkIndex < this.chunks.length) {
|
|
17745
|
+
const chunk = this.chunks[chunkIndex];
|
|
17746
|
+
const remaining = chunk.length - pos;
|
|
17747
|
+
if (offset < remaining) {
|
|
17748
|
+
return chunk[pos + offset];
|
|
17749
|
+
}
|
|
17750
|
+
offset -= remaining;
|
|
17751
|
+
chunkIndex++;
|
|
17752
|
+
pos = 0;
|
|
17753
|
+
}
|
|
17754
|
+
}
|
|
17755
|
+
discardLeadingBytes(count) {
|
|
17756
|
+
while (count > 0 && this.lineChunkIndex < this.chunks.length) {
|
|
17757
|
+
const chunk = this.chunks[this.lineChunkIndex];
|
|
17758
|
+
const remaining = chunk.length - this.linePos;
|
|
17759
|
+
if (count < remaining) {
|
|
17760
|
+
this.linePos += count;
|
|
17761
|
+
count = 0;
|
|
17762
|
+
} else {
|
|
17763
|
+
count -= remaining;
|
|
17764
|
+
this.lineChunkIndex++;
|
|
17765
|
+
this.linePos = 0;
|
|
17766
|
+
}
|
|
17767
|
+
}
|
|
17768
|
+
this.chunkIndex = this.lineChunkIndex;
|
|
17769
|
+
this.pos = this.linePos;
|
|
17770
|
+
this.dropConsumedChunks();
|
|
17771
|
+
}
|
|
17772
|
+
handleBOM() {
|
|
17773
|
+
const first = this.peekBufferedByte(0);
|
|
17774
|
+
const second = this.peekBufferedByte(1);
|
|
17775
|
+
const third = this.peekBufferedByte(2);
|
|
17776
|
+
if (second === undefined) {
|
|
17777
|
+
if (first === BOM[0]) {
|
|
17778
|
+
return true;
|
|
17779
|
+
}
|
|
17780
|
+
this.checkBOM = false;
|
|
17781
|
+
return true;
|
|
17782
|
+
}
|
|
17783
|
+
if (third === undefined) {
|
|
17784
|
+
if (first === BOM[0] && second === BOM[1]) {
|
|
17785
|
+
return true;
|
|
17786
|
+
}
|
|
17787
|
+
this.checkBOM = false;
|
|
17788
|
+
return false;
|
|
17789
|
+
}
|
|
17790
|
+
if (first === BOM[0] && second === BOM[1] && third === BOM[2]) {
|
|
17791
|
+
this.discardLeadingBytes(3);
|
|
17792
|
+
}
|
|
17793
|
+
this.checkBOM = false;
|
|
17794
|
+
return !this.hasCurrentByte();
|
|
17362
17795
|
}
|
|
17363
17796
|
}
|
|
17364
17797
|
module.exports = {
|
|
@@ -17766,7 +18199,7 @@ var require_undici = __commonJS((exports, module) => {
|
|
|
17766
18199
|
// node_modules/discord-api-types/gateway/v10.js
|
|
17767
18200
|
var require_v10 = __commonJS((exports) => {
|
|
17768
18201
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17769
|
-
exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = undefined;
|
|
18202
|
+
exports.GatewayRequestChannelInfoField = exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = exports.GatewayCapabilityBits = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = undefined;
|
|
17770
18203
|
exports.GatewayVersion = "10";
|
|
17771
18204
|
var GatewayOpcodes;
|
|
17772
18205
|
(function(GatewayOpcodes2) {
|
|
@@ -17782,6 +18215,7 @@ var require_v10 = __commonJS((exports) => {
|
|
|
17782
18215
|
GatewayOpcodes2[GatewayOpcodes2["Hello"] = 10] = "Hello";
|
|
17783
18216
|
GatewayOpcodes2[GatewayOpcodes2["HeartbeatAck"] = 11] = "HeartbeatAck";
|
|
17784
18217
|
GatewayOpcodes2[GatewayOpcodes2["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds";
|
|
18218
|
+
GatewayOpcodes2[GatewayOpcodes2["RequestChannelInfo"] = 43] = "RequestChannelInfo";
|
|
17785
18219
|
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
|
|
17786
18220
|
var GatewayCloseCodes;
|
|
17787
18221
|
(function(GatewayCloseCodes2) {
|
|
@@ -17826,6 +18260,10 @@ var require_v10 = __commonJS((exports) => {
|
|
|
17826
18260
|
GatewayIntentBits2[GatewayIntentBits2["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
|
|
17827
18261
|
GatewayIntentBits2[GatewayIntentBits2["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
|
|
17828
18262
|
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
|
|
18263
|
+
var GatewayCapabilityBits;
|
|
18264
|
+
(function(GatewayCapabilityBits2) {
|
|
18265
|
+
GatewayCapabilityBits2[GatewayCapabilityBits2["ChannelObfuscation"] = 32768] = "ChannelObfuscation";
|
|
18266
|
+
})(GatewayCapabilityBits || (exports.GatewayCapabilityBits = GatewayCapabilityBits = {}));
|
|
17829
18267
|
var GatewayDispatchEvents;
|
|
17830
18268
|
(function(GatewayDispatchEvents2) {
|
|
17831
18269
|
GatewayDispatchEvents2["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
|
|
@@ -17835,6 +18273,7 @@ var require_v10 = __commonJS((exports) => {
|
|
|
17835
18273
|
GatewayDispatchEvents2["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
|
|
17836
18274
|
GatewayDispatchEvents2["ChannelCreate"] = "CHANNEL_CREATE";
|
|
17837
18275
|
GatewayDispatchEvents2["ChannelDelete"] = "CHANNEL_DELETE";
|
|
18276
|
+
GatewayDispatchEvents2["ChannelInfo"] = "CHANNEL_INFO";
|
|
17838
18277
|
GatewayDispatchEvents2["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
|
17839
18278
|
GatewayDispatchEvents2["ChannelUpdate"] = "CHANNEL_UPDATE";
|
|
17840
18279
|
GatewayDispatchEvents2["EntitlementCreate"] = "ENTITLEMENT_CREATE";
|
|
@@ -17901,6 +18340,8 @@ var require_v10 = __commonJS((exports) => {
|
|
|
17901
18340
|
GatewayDispatchEvents2["TypingStart"] = "TYPING_START";
|
|
17902
18341
|
GatewayDispatchEvents2["UserUpdate"] = "USER_UPDATE";
|
|
17903
18342
|
GatewayDispatchEvents2["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND";
|
|
18343
|
+
GatewayDispatchEvents2["VoiceChannelStartTimeUpdate"] = "VOICE_CHANNEL_START_TIME_UPDATE";
|
|
18344
|
+
GatewayDispatchEvents2["VoiceChannelStatusUpdate"] = "VOICE_CHANNEL_STATUS_UPDATE";
|
|
17904
18345
|
GatewayDispatchEvents2["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
|
17905
18346
|
GatewayDispatchEvents2["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
|
17906
18347
|
GatewayDispatchEvents2["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
|
@@ -17910,6 +18351,11 @@ var require_v10 = __commonJS((exports) => {
|
|
|
17910
18351
|
VoiceChannelEffectSendAnimationType2[VoiceChannelEffectSendAnimationType2["Premium"] = 0] = "Premium";
|
|
17911
18352
|
VoiceChannelEffectSendAnimationType2[VoiceChannelEffectSendAnimationType2["Basic"] = 1] = "Basic";
|
|
17912
18353
|
})(VoiceChannelEffectSendAnimationType || (exports.VoiceChannelEffectSendAnimationType = VoiceChannelEffectSendAnimationType = {}));
|
|
18354
|
+
var GatewayRequestChannelInfoField;
|
|
18355
|
+
(function(GatewayRequestChannelInfoField2) {
|
|
18356
|
+
GatewayRequestChannelInfoField2["Status"] = "status";
|
|
18357
|
+
GatewayRequestChannelInfoField2["VoiceStartTime"] = "voice_start_time";
|
|
18358
|
+
})(GatewayRequestChannelInfoField || (exports.GatewayRequestChannelInfoField = GatewayRequestChannelInfoField = {}));
|
|
17913
18359
|
});
|
|
17914
18360
|
|
|
17915
18361
|
// node_modules/discord-api-types/globals.js
|
|
@@ -17924,6 +18370,7 @@ var require_globals = __commonJS((exports) => {
|
|
|
17924
18370
|
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
|
17925
18371
|
Channel: /<#(?<id>\d{17,20})>/,
|
|
17926
18372
|
Role: /<@&(?<id>\d{17,20})>/,
|
|
18373
|
+
GameProfile: /<@\$(?<id>\d{17,20})>/,
|
|
17927
18374
|
SlashCommand: /<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
|
17928
18375
|
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
|
17929
18376
|
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
|
@@ -17990,6 +18437,7 @@ var require_common = __commonJS((exports) => {
|
|
|
17990
18437
|
CreateEvents: 1n << 44n,
|
|
17991
18438
|
UseExternalSounds: 1n << 45n,
|
|
17992
18439
|
SendVoiceMessages: 1n << 46n,
|
|
18440
|
+
SetVoiceChannelStatus: 1n << 48n,
|
|
17993
18441
|
SendPolls: 1n << 49n,
|
|
17994
18442
|
UseExternalApps: 1n << 50n,
|
|
17995
18443
|
PinMessages: 1n << 51n,
|
|
@@ -18045,6 +18493,18 @@ var require_application = __commonJS((exports) => {
|
|
|
18045
18493
|
})(ApplicationWebhookEventStatus || (exports.ApplicationWebhookEventStatus = ApplicationWebhookEventStatus = {}));
|
|
18046
18494
|
});
|
|
18047
18495
|
|
|
18496
|
+
// node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js
|
|
18497
|
+
var require_applicationIdentityProfile = __commonJS((exports) => {
|
|
18498
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18499
|
+
exports.ApplicationIdentityProfileDynamicFieldType = undefined;
|
|
18500
|
+
var ApplicationIdentityProfileDynamicFieldType;
|
|
18501
|
+
(function(ApplicationIdentityProfileDynamicFieldType2) {
|
|
18502
|
+
ApplicationIdentityProfileDynamicFieldType2[ApplicationIdentityProfileDynamicFieldType2["String"] = 1] = "String";
|
|
18503
|
+
ApplicationIdentityProfileDynamicFieldType2[ApplicationIdentityProfileDynamicFieldType2["Number"] = 2] = "Number";
|
|
18504
|
+
ApplicationIdentityProfileDynamicFieldType2[ApplicationIdentityProfileDynamicFieldType2["Media"] = 3] = "Media";
|
|
18505
|
+
})(ApplicationIdentityProfileDynamicFieldType || (exports.ApplicationIdentityProfileDynamicFieldType = ApplicationIdentityProfileDynamicFieldType = {}));
|
|
18506
|
+
});
|
|
18507
|
+
|
|
18048
18508
|
// node_modules/discord-api-types/payloads/v10/auditLog.js
|
|
18049
18509
|
var require_auditLog = __commonJS((exports) => {
|
|
18050
18510
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -18118,6 +18578,8 @@ var require_auditLog = __commonJS((exports) => {
|
|
|
18118
18578
|
AuditLogEvent2[AuditLogEvent2["OnboardingUpdate"] = 167] = "OnboardingUpdate";
|
|
18119
18579
|
AuditLogEvent2[AuditLogEvent2["HomeSettingsCreate"] = 190] = "HomeSettingsCreate";
|
|
18120
18580
|
AuditLogEvent2[AuditLogEvent2["HomeSettingsUpdate"] = 191] = "HomeSettingsUpdate";
|
|
18581
|
+
AuditLogEvent2[AuditLogEvent2["VoiceChannelStatusCreate"] = 192] = "VoiceChannelStatusCreate";
|
|
18582
|
+
AuditLogEvent2[AuditLogEvent2["VoiceChannelStatusDelete"] = 193] = "VoiceChannelStatusDelete";
|
|
18121
18583
|
})(AuditLogEvent || (exports.AuditLogEvent = AuditLogEvent = {}));
|
|
18122
18584
|
var AuditLogOptionsType;
|
|
18123
18585
|
(function(AuditLogOptionsType2) {
|
|
@@ -18228,6 +18690,8 @@ var require_channel = __commonJS((exports) => {
|
|
|
18228
18690
|
ChannelFlags2[ChannelFlags2["ClydeAI"] = 256] = "ClydeAI";
|
|
18229
18691
|
ChannelFlags2[ChannelFlags2["IsScheduledForDeletion"] = 512] = "IsScheduledForDeletion";
|
|
18230
18692
|
ChannelFlags2[ChannelFlags2["HideMediaDownloadOptions"] = 32768] = "HideMediaDownloadOptions";
|
|
18693
|
+
ChannelFlags2[ChannelFlags2["ChannelObfuscated"] = 131072] = "ChannelObfuscated";
|
|
18694
|
+
ChannelFlags2[ChannelFlags2["IsSpoilerChannel"] = 2097152] = "IsSpoilerChannel";
|
|
18231
18695
|
})(ChannelFlags || (exports.ChannelFlags = ChannelFlags = {}));
|
|
18232
18696
|
});
|
|
18233
18697
|
|
|
@@ -18352,20 +18816,25 @@ var require_guild = __commonJS((exports) => {
|
|
|
18352
18816
|
GuildFeature2["CreatorStorePage"] = "CREATOR_STORE_PAGE";
|
|
18353
18817
|
GuildFeature2["DeveloperSupportServer"] = "DEVELOPER_SUPPORT_SERVER";
|
|
18354
18818
|
GuildFeature2["Discoverable"] = "DISCOVERABLE";
|
|
18819
|
+
GuildFeature2["EnhancedRoleColors"] = "ENHANCED_ROLE_COLORS";
|
|
18355
18820
|
GuildFeature2["Featurable"] = "FEATURABLE";
|
|
18821
|
+
GuildFeature2["GuestsEnabled"] = "GUESTS_ENABLED";
|
|
18822
|
+
GuildFeature2["GuildTags"] = "GUILD_TAGS";
|
|
18356
18823
|
GuildFeature2["HasDirectoryEntry"] = "HAS_DIRECTORY_ENTRY";
|
|
18357
18824
|
GuildFeature2["Hub"] = "HUB";
|
|
18358
18825
|
GuildFeature2["InvitesDisabled"] = "INVITES_DISABLED";
|
|
18359
18826
|
GuildFeature2["InviteSplash"] = "INVITE_SPLASH";
|
|
18360
18827
|
GuildFeature2["LinkedToHub"] = "LINKED_TO_HUB";
|
|
18361
18828
|
GuildFeature2["MemberVerificationGateEnabled"] = "MEMBER_VERIFICATION_GATE_ENABLED";
|
|
18362
|
-
GuildFeature2["MoreSoundboard"] = "MORE_SOUNDBOARD";
|
|
18363
18829
|
GuildFeature2["MonetizationEnabled"] = "MONETIZATION_ENABLED";
|
|
18830
|
+
GuildFeature2["MoreSoundboard"] = "MORE_SOUNDBOARD";
|
|
18364
18831
|
GuildFeature2["MoreStickers"] = "MORE_STICKERS";
|
|
18365
18832
|
GuildFeature2["News"] = "NEWS";
|
|
18366
18833
|
GuildFeature2["Partnered"] = "PARTNERED";
|
|
18834
|
+
GuildFeature2["PinPermissionMigrationComplete"] = "PIN_PERMISSION_MIGRATION_COMPLETE";
|
|
18367
18835
|
GuildFeature2["PreviewEnabled"] = "PREVIEW_ENABLED";
|
|
18368
18836
|
GuildFeature2["PrivateThreads"] = "PRIVATE_THREADS";
|
|
18837
|
+
GuildFeature2["PruneRequiresAdmin"] = "PRUNE_REQUIRES_ADMIN";
|
|
18369
18838
|
GuildFeature2["RaidAlertsDisabled"] = "RAID_ALERTS_DISABLED";
|
|
18370
18839
|
GuildFeature2["RelayEnabled"] = "RELAY_ENABLED";
|
|
18371
18840
|
GuildFeature2["RoleIcons"] = "ROLE_ICONS";
|
|
@@ -18377,10 +18846,6 @@ var require_guild = __commonJS((exports) => {
|
|
|
18377
18846
|
GuildFeature2["Verified"] = "VERIFIED";
|
|
18378
18847
|
GuildFeature2["VIPRegions"] = "VIP_REGIONS";
|
|
18379
18848
|
GuildFeature2["WelcomeScreenEnabled"] = "WELCOME_SCREEN_ENABLED";
|
|
18380
|
-
GuildFeature2["GuildTags"] = "GUILD_TAGS";
|
|
18381
|
-
GuildFeature2["EnhancedRoleColors"] = "ENHANCED_ROLE_COLORS";
|
|
18382
|
-
GuildFeature2["GuestsEnabled"] = "GUESTS_ENABLED";
|
|
18383
|
-
GuildFeature2["PinPermissionMigrationComplete"] = "PIN_PERMISSION_MIGRATION_COMPLETE";
|
|
18384
18849
|
})(GuildFeature || (exports.GuildFeature = GuildFeature = {}));
|
|
18385
18850
|
var GuildMemberFlags;
|
|
18386
18851
|
(function(GuildMemberFlags2) {
|
|
@@ -18718,6 +19183,7 @@ var require_message = __commonJS((exports) => {
|
|
|
18718
19183
|
MessageActivityType2[MessageActivityType2["Spectate"] = 2] = "Spectate";
|
|
18719
19184
|
MessageActivityType2[MessageActivityType2["Listen"] = 3] = "Listen";
|
|
18720
19185
|
MessageActivityType2[MessageActivityType2["JoinRequest"] = 5] = "JoinRequest";
|
|
19186
|
+
MessageActivityType2[MessageActivityType2["StreamRequest"] = 6] = "StreamRequest";
|
|
18721
19187
|
})(MessageActivityType || (exports.MessageActivityType = MessageActivityType = {}));
|
|
18722
19188
|
var MessageReferenceType;
|
|
18723
19189
|
(function(MessageReferenceType2) {
|
|
@@ -18919,8 +19385,8 @@ var require_monetization = __commonJS((exports) => {
|
|
|
18919
19385
|
var SubscriptionStatus;
|
|
18920
19386
|
(function(SubscriptionStatus2) {
|
|
18921
19387
|
SubscriptionStatus2[SubscriptionStatus2["Active"] = 0] = "Active";
|
|
18922
|
-
SubscriptionStatus2[SubscriptionStatus2["
|
|
18923
|
-
SubscriptionStatus2[SubscriptionStatus2["
|
|
19388
|
+
SubscriptionStatus2[SubscriptionStatus2["Inactive"] = 1] = "Inactive";
|
|
19389
|
+
SubscriptionStatus2[SubscriptionStatus2["Ending"] = 2] = "Ending";
|
|
18924
19390
|
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
|
|
18925
19391
|
});
|
|
18926
19392
|
|
|
@@ -18935,6 +19401,7 @@ var require_oauth2 = __commonJS((exports) => {
|
|
|
18935
19401
|
OAuth2Scopes2["DMChannelsRead"] = "dm_channels.read";
|
|
18936
19402
|
OAuth2Scopes2["Email"] = "email";
|
|
18937
19403
|
OAuth2Scopes2["Identify"] = "identify";
|
|
19404
|
+
OAuth2Scopes2["IdentifyPremium"] = "identify.premium";
|
|
18938
19405
|
OAuth2Scopes2["Guilds"] = "guilds";
|
|
18939
19406
|
OAuth2Scopes2["GuildsJoin"] = "guilds.join";
|
|
18940
19407
|
OAuth2Scopes2["GuildsMembersRead"] = "guilds.members.read";
|
|
@@ -19166,6 +19633,7 @@ var require_v102 = __commonJS((exports) => {
|
|
|
19166
19633
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19167
19634
|
__exportStar(require_common(), exports);
|
|
19168
19635
|
__exportStar(require_application(), exports);
|
|
19636
|
+
__exportStar(require_applicationIdentityProfile(), exports);
|
|
19169
19637
|
__exportStar(require_auditLog(), exports);
|
|
19170
19638
|
__exportStar(require_autoModeration(), exports);
|
|
19171
19639
|
__exportStar(require_channel(), exports);
|
|
@@ -19252,10 +19720,13 @@ var require_common2 = __commonJS((exports) => {
|
|
|
19252
19720
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UnknownGuildScheduledEventUser"] = 10071] = "UnknownGuildScheduledEventUser";
|
|
19253
19721
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UnknownTag"] = 10087] = "UnknownTag";
|
|
19254
19722
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UnknownSound"] = 10097] = "UnknownSound";
|
|
19723
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UnknownInviteTargetUsersJob"] = 10124] = "UnknownInviteTargetUsersJob";
|
|
19724
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UnknownInviteTargetUsers"] = 10129] = "UnknownInviteTargetUsers";
|
|
19255
19725
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["BotsCannotUseThisEndpoint"] = 20001] = "BotsCannotUseThisEndpoint";
|
|
19256
19726
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["OnlyBotsCanUseThisEndpoint"] = 20002] = "OnlyBotsCanUseThisEndpoint";
|
|
19257
19727
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ExplicitContentCannotBeSentToTheDesiredRecipient"] = 20009] = "ExplicitContentCannotBeSentToTheDesiredRecipient";
|
|
19258
19728
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["NotAuthorizedToPerformThisActionOnThisApplication"] = 20012] = "NotAuthorizedToPerformThisActionOnThisApplication";
|
|
19729
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ThisActionRequiresAPremiumSubscription"] = 20015] = "ThisActionRequiresAPremiumSubscription";
|
|
19259
19730
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ActionCannotBePerformedDueToSlowmodeRateLimit"] = 20016] = "ActionCannotBePerformedDueToSlowmodeRateLimit";
|
|
19260
19731
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["TheMazeIsntMeantForYou"] = 20017] = "TheMazeIsntMeantForYou";
|
|
19261
19732
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["OnlyTheOwnerOfThisAccountCanPerformThisAction"] = 20018] = "OnlyTheOwnerOfThisAccountCanPerformThisAction";
|
|
@@ -19308,6 +19779,7 @@ var require_common2 = __commonJS((exports) => {
|
|
|
19308
19779
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["RequestEntityTooLarge"] = 40005] = "RequestEntityTooLarge";
|
|
19309
19780
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["FeatureTemporarilyDisabledServerSide"] = 40006] = "FeatureTemporarilyDisabledServerSide";
|
|
19310
19781
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UserBannedFromThisGuild"] = 40007] = "UserBannedFromThisGuild";
|
|
19782
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["OnlyOneChannelCanHaveAParentIdModifiedAtATime"] = 40009] = "OnlyOneChannelCanHaveAParentIdModifiedAtATime";
|
|
19311
19783
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ConnectionHasBeenRevoked"] = 40012] = "ConnectionHasBeenRevoked";
|
|
19312
19784
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["OnlyConsumableSKUsCanBeConsumed"] = 40018] = "OnlyConsumableSKUsCanBeConsumed";
|
|
19313
19785
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["YouCanOnlyDeleteSandboxEntitlements"] = 40019] = "YouCanOnlyDeleteSandboxEntitlements";
|
|
@@ -19392,6 +19864,7 @@ var require_common2 = __commonJS((exports) => {
|
|
|
19392
19864
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["VoiceMessagesMustHaveSupportingMetadata"] = 50161] = "VoiceMessagesMustHaveSupportingMetadata";
|
|
19393
19865
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["VoiceMessagesCannotBeEdited"] = 50162] = "VoiceMessagesCannotBeEdited";
|
|
19394
19866
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotDeleteGuildSubscriptionIntegration"] = 50163] = "CannotDeleteGuildSubscriptionIntegration";
|
|
19867
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed"] = 50167] = "CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed";
|
|
19395
19868
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["YouCannotSendVoiceMessagesInThisChannel"] = 50173] = "YouCannotSendVoiceMessagesInThisChannel";
|
|
19396
19869
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["TheUserAccountMustFirstBeVerified"] = 50178] = "TheUserAccountMustFirstBeVerified";
|
|
19397
19870
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ProvidedFileDoesNotHaveAValidDuration"] = 50192] = "ProvidedFileDoesNotHaveAValidDuration";
|
|
@@ -19410,6 +19883,8 @@ var require_common2 = __commonJS((exports) => {
|
|
|
19410
19883
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["ThreadLocked"] = 160005] = "ThreadLocked";
|
|
19411
19884
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["MaximumActiveThreads"] = 160006] = "MaximumActiveThreads";
|
|
19412
19885
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["MaximumActiveAnnouncementThreads"] = 160007] = "MaximumActiveAnnouncementThreads";
|
|
19886
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotReferenceAMessageWithoutPermissionToReadMessageHistory"] = 160009] = "CannotReferenceAMessageWithoutPermissionToReadMessageHistory";
|
|
19887
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["NSFWChannelMessageReferenceNotAllowed"] = 160010] = "NSFWChannelMessageReferenceNotAllowed";
|
|
19413
19888
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotForwardMessageWithUnreadableContent"] = 160014] = "CannotForwardMessageWithUnreadableContent";
|
|
19414
19889
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["InvalidJSONForUploadedLottieFile"] = 170001] = "InvalidJSONForUploadedLottieFile";
|
|
19415
19890
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["UploadedLottiesCannotContainRasterizedImages"] = 170002] = "UploadedLottiesCannotContainRasterizedImages";
|
|
@@ -19427,6 +19902,7 @@ var require_common2 = __commonJS((exports) => {
|
|
|
19427
19902
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["WebhooksCanOnlyCreateThreadsInForumChannels"] = 220003] = "WebhooksCanOnlyCreateThreadsInForumChannels";
|
|
19428
19903
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["WebhookServicesCannotBeUsedInForumChannels"] = 220004] = "WebhookServicesCannotBeUsedInForumChannels";
|
|
19429
19904
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
|
19905
|
+
RESTJSONErrorCodes2[RESTJSONErrorCodes2["AccessToJoiningNewServersHasBeenLimitedForTheUser"] = 340015] = "AccessToJoiningNewServersHasBeenLimitedForTheUser";
|
|
19430
19906
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
|
19431
19907
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
|
19432
19908
|
RESTJSONErrorCodes2[RESTJSONErrorCodes2["AccessToFileUploadsHasBeenLimitedForThisGuild"] = 400001] = "AccessToFileUploadsHasBeenLimitedForThisGuild";
|
|
@@ -19498,6 +19974,19 @@ var require_channel2 = __commonJS((exports) => {
|
|
|
19498
19974
|
})(ReactionType || (exports.ReactionType = ReactionType = {}));
|
|
19499
19975
|
});
|
|
19500
19976
|
|
|
19977
|
+
// node_modules/discord-api-types/rest/v10/invite.js
|
|
19978
|
+
var require_invite2 = __commonJS((exports) => {
|
|
19979
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19980
|
+
exports.InviteTargetUsersJobStatus = undefined;
|
|
19981
|
+
var InviteTargetUsersJobStatus;
|
|
19982
|
+
(function(InviteTargetUsersJobStatus2) {
|
|
19983
|
+
InviteTargetUsersJobStatus2[InviteTargetUsersJobStatus2["Unspecified"] = 0] = "Unspecified";
|
|
19984
|
+
InviteTargetUsersJobStatus2[InviteTargetUsersJobStatus2["Processing"] = 1] = "Processing";
|
|
19985
|
+
InviteTargetUsersJobStatus2[InviteTargetUsersJobStatus2["Completed"] = 2] = "Completed";
|
|
19986
|
+
InviteTargetUsersJobStatus2[InviteTargetUsersJobStatus2["Failed"] = 3] = "Failed";
|
|
19987
|
+
})(InviteTargetUsersJobStatus || (exports.InviteTargetUsersJobStatus = InviteTargetUsersJobStatus = {}));
|
|
19988
|
+
});
|
|
19989
|
+
|
|
19501
19990
|
// node_modules/discord-api-types/rest/v10/monetization.js
|
|
19502
19991
|
var require_monetization2 = __commonJS((exports) => {
|
|
19503
19992
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -19536,6 +20025,7 @@ var require_v103 = __commonJS((exports) => {
|
|
|
19536
20025
|
var internals_1 = require_internals();
|
|
19537
20026
|
__exportStar(require_common2(), exports);
|
|
19538
20027
|
__exportStar(require_channel2(), exports);
|
|
20028
|
+
__exportStar(require_invite2(), exports);
|
|
19539
20029
|
__exportStar(require_monetization2(), exports);
|
|
19540
20030
|
exports.APIVersion = "10";
|
|
19541
20031
|
exports.Routes = {
|
|
@@ -19605,6 +20095,9 @@ var require_v103 = __commonJS((exports) => {
|
|
|
19605
20095
|
channelRecipient(channelId, userId) {
|
|
19606
20096
|
return `/channels/${channelId}/recipients/${userId}`;
|
|
19607
20097
|
},
|
|
20098
|
+
channelVoiceStatus(channelId) {
|
|
20099
|
+
return `/channels/${channelId}/voice-status`;
|
|
20100
|
+
},
|
|
19608
20101
|
guildEmojis(guildId) {
|
|
19609
20102
|
return `/guilds/${guildId}/emojis`;
|
|
19610
20103
|
},
|
|
@@ -19689,6 +20182,12 @@ var require_v103 = __commonJS((exports) => {
|
|
|
19689
20182
|
invite(code) {
|
|
19690
20183
|
return `/invites/${code}`;
|
|
19691
20184
|
},
|
|
20185
|
+
inviteTargetUsers(code) {
|
|
20186
|
+
return `/invites/${code}/target-users`;
|
|
20187
|
+
},
|
|
20188
|
+
inviteTargetUsersJobStatus(code) {
|
|
20189
|
+
return `/invites/${code}/target-users/job-status`;
|
|
20190
|
+
},
|
|
19692
20191
|
template(code) {
|
|
19693
20192
|
return `/guilds/templates/${code}`;
|
|
19694
20193
|
},
|
|
@@ -19902,6 +20401,18 @@ var require_v103 = __commonJS((exports) => {
|
|
|
19902
20401
|
},
|
|
19903
20402
|
guildSoundboardSound(guildId, soundId) {
|
|
19904
20403
|
return `/guilds/${guildId}/soundboard-sounds/${soundId}`;
|
|
20404
|
+
},
|
|
20405
|
+
applicationUserIdentityProfile(applicationId, userId, providerIssuedUserId) {
|
|
20406
|
+
return `/applications/${applicationId}/users/${userId}/identities/${providerIssuedUserId}/profile`;
|
|
20407
|
+
},
|
|
20408
|
+
userApplicationIdentities(userId, applicationId) {
|
|
20409
|
+
return `/users/${userId}/application-identities/${applicationId}`;
|
|
20410
|
+
},
|
|
20411
|
+
applicationIdentities(applicationId, providerType, providerIssuedUserId) {
|
|
20412
|
+
return `/applications/${applicationId}/application-identities/${providerType}/${providerIssuedUserId}`;
|
|
20413
|
+
},
|
|
20414
|
+
userApplicationIdentityDelete(userId, applicationId, providerType, providerIssuedUserId) {
|
|
20415
|
+
return `/users/${userId}/application-identities/${applicationId}/${providerType}/${providerIssuedUserId}/delete`;
|
|
19905
20416
|
}
|
|
19906
20417
|
};
|
|
19907
20418
|
for (const [key, fn] of Object.entries(exports.Routes)) {
|
|
@@ -20798,7 +21309,7 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
20798
21309
|
var version = "2.1.1";
|
|
20799
21310
|
});
|
|
20800
21311
|
|
|
20801
|
-
// node_modules/@
|
|
21312
|
+
// node_modules/@sapphire/snowflake/dist/cjs/index.cjs
|
|
20802
21313
|
var require_cjs = __commonJS((exports) => {
|
|
20803
21314
|
var __defProp2 = Object.defineProperty;
|
|
20804
21315
|
var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -24451,10 +24962,6 @@ var require_pattern_tree = __commonJS((exports) => {
|
|
|
24451
24962
|
mime: "application/vnd.rar",
|
|
24452
24963
|
extension: "rar"
|
|
24453
24964
|
});
|
|
24454
|
-
exports.add("rar", ["0x7F", "0x45", "0x4C", "0x46"], {
|
|
24455
|
-
mime: "application/vnd.rar",
|
|
24456
|
-
extension: "rar"
|
|
24457
|
-
});
|
|
24458
24965
|
exports.add("png", ["0x89", "0x50", "0x4E", "0x47", "0x0D", "0x0A", "0x1A", "0x0A"], {
|
|
24459
24966
|
mime: "image/png",
|
|
24460
24967
|
extension: "png"
|
|
@@ -24480,6 +24987,10 @@ var require_pattern_tree = __commonJS((exports) => {
|
|
|
24480
24987
|
mime: "application/pdf",
|
|
24481
24988
|
extension: "pdf"
|
|
24482
24989
|
});
|
|
24990
|
+
exports.add("pdf", ["0xEF", "0xBB", "0xBF", "0x25", "0x50", "0x44", "0x46"], {
|
|
24991
|
+
mime: "application/pdf",
|
|
24992
|
+
extension: "pdf"
|
|
24993
|
+
});
|
|
24483
24994
|
exports.add("asf", [
|
|
24484
24995
|
"0x30",
|
|
24485
24996
|
"0x26",
|
|
@@ -25138,29 +25649,43 @@ var require_dist4 = __commonJS((exports) => {
|
|
|
25138
25649
|
var toHex_1 = require_toHex();
|
|
25139
25650
|
var patternTree = pattern_tree_1.createTree();
|
|
25140
25651
|
var filetypeinfo = (bytes) => {
|
|
25141
|
-
|
|
25652
|
+
const tree = patternTree;
|
|
25653
|
+
const found = [];
|
|
25142
25654
|
for (const k of Object.keys(tree.offset)) {
|
|
25143
25655
|
const offset = toHex_1.fromHex(k);
|
|
25144
25656
|
const offsetExceedsFile = offset >= bytes.length;
|
|
25145
25657
|
if (offsetExceedsFile) {
|
|
25146
25658
|
continue;
|
|
25147
25659
|
}
|
|
25148
|
-
const node =
|
|
25149
|
-
|
|
25150
|
-
if (guessed.length > 0) {
|
|
25151
|
-
return guessed;
|
|
25152
|
-
}
|
|
25660
|
+
const node = tree.offset[k];
|
|
25661
|
+
found.push(...walkTree(offset, bytes, node));
|
|
25153
25662
|
}
|
|
25154
|
-
if (tree.noOffset
|
|
25155
|
-
|
|
25663
|
+
if (tree.noOffset !== null) {
|
|
25664
|
+
found.push(...walkTree(0, bytes, tree.noOffset));
|
|
25156
25665
|
}
|
|
25157
|
-
return
|
|
25666
|
+
return unique(found);
|
|
25158
25667
|
};
|
|
25159
25668
|
exports.filetypeinfo = filetypeinfo;
|
|
25669
|
+
var unique = (found) => {
|
|
25670
|
+
const seen = new Set;
|
|
25671
|
+
const result = [];
|
|
25672
|
+
for (const guess of found) {
|
|
25673
|
+
const key = JSON.stringify([guess.typename, guess.mime, guess.extension]);
|
|
25674
|
+
if (seen.has(key)) {
|
|
25675
|
+
continue;
|
|
25676
|
+
}
|
|
25677
|
+
seen.add(key);
|
|
25678
|
+
result.push({ ...guess });
|
|
25679
|
+
}
|
|
25680
|
+
return result;
|
|
25681
|
+
};
|
|
25160
25682
|
var walkTree = (index, bytes, node) => {
|
|
25161
25683
|
let step = node;
|
|
25162
25684
|
let guessFile = [];
|
|
25163
25685
|
while (true) {
|
|
25686
|
+
if (index >= bytes.length) {
|
|
25687
|
+
return guessFile;
|
|
25688
|
+
}
|
|
25164
25689
|
const currentByte = toHex_1.toHex(bytes[index]);
|
|
25165
25690
|
if (step.bytes["?"] && !step.bytes[currentByte]) {
|
|
25166
25691
|
step = step.bytes["?"];
|
|
@@ -25407,7 +25932,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
25407
25932
|
var import_v102 = require_v106();
|
|
25408
25933
|
var import_util = require_dist();
|
|
25409
25934
|
var import_v10 = require_v106();
|
|
25410
|
-
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.
|
|
25935
|
+
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.6.3)`;
|
|
25411
25936
|
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
|
|
25412
25937
|
var DefaultRestOptions = {
|
|
25413
25938
|
agent: null,
|
|
@@ -25533,11 +26058,30 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
25533
26058
|
}
|
|
25534
26059
|
}
|
|
25535
26060
|
__name(serializeSearchParam, "serializeSearchParam");
|
|
25536
|
-
function makeURLSearchParams(options) {
|
|
26061
|
+
function makeURLSearchParams(parameters, options = {}) {
|
|
25537
26062
|
const params = new URLSearchParams;
|
|
25538
|
-
if (!
|
|
26063
|
+
if (!parameters)
|
|
25539
26064
|
return params;
|
|
25540
|
-
|
|
26065
|
+
const { arrayFormat = "repeat" } = options;
|
|
26066
|
+
for (const [key, value] of Object.entries(parameters)) {
|
|
26067
|
+
if (Array.isArray(value)) {
|
|
26068
|
+
const commaSeparatedElements = arrayFormat === "comma" ? [] : null;
|
|
26069
|
+
for (const element of value) {
|
|
26070
|
+
const serialized2 = serializeSearchParam(element);
|
|
26071
|
+
if (serialized2 === null) {
|
|
26072
|
+
continue;
|
|
26073
|
+
}
|
|
26074
|
+
if (commaSeparatedElements) {
|
|
26075
|
+
commaSeparatedElements.push(serialized2);
|
|
26076
|
+
} else {
|
|
26077
|
+
params.append(key, serialized2);
|
|
26078
|
+
}
|
|
26079
|
+
}
|
|
26080
|
+
if (commaSeparatedElements?.length) {
|
|
26081
|
+
params.append(key, commaSeparatedElements.join(","));
|
|
26082
|
+
}
|
|
26083
|
+
continue;
|
|
26084
|
+
}
|
|
25541
26085
|
const serialized = serializeSearchParam(value);
|
|
25542
26086
|
if (serialized !== null)
|
|
25543
26087
|
params.append(key, serialized);
|
|
@@ -25616,6 +26160,8 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
25616
26160
|
this.cdn = cdn;
|
|
25617
26161
|
this.mediaProxy = mediaProxy;
|
|
25618
26162
|
}
|
|
26163
|
+
cdn;
|
|
26164
|
+
mediaProxy;
|
|
25619
26165
|
static {
|
|
25620
26166
|
__name(this, "CDN");
|
|
25621
26167
|
}
|
|
@@ -25743,6 +26289,11 @@ Must be one of: ${ALLOWED_SIZES.join(", ")}`);
|
|
|
25743
26289
|
this.url = url;
|
|
25744
26290
|
this.requestBody = { files: bodyData.files, json: bodyData.body };
|
|
25745
26291
|
}
|
|
26292
|
+
rawError;
|
|
26293
|
+
code;
|
|
26294
|
+
status;
|
|
26295
|
+
method;
|
|
26296
|
+
url;
|
|
25746
26297
|
static {
|
|
25747
26298
|
__name(this, "DiscordAPIError");
|
|
25748
26299
|
}
|
|
@@ -25788,6 +26339,9 @@ ${flattened}` : error.message || flattened || "Unknown Error";
|
|
|
25788
26339
|
this.url = url;
|
|
25789
26340
|
this.requestBody = { files: bodyData.files, json: bodyData.body };
|
|
25790
26341
|
}
|
|
26342
|
+
status;
|
|
26343
|
+
method;
|
|
26344
|
+
url;
|
|
25791
26345
|
static {
|
|
25792
26346
|
__name(this, "HTTPError");
|
|
25793
26347
|
}
|
|
@@ -25876,6 +26430,9 @@ ${flattened}` : error.message || flattened || "Unknown Error";
|
|
|
25876
26430
|
this.majorParameter = majorParameter;
|
|
25877
26431
|
this.id = `${hash}:${majorParameter}`;
|
|
25878
26432
|
}
|
|
26433
|
+
manager;
|
|
26434
|
+
hash;
|
|
26435
|
+
majorParameter;
|
|
25879
26436
|
static {
|
|
25880
26437
|
__name(this, "BurstHandler");
|
|
25881
26438
|
}
|
|
@@ -25953,6 +26510,9 @@ ${flattened}` : error.message || flattened || "Unknown Error";
|
|
|
25953
26510
|
this.majorParameter = majorParameter;
|
|
25954
26511
|
this.id = `${hash}:${majorParameter}`;
|
|
25955
26512
|
}
|
|
26513
|
+
manager;
|
|
26514
|
+
hash;
|
|
26515
|
+
majorParameter;
|
|
25956
26516
|
static {
|
|
25957
26517
|
__name(this, "SequentialHandler");
|
|
25958
26518
|
}
|
|
@@ -26388,7 +26948,7 @@ ${flattened}` : error.message || flattened || "Unknown Error";
|
|
|
26388
26948
|
};
|
|
26389
26949
|
}
|
|
26390
26950
|
};
|
|
26391
|
-
var version = "2.6.
|
|
26951
|
+
var version = "2.6.3";
|
|
26392
26952
|
globalThis.FormData ??= import_undici2.FormData;
|
|
26393
26953
|
globalThis.Blob ??= import_node_buffer.Blob;
|
|
26394
26954
|
setDefaultStrategy((0, import_util2.shouldUseGlobalFetchAndWebSocket)() ? fetch : makeRequest);
|
|
@@ -27517,8 +28077,9 @@ var require_AttachmentFlagsBitField = __commonJS((exports, module) => {
|
|
|
27517
28077
|
|
|
27518
28078
|
// node_modules/discord.js/src/structures/Attachment.js
|
|
27519
28079
|
var require_Attachment = __commonJS((exports, module) => {
|
|
28080
|
+
var { AttachmentFlags } = require_v106();
|
|
27520
28081
|
var AttachmentFlagsBitField = require_AttachmentFlagsBitField();
|
|
27521
|
-
var {
|
|
28082
|
+
var { flatten } = require_Util();
|
|
27522
28083
|
|
|
27523
28084
|
class Attachment {
|
|
27524
28085
|
constructor(data) {
|
|
@@ -27580,7 +28141,7 @@ var require_Attachment = __commonJS((exports, module) => {
|
|
|
27580
28141
|
}
|
|
27581
28142
|
}
|
|
27582
28143
|
get spoiler() {
|
|
27583
|
-
return
|
|
28144
|
+
return this.flags.has(AttachmentFlags.IsSpoiler);
|
|
27584
28145
|
}
|
|
27585
28146
|
toJSON() {
|
|
27586
28147
|
return flatten(this);
|
|
@@ -27589,110 +28150,6 @@ var require_Attachment = __commonJS((exports, module) => {
|
|
|
27589
28150
|
module.exports = Attachment;
|
|
27590
28151
|
});
|
|
27591
28152
|
|
|
27592
|
-
// node_modules/@sapphire/snowflake/dist/cjs/index.cjs
|
|
27593
|
-
var require_cjs3 = __commonJS((exports) => {
|
|
27594
|
-
var __defProp2 = Object.defineProperty;
|
|
27595
|
-
var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
27596
|
-
var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
|
|
27597
|
-
var __publicField = (obj, key, value) => {
|
|
27598
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
27599
|
-
return value;
|
|
27600
|
-
};
|
|
27601
|
-
var IncrementSymbol = Symbol("@sapphire/snowflake.increment");
|
|
27602
|
-
var EpochSymbol = Symbol("@sapphire/snowflake.epoch");
|
|
27603
|
-
var ProcessIdSymbol = Symbol("@sapphire/snowflake.processId");
|
|
27604
|
-
var WorkerIdSymbol = Symbol("@sapphire/snowflake.workerId");
|
|
27605
|
-
var MaximumWorkerId = 0b11111n;
|
|
27606
|
-
var MaximumProcessId = 0b11111n;
|
|
27607
|
-
var MaximumIncrement = 0b111111111111n;
|
|
27608
|
-
var _a;
|
|
27609
|
-
var _b;
|
|
27610
|
-
var _c;
|
|
27611
|
-
var _d;
|
|
27612
|
-
var _Snowflake = class _Snowflake2 {
|
|
27613
|
-
constructor(epoch) {
|
|
27614
|
-
__publicField(this, "decode", this.deconstruct);
|
|
27615
|
-
__publicField(this, _a);
|
|
27616
|
-
__publicField(this, _b, 0n);
|
|
27617
|
-
__publicField(this, _c, 1n);
|
|
27618
|
-
__publicField(this, _d, 0n);
|
|
27619
|
-
this[EpochSymbol] = BigInt(epoch instanceof Date ? epoch.getTime() : epoch);
|
|
27620
|
-
}
|
|
27621
|
-
get epoch() {
|
|
27622
|
-
return this[EpochSymbol];
|
|
27623
|
-
}
|
|
27624
|
-
get processId() {
|
|
27625
|
-
return this[ProcessIdSymbol];
|
|
27626
|
-
}
|
|
27627
|
-
set processId(value) {
|
|
27628
|
-
this[ProcessIdSymbol] = BigInt(value) & MaximumProcessId;
|
|
27629
|
-
}
|
|
27630
|
-
get workerId() {
|
|
27631
|
-
return this[WorkerIdSymbol];
|
|
27632
|
-
}
|
|
27633
|
-
set workerId(value) {
|
|
27634
|
-
this[WorkerIdSymbol] = BigInt(value) & MaximumWorkerId;
|
|
27635
|
-
}
|
|
27636
|
-
generate({
|
|
27637
|
-
increment,
|
|
27638
|
-
timestamp = Date.now(),
|
|
27639
|
-
workerId = this[WorkerIdSymbol],
|
|
27640
|
-
processId = this[ProcessIdSymbol]
|
|
27641
|
-
} = {}) {
|
|
27642
|
-
if (timestamp instanceof Date)
|
|
27643
|
-
timestamp = BigInt(timestamp.getTime());
|
|
27644
|
-
else if (typeof timestamp === "number")
|
|
27645
|
-
timestamp = BigInt(timestamp);
|
|
27646
|
-
else if (typeof timestamp !== "bigint") {
|
|
27647
|
-
throw new TypeError(`"timestamp" argument must be a number, bigint, or Date (received ${typeof timestamp})`);
|
|
27648
|
-
}
|
|
27649
|
-
if (typeof increment !== "bigint") {
|
|
27650
|
-
increment = this[IncrementSymbol];
|
|
27651
|
-
this[IncrementSymbol] = increment + 1n & MaximumIncrement;
|
|
27652
|
-
}
|
|
27653
|
-
return timestamp - this[EpochSymbol] << 22n | (workerId & MaximumWorkerId) << 17n | (processId & MaximumProcessId) << 12n | increment & MaximumIncrement;
|
|
27654
|
-
}
|
|
27655
|
-
deconstruct(id) {
|
|
27656
|
-
const bigIntId = BigInt(id);
|
|
27657
|
-
const epoch = this[EpochSymbol];
|
|
27658
|
-
return {
|
|
27659
|
-
id: bigIntId,
|
|
27660
|
-
timestamp: (bigIntId >> 22n) + epoch,
|
|
27661
|
-
workerId: bigIntId >> 17n & MaximumWorkerId,
|
|
27662
|
-
processId: bigIntId >> 12n & MaximumProcessId,
|
|
27663
|
-
increment: bigIntId & MaximumIncrement,
|
|
27664
|
-
epoch
|
|
27665
|
-
};
|
|
27666
|
-
}
|
|
27667
|
-
timestampFrom(id) {
|
|
27668
|
-
return Number((BigInt(id) >> 22n) + this[EpochSymbol]);
|
|
27669
|
-
}
|
|
27670
|
-
static compare(a, b) {
|
|
27671
|
-
const typeA = typeof a;
|
|
27672
|
-
return typeA === typeof b ? typeA === "string" ? cmpString(a, b) : cmpBigInt(a, b) : cmpBigInt(BigInt(a), BigInt(b));
|
|
27673
|
-
}
|
|
27674
|
-
};
|
|
27675
|
-
_a = EpochSymbol, _b = IncrementSymbol, _c = ProcessIdSymbol, _d = WorkerIdSymbol;
|
|
27676
|
-
__name(_Snowflake, "Snowflake");
|
|
27677
|
-
var Snowflake = _Snowflake;
|
|
27678
|
-
function cmpBigInt(a, b) {
|
|
27679
|
-
return a === b ? 0 : a < b ? -1 : 1;
|
|
27680
|
-
}
|
|
27681
|
-
__name(cmpBigInt, "cmpBigInt");
|
|
27682
|
-
function cmpString(a, b) {
|
|
27683
|
-
return a === b ? 0 : a.length < b.length ? -1 : a.length > b.length ? 1 : a < b ? -1 : 1;
|
|
27684
|
-
}
|
|
27685
|
-
__name(cmpString, "cmpString");
|
|
27686
|
-
var DiscordSnowflake = new Snowflake(1420070400000n);
|
|
27687
|
-
var TwitterSnowflake = new Snowflake(1288834974657n);
|
|
27688
|
-
exports.DiscordSnowflake = DiscordSnowflake;
|
|
27689
|
-
exports.MaximumIncrement = MaximumIncrement;
|
|
27690
|
-
exports.MaximumProcessId = MaximumProcessId;
|
|
27691
|
-
exports.MaximumWorkerId = MaximumWorkerId;
|
|
27692
|
-
exports.Snowflake = Snowflake;
|
|
27693
|
-
exports.TwitterSnowflake = TwitterSnowflake;
|
|
27694
|
-
});
|
|
27695
|
-
|
|
27696
28153
|
// node_modules/@discordjs/formatters/dist/index.js
|
|
27697
28154
|
var require_dist7 = __commonJS((exports, module) => {
|
|
27698
28155
|
var __defProp2 = Object.defineProperty;
|
|
@@ -28240,7 +28697,7 @@ var require_Constants = __commonJS((exports) => {
|
|
|
28240
28697
|
// node_modules/discord.js/src/structures/BaseChannel.js
|
|
28241
28698
|
var require_BaseChannel = __commonJS((exports) => {
|
|
28242
28699
|
var { channelLink, channelMention } = require_dist7();
|
|
28243
|
-
var { DiscordSnowflake } =
|
|
28700
|
+
var { DiscordSnowflake } = require_cjs();
|
|
28244
28701
|
var { ChannelType, Routes } = require_v106();
|
|
28245
28702
|
var Base = require_Base();
|
|
28246
28703
|
var ChannelFlagsBitField = require_ChannelFlagsBitField();
|
|
@@ -28438,7 +28895,7 @@ var require_RoleFlagsBitField = __commonJS((exports, module) => {
|
|
|
28438
28895
|
// node_modules/discord.js/src/structures/Role.js
|
|
28439
28896
|
var require_Role = __commonJS((exports) => {
|
|
28440
28897
|
var { roleMention } = require_dist7();
|
|
28441
|
-
var { DiscordSnowflake } =
|
|
28898
|
+
var { DiscordSnowflake } = require_cjs();
|
|
28442
28899
|
var { PermissionFlagsBits } = require_v106();
|
|
28443
28900
|
var Base = require_Base();
|
|
28444
28901
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -28757,7 +29214,7 @@ var require_PermissionOverwriteManager = __commonJS((exports, module) => {
|
|
|
28757
29214
|
|
|
28758
29215
|
// node_modules/discord.js/src/structures/GuildChannel.js
|
|
28759
29216
|
var require_GuildChannel = __commonJS((exports, module) => {
|
|
28760
|
-
var { Snowflake } =
|
|
29217
|
+
var { Snowflake } = require_cjs();
|
|
28761
29218
|
var { PermissionFlagsBits, ChannelType } = require_v106();
|
|
28762
29219
|
var { BaseChannel } = require_BaseChannel();
|
|
28763
29220
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -28807,16 +29264,17 @@ var require_GuildChannel = __commonJS((exports, module) => {
|
|
|
28807
29264
|
return this.guild.channels.resolve(this.parentId);
|
|
28808
29265
|
}
|
|
28809
29266
|
get permissionsLocked() {
|
|
28810
|
-
|
|
29267
|
+
const { parent } = this;
|
|
29268
|
+
if (!parent)
|
|
28811
29269
|
return null;
|
|
28812
29270
|
const overwriteIds = new Set([
|
|
28813
29271
|
...this.permissionOverwrites.cache.keys(),
|
|
28814
|
-
...
|
|
29272
|
+
...parent.permissionOverwrites.cache.keys()
|
|
28815
29273
|
]);
|
|
28816
29274
|
return [...overwriteIds].every((key) => {
|
|
28817
29275
|
const channelVal = this.permissionOverwrites.cache.get(key);
|
|
28818
|
-
const parentVal =
|
|
28819
|
-
if (!channelVal && parentVal.deny.bitfield === PermissionsBitField.DefaultBit && parentVal.allow.bitfield === PermissionsBitField.DefaultBit || !parentVal && channelVal.deny.bitfield === PermissionsBitField.DefaultBit && channelVal.allow.bitfield === PermissionsBitField.DefaultBit) {
|
|
29276
|
+
const parentVal = parent.permissionOverwrites.cache.get(key);
|
|
29277
|
+
if (key === this.guildId && (!channelVal && parentVal.deny.bitfield === PermissionsBitField.DefaultBit && parentVal.allow.bitfield === PermissionsBitField.DefaultBit || !parentVal && channelVal.deny.bitfield === PermissionsBitField.DefaultBit && channelVal.allow.bitfield === PermissionsBitField.DefaultBit)) {
|
|
28820
29278
|
return true;
|
|
28821
29279
|
}
|
|
28822
29280
|
return channelVal !== undefined && parentVal !== undefined && channelVal.deny.bitfield === parentVal.deny.bitfield && channelVal.allow.bitfield === parentVal.allow.bitfield;
|
|
@@ -28957,7 +29415,8 @@ var require_GuildChannel = __commonJS((exports, module) => {
|
|
|
28957
29415
|
return true;
|
|
28958
29416
|
if (this.guild.members.me.communicationDisabledUntilTimestamp > Date.now())
|
|
28959
29417
|
return false;
|
|
28960
|
-
const
|
|
29418
|
+
const baseBitfield = PermissionFlagsBits.ViewChannel | PermissionFlagsBits.ManageChannels;
|
|
29419
|
+
const bitfield = VoiceBasedChannelTypes.includes(this.type) ? baseBitfield | PermissionFlagsBits.Connect : baseBitfield;
|
|
28961
29420
|
return permissions.has(bitfield, false);
|
|
28962
29421
|
}
|
|
28963
29422
|
get viewable() {
|
|
@@ -29306,11 +29765,43 @@ var require_Util = __commonJS((exports, module) => {
|
|
|
29306
29765
|
var { SKU } = require_SKU();
|
|
29307
29766
|
});
|
|
29308
29767
|
|
|
29768
|
+
// node_modules/discord.js/src/structures/AuthorizingIntegrationOwners.js
|
|
29769
|
+
var require_AuthorizingIntegrationOwners = __commonJS((exports, module) => {
|
|
29770
|
+
var { ApplicationIntegrationType } = require_v106();
|
|
29771
|
+
var Base = require_Base();
|
|
29772
|
+
|
|
29773
|
+
class AuthorizingIntegrationOwners extends Base {
|
|
29774
|
+
constructor(client, data) {
|
|
29775
|
+
super(client);
|
|
29776
|
+
Object.defineProperty(this, "data", { value: data });
|
|
29777
|
+
for (const value of Object.values(ApplicationIntegrationType)) {
|
|
29778
|
+
if (typeof value !== "number") {
|
|
29779
|
+
continue;
|
|
29780
|
+
}
|
|
29781
|
+
Object.defineProperty(this, value, { value: this.data[value] });
|
|
29782
|
+
}
|
|
29783
|
+
this.guildId = this.data[ApplicationIntegrationType.GuildInstall] ?? null;
|
|
29784
|
+
this.userId = this.data[ApplicationIntegrationType.UserInstall] ?? null;
|
|
29785
|
+
}
|
|
29786
|
+
get guild() {
|
|
29787
|
+
return (this.guildId && this.client.guilds.cache.get(this.guildId)) ?? null;
|
|
29788
|
+
}
|
|
29789
|
+
get user() {
|
|
29790
|
+
return (this.userId && this.client.users.cache.get(this.userId)) ?? null;
|
|
29791
|
+
}
|
|
29792
|
+
toJSON() {
|
|
29793
|
+
return this.data;
|
|
29794
|
+
}
|
|
29795
|
+
}
|
|
29796
|
+
module.exports = AuthorizingIntegrationOwners;
|
|
29797
|
+
});
|
|
29798
|
+
|
|
29309
29799
|
// node_modules/discord.js/src/util/Transformers.js
|
|
29310
29800
|
var require_Transformers = __commonJS((exports, module) => {
|
|
29311
29801
|
var { isJSONEncodable } = require_dist();
|
|
29312
29802
|
var snakeCase = require_lodash();
|
|
29313
29803
|
var { resolvePartialEmoji } = require_Util();
|
|
29804
|
+
var AuthorizingIntegrationOwners = require_AuthorizingIntegrationOwners();
|
|
29314
29805
|
function toSnakeCase(obj) {
|
|
29315
29806
|
if (typeof obj !== "object" || !obj)
|
|
29316
29807
|
return obj;
|
|
@@ -29340,7 +29831,7 @@ var require_Transformers = __commonJS((exports, module) => {
|
|
|
29340
29831
|
id: messageInteractionMetadata.id,
|
|
29341
29832
|
type: messageInteractionMetadata.type,
|
|
29342
29833
|
user: client.users._add(messageInteractionMetadata.user),
|
|
29343
|
-
authorizingIntegrationOwners: messageInteractionMetadata.authorizing_integration_owners,
|
|
29834
|
+
authorizingIntegrationOwners: new AuthorizingIntegrationOwners(client, messageInteractionMetadata.authorizing_integration_owners),
|
|
29344
29835
|
originalResponseMessageId: messageInteractionMetadata.original_response_message_id ?? null,
|
|
29345
29836
|
interactedMessageId: messageInteractionMetadata.interacted_message_id ?? null,
|
|
29346
29837
|
triggeringInteractionMetadata: messageInteractionMetadata.triggering_interaction_metadata ? _transformAPIMessageInteractionMetadata(client, messageInteractionMetadata.triggering_interaction_metadata) : null
|
|
@@ -29392,7 +29883,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
29392
29883
|
module.exports = {
|
|
29393
29884
|
$schema: "https://json.schemastore.org/package.json",
|
|
29394
29885
|
name: "discord.js",
|
|
29395
|
-
version: "14.
|
|
29886
|
+
version: "14.27.0",
|
|
29396
29887
|
description: "A powerful library for interacting with the Discord API",
|
|
29397
29888
|
main: "./src/index.js",
|
|
29398
29889
|
types: "./typings/index.d.ts",
|
|
@@ -29446,32 +29937,32 @@ var require_package = __commonJS((exports, module) => {
|
|
|
29446
29937
|
dependencies: {
|
|
29447
29938
|
"@discordjs/collection": "1.5.3",
|
|
29448
29939
|
"@discordjs/ws": "^1.2.3",
|
|
29449
|
-
"@sapphire/snowflake": "3.5.
|
|
29450
|
-
"discord-api-types": "^0.38.
|
|
29940
|
+
"@sapphire/snowflake": "3.5.5",
|
|
29941
|
+
"discord-api-types": "^0.38.49",
|
|
29451
29942
|
"fast-deep-equal": "3.1.3",
|
|
29452
29943
|
"lodash.snakecase": "4.1.1",
|
|
29453
29944
|
"magic-bytes.js": "^1.13.0",
|
|
29454
29945
|
tslib: "^2.6.3",
|
|
29455
|
-
undici: "6.
|
|
29456
|
-
"@discordjs/formatters": "^0.6.2",
|
|
29457
|
-
"@discordjs/rest": "^2.6.1",
|
|
29946
|
+
undici: "^6.27.0",
|
|
29458
29947
|
"@discordjs/builders": "^1.14.1",
|
|
29948
|
+
"@discordjs/rest": "^2.6.2",
|
|
29949
|
+
"@discordjs/formatters": "^0.6.2",
|
|
29459
29950
|
"@discordjs/util": "^1.2.0"
|
|
29460
29951
|
},
|
|
29461
29952
|
devDependencies: {
|
|
29462
29953
|
"@favware/cliff-jumper": "^4.1.0",
|
|
29463
29954
|
"@types/node": "^16.18.126",
|
|
29464
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
29465
|
-
"@typescript-eslint/parser": "^8.
|
|
29955
|
+
"@typescript-eslint/eslint-plugin": "^8.64.0",
|
|
29956
|
+
"@typescript-eslint/parser": "^8.64.0",
|
|
29466
29957
|
"cross-env": "^7.0.3",
|
|
29467
29958
|
dtslint: "4.2.1",
|
|
29468
29959
|
eslint: "^8.57.1",
|
|
29469
29960
|
"eslint-formatter-pretty": "^5.0.0",
|
|
29470
29961
|
jest: "29.7.0",
|
|
29471
|
-
prettier: "^3.
|
|
29962
|
+
prettier: "^3.9.5",
|
|
29472
29963
|
tsd: "^0.31.1",
|
|
29473
29964
|
tslint: "6.1.3",
|
|
29474
|
-
turbo: "^2.
|
|
29965
|
+
turbo: "^2.10.5",
|
|
29475
29966
|
typescript: "~5.8.3",
|
|
29476
29967
|
"@discordjs/docgen": "^0.12.1",
|
|
29477
29968
|
"@discordjs/scripts": "^0.1.0",
|
|
@@ -29684,7 +30175,7 @@ var require_BaseClient = __commonJS((exports, module) => {
|
|
|
29684
30175
|
var require_Emoji = __commonJS((exports) => {
|
|
29685
30176
|
var process2 = __require("node:process");
|
|
29686
30177
|
var { formatEmoji } = require_dist7();
|
|
29687
|
-
var { DiscordSnowflake } =
|
|
30178
|
+
var { DiscordSnowflake } = require_cjs();
|
|
29688
30179
|
var Base = require_Base();
|
|
29689
30180
|
var deprecationEmittedForURL = false;
|
|
29690
30181
|
|
|
@@ -30174,7 +30665,7 @@ var require_MessageCollector = __commonJS((exports, module) => {
|
|
|
30174
30665
|
|
|
30175
30666
|
// node_modules/discord.js/src/structures/GuildScheduledEvent.js
|
|
30176
30667
|
var require_GuildScheduledEvent = __commonJS((exports) => {
|
|
30177
|
-
var { DiscordSnowflake } =
|
|
30668
|
+
var { DiscordSnowflake } = require_cjs();
|
|
30178
30669
|
var { GuildScheduledEventStatus, GuildScheduledEventEntityType, RouteBases } = require_v106();
|
|
30179
30670
|
var Base = require_Base();
|
|
30180
30671
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -30377,7 +30868,7 @@ var require_GuildScheduledEvent = __commonJS((exports) => {
|
|
|
30377
30868
|
|
|
30378
30869
|
// node_modules/discord.js/src/structures/interfaces/Application.js
|
|
30379
30870
|
var require_Application = __commonJS((exports, module) => {
|
|
30380
|
-
var { DiscordSnowflake } =
|
|
30871
|
+
var { DiscordSnowflake } = require_cjs();
|
|
30381
30872
|
var Base = require_Base();
|
|
30382
30873
|
|
|
30383
30874
|
class Application extends Base {
|
|
@@ -30550,7 +31041,7 @@ var require_InviteFlagsBitField = __commonJS((exports) => {
|
|
|
30550
31041
|
// node_modules/discord.js/src/structures/BaseGuild.js
|
|
30551
31042
|
var require_BaseGuild = __commonJS((exports, module) => {
|
|
30552
31043
|
var { makeURLSearchParams } = require_dist5();
|
|
30553
|
-
var { DiscordSnowflake } =
|
|
31044
|
+
var { DiscordSnowflake } = require_cjs();
|
|
30554
31045
|
var { Routes, GuildFeature } = require_v106();
|
|
30555
31046
|
var Base = require_Base();
|
|
30556
31047
|
|
|
@@ -31047,8 +31538,9 @@ var require_MessageFlagsBitField = __commonJS((exports, module) => {
|
|
|
31047
31538
|
var require_BaseInteraction = __commonJS((exports, module) => {
|
|
31048
31539
|
var { deprecate } = __require("node:util");
|
|
31049
31540
|
var { Collection } = require_dist6();
|
|
31050
|
-
var { DiscordSnowflake } =
|
|
31541
|
+
var { DiscordSnowflake } = require_cjs();
|
|
31051
31542
|
var { InteractionType, ApplicationCommandType, ComponentType } = require_v106();
|
|
31543
|
+
var AuthorizingIntegrationOwners = require_AuthorizingIntegrationOwners();
|
|
31052
31544
|
var Base = require_Base();
|
|
31053
31545
|
var { SelectMenuTypes } = require_Constants();
|
|
31054
31546
|
var PermissionsBitField = require_PermissionsBitField();
|
|
@@ -31070,7 +31562,7 @@ var require_BaseInteraction = __commonJS((exports, module) => {
|
|
|
31070
31562
|
this.locale = data.locale;
|
|
31071
31563
|
this.guildLocale = data.guild_locale ?? null;
|
|
31072
31564
|
this.entitlements = data.entitlements.reduce((coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)), new Collection);
|
|
31073
|
-
this.authorizingIntegrationOwners = data.authorizing_integration_owners;
|
|
31565
|
+
this.authorizingIntegrationOwners = new AuthorizingIntegrationOwners(this.client, data.authorizing_integration_owners);
|
|
31074
31566
|
this.context = data.context ?? null;
|
|
31075
31567
|
this.attachmentSizeLimit = data.attachment_size_limit;
|
|
31076
31568
|
}
|
|
@@ -31154,6 +31646,48 @@ var require_BaseInteraction = __commonJS((exports, module) => {
|
|
|
31154
31646
|
module.exports = BaseInteraction;
|
|
31155
31647
|
});
|
|
31156
31648
|
|
|
31649
|
+
// node_modules/discord.js/src/structures/ActivityLocation.js
|
|
31650
|
+
var require_ActivityLocation = __commonJS((exports) => {
|
|
31651
|
+
var Base = require_Base();
|
|
31652
|
+
|
|
31653
|
+
class ActivityLocation extends Base {
|
|
31654
|
+
constructor(client, data) {
|
|
31655
|
+
super(client);
|
|
31656
|
+
this.id = data.id;
|
|
31657
|
+
this.kind = data.kind;
|
|
31658
|
+
this.channelId = data.channel_id;
|
|
31659
|
+
this.guildId = data.guild_id ?? null;
|
|
31660
|
+
}
|
|
31661
|
+
get channel() {
|
|
31662
|
+
return this.client.channels.cache.get(this.channelId) ?? null;
|
|
31663
|
+
}
|
|
31664
|
+
get guild() {
|
|
31665
|
+
if (!this.guildId)
|
|
31666
|
+
return null;
|
|
31667
|
+
return this.client.guilds.cache.get(this.guildId) ?? null;
|
|
31668
|
+
}
|
|
31669
|
+
}
|
|
31670
|
+
exports.ActivityLocation = ActivityLocation;
|
|
31671
|
+
});
|
|
31672
|
+
|
|
31673
|
+
// node_modules/discord.js/src/structures/ActivityInstance.js
|
|
31674
|
+
var require_ActivityInstance = __commonJS((exports) => {
|
|
31675
|
+
var { ActivityLocation } = require_ActivityLocation();
|
|
31676
|
+
var Base = require_Base();
|
|
31677
|
+
|
|
31678
|
+
class ActivityInstance extends Base {
|
|
31679
|
+
constructor(client, data) {
|
|
31680
|
+
super(client);
|
|
31681
|
+
this.applicationId = data.application_id;
|
|
31682
|
+
this.instanceId = data.instance_id;
|
|
31683
|
+
this.launchId = data.launch_id;
|
|
31684
|
+
this.location = new ActivityLocation(client, data.location);
|
|
31685
|
+
this.users = data.users;
|
|
31686
|
+
}
|
|
31687
|
+
}
|
|
31688
|
+
exports.ActivityInstance = ActivityInstance;
|
|
31689
|
+
});
|
|
31690
|
+
|
|
31157
31691
|
// node_modules/discord.js/src/structures/ApplicationRoleConnectionMetadata.js
|
|
31158
31692
|
var require_ApplicationRoleConnectionMetadata = __commonJS((exports) => {
|
|
31159
31693
|
class ApplicationRoleConnectionMetadata {
|
|
@@ -31208,7 +31742,7 @@ var require_TeamMember = __commonJS((exports, module) => {
|
|
|
31208
31742
|
// node_modules/discord.js/src/structures/Team.js
|
|
31209
31743
|
var require_Team = __commonJS((exports, module) => {
|
|
31210
31744
|
var { Collection } = require_dist6();
|
|
31211
|
-
var { DiscordSnowflake } =
|
|
31745
|
+
var { DiscordSnowflake } = require_cjs();
|
|
31212
31746
|
var Base = require_Base();
|
|
31213
31747
|
var TeamMember = require_TeamMember();
|
|
31214
31748
|
|
|
@@ -31500,7 +32034,7 @@ var require_fast_deep_equal = __commonJS((exports, module) => {
|
|
|
31500
32034
|
|
|
31501
32035
|
// node_modules/discord.js/src/structures/ApplicationCommand.js
|
|
31502
32036
|
var require_ApplicationCommand = __commonJS((exports, module) => {
|
|
31503
|
-
var { DiscordSnowflake } =
|
|
32037
|
+
var { DiscordSnowflake } = require_cjs();
|
|
31504
32038
|
var { ApplicationCommandOptionType } = require_v106();
|
|
31505
32039
|
var isEqual = require_fast_deep_equal();
|
|
31506
32040
|
var Base = require_Base();
|
|
@@ -32211,6 +32745,7 @@ var require_ApplicationFlagsBitField = __commonJS((exports, module) => {
|
|
|
32211
32745
|
var require_ClientApplication = __commonJS((exports, module) => {
|
|
32212
32746
|
var { Collection } = require_dist6();
|
|
32213
32747
|
var { Routes } = require_v106();
|
|
32748
|
+
var { ActivityInstance } = require_ActivityInstance();
|
|
32214
32749
|
var { ApplicationRoleConnectionMetadata } = require_ApplicationRoleConnectionMetadata();
|
|
32215
32750
|
var { SKU } = require_SKU();
|
|
32216
32751
|
var Team = require_Team();
|
|
@@ -32394,6 +32929,10 @@ var require_ClientApplication = __commonJS((exports, module) => {
|
|
|
32394
32929
|
const skus = await this.client.rest.get(Routes.skus(this.id));
|
|
32395
32930
|
return skus.reduce((coll, sku) => coll.set(sku.id, new SKU(this.client, sku)), new Collection);
|
|
32396
32931
|
}
|
|
32932
|
+
async fetchActivityInstance(instanceId) {
|
|
32933
|
+
const data = await this.client.rest.get(Routes.applicationActivityInstance(this.id, instanceId));
|
|
32934
|
+
return new ActivityInstance(this.client, data);
|
|
32935
|
+
}
|
|
32397
32936
|
}
|
|
32398
32937
|
module.exports = ClientApplication;
|
|
32399
32938
|
});
|
|
@@ -33378,7 +33917,7 @@ var require_uniqWith = __commonJS((exports, module) => {
|
|
|
33378
33917
|
});
|
|
33379
33918
|
|
|
33380
33919
|
// node_modules/@sapphire/shapeshift/dist/cjs/index.cjs
|
|
33381
|
-
var
|
|
33920
|
+
var require_cjs3 = __commonJS((exports) => {
|
|
33382
33921
|
var get = require_get();
|
|
33383
33922
|
var fastDeepEqual = require_es6();
|
|
33384
33923
|
var uniqWith = require_uniqWith();
|
|
@@ -36658,7 +37197,7 @@ var require_mixins = __commonJS((exports) => {
|
|
|
36658
37197
|
});
|
|
36659
37198
|
|
|
36660
37199
|
// node_modules/ts-mixer/dist/cjs/index.js
|
|
36661
|
-
var
|
|
37200
|
+
var require_cjs4 = __commonJS((exports) => {
|
|
36662
37201
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36663
37202
|
exports.hasMixin = exports.decorate = exports.settings = exports.mix = exports.Mixin = undefined;
|
|
36664
37203
|
var mixins_1 = require_mixins();
|
|
@@ -36811,7 +37350,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
36811
37350
|
urlPredicate: () => urlPredicate,
|
|
36812
37351
|
validateFieldLength: () => validateFieldLength
|
|
36813
37352
|
});
|
|
36814
|
-
var import_shapeshift =
|
|
37353
|
+
var import_shapeshift = require_cjs3();
|
|
36815
37354
|
var validate = true;
|
|
36816
37355
|
function enableValidators() {
|
|
36817
37356
|
return validate = true;
|
|
@@ -36985,7 +37524,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
36985
37524
|
validateRequiredSelectMenuOptionParameters: () => validateRequiredSelectMenuOptionParameters,
|
|
36986
37525
|
validateRequiredSelectMenuParameters: () => validateRequiredSelectMenuParameters
|
|
36987
37526
|
});
|
|
36988
|
-
var import_shapeshift2 =
|
|
37527
|
+
var import_shapeshift2 = require_cjs3();
|
|
36989
37528
|
var import_v10 = require_v106();
|
|
36990
37529
|
var StringSelectMenuOptionBuilder = class {
|
|
36991
37530
|
constructor(data = {}) {
|
|
@@ -37158,7 +37697,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37158
37697
|
radioGroupOptionPredicate: () => radioGroupOptionPredicate,
|
|
37159
37698
|
radioGroupPredicate: () => radioGroupPredicate
|
|
37160
37699
|
});
|
|
37161
|
-
var import_shapeshift3 =
|
|
37700
|
+
var import_shapeshift3 = require_cjs3();
|
|
37162
37701
|
var import_v103 = require_v106();
|
|
37163
37702
|
var checkboxPredicate = import_shapeshift3.s.object({
|
|
37164
37703
|
type: import_shapeshift3.s.literal(import_v103.ComponentType.Checkbox),
|
|
@@ -37424,7 +37963,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37424
37963
|
__export2(Assertions_exports4, {
|
|
37425
37964
|
fileUploadPredicate: () => fileUploadPredicate
|
|
37426
37965
|
});
|
|
37427
|
-
var import_shapeshift4 =
|
|
37966
|
+
var import_shapeshift4 = require_cjs3();
|
|
37428
37967
|
var import_v107 = require_v106();
|
|
37429
37968
|
var fileUploadPredicate = import_shapeshift4.s.object({
|
|
37430
37969
|
type: import_shapeshift4.s.literal(import_v107.ComponentType.FileUpload),
|
|
@@ -37484,7 +38023,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37484
38023
|
validateRequiredParameters: () => validateRequiredParameters,
|
|
37485
38024
|
valueValidator: () => valueValidator
|
|
37486
38025
|
});
|
|
37487
|
-
var import_shapeshift5 =
|
|
38026
|
+
var import_shapeshift5 = require_cjs3();
|
|
37488
38027
|
var import_v109 = require_v106();
|
|
37489
38028
|
var textInputStyleValidator = import_shapeshift5.s.nativeEnum(import_v109.TextInputStyle).setValidationEnabled(isValidationEnabled);
|
|
37490
38029
|
var minLengthValidator = import_shapeshift5.s.number().int().greaterThanOrEqual(0).lessThanOrEqual(4000).setValidationEnabled(isValidationEnabled);
|
|
@@ -37669,7 +38208,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37669
38208
|
selectMenuStringPredicate: () => selectMenuStringPredicate,
|
|
37670
38209
|
selectMenuUserPredicate: () => selectMenuUserPredicate
|
|
37671
38210
|
});
|
|
37672
|
-
var import_shapeshift6 =
|
|
38211
|
+
var import_shapeshift6 = require_cjs3();
|
|
37673
38212
|
var import_v1013 = require_v106();
|
|
37674
38213
|
var selectMenuBasePredicate = import_shapeshift6.s.object({
|
|
37675
38214
|
id: idValidator.optional(),
|
|
@@ -37840,7 +38379,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37840
38379
|
__export2(Assertions_exports7, {
|
|
37841
38380
|
labelPredicate: () => labelPredicate
|
|
37842
38381
|
});
|
|
37843
|
-
var import_shapeshift7 =
|
|
38382
|
+
var import_shapeshift7 = require_cjs3();
|
|
37844
38383
|
var import_v1017 = require_v106();
|
|
37845
38384
|
var labelPredicate = import_shapeshift7.s.object({
|
|
37846
38385
|
id: idValidator.optional(),
|
|
@@ -37951,7 +38490,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
37951
38490
|
unfurledMediaItemPredicate: () => unfurledMediaItemPredicate,
|
|
37952
38491
|
validateComponentArray: () => validateComponentArray
|
|
37953
38492
|
});
|
|
37954
|
-
var import_shapeshift8 =
|
|
38493
|
+
var import_shapeshift8 = require_cjs3();
|
|
37955
38494
|
var import_v1020 = require_v106();
|
|
37956
38495
|
var import_v1019 = require_v106();
|
|
37957
38496
|
var ThumbnailBuilder = class extends ComponentBuilder {
|
|
@@ -38340,7 +38879,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38340
38879
|
titleValidator: () => titleValidator,
|
|
38341
38880
|
validateRequiredParameters: () => validateRequiredParameters2
|
|
38342
38881
|
});
|
|
38343
|
-
var import_shapeshift9 =
|
|
38882
|
+
var import_shapeshift9 = require_cjs3();
|
|
38344
38883
|
var titleValidator = import_shapeshift9.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);
|
|
38345
38884
|
var componentsValidator = import_shapeshift9.s.union([import_shapeshift9.s.instance(ActionRowBuilder), import_shapeshift9.s.instance(LabelBuilder), import_shapeshift9.s.instance(TextDisplayBuilder)]).array().lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);
|
|
38346
38885
|
function validateRequiredParameters2(customId, title, components) {
|
|
@@ -38452,7 +38991,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38452
38991
|
validateRequired: () => validateRequired,
|
|
38453
38992
|
validateRequiredParameters: () => validateRequiredParameters3
|
|
38454
38993
|
});
|
|
38455
|
-
var import_shapeshift10 =
|
|
38994
|
+
var import_shapeshift10 = require_cjs3();
|
|
38456
38995
|
var import_v1030 = require_v106();
|
|
38457
38996
|
var namePredicate = import_shapeshift10.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u).setValidationEnabled(isValidationEnabled);
|
|
38458
38997
|
function validateName(name) {
|
|
@@ -38523,7 +39062,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38523
39062
|
__name(validateNSFW, "validateNSFW");
|
|
38524
39063
|
var contextsPredicate = import_shapeshift10.s.array(import_shapeshift10.s.nativeEnum(import_v1030.InteractionContextType).setValidationEnabled(isValidationEnabled));
|
|
38525
39064
|
var integrationTypesPredicate = import_shapeshift10.s.array(import_shapeshift10.s.nativeEnum(import_v1030.ApplicationIntegrationType).setValidationEnabled(isValidationEnabled));
|
|
38526
|
-
var import_ts_mixer6 =
|
|
39065
|
+
var import_ts_mixer6 = require_cjs4();
|
|
38527
39066
|
var SharedNameAndDescription = class {
|
|
38528
39067
|
static {
|
|
38529
39068
|
__name(this, "SharedNameAndDescription");
|
|
@@ -38686,8 +39225,8 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38686
39225
|
}
|
|
38687
39226
|
};
|
|
38688
39227
|
var import_v1035 = require_v106();
|
|
38689
|
-
var import_ts_mixer =
|
|
38690
|
-
var import_shapeshift11 =
|
|
39228
|
+
var import_ts_mixer = require_cjs4();
|
|
39229
|
+
var import_shapeshift11 = require_cjs3();
|
|
38691
39230
|
var import_v1034 = require_v106();
|
|
38692
39231
|
var allowedChannelTypes = [
|
|
38693
39232
|
import_v1034.ChannelType.GuildText,
|
|
@@ -38726,9 +39265,9 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38726
39265
|
SlashCommandChannelOption = __decorateClass([
|
|
38727
39266
|
(0, import_ts_mixer.mix)(ApplicationCommandOptionChannelTypesMixin)
|
|
38728
39267
|
], SlashCommandChannelOption);
|
|
38729
|
-
var import_shapeshift14 =
|
|
39268
|
+
var import_shapeshift14 = require_cjs3();
|
|
38730
39269
|
var import_v1037 = require_v106();
|
|
38731
|
-
var import_ts_mixer2 =
|
|
39270
|
+
var import_ts_mixer2 = require_cjs4();
|
|
38732
39271
|
var ApplicationCommandNumericOptionMinMaxValueMixin = class {
|
|
38733
39272
|
static {
|
|
38734
39273
|
__name(this, "ApplicationCommandNumericOptionMinMaxValueMixin");
|
|
@@ -38736,7 +39275,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38736
39275
|
max_value;
|
|
38737
39276
|
min_value;
|
|
38738
39277
|
};
|
|
38739
|
-
var import_shapeshift12 =
|
|
39278
|
+
var import_shapeshift12 = require_cjs3();
|
|
38740
39279
|
var booleanPredicate2 = import_shapeshift12.s.boolean();
|
|
38741
39280
|
var ApplicationCommandOptionWithAutocompleteMixin = class {
|
|
38742
39281
|
static {
|
|
@@ -38753,7 +39292,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38753
39292
|
return this;
|
|
38754
39293
|
}
|
|
38755
39294
|
};
|
|
38756
|
-
var import_shapeshift13 =
|
|
39295
|
+
var import_shapeshift13 = require_cjs3();
|
|
38757
39296
|
var import_v1036 = require_v106();
|
|
38758
39297
|
var stringPredicate = import_shapeshift13.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100);
|
|
38759
39298
|
var numberPredicate = import_shapeshift13.s.number().greaterThan(Number.NEGATIVE_INFINITY).lessThan(Number.POSITIVE_INFINITY);
|
|
@@ -38835,9 +39374,9 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38835
39374
|
return { ...this };
|
|
38836
39375
|
}
|
|
38837
39376
|
};
|
|
38838
|
-
var import_shapeshift15 =
|
|
39377
|
+
var import_shapeshift15 = require_cjs3();
|
|
38839
39378
|
var import_v1039 = require_v106();
|
|
38840
|
-
var import_ts_mixer3 =
|
|
39379
|
+
var import_ts_mixer3 = require_cjs4();
|
|
38841
39380
|
var numberValidator2 = import_shapeshift15.s.number();
|
|
38842
39381
|
var SlashCommandNumberOption = class extends ApplicationCommandOptionBase {
|
|
38843
39382
|
type = import_v1039.ApplicationCommandOptionType.Number;
|
|
@@ -38874,9 +39413,9 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38874
39413
|
return { ...this };
|
|
38875
39414
|
}
|
|
38876
39415
|
};
|
|
38877
|
-
var import_shapeshift16 =
|
|
39416
|
+
var import_shapeshift16 = require_cjs3();
|
|
38878
39417
|
var import_v1041 = require_v106();
|
|
38879
|
-
var import_ts_mixer4 =
|
|
39418
|
+
var import_ts_mixer4 = require_cjs4();
|
|
38880
39419
|
var minLengthValidator2 = import_shapeshift16.s.number().greaterThanOrEqual(0).lessThanOrEqual(6000);
|
|
38881
39420
|
var maxLengthValidator2 = import_shapeshift16.s.number().greaterThanOrEqual(1).lessThanOrEqual(6000);
|
|
38882
39421
|
var SlashCommandStringOption = class extends ApplicationCommandOptionBase {
|
|
@@ -38958,7 +39497,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
38958
39497
|
}
|
|
38959
39498
|
};
|
|
38960
39499
|
var import_v1043 = require_v106();
|
|
38961
|
-
var import_ts_mixer5 =
|
|
39500
|
+
var import_ts_mixer5 = require_cjs4();
|
|
38962
39501
|
var SlashCommandSubcommandGroupBuilder = class {
|
|
38963
39502
|
name = undefined;
|
|
38964
39503
|
description = undefined;
|
|
@@ -39057,7 +39596,7 @@ var require_dist8 = __commonJS((exports, module) => {
|
|
|
39057
39596
|
validateRequiredParameters: () => validateRequiredParameters4,
|
|
39058
39597
|
validateType: () => validateType
|
|
39059
39598
|
});
|
|
39060
|
-
var import_shapeshift17 =
|
|
39599
|
+
var import_shapeshift17 = require_cjs3();
|
|
39061
39600
|
var import_v1044 = require_v106();
|
|
39062
39601
|
var namePredicate2 = import_shapeshift17.s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/\S/).setValidationEnabled(isValidationEnabled);
|
|
39063
39602
|
var typePredicate = import_shapeshift17.s.union([import_shapeshift17.s.literal(import_v1044.ApplicationCommandType.User), import_shapeshift17.s.literal(import_v1044.ApplicationCommandType.Message)]).setValidationEnabled(isValidationEnabled);
|
|
@@ -39530,7 +40069,7 @@ var require_ReactionCollector = __commonJS((exports, module) => {
|
|
|
39530
40069
|
|
|
39531
40070
|
// node_modules/discord.js/src/structures/Sticker.js
|
|
39532
40071
|
var require_Sticker = __commonJS((exports) => {
|
|
39533
|
-
var { DiscordSnowflake } =
|
|
40072
|
+
var { DiscordSnowflake } = require_cjs();
|
|
39534
40073
|
var { Routes } = require_v106();
|
|
39535
40074
|
var Base = require_Base();
|
|
39536
40075
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -40619,7 +41158,7 @@ var require_Components = __commonJS((exports, module) => {
|
|
|
40619
41158
|
var require_Message = __commonJS((exports) => {
|
|
40620
41159
|
var { Collection } = require_dist6();
|
|
40621
41160
|
var { messageLink } = require_dist7();
|
|
40622
|
-
var { DiscordSnowflake } =
|
|
41161
|
+
var { DiscordSnowflake } = require_cjs();
|
|
40623
41162
|
var {
|
|
40624
41163
|
InteractionType,
|
|
40625
41164
|
ChannelType,
|
|
@@ -40852,6 +41391,18 @@ var require_Message = __commonJS((exports) => {
|
|
|
40852
41391
|
} else {
|
|
40853
41392
|
this.call ??= null;
|
|
40854
41393
|
}
|
|
41394
|
+
if (data.shared_client_theme) {
|
|
41395
|
+
this.sharedClientTheme = {
|
|
41396
|
+
colors: data.shared_client_theme.colors,
|
|
41397
|
+
gradientAngle: data.shared_client_theme.gradient_angle,
|
|
41398
|
+
baseMix: data.shared_client_theme.base_mix
|
|
41399
|
+
};
|
|
41400
|
+
if ("base_theme" in data.shared_client_theme) {
|
|
41401
|
+
this.sharedClientTheme.baseTheme = data.shared_client_theme.base_theme;
|
|
41402
|
+
}
|
|
41403
|
+
} else {
|
|
41404
|
+
this.sharedClientTheme ??= null;
|
|
41405
|
+
}
|
|
40855
41406
|
}
|
|
40856
41407
|
get channel() {
|
|
40857
41408
|
return this.client.channels.resolve(this.channelId);
|
|
@@ -41120,7 +41671,7 @@ var require_Message = __commonJS((exports) => {
|
|
|
41120
41671
|
var require_Webhook = __commonJS((exports, module) => {
|
|
41121
41672
|
var { makeURLSearchParams } = require_dist5();
|
|
41122
41673
|
var { lazy } = require_dist();
|
|
41123
|
-
var { DiscordSnowflake } =
|
|
41674
|
+
var { DiscordSnowflake } = require_cjs();
|
|
41124
41675
|
var { Routes, WebhookType } = require_v106();
|
|
41125
41676
|
var MessagePayload = require_MessagePayload();
|
|
41126
41677
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -41635,6 +42186,7 @@ var require_GuildMember = __commonJS((exports) => {
|
|
|
41635
42186
|
var GuildMemberRoleManager = require_GuildMemberRoleManager();
|
|
41636
42187
|
var { GuildMemberFlagsBitField } = require_GuildMemberFlagsBitField();
|
|
41637
42188
|
var PermissionsBitField = require_PermissionsBitField();
|
|
42189
|
+
var { _transformCollectibles } = require_Transformers();
|
|
41638
42190
|
|
|
41639
42191
|
class GuildMember extends Base {
|
|
41640
42192
|
constructor(client, data, guild) {
|
|
@@ -41694,6 +42246,11 @@ var require_GuildMember = __commonJS((exports) => {
|
|
|
41694
42246
|
} else {
|
|
41695
42247
|
this.avatarDecorationData = null;
|
|
41696
42248
|
}
|
|
42249
|
+
if ("collectibles" in data) {
|
|
42250
|
+
this.collectibles = data.collectibles ? _transformCollectibles(data.collectibles) : null;
|
|
42251
|
+
} else {
|
|
42252
|
+
this.collectibles ??= null;
|
|
42253
|
+
}
|
|
41697
42254
|
}
|
|
41698
42255
|
_clone() {
|
|
41699
42256
|
const clone = super._clone();
|
|
@@ -41823,7 +42380,7 @@ var require_GuildMember = __commonJS((exports) => {
|
|
|
41823
42380
|
return this.guild.members.fetch({ user: this.id, cache: true, force });
|
|
41824
42381
|
}
|
|
41825
42382
|
equals(member) {
|
|
41826
|
-
return member instanceof this.constructor && this.id === member.id && this.partial === member.partial && this.guild.id === member.guild.id && this.joinedTimestamp === member.joinedTimestamp && this.nickname === member.nickname && this.avatar === member.avatar && this.banner === member.banner && this.pending === member.pending && this.communicationDisabledUntilTimestamp === member.communicationDisabledUntilTimestamp && this.flags.bitfield === member.flags.bitfield && (this._roles === member._roles || this._roles.length === member._roles.length && this._roles.every((role, index) => role === member._roles[index])) && this.avatarDecorationData?.asset === member.avatarDecorationData?.asset && this.avatarDecorationData?.skuId === member.avatarDecorationData?.skuId;
|
|
42383
|
+
return member instanceof this.constructor && this.id === member.id && this.partial === member.partial && this.guild.id === member.guild.id && this.joinedTimestamp === member.joinedTimestamp && this.nickname === member.nickname && this.avatar === member.avatar && this.banner === member.banner && this.pending === member.pending && this.communicationDisabledUntilTimestamp === member.communicationDisabledUntilTimestamp && this.flags.bitfield === member.flags.bitfield && (this._roles === member._roles || this._roles.length === member._roles.length && this._roles.every((role, index) => role === member._roles[index])) && this.avatarDecorationData?.asset === member.avatarDecorationData?.asset && this.avatarDecorationData?.skuId === member.avatarDecorationData?.skuId && this.collectibles?.nameplate?.skuId === member.collectibles?.nameplate?.skuId && this.collectibles?.nameplate?.asset === member.collectibles?.nameplate?.asset && this.collectibles?.nameplate?.label === member.collectibles?.nameplate?.label && this.collectibles?.nameplate?.palette === member.collectibles?.nameplate?.palette;
|
|
41827
42384
|
}
|
|
41828
42385
|
toString() {
|
|
41829
42386
|
return this.user.toString();
|
|
@@ -42010,7 +42567,7 @@ var require_InteractionWebhook = __commonJS((exports, module) => {
|
|
|
42010
42567
|
var require_MessagePayload = __commonJS((exports, module) => {
|
|
42011
42568
|
var { Buffer: Buffer2 } = __require("node:buffer");
|
|
42012
42569
|
var { lazy, isJSONEncodable } = require_dist();
|
|
42013
|
-
var { DiscordSnowflake } =
|
|
42570
|
+
var { DiscordSnowflake } = require_cjs();
|
|
42014
42571
|
var { MessageFlags, MessageReferenceType } = require_v106();
|
|
42015
42572
|
var { DiscordjsError, DiscordjsRangeError, ErrorCodes } = require_errors2();
|
|
42016
42573
|
var { resolveFile } = require_DataResolver();
|
|
@@ -42135,7 +42692,10 @@ var require_MessagePayload = __commonJS((exports, module) => {
|
|
|
42135
42692
|
}
|
|
42136
42693
|
const attachments = this.options.files?.map((file, index) => ({
|
|
42137
42694
|
id: index.toString(),
|
|
42138
|
-
description: file.description
|
|
42695
|
+
description: file.description,
|
|
42696
|
+
title: file.title,
|
|
42697
|
+
waveform: file.waveform,
|
|
42698
|
+
duration_secs: file.duration
|
|
42139
42699
|
}));
|
|
42140
42700
|
if (Array.isArray(this.options.attachments)) {
|
|
42141
42701
|
this.options.attachments.push(...attachments ?? []);
|
|
@@ -42156,6 +42716,15 @@ var require_MessagePayload = __commonJS((exports, module) => {
|
|
|
42156
42716
|
layout_type: this.options.poll.layoutType
|
|
42157
42717
|
};
|
|
42158
42718
|
}
|
|
42719
|
+
let shared_client_theme;
|
|
42720
|
+
if (this.options.sharedClientTheme) {
|
|
42721
|
+
shared_client_theme = isJSONEncodable(this.options.sharedClientTheme) ? this.options.sharedClientTheme.toJSON() : {
|
|
42722
|
+
colors: this.options.sharedClientTheme.colors,
|
|
42723
|
+
gradient_angle: this.options.sharedClientTheme.gradientAngle,
|
|
42724
|
+
base_mix: this.options.sharedClientTheme.baseMix,
|
|
42725
|
+
base_theme: this.options.sharedClientTheme.baseTheme
|
|
42726
|
+
};
|
|
42727
|
+
}
|
|
42159
42728
|
this.body = {
|
|
42160
42729
|
content,
|
|
42161
42730
|
tts,
|
|
@@ -42172,7 +42741,8 @@ var require_MessagePayload = __commonJS((exports, module) => {
|
|
|
42172
42741
|
sticker_ids: this.options.stickers?.map((sticker) => sticker.id ?? sticker),
|
|
42173
42742
|
thread_name: threadName,
|
|
42174
42743
|
applied_tags: appliedTags,
|
|
42175
|
-
poll
|
|
42744
|
+
poll,
|
|
42745
|
+
shared_client_theme
|
|
42176
42746
|
};
|
|
42177
42747
|
return this;
|
|
42178
42748
|
}
|
|
@@ -42224,7 +42794,7 @@ var require_GuildMessageManager = __commonJS((exports, module) => {
|
|
|
42224
42794
|
// node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js
|
|
42225
42795
|
var require_TextBasedChannel = __commonJS((exports, module) => {
|
|
42226
42796
|
var { Collection } = require_dist6();
|
|
42227
|
-
var { DiscordSnowflake } =
|
|
42797
|
+
var { DiscordSnowflake } = require_cjs();
|
|
42228
42798
|
var { InteractionType, Routes } = require_v106();
|
|
42229
42799
|
var { DiscordjsTypeError, DiscordjsError, ErrorCodes } = require_errors2();
|
|
42230
42800
|
var { MaxBulkDeletableMessageAge } = require_Constants();
|
|
@@ -42368,7 +42938,7 @@ var require_UserFlagsBitField = __commonJS((exports, module) => {
|
|
|
42368
42938
|
var require_User = __commonJS((exports, module) => {
|
|
42369
42939
|
var { userMention } = require_dist7();
|
|
42370
42940
|
var { calculateUserDefaultAvatarIndex } = require_dist5();
|
|
42371
|
-
var { DiscordSnowflake } =
|
|
42941
|
+
var { DiscordSnowflake } = require_cjs();
|
|
42372
42942
|
var Base = require_Base();
|
|
42373
42943
|
var TextBasedChannel = require_TextBasedChannel();
|
|
42374
42944
|
var { _transformCollectibles } = require_Transformers();
|
|
@@ -42445,10 +43015,10 @@ var require_User = __commonJS((exports, module) => {
|
|
|
42445
43015
|
} else {
|
|
42446
43016
|
this.avatarDecorationData ??= null;
|
|
42447
43017
|
}
|
|
42448
|
-
if (data
|
|
42449
|
-
this.collectibles = _transformCollectibles(data.collectibles);
|
|
43018
|
+
if ("collectibles" in data) {
|
|
43019
|
+
this.collectibles = data.collectibles ? _transformCollectibles(data.collectibles) : null;
|
|
42450
43020
|
} else {
|
|
42451
|
-
this.collectibles
|
|
43021
|
+
this.collectibles ??= null;
|
|
42452
43022
|
}
|
|
42453
43023
|
if ("primary_guild" in data) {
|
|
42454
43024
|
if (data.primary_guild) {
|
|
@@ -44619,7 +45189,7 @@ var require_Integration = __commonJS((exports, module) => {
|
|
|
44619
45189
|
|
|
44620
45190
|
// node_modules/discord.js/src/structures/StageInstance.js
|
|
44621
45191
|
var require_StageInstance = __commonJS((exports) => {
|
|
44622
|
-
var { DiscordSnowflake } =
|
|
45192
|
+
var { DiscordSnowflake } = require_cjs();
|
|
44623
45193
|
var Base = require_Base();
|
|
44624
45194
|
|
|
44625
45195
|
class StageInstance extends Base {
|
|
@@ -44684,7 +45254,7 @@ var require_StageInstance = __commonJS((exports) => {
|
|
|
44684
45254
|
|
|
44685
45255
|
// node_modules/discord.js/src/structures/GuildAuditLogsEntry.js
|
|
44686
45256
|
var require_GuildAuditLogsEntry = __commonJS((exports, module) => {
|
|
44687
|
-
var { DiscordSnowflake } =
|
|
45257
|
+
var { DiscordSnowflake } = require_cjs();
|
|
44688
45258
|
var { AuditLogOptionsType, AuditLogEvent } = require_v106();
|
|
44689
45259
|
var AutoModerationRule = require_AutoModerationRule();
|
|
44690
45260
|
var { GuildOnboardingPrompt } = require_GuildOnboardingPrompt();
|
|
@@ -45792,7 +46362,7 @@ var require_AutocompleteInteraction = __commonJS((exports, module) => {
|
|
|
45792
46362
|
|
|
45793
46363
|
// node_modules/discord.js/src/structures/InteractionCallback.js
|
|
45794
46364
|
var require_InteractionCallback = __commonJS((exports, module) => {
|
|
45795
|
-
var { DiscordSnowflake } =
|
|
46365
|
+
var { DiscordSnowflake } = require_cjs();
|
|
45796
46366
|
|
|
45797
46367
|
class InteractionCallback {
|
|
45798
46368
|
constructor(client, data) {
|
|
@@ -45851,7 +46421,7 @@ var require_InteractionCallbackResponse = __commonJS((exports, module) => {
|
|
|
45851
46421
|
|
|
45852
46422
|
// node_modules/discord.js/src/structures/InteractionResponse.js
|
|
45853
46423
|
var require_InteractionResponse = __commonJS((exports, module) => {
|
|
45854
|
-
var { DiscordSnowflake } =
|
|
46424
|
+
var { DiscordSnowflake } = require_cjs();
|
|
45855
46425
|
var { InteractionType } = require_v106();
|
|
45856
46426
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
45857
46427
|
|
|
@@ -46028,7 +46598,7 @@ var require_InteractionResponses = __commonJS((exports, module) => {
|
|
|
46028
46598
|
this.deferred = true;
|
|
46029
46599
|
return options.withResponse ? new InteractionCallbackResponse(this.client, response) : options.fetchReply ? this.fetchReply() : new InteractionResponse(this, this.message?.interactionMetadata?.id);
|
|
46030
46600
|
}
|
|
46031
|
-
async update(options) {
|
|
46601
|
+
async update(options = {}) {
|
|
46032
46602
|
if (this.deferred || this.replied)
|
|
46033
46603
|
throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
|
46034
46604
|
if (typeof options !== "string" && "fetchReply" in options) {
|
|
@@ -47475,7 +48045,7 @@ var require_VoiceStateUpdate = __commonJS((exports, module) => {
|
|
|
47475
48045
|
member = guild.members._add(data.member);
|
|
47476
48046
|
}
|
|
47477
48047
|
if (member?.user.id === client.user.id) {
|
|
47478
|
-
client.emit(
|
|
48048
|
+
client.emit(Events.Debug, `[VOICE] received voice state update: ${JSON.stringify(data)}`);
|
|
47479
48049
|
client.voice.onVoiceStateUpdate(data);
|
|
47480
48050
|
}
|
|
47481
48051
|
client.emit(Events.VoiceStateUpdate, oldState, newState);
|
|
@@ -48248,7 +48818,7 @@ var require_permessage_deflate2 = __commonJS((exports, module) => {
|
|
|
48248
48818
|
acceptAsServer(offers) {
|
|
48249
48819
|
const opts = this._options;
|
|
48250
48820
|
const accepted = offers.find((params) => {
|
|
48251
|
-
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
|
|
48821
|
+
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && (typeof params.client_max_window_bits === "number" ? opts.clientMaxWindowBits > params.client_max_window_bits : !params.client_max_window_bits)) {
|
|
48252
48822
|
return false;
|
|
48253
48823
|
}
|
|
48254
48824
|
return true;
|
|
@@ -48671,6 +49241,7 @@ var require_receiver2 = __commonJS((exports, module) => {
|
|
|
48671
49241
|
this._opcode = 0;
|
|
48672
49242
|
this._totalPayloadLength = 0;
|
|
48673
49243
|
this._messageLength = 0;
|
|
49244
|
+
this._numFragments = 0;
|
|
48674
49245
|
this._fragments = [];
|
|
48675
49246
|
this._errored = false;
|
|
48676
49247
|
this._loop = false;
|
|
@@ -48880,17 +49451,17 @@ var require_receiver2 = __commonJS((exports, module) => {
|
|
|
48880
49451
|
this.controlMessage(data, cb);
|
|
48881
49452
|
return;
|
|
48882
49453
|
}
|
|
49454
|
+
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
|
49455
|
+
const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
|
|
49456
|
+
cb(error);
|
|
49457
|
+
return;
|
|
49458
|
+
}
|
|
48883
49459
|
if (this._compressed) {
|
|
48884
49460
|
this._state = INFLATING;
|
|
48885
49461
|
this.decompress(data, cb);
|
|
48886
49462
|
return;
|
|
48887
49463
|
}
|
|
48888
49464
|
if (data.length) {
|
|
48889
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
48890
|
-
const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
|
|
48891
|
-
cb(error);
|
|
48892
|
-
return;
|
|
48893
|
-
}
|
|
48894
49465
|
this._messageLength = this._totalPayloadLength;
|
|
48895
49466
|
this._fragments.push(data);
|
|
48896
49467
|
}
|
|
@@ -48908,11 +49479,6 @@ var require_receiver2 = __commonJS((exports, module) => {
|
|
|
48908
49479
|
cb(error);
|
|
48909
49480
|
return;
|
|
48910
49481
|
}
|
|
48911
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
48912
|
-
const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
|
|
48913
|
-
cb(error);
|
|
48914
|
-
return;
|
|
48915
|
-
}
|
|
48916
49482
|
this._fragments.push(buf);
|
|
48917
49483
|
}
|
|
48918
49484
|
this.dataMessage(cb);
|
|
@@ -48930,6 +49496,7 @@ var require_receiver2 = __commonJS((exports, module) => {
|
|
|
48930
49496
|
this._totalPayloadLength = 0;
|
|
48931
49497
|
this._messageLength = 0;
|
|
48932
49498
|
this._fragmented = 0;
|
|
49499
|
+
this._numFragments = 0;
|
|
48933
49500
|
this._fragments = [];
|
|
48934
49501
|
if (this._opcode === 2) {
|
|
48935
49502
|
let data;
|
|
@@ -49756,11 +50323,23 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
49756
50323
|
this._isServer = false;
|
|
49757
50324
|
this._redirects = 0;
|
|
49758
50325
|
if (protocols === undefined) {
|
|
49759
|
-
protocols
|
|
50326
|
+
if (!options || options.protocols === undefined) {
|
|
50327
|
+
protocols = [];
|
|
50328
|
+
} else if (Array.isArray(options.protocols)) {
|
|
50329
|
+
protocols = options.protocols;
|
|
50330
|
+
} else {
|
|
50331
|
+
protocols = [options.protocols];
|
|
50332
|
+
}
|
|
49760
50333
|
} else if (!Array.isArray(protocols)) {
|
|
49761
50334
|
if (typeof protocols === "object" && protocols !== null) {
|
|
49762
50335
|
options = protocols;
|
|
49763
|
-
protocols
|
|
50336
|
+
if (options.protocols === undefined) {
|
|
50337
|
+
protocols = [];
|
|
50338
|
+
} else if (Array.isArray(options.protocols)) {
|
|
50339
|
+
protocols = options.protocols;
|
|
50340
|
+
} else {
|
|
50341
|
+
protocols = [options.protocols];
|
|
50342
|
+
}
|
|
49764
50343
|
} else {
|
|
49765
50344
|
protocols = [protocols];
|
|
49766
50345
|
}
|
|
@@ -49879,7 +50458,6 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
49879
50458
|
}
|
|
49880
50459
|
return;
|
|
49881
50460
|
}
|
|
49882
|
-
this._readyState = WebSocket.CLOSING;
|
|
49883
50461
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
49884
50462
|
if (err)
|
|
49885
50463
|
return;
|
|
@@ -49888,6 +50466,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
49888
50466
|
this._socket.end();
|
|
49889
50467
|
}
|
|
49890
50468
|
});
|
|
50469
|
+
this._readyState = WebSocket.CLOSING;
|
|
49891
50470
|
setCloseTimer(this);
|
|
49892
50471
|
}
|
|
49893
50472
|
pause() {
|
|
@@ -50064,8 +50643,8 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
50064
50643
|
autoPong: true,
|
|
50065
50644
|
closeTimeout: CLOSE_TIMEOUT,
|
|
50066
50645
|
protocolVersion: protocolVersions[1],
|
|
50067
|
-
maxBufferedChunks:
|
|
50068
|
-
maxFragments:
|
|
50646
|
+
maxBufferedChunks: 256 * 1024,
|
|
50647
|
+
maxFragments: 16 * 1024,
|
|
50069
50648
|
maxPayload: 100 * 1024 * 1024,
|
|
50070
50649
|
skipUTF8Validation: false,
|
|
50071
50650
|
perMessageDeflate: true,
|
|
@@ -50075,6 +50654,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
50075
50654
|
socketPath: undefined,
|
|
50076
50655
|
hostname: undefined,
|
|
50077
50656
|
protocol: undefined,
|
|
50657
|
+
protocols: undefined,
|
|
50078
50658
|
timeout: undefined,
|
|
50079
50659
|
method: "GET",
|
|
50080
50660
|
host: undefined,
|
|
@@ -50641,8 +51221,8 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
50641
51221
|
options = {
|
|
50642
51222
|
allowSynchronousEvents: true,
|
|
50643
51223
|
autoPong: true,
|
|
50644
|
-
maxBufferedChunks:
|
|
50645
|
-
maxFragments:
|
|
51224
|
+
maxBufferedChunks: 256 * 1024,
|
|
51225
|
+
maxFragments: 16 * 1024,
|
|
50646
51226
|
maxPayload: 100 * 1024 * 1024,
|
|
50647
51227
|
skipUTF8Validation: false,
|
|
50648
51228
|
perMessageDeflate: false,
|
|
@@ -50953,7 +51533,7 @@ var require_ws = __commonJS((exports, module) => {
|
|
|
50953
51533
|
|
|
50954
51534
|
// node_modules/@discordjs/ws/dist/index.js
|
|
50955
51535
|
var require_dist10 = __commonJS((exports, module) => {
|
|
50956
|
-
var __dirname = "/
|
|
51536
|
+
var __dirname = "/home/dev/projetos/package/node_modules/@discordjs/ws/dist";
|
|
50957
51537
|
var __create2 = Object.create;
|
|
50958
51538
|
var __defProp2 = Object.defineProperty;
|
|
50959
51539
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -53109,9 +53689,15 @@ var require_VOICE_CHANNEL_EFFECT_SEND = __commonJS((exports, module) => {
|
|
|
53109
53689
|
|
|
53110
53690
|
// node_modules/discord.js/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js
|
|
53111
53691
|
var require_VOICE_SERVER_UPDATE = __commonJS((exports, module) => {
|
|
53112
|
-
|
|
53113
|
-
|
|
53114
|
-
client.voice.
|
|
53692
|
+
var Events = require_Events();
|
|
53693
|
+
module.exports = (client, { d: data }) => {
|
|
53694
|
+
client.emit(Events.Debug, `[VOICE] received voice server: ${JSON.stringify({ ...data, token: "*".repeat(data.token.length) })}`);
|
|
53695
|
+
client.voice.onVoiceServer(data);
|
|
53696
|
+
client.emit(Events.VoiceServerUpdate, {
|
|
53697
|
+
guildId: data.guild_id,
|
|
53698
|
+
endpoint: data.endpoint,
|
|
53699
|
+
token: data.token
|
|
53700
|
+
});
|
|
53115
53701
|
};
|
|
53116
53702
|
});
|
|
53117
53703
|
|
|
@@ -53830,7 +54416,7 @@ var require_GuildPreviewEmoji = __commonJS((exports, module) => {
|
|
|
53830
54416
|
// node_modules/discord.js/src/structures/GuildPreview.js
|
|
53831
54417
|
var require_GuildPreview = __commonJS((exports, module) => {
|
|
53832
54418
|
var { Collection } = require_dist6();
|
|
53833
|
-
var { DiscordSnowflake } =
|
|
54419
|
+
var { DiscordSnowflake } = require_cjs();
|
|
53834
54420
|
var { Routes } = require_v106();
|
|
53835
54421
|
var Base = require_Base();
|
|
53836
54422
|
var GuildPreviewEmoji = require_GuildPreviewEmoji();
|
|
@@ -54582,7 +55168,7 @@ var require_GuildMemberManager = __commonJS((exports, module) => {
|
|
|
54582
55168
|
var { Collection } = require_dist6();
|
|
54583
55169
|
var { makeURLSearchParams } = require_dist5();
|
|
54584
55170
|
var { GatewayRateLimitError } = require_dist();
|
|
54585
|
-
var { DiscordSnowflake } =
|
|
55171
|
+
var { DiscordSnowflake } = require_cjs();
|
|
54586
55172
|
var { Routes, GatewayOpcodes, GatewayDispatchEvents } = require_v106();
|
|
54587
55173
|
var CachedManager = require_CachedManager();
|
|
54588
55174
|
var { DiscordjsError, DiscordjsTypeError, DiscordjsRangeError, ErrorCodes } = require_errors2();
|
|
@@ -55007,7 +55593,7 @@ var require_GuildScheduledEventManager = __commonJS((exports, module) => {
|
|
|
55007
55593
|
|
|
55008
55594
|
// node_modules/discord.js/src/structures/SoundboardSound.js
|
|
55009
55595
|
var require_SoundboardSound = __commonJS((exports) => {
|
|
55010
|
-
var { DiscordSnowflake } =
|
|
55596
|
+
var { DiscordSnowflake } = require_cjs();
|
|
55011
55597
|
var Base = require_Base();
|
|
55012
55598
|
var { Emoji } = require_Emoji();
|
|
55013
55599
|
var { DiscordjsError, ErrorCodes } = require_errors2();
|
|
@@ -55482,6 +56068,10 @@ var require_RoleManager = __commonJS((exports, module) => {
|
|
|
55482
56068
|
throw error;
|
|
55483
56069
|
}
|
|
55484
56070
|
}
|
|
56071
|
+
async fetchMemberCounts() {
|
|
56072
|
+
const data = await this.client.rest.get(Routes.guildRoleMemberCounts(this.guild.id));
|
|
56073
|
+
return new Collection(Object.entries(data));
|
|
56074
|
+
}
|
|
55485
56075
|
async create(options = {}) {
|
|
55486
56076
|
let { permissions, icon } = options;
|
|
55487
56077
|
const { name, color, hoist, position, mentionable, reason, unicodeEmoji } = options;
|
|
@@ -55651,7 +56241,7 @@ var require_StageInstanceManager = __commonJS((exports, module) => {
|
|
|
55651
56241
|
if (typeof options !== "object")
|
|
55652
56242
|
throw new DiscordjsTypeError(ErrorCodes.InvalidType, "options", "object", true);
|
|
55653
56243
|
const { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = options;
|
|
55654
|
-
const guildScheduledEventId = guildScheduledEvent && this.resolveId(guildScheduledEvent);
|
|
56244
|
+
const guildScheduledEventId = guildScheduledEvent && this.guild.scheduledEvents.resolveId(guildScheduledEvent);
|
|
55655
56245
|
const data = await this.client.rest.post(Routes.stageInstances(), {
|
|
55656
56246
|
body: {
|
|
55657
56247
|
channel_id: channelId,
|
|
@@ -55754,7 +56344,7 @@ var require_SystemChannelFlagsBitField = __commonJS((exports, module) => {
|
|
|
55754
56344
|
var require_Guild = __commonJS((exports) => {
|
|
55755
56345
|
var { Collection } = require_dist6();
|
|
55756
56346
|
var { makeURLSearchParams } = require_dist5();
|
|
55757
|
-
var { DiscordSnowflake } =
|
|
56347
|
+
var { DiscordSnowflake } = require_cjs();
|
|
55758
56348
|
var { ChannelType, GuildPremiumTier, Routes, GuildFeature } = require_v106();
|
|
55759
56349
|
var AnonymousGuild = require_AnonymousGuild();
|
|
55760
56350
|
var GuildAuditLogs = require_GuildAuditLogs();
|
|
@@ -56050,6 +56640,9 @@ var require_Guild = __commonJS((exports) => {
|
|
|
56050
56640
|
return 96000;
|
|
56051
56641
|
}
|
|
56052
56642
|
}
|
|
56643
|
+
get maximumStageBitrate() {
|
|
56644
|
+
return 64000;
|
|
56645
|
+
}
|
|
56053
56646
|
async fetchIntegrations() {
|
|
56054
56647
|
const data = await this.client.rest.get(Routes.guildIntegrations(this.id));
|
|
56055
56648
|
return data.reduce((collection, integration) => collection.set(integration.id, new Integration(this.client, integration, this)), new Collection);
|
|
@@ -56705,7 +57298,7 @@ var require_ClientPresence = __commonJS((exports, module) => {
|
|
|
56705
57298
|
// node_modules/discord.js/src/structures/StickerPack.js
|
|
56706
57299
|
var require_StickerPack = __commonJS((exports, module) => {
|
|
56707
57300
|
var { Collection } = require_dist6();
|
|
56708
|
-
var { DiscordSnowflake } =
|
|
57301
|
+
var { DiscordSnowflake } = require_cjs();
|
|
56709
57302
|
var Base = require_Base();
|
|
56710
57303
|
var { Sticker } = require_Sticker();
|
|
56711
57304
|
|
|
@@ -57891,8 +58484,11 @@ var require_AttachmentBuilder = __commonJS((exports, module) => {
|
|
|
57891
58484
|
class AttachmentBuilder {
|
|
57892
58485
|
constructor(attachment, data = {}) {
|
|
57893
58486
|
this.attachment = attachment;
|
|
57894
|
-
this.name = data.name;
|
|
57895
|
-
this.description = data.description;
|
|
58487
|
+
this.name = data.name ?? null;
|
|
58488
|
+
this.description = data.description ?? null;
|
|
58489
|
+
this.title = data.title ?? null;
|
|
58490
|
+
this.waveform = data.waveform ?? null;
|
|
58491
|
+
this.duration = data.duration ?? null;
|
|
57896
58492
|
}
|
|
57897
58493
|
setDescription(description) {
|
|
57898
58494
|
this.description = description;
|
|
@@ -57906,6 +58502,18 @@ var require_AttachmentBuilder = __commonJS((exports, module) => {
|
|
|
57906
58502
|
this.name = name;
|
|
57907
58503
|
return this;
|
|
57908
58504
|
}
|
|
58505
|
+
setTitle(title) {
|
|
58506
|
+
this.title = title;
|
|
58507
|
+
return this;
|
|
58508
|
+
}
|
|
58509
|
+
setWaveform(waveform) {
|
|
58510
|
+
this.waveform = waveform;
|
|
58511
|
+
return this;
|
|
58512
|
+
}
|
|
58513
|
+
setDuration(duration) {
|
|
58514
|
+
this.duration = duration;
|
|
58515
|
+
return this;
|
|
58516
|
+
}
|
|
57909
58517
|
setSpoiler(spoiler = true) {
|
|
57910
58518
|
if (spoiler === this.spoiler)
|
|
57911
58519
|
return this;
|
|
@@ -58091,7 +58699,7 @@ var require_src = __commonJS((exports) => {
|
|
|
58091
58699
|
exports.ShardEvents = require_ShardEvents();
|
|
58092
58700
|
exports.SKUFlagsBitField = require_SKUFlagsBitField().SKUFlagsBitField;
|
|
58093
58701
|
exports.Status = require_Status();
|
|
58094
|
-
exports.SnowflakeUtil =
|
|
58702
|
+
exports.SnowflakeUtil = require_cjs().DiscordSnowflake;
|
|
58095
58703
|
exports.Sweepers = require_Sweepers();
|
|
58096
58704
|
exports.SystemChannelFlagsBitField = require_SystemChannelFlagsBitField();
|
|
58097
58705
|
exports.ThreadMemberFlagsBitField = require_ThreadMemberFlagsBitField();
|
|
@@ -58143,11 +58751,14 @@ var require_src = __commonJS((exports) => {
|
|
|
58143
58751
|
exports.ActionRow = require_ActionRow();
|
|
58144
58752
|
exports.ActionRowBuilder = require_ActionRowBuilder();
|
|
58145
58753
|
exports.Activity = require_Presence().Activity;
|
|
58754
|
+
exports.ActivityInstance = require_ActivityInstance().ActivityInstance;
|
|
58755
|
+
exports.ActivityLocation = require_ActivityLocation().ActivityLocation;
|
|
58146
58756
|
exports.AnonymousGuild = require_AnonymousGuild();
|
|
58147
58757
|
exports.Application = require_Application();
|
|
58148
58758
|
exports.ApplicationCommand = require_ApplicationCommand();
|
|
58149
58759
|
exports.ApplicationEmoji = require_ApplicationEmoji();
|
|
58150
58760
|
exports.ApplicationRoleConnectionMetadata = require_ApplicationRoleConnectionMetadata().ApplicationRoleConnectionMetadata;
|
|
58761
|
+
exports.AuthorizingIntegrationOwners = require_AuthorizingIntegrationOwners();
|
|
58151
58762
|
exports.AutocompleteInteraction = require_AutocompleteInteraction();
|
|
58152
58763
|
exports.AutoModerationActionExecution = require_AutoModerationActionExecution();
|
|
58153
58764
|
exports.AutoModerationRule = require_AutoModerationRule();
|
|
@@ -58295,113 +58906,369 @@ var require_src = __commonJS((exports) => {
|
|
|
58295
58906
|
__exportStar(require_dist10(), exports);
|
|
58296
58907
|
});
|
|
58297
58908
|
|
|
58298
|
-
// src/core/ui/builders
|
|
58909
|
+
// src/core/ui/builders.ts
|
|
58910
|
+
var import_discord2 = __toESM(require_src(), 1);
|
|
58911
|
+
|
|
58912
|
+
// src/core/ui/normalize.ts
|
|
58299
58913
|
var import_discord = __toESM(require_src(), 1);
|
|
58300
58914
|
|
|
58301
|
-
// src/core/ui/
|
|
58302
|
-
|
|
58915
|
+
// src/core/ui/validate.ts
|
|
58916
|
+
var HTTP_URL_PATTERN = /^https?:\/\/.+/i;
|
|
58917
|
+
var ATTACHMENT_URL_PATTERN = /^attachment:\/\/.+/i;
|
|
58918
|
+
var HEX_COLOR_PATTERN = /^(?:#|0x)?([0-9a-fA-F]{6})$/;
|
|
58919
|
+
function has_length_between(value, min, max) {
|
|
58920
|
+
if (value === undefined)
|
|
58921
|
+
return false;
|
|
58922
|
+
return value.length >= min && value.length <= max;
|
|
58923
|
+
}
|
|
58924
|
+
var validate = {
|
|
58925
|
+
components(components) {
|
|
58926
|
+
if (components.length > 40) {
|
|
58927
|
+
throw new Error("A message cannot contain more than 40 components.");
|
|
58928
|
+
}
|
|
58929
|
+
},
|
|
58930
|
+
text(content) {
|
|
58931
|
+
if (content.length > 4000) {
|
|
58932
|
+
throw new Error("Display text cannot exceed 4000 characters.");
|
|
58933
|
+
}
|
|
58934
|
+
},
|
|
58935
|
+
url(url) {
|
|
58936
|
+
if (!HTTP_URL_PATTERN.test(url)) {
|
|
58937
|
+
throw new Error("URL must start with http:// or https://");
|
|
58938
|
+
}
|
|
58939
|
+
},
|
|
58940
|
+
attachment_url(url) {
|
|
58941
|
+
if (!ATTACHMENT_URL_PATTERN.test(url)) {
|
|
58942
|
+
throw new Error("File URL must start with attachment://");
|
|
58943
|
+
}
|
|
58944
|
+
},
|
|
58945
|
+
button(button) {
|
|
58946
|
+
if (!has_length_between(button.label, 1, 80)) {
|
|
58947
|
+
throw new Error("Button label must have between 1 and 80 characters.");
|
|
58948
|
+
}
|
|
58949
|
+
if (!has_length_between(button.customId, 1, 100)) {
|
|
58950
|
+
throw new Error("Button custom id must have between 1 and 100 characters.");
|
|
58951
|
+
}
|
|
58952
|
+
},
|
|
58953
|
+
row(components) {
|
|
58954
|
+
if (components.length < 1 || components.length > 5) {
|
|
58955
|
+
throw new Error("Action row must contain between 1 and 5 components.");
|
|
58956
|
+
}
|
|
58957
|
+
const select_count = components.filter((component) => !("label" in component)).length;
|
|
58958
|
+
if (select_count > 0 && components.length > 1) {
|
|
58959
|
+
throw new Error("Select menus must be alone in an action row (max width layout rule).");
|
|
58960
|
+
}
|
|
58961
|
+
},
|
|
58962
|
+
select(select) {
|
|
58963
|
+
if (!has_length_between(select.id, 1, 100)) {
|
|
58964
|
+
throw new Error("Select custom id must have between 1 and 100 characters.");
|
|
58965
|
+
}
|
|
58966
|
+
if (select.placeholder !== undefined && select.placeholder.length > 150) {
|
|
58967
|
+
throw new Error("Select placeholder cannot exceed 150 characters.");
|
|
58968
|
+
}
|
|
58969
|
+
if (select.minValues !== undefined && select.minValues < 0) {
|
|
58970
|
+
throw new Error("Select minValues cannot be negative.");
|
|
58971
|
+
}
|
|
58972
|
+
if (select.maxValues !== undefined && select.maxValues < 1) {
|
|
58973
|
+
throw new Error("Select maxValues must be at least 1.");
|
|
58974
|
+
}
|
|
58975
|
+
if (select.minValues !== undefined && select.maxValues !== undefined && select.minValues > select.maxValues) {
|
|
58976
|
+
throw new Error("Select minValues cannot exceed maxValues.");
|
|
58977
|
+
}
|
|
58978
|
+
if (select.type === "select.string") {
|
|
58979
|
+
if (select.options.length < 1 || select.options.length > 25) {
|
|
58980
|
+
throw new Error("String select must contain between 1 and 25 options.");
|
|
58981
|
+
}
|
|
58982
|
+
for (const option of select.options) {
|
|
58983
|
+
if (!has_length_between(option.label, 1, 100)) {
|
|
58984
|
+
throw new Error("String select option labels must have between 1 and 100 characters.");
|
|
58985
|
+
}
|
|
58986
|
+
if (!has_length_between(option.value, 1, 100)) {
|
|
58987
|
+
throw new Error("String select option values must have between 1 and 100 characters.");
|
|
58988
|
+
}
|
|
58989
|
+
if (option.description !== undefined && option.description.length > 100) {
|
|
58990
|
+
throw new Error("String select option descriptions cannot exceed 100 characters.");
|
|
58991
|
+
}
|
|
58992
|
+
}
|
|
58993
|
+
}
|
|
58994
|
+
},
|
|
58995
|
+
section(section) {
|
|
58996
|
+
if (section.texts.length < 1 || section.texts.length > 3) {
|
|
58997
|
+
throw new Error("Section must contain between 1 and 3 text blocks.");
|
|
58998
|
+
}
|
|
58999
|
+
},
|
|
59000
|
+
color(color) {
|
|
59001
|
+
if (typeof color === "number") {
|
|
59002
|
+
if (!Number.isInteger(color) || color < 0 || color > 16777215) {
|
|
59003
|
+
throw new Error("Container color must be an integer between 0x000000 and 0xFFFFFF.");
|
|
59004
|
+
}
|
|
59005
|
+
return color;
|
|
59006
|
+
}
|
|
59007
|
+
const match = color.match(HEX_COLOR_PATTERN);
|
|
59008
|
+
if (!match) {
|
|
59009
|
+
throw new Error("Container accent_color must be a number (0x000000-0xFFFFFF) or hex string (#000000, 0x000000, 000000).");
|
|
59010
|
+
}
|
|
59011
|
+
const hex = match[1];
|
|
59012
|
+
if (hex === undefined) {
|
|
59013
|
+
throw new Error("Invalid accent color hex value.");
|
|
59014
|
+
}
|
|
59015
|
+
return Number.parseInt(hex, 16);
|
|
59016
|
+
},
|
|
59017
|
+
gallery(items) {
|
|
59018
|
+
if (items.length < 1 || items.length > 10) {
|
|
59019
|
+
throw new Error("Gallery must contain between 1 and 10 items.");
|
|
59020
|
+
}
|
|
59021
|
+
}
|
|
59022
|
+
};
|
|
59023
|
+
|
|
59024
|
+
// src/core/ui/normalize.ts
|
|
59025
|
+
var ATTACHMENTS = Symbol("ui.display.attachments");
|
|
59026
|
+
function is_container_child(component) {
|
|
59027
|
+
return component instanceof import_discord.TextDisplayBuilder || component instanceof import_discord.SeparatorBuilder || component instanceof import_discord.SectionBuilder || component instanceof import_discord.MediaGalleryBuilder || component instanceof import_discord.FileBuilder || component instanceof import_discord.ActionRowBuilder;
|
|
59028
|
+
}
|
|
59029
|
+
function is_display_component(component) {
|
|
59030
|
+
return component instanceof import_discord.ContainerBuilder || is_container_child(component);
|
|
59031
|
+
}
|
|
59032
|
+
function build_button(button) {
|
|
59033
|
+
validate.button(button);
|
|
59034
|
+
const builder = new import_discord.ButtonBuilder().setLabel(button.label).setCustomId(button.customId).setStyle(button.style ?? import_discord.ButtonStyle.Primary);
|
|
59035
|
+
if (button.emoji) {
|
|
59036
|
+
builder.setEmoji({ name: button.emoji });
|
|
59037
|
+
}
|
|
59038
|
+
return builder;
|
|
59039
|
+
}
|
|
59040
|
+
function apply_button_data(builder, button) {
|
|
59041
|
+
builder.setLabel(button.label).setCustomId(button.customId).setStyle(button.style ?? import_discord.ButtonStyle.Primary);
|
|
59042
|
+
if (button.emoji) {
|
|
59043
|
+
builder.setEmoji({ name: button.emoji });
|
|
59044
|
+
}
|
|
59045
|
+
return builder;
|
|
59046
|
+
}
|
|
59047
|
+
function apply_select_base(builder, select) {
|
|
58303
59048
|
builder.setCustomId(select.id);
|
|
58304
|
-
if (select.placeholder)
|
|
59049
|
+
if (select.placeholder !== undefined) {
|
|
58305
59050
|
builder.setPlaceholder(select.placeholder);
|
|
58306
|
-
|
|
59051
|
+
}
|
|
59052
|
+
if (select.minValues !== undefined) {
|
|
58307
59053
|
builder.setMinValues(select.minValues);
|
|
58308
|
-
|
|
59054
|
+
}
|
|
59055
|
+
if (select.maxValues !== undefined) {
|
|
58309
59056
|
builder.setMaxValues(select.maxValues);
|
|
58310
|
-
|
|
59057
|
+
}
|
|
59058
|
+
if (select.disabled !== undefined) {
|
|
58311
59059
|
builder.setDisabled(select.disabled);
|
|
59060
|
+
}
|
|
58312
59061
|
return builder;
|
|
58313
59062
|
}
|
|
58314
|
-
|
|
58315
|
-
|
|
58316
|
-
|
|
58317
|
-
|
|
58318
|
-
|
|
58319
|
-
|
|
58320
|
-
|
|
58321
|
-
|
|
58322
|
-
|
|
59063
|
+
function build_select(select) {
|
|
59064
|
+
validate.select(select);
|
|
59065
|
+
switch (select.type) {
|
|
59066
|
+
case "select.user":
|
|
59067
|
+
return apply_select_base(new import_discord.UserSelectMenuBuilder, select);
|
|
59068
|
+
case "select.role":
|
|
59069
|
+
return apply_select_base(new import_discord.RoleSelectMenuBuilder, select);
|
|
59070
|
+
case "select.mentionable":
|
|
59071
|
+
return apply_select_base(new import_discord.MentionableSelectMenuBuilder, select);
|
|
59072
|
+
case "select.channel": {
|
|
59073
|
+
const builder = apply_select_base(new import_discord.ChannelSelectMenuBuilder, select);
|
|
59074
|
+
if (select.channelTypes?.length) {
|
|
59075
|
+
builder.setChannelTypes(...select.channelTypes);
|
|
59076
|
+
}
|
|
59077
|
+
return builder;
|
|
59078
|
+
}
|
|
59079
|
+
case "select.string": {
|
|
59080
|
+
const builder = apply_select_base(new import_discord.StringSelectMenuBuilder, select);
|
|
59081
|
+
builder.setOptions(...select.options.map((option) => ({
|
|
59082
|
+
label: option.label,
|
|
59083
|
+
value: option.value,
|
|
59084
|
+
...option.description !== undefined && {
|
|
59085
|
+
description: option.description
|
|
59086
|
+
},
|
|
59087
|
+
...option.default !== undefined && {
|
|
59088
|
+
default: option.default
|
|
59089
|
+
}
|
|
59090
|
+
})));
|
|
59091
|
+
return builder;
|
|
59092
|
+
}
|
|
58323
59093
|
}
|
|
58324
|
-
return name;
|
|
58325
59094
|
}
|
|
58326
|
-
|
|
58327
|
-
|
|
58328
|
-
return `${marker}${content}${marker}`;
|
|
59095
|
+
function build_row_component(component) {
|
|
59096
|
+
return "label" in component ? build_button(component) : build_select(component);
|
|
58329
59097
|
}
|
|
58330
|
-
function
|
|
58331
|
-
|
|
58332
|
-
|
|
58333
|
-
|
|
58334
|
-
|
|
58335
|
-
|
|
58336
|
-
|
|
58337
|
-
|
|
58338
|
-
continue;
|
|
59098
|
+
function build_gallery(items) {
|
|
59099
|
+
validate.gallery(items);
|
|
59100
|
+
const gallery = new import_discord.MediaGalleryBuilder;
|
|
59101
|
+
gallery.addItems(...items.map((item) => (media) => {
|
|
59102
|
+
validate.url(item.url);
|
|
59103
|
+
media.setURL(item.url);
|
|
59104
|
+
if (item.description !== undefined) {
|
|
59105
|
+
media.setDescription(item.description);
|
|
58339
59106
|
}
|
|
58340
|
-
|
|
59107
|
+
if (item.spoiler !== undefined) {
|
|
59108
|
+
media.setSpoiler(item.spoiler);
|
|
59109
|
+
}
|
|
59110
|
+
return media;
|
|
59111
|
+
}));
|
|
59112
|
+
return gallery;
|
|
59113
|
+
}
|
|
59114
|
+
function build_file(file_input) {
|
|
59115
|
+
validate.attachment_url(file_input.url);
|
|
59116
|
+
const file = new import_discord.FileBuilder().setURL(file_input.url);
|
|
59117
|
+
if (file_input.spoiler !== undefined) {
|
|
59118
|
+
file.setSpoiler(file_input.spoiler);
|
|
58341
59119
|
}
|
|
58342
|
-
return
|
|
59120
|
+
return file;
|
|
58343
59121
|
}
|
|
58344
|
-
function
|
|
58345
|
-
|
|
59122
|
+
function build_easy_child(component) {
|
|
59123
|
+
switch (component.type) {
|
|
59124
|
+
case "text": {
|
|
59125
|
+
validate.text(component.content);
|
|
59126
|
+
return new import_discord.TextDisplayBuilder().setContent(component.content);
|
|
59127
|
+
}
|
|
59128
|
+
case "separator": {
|
|
59129
|
+
return new import_discord.SeparatorBuilder;
|
|
59130
|
+
}
|
|
59131
|
+
case "section": {
|
|
59132
|
+
validate.section(component);
|
|
59133
|
+
const section = new import_discord.SectionBuilder;
|
|
59134
|
+
section.addTextDisplayComponents(...component.texts.map((content) => {
|
|
59135
|
+
validate.text(content);
|
|
59136
|
+
return (text) => text.setContent(content);
|
|
59137
|
+
}));
|
|
59138
|
+
if (component.button) {
|
|
59139
|
+
section.setButtonAccessory((button) => apply_button_data(button, component.button));
|
|
59140
|
+
}
|
|
59141
|
+
if (component.thumbnail) {
|
|
59142
|
+
const thumbnail = component.thumbnail;
|
|
59143
|
+
validate.url(thumbnail.url);
|
|
59144
|
+
section.setThumbnailAccessory((thumb) => {
|
|
59145
|
+
thumb.setURL(thumbnail.url);
|
|
59146
|
+
if (thumbnail.description !== undefined) {
|
|
59147
|
+
thumb.setDescription(thumbnail.description);
|
|
59148
|
+
}
|
|
59149
|
+
if (thumbnail.spoiler !== undefined) {
|
|
59150
|
+
thumb.setSpoiler(thumbnail.spoiler);
|
|
59151
|
+
}
|
|
59152
|
+
return thumb;
|
|
59153
|
+
});
|
|
59154
|
+
}
|
|
59155
|
+
return section;
|
|
59156
|
+
}
|
|
59157
|
+
case "row": {
|
|
59158
|
+
validate.row(component.components);
|
|
59159
|
+
return new import_discord.ActionRowBuilder().addComponents(...component.components.map(build_row_component));
|
|
59160
|
+
}
|
|
59161
|
+
case "gallery": {
|
|
59162
|
+
return build_gallery(component.items);
|
|
59163
|
+
}
|
|
59164
|
+
case "file": {
|
|
59165
|
+
return build_file(component);
|
|
59166
|
+
}
|
|
59167
|
+
default: {
|
|
59168
|
+
throw new Error("Unknown container component.");
|
|
59169
|
+
}
|
|
59170
|
+
}
|
|
58346
59171
|
}
|
|
58347
|
-
function
|
|
58348
|
-
|
|
58349
|
-
|
|
59172
|
+
function to_container_child(component) {
|
|
59173
|
+
if (is_container_child(component)) {
|
|
59174
|
+
return component;
|
|
59175
|
+
}
|
|
59176
|
+
return build_easy_child(component);
|
|
58350
59177
|
}
|
|
58351
|
-
function
|
|
58352
|
-
|
|
58353
|
-
|
|
58354
|
-
|
|
58355
|
-
|
|
58356
|
-
if (options.italic)
|
|
58357
|
-
formatted = wrap(formatted, "*");
|
|
58358
|
-
if (options.bold)
|
|
58359
|
-
formatted = wrap(formatted, "**");
|
|
58360
|
-
if (typeof options.size === "number") {
|
|
58361
|
-
const prefix = options.size === 4 ? "-#" : "#".repeat(options.size);
|
|
58362
|
-
return `${prefix} ${formatted}`;
|
|
58363
|
-
}
|
|
58364
|
-
return formatted;
|
|
59178
|
+
function to_display_component(component) {
|
|
59179
|
+
if (is_display_component(component)) {
|
|
59180
|
+
return component;
|
|
59181
|
+
}
|
|
59182
|
+
return build_easy_child(component);
|
|
58365
59183
|
}
|
|
58366
|
-
function
|
|
58367
|
-
|
|
58368
|
-
`);
|
|
58369
|
-
const delimiter = getInlineCodeDelimiter(text);
|
|
58370
|
-
return `${delimiter}${text}${delimiter}`;
|
|
59184
|
+
function to_display_components(...components) {
|
|
59185
|
+
return components.map(to_display_component);
|
|
58371
59186
|
}
|
|
58372
|
-
function
|
|
58373
|
-
|
|
59187
|
+
function is_easy_file_input(component) {
|
|
59188
|
+
if (!component || typeof component !== "object" || Array.isArray(component)) {
|
|
59189
|
+
return false;
|
|
59190
|
+
}
|
|
59191
|
+
return "type" in component && component.type === "file";
|
|
58374
59192
|
}
|
|
58375
|
-
function
|
|
58376
|
-
return
|
|
59193
|
+
function get_container_attachments(container) {
|
|
59194
|
+
return container[ATTACHMENTS] ?? [];
|
|
58377
59195
|
}
|
|
58378
|
-
|
|
58379
|
-
|
|
58380
|
-
|
|
58381
|
-
|
|
58382
|
-
|
|
58383
|
-
return `${index + 1}. ${item}`;
|
|
59196
|
+
function collect_attachments_from_container_inputs(components) {
|
|
59197
|
+
const attachments = [];
|
|
59198
|
+
for (const component of components) {
|
|
59199
|
+
if (is_easy_file_input(component) && component.attachment !== undefined) {
|
|
59200
|
+
attachments.push(component.attachment);
|
|
58384
59201
|
}
|
|
58385
|
-
|
|
58386
|
-
|
|
59202
|
+
}
|
|
59203
|
+
return attachments;
|
|
59204
|
+
}
|
|
59205
|
+
function attach_container_attachments(container, attachments) {
|
|
59206
|
+
if (attachments.length === 0) {
|
|
59207
|
+
return container;
|
|
59208
|
+
}
|
|
59209
|
+
container[ATTACHMENTS] = attachments;
|
|
59210
|
+
return container;
|
|
59211
|
+
}
|
|
59212
|
+
function collect_attachments_from_display_inputs(components) {
|
|
59213
|
+
const attachments = [];
|
|
59214
|
+
for (const component of components) {
|
|
59215
|
+
if (component instanceof import_discord.ContainerBuilder) {
|
|
59216
|
+
attachments.push(...get_container_attachments(component));
|
|
59217
|
+
continue;
|
|
59218
|
+
}
|
|
59219
|
+
if (is_easy_file_input(component) && component.attachment !== undefined) {
|
|
59220
|
+
attachments.push(component.attachment);
|
|
59221
|
+
}
|
|
59222
|
+
}
|
|
59223
|
+
return attachments;
|
|
58387
59224
|
}
|
|
58388
|
-
|
|
58389
|
-
|
|
58390
|
-
|
|
58391
|
-
|
|
59225
|
+
function prepare_components(components) {
|
|
59226
|
+
const display_components = to_display_components(...components);
|
|
59227
|
+
validate.components(display_components);
|
|
59228
|
+
return {
|
|
59229
|
+
components: display_components,
|
|
59230
|
+
files: collect_attachments_from_display_inputs(components)
|
|
59231
|
+
};
|
|
59232
|
+
}
|
|
59233
|
+
|
|
59234
|
+
// src/core/ui/builders.ts
|
|
59235
|
+
function get_attachment_name(attachment) {
|
|
59236
|
+
if (!attachment || typeof attachment !== "object") {
|
|
59237
|
+
throw new Error("Attachment must be an object with a valid file name.");
|
|
58392
59238
|
}
|
|
58393
|
-
const
|
|
58394
|
-
|
|
59239
|
+
const candidate = attachment;
|
|
59240
|
+
const name = typeof candidate.name === "string" ? candidate.name : typeof candidate.data?.name === "string" ? candidate.data.name : undefined;
|
|
59241
|
+
if (!name) {
|
|
59242
|
+
throw new Error("Attachment name was not found. Define a name in AttachmentBuilder options.");
|
|
59243
|
+
}
|
|
59244
|
+
return name;
|
|
59245
|
+
}
|
|
59246
|
+
function build_easy_file(url, attachment_or_spoiler, spoiler = false) {
|
|
59247
|
+
const has_attachment = attachment_or_spoiler !== undefined && typeof attachment_or_spoiler !== "boolean";
|
|
59248
|
+
return create_file_component(url, has_attachment ? spoiler : attachment_or_spoiler ?? false, has_attachment ? attachment_or_spoiler : undefined);
|
|
58395
59249
|
}
|
|
58396
|
-
|
|
58397
|
-
|
|
59250
|
+
function create_file_component(url, spoiler, attachment) {
|
|
59251
|
+
return {
|
|
59252
|
+
type: "file",
|
|
59253
|
+
url,
|
|
59254
|
+
spoiler,
|
|
59255
|
+
...attachment !== undefined && { attachment }
|
|
59256
|
+
};
|
|
59257
|
+
}
|
|
59258
|
+
var file = Object.assign(build_easy_file, {
|
|
59259
|
+
fromAttachment(attachment, spoiler = false) {
|
|
59260
|
+
const name = get_attachment_name(attachment);
|
|
59261
|
+
return build_easy_file(`attachment://${name}`, attachment, spoiler);
|
|
59262
|
+
}
|
|
59263
|
+
});
|
|
59264
|
+
function is_container_options(value) {
|
|
58398
59265
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
58399
59266
|
return false;
|
|
58400
59267
|
}
|
|
58401
59268
|
return "color" in value;
|
|
58402
59269
|
}
|
|
58403
|
-
function
|
|
58404
|
-
if (
|
|
59270
|
+
function split_container_args(args) {
|
|
59271
|
+
if (is_container_options(args[0])) {
|
|
58405
59272
|
return {
|
|
58406
59273
|
options: args[0],
|
|
58407
59274
|
components: args.slice(1)
|
|
@@ -58412,569 +59279,128 @@ function splitContainerArgs(args) {
|
|
|
58412
59279
|
components: args
|
|
58413
59280
|
};
|
|
58414
59281
|
}
|
|
58415
|
-
|
|
58416
|
-
|
|
58417
|
-
|
|
58418
|
-
|
|
58419
|
-
|
|
58420
|
-
|
|
58421
|
-
}
|
|
58422
|
-
|
|
58423
|
-
return buildText(formatList(items, { ordered: true }));
|
|
58424
|
-
}
|
|
58425
|
-
function buildTextCode(content) {
|
|
58426
|
-
return buildText(formatInlineCode(content));
|
|
58427
|
-
}
|
|
58428
|
-
function buildTextQuote(input) {
|
|
58429
|
-
return buildText(formatQuote(input));
|
|
58430
|
-
}
|
|
58431
|
-
function buildTextSpoiler(input) {
|
|
58432
|
-
return buildText(formatSpoiler(input));
|
|
58433
|
-
}
|
|
58434
|
-
var text = Object.assign(buildText, {
|
|
58435
|
-
list: buildTextList,
|
|
58436
|
-
ordered: buildTextOrdered,
|
|
58437
|
-
code: buildTextCode,
|
|
58438
|
-
quote: buildTextQuote,
|
|
58439
|
-
spoiler: buildTextSpoiler
|
|
58440
|
-
});
|
|
58441
|
-
function separator(options = {}) {
|
|
58442
|
-
return new import_discord.SeparatorBuilder(options);
|
|
58443
|
-
}
|
|
58444
|
-
function divider(options = {}) {
|
|
58445
|
-
return separator(options);
|
|
58446
|
-
}
|
|
58447
|
-
function button(options) {
|
|
58448
|
-
return options;
|
|
58449
|
-
}
|
|
58450
|
-
function thumbnail(options) {
|
|
58451
|
-
return options;
|
|
58452
|
-
}
|
|
58453
|
-
function gallery(...items) {
|
|
58454
|
-
return { type: "gallery", items };
|
|
58455
|
-
}
|
|
58456
|
-
function image(options) {
|
|
58457
|
-
return options;
|
|
58458
|
-
}
|
|
58459
|
-
function row(...components) {
|
|
58460
|
-
return { type: "row", components };
|
|
58461
|
-
}
|
|
58462
|
-
function buildEasyFile(url, fileOrSpoiler, spoiler = false) {
|
|
58463
|
-
const hasFile = typeof fileOrSpoiler !== "boolean";
|
|
58464
|
-
return {
|
|
58465
|
-
type: "file",
|
|
58466
|
-
url,
|
|
58467
|
-
spoiler: hasFile ? spoiler : fileOrSpoiler ?? false,
|
|
58468
|
-
attachment: hasFile ? fileOrSpoiler : undefined
|
|
58469
|
-
};
|
|
58470
|
-
}
|
|
58471
|
-
function buildFile(url, fileOrSpoiler, spoiler = false) {
|
|
58472
|
-
return buildEasyFile(url, fileOrSpoiler, spoiler);
|
|
58473
|
-
}
|
|
58474
|
-
function fromAttachment(attachment, spoiler = false) {
|
|
58475
|
-
const name = getAttachmentName(attachment);
|
|
58476
|
-
return buildEasyFile(`attachment://${name}`, attachment, spoiler);
|
|
58477
|
-
}
|
|
58478
|
-
var file = Object.assign(buildFile, { fromAttachment });
|
|
58479
|
-
|
|
58480
|
-
// src/core/ui/builders/select.ts
|
|
58481
|
-
function createSelect(type, customId, opts) {
|
|
59282
|
+
function resolve_select_base(custom_id_or_opts, opts = {}) {
|
|
59283
|
+
if (typeof custom_id_or_opts === "string") {
|
|
59284
|
+
return {
|
|
59285
|
+
id: custom_id_or_opts,
|
|
59286
|
+
...opts
|
|
59287
|
+
};
|
|
59288
|
+
}
|
|
59289
|
+
const { customId, ...select_options } = custom_id_or_opts;
|
|
58482
59290
|
return {
|
|
58483
|
-
|
|
58484
|
-
...
|
|
59291
|
+
id: customId,
|
|
59292
|
+
...select_options
|
|
58485
59293
|
};
|
|
58486
59294
|
}
|
|
58487
|
-
function
|
|
58488
|
-
const { customId, ...selectOptions } = customIdOrOpts;
|
|
59295
|
+
function create_select(type, custom_id_or_opts, opts) {
|
|
58489
59296
|
return {
|
|
58490
59297
|
type,
|
|
58491
|
-
...
|
|
59298
|
+
...typeof custom_id_or_opts === "string" ? resolve_select_base(custom_id_or_opts, opts) : resolve_select_base(custom_id_or_opts)
|
|
58492
59299
|
};
|
|
58493
59300
|
}
|
|
58494
|
-
function
|
|
58495
|
-
function build(
|
|
58496
|
-
return typeof
|
|
59301
|
+
function create_simple_select_builder(type) {
|
|
59302
|
+
function build(custom_id_or_opts, opts) {
|
|
59303
|
+
return typeof custom_id_or_opts === "string" ? create_select(type, custom_id_or_opts, opts) : create_select(type, custom_id_or_opts);
|
|
58497
59304
|
}
|
|
58498
59305
|
return build;
|
|
58499
59306
|
}
|
|
58500
|
-
var
|
|
58501
|
-
var
|
|
58502
|
-
var
|
|
58503
|
-
function
|
|
58504
|
-
|
|
58505
|
-
}
|
|
58506
|
-
function role(customIdOrOpts, opts) {
|
|
58507
|
-
return typeof customIdOrOpts === "string" ? roleSelect(customIdOrOpts, opts) : roleSelect(customIdOrOpts);
|
|
58508
|
-
}
|
|
58509
|
-
function mentionable(customIdOrOpts, opts) {
|
|
58510
|
-
return typeof customIdOrOpts === "string" ? mentionableSelect(customIdOrOpts, opts) : mentionableSelect(customIdOrOpts);
|
|
58511
|
-
}
|
|
58512
|
-
function channel(customIdOrOpts, channelTypes, opts = {}) {
|
|
58513
|
-
if (typeof customIdOrOpts !== "string") {
|
|
58514
|
-
const { channelTypes: resolvedChannelTypes, ...select } = customIdOrOpts;
|
|
59307
|
+
var user_select = create_simple_select_builder("select.user");
|
|
59308
|
+
var role_select = create_simple_select_builder("select.role");
|
|
59309
|
+
var mentionable_select = create_simple_select_builder("select.mentionable");
|
|
59310
|
+
function channel_select(custom_id_or_opts, channel_types, opts = {}) {
|
|
59311
|
+
if (typeof custom_id_or_opts !== "string") {
|
|
59312
|
+
const { channelTypes, ...select_options } = custom_id_or_opts;
|
|
58515
59313
|
return {
|
|
58516
59314
|
type: "select.channel",
|
|
58517
|
-
...
|
|
58518
|
-
channelTypes
|
|
59315
|
+
...resolve_select_base(select_options),
|
|
59316
|
+
...channelTypes !== undefined && { channelTypes }
|
|
58519
59317
|
};
|
|
58520
59318
|
}
|
|
58521
|
-
const
|
|
59319
|
+
const has_channel_types = Array.isArray(channel_types);
|
|
59320
|
+
const resolved_opts = has_channel_types ? opts : channel_types;
|
|
58522
59321
|
return {
|
|
58523
59322
|
type: "select.channel",
|
|
58524
|
-
...
|
|
58525
|
-
|
|
59323
|
+
...resolve_select_base(custom_id_or_opts, resolved_opts),
|
|
59324
|
+
...has_channel_types && {
|
|
59325
|
+
channelTypes: channel_types
|
|
59326
|
+
}
|
|
58526
59327
|
};
|
|
58527
59328
|
}
|
|
58528
|
-
function
|
|
58529
|
-
if (typeof
|
|
58530
|
-
const { options:
|
|
59329
|
+
function string_select(custom_id_or_opts, options, opts = {}) {
|
|
59330
|
+
if (typeof custom_id_or_opts !== "string") {
|
|
59331
|
+
const { options: string_options, ...select_options } = custom_id_or_opts;
|
|
58531
59332
|
return {
|
|
58532
59333
|
type: "select.string",
|
|
58533
|
-
...
|
|
58534
|
-
options:
|
|
59334
|
+
...resolve_select_base(select_options),
|
|
59335
|
+
options: string_options
|
|
58535
59336
|
};
|
|
58536
59337
|
}
|
|
59338
|
+
const has_options = Array.isArray(options);
|
|
58537
59339
|
return {
|
|
58538
59340
|
type: "select.string",
|
|
58539
|
-
...
|
|
58540
|
-
options:
|
|
59341
|
+
...resolve_select_base(custom_id_or_opts, has_options ? opts : options),
|
|
59342
|
+
options: has_options ? options : []
|
|
58541
59343
|
};
|
|
58542
59344
|
}
|
|
58543
|
-
|
|
58544
|
-
// src/core/ui/builders/container.ts
|
|
58545
|
-
var import_discord6 = __toESM(require_src(), 1);
|
|
58546
|
-
|
|
58547
|
-
// src/core/ui/constants/limits.ts
|
|
58548
|
-
var MAX_MESSAGE_COMPONENTS = 40;
|
|
58549
|
-
var MAX_TEXT_LENGTH = 4000;
|
|
58550
|
-
var MAX_ROW_COMPONENTS = 5;
|
|
58551
|
-
var MAX_STRING_SELECT_OPTIONS = 25;
|
|
58552
|
-
var MAX_SELECT_PLACEHOLDER_LENGTH = 150;
|
|
58553
|
-
var MAX_SECTION_TEXTS = 3;
|
|
58554
|
-
var MAX_GALLERY_ITEMS = 10;
|
|
58555
|
-
var MAX_BUTTON_LABEL_LENGTH = 80;
|
|
58556
|
-
var MAX_BUTTON_CUSTOM_ID_LENGTH = 100;
|
|
58557
|
-
// src/core/ui/constants/patterns.ts
|
|
58558
|
-
var HTTP_URL_PATTERN = /^https?:\/\/.+/i;
|
|
58559
|
-
var ATTACHMENT_URL_PATTERN = /^attachment:\/\/.+/i;
|
|
58560
|
-
var HEX_COLOR_PATTERN = /^(?:#|0x)?([0-9a-fA-F]{6})$/;
|
|
58561
|
-
// src/core/ui/constants/symbols.ts
|
|
58562
|
-
var ATTACHMENTS = Symbol("ui.display.attachments");
|
|
58563
|
-
var RENDERED = Symbol("ui.display.rendered");
|
|
58564
|
-
var RENDERED_ATTACHMENTS = Symbol("ui.display.rendered.attachments");
|
|
58565
|
-
// src/core/ui/validators/container.ts
|
|
58566
|
-
function validateComponents(components) {
|
|
58567
|
-
if (components.length > MAX_MESSAGE_COMPONENTS) {
|
|
58568
|
-
throw new Error("A message cannot contain more than 40 components.");
|
|
58569
|
-
}
|
|
58570
|
-
}
|
|
58571
|
-
function validateText(content) {
|
|
58572
|
-
if (content.length > MAX_TEXT_LENGTH) {
|
|
58573
|
-
throw new Error("Display text cannot exceed 4000 characters.");
|
|
58574
|
-
}
|
|
58575
|
-
}
|
|
58576
|
-
function validateUrl(url) {
|
|
58577
|
-
if (!HTTP_URL_PATTERN.test(url)) {
|
|
58578
|
-
throw new Error("URL must start with http:// or https://");
|
|
58579
|
-
}
|
|
58580
|
-
}
|
|
58581
|
-
function validateAttachmentUrl(url) {
|
|
58582
|
-
if (!ATTACHMENT_URL_PATTERN.test(url)) {
|
|
58583
|
-
throw new Error("File URL must start with attachment://");
|
|
58584
|
-
}
|
|
58585
|
-
}
|
|
58586
|
-
function validateRow(components) {
|
|
58587
|
-
if (components.length < 1 || components.length > MAX_ROW_COMPONENTS) {
|
|
58588
|
-
throw new Error("Action row must contain between 1 and 5 components.");
|
|
58589
|
-
}
|
|
58590
|
-
const selectCount = components.filter((component) => !("label" in component)).length;
|
|
58591
|
-
if (selectCount > 0 && components.length > 1) {
|
|
58592
|
-
throw new Error("Select menus must be alone in an action row (max width layout rule).");
|
|
58593
|
-
}
|
|
58594
|
-
}
|
|
58595
|
-
function validateSection(section) {
|
|
58596
|
-
if (section.texts.length < 1 || section.texts.length > MAX_SECTION_TEXTS) {
|
|
58597
|
-
throw new Error("Section must contain between 1 and 3 text blocks.");
|
|
58598
|
-
}
|
|
58599
|
-
}
|
|
58600
|
-
function validateColor(color) {
|
|
58601
|
-
if (typeof color === "number") {
|
|
58602
|
-
if (!Number.isInteger(color) || color < 0 || color > 16777215) {
|
|
58603
|
-
throw new Error("Container color must be an integer between 0x000000 and 0xFFFFFF.");
|
|
58604
|
-
}
|
|
58605
|
-
return color;
|
|
58606
|
-
}
|
|
58607
|
-
const match = color.match(HEX_COLOR_PATTERN);
|
|
58608
|
-
if (!match) {
|
|
58609
|
-
throw new Error("Container accentColor must be a number (0x000000-0xFFFFFF) or hex string (#000000, 0x000000, 000000).");
|
|
58610
|
-
}
|
|
58611
|
-
const hex = match[1];
|
|
58612
|
-
if (!hex) {
|
|
58613
|
-
throw new Error("Invalid accent color hex value.");
|
|
58614
|
-
}
|
|
58615
|
-
return Number.parseInt(hex, 16);
|
|
58616
|
-
}
|
|
58617
|
-
function validateGallery(items) {
|
|
58618
|
-
if (items.length < 1 || items.length > MAX_GALLERY_ITEMS) {
|
|
58619
|
-
throw new Error("Gallery must contain between 1 and 10 items.");
|
|
58620
|
-
}
|
|
58621
|
-
}
|
|
58622
|
-
|
|
58623
|
-
// src/core/ui/validators/button.ts
|
|
58624
|
-
function hasLengthBetween(value, min, max) {
|
|
58625
|
-
if (!value)
|
|
58626
|
-
return false;
|
|
58627
|
-
return value.length >= min && value.length <= max;
|
|
58628
|
-
}
|
|
58629
|
-
function validateButton(button2) {
|
|
58630
|
-
if (!hasLengthBetween(button2.label, 1, MAX_BUTTON_LABEL_LENGTH)) {
|
|
58631
|
-
throw new Error("Button label must have between 1 and 80 characters.");
|
|
58632
|
-
}
|
|
58633
|
-
if (!hasLengthBetween(button2.customId, 1, MAX_BUTTON_CUSTOM_ID_LENGTH)) {
|
|
58634
|
-
throw new Error("Button custom id must have between 1 and 100 characters.");
|
|
58635
|
-
}
|
|
58636
|
-
}
|
|
58637
|
-
|
|
58638
|
-
// src/core/ui/validators/select.ts
|
|
58639
|
-
function hasLengthBetween2(value, min, max) {
|
|
58640
|
-
if (!value)
|
|
58641
|
-
return false;
|
|
58642
|
-
return value.length >= min && value.length <= max;
|
|
58643
|
-
}
|
|
58644
|
-
function validateSelect(select) {
|
|
58645
|
-
if (!hasLengthBetween2(select.id, 1, 100)) {
|
|
58646
|
-
throw new Error("Select custom id must have between 1 and 100 characters.");
|
|
58647
|
-
}
|
|
58648
|
-
if (select.placeholder && select.placeholder.length > MAX_SELECT_PLACEHOLDER_LENGTH) {
|
|
58649
|
-
throw new Error("Select placeholder cannot exceed 150 characters.");
|
|
58650
|
-
}
|
|
58651
|
-
if (select.type === "select.string") {
|
|
58652
|
-
if (select.options.length < 1 || select.options.length > MAX_STRING_SELECT_OPTIONS) {
|
|
58653
|
-
throw new Error("String select must contain between 1 and 25 options.");
|
|
58654
|
-
}
|
|
58655
|
-
}
|
|
58656
|
-
}
|
|
58657
|
-
|
|
58658
|
-
// src/core/ui/validators/index.ts
|
|
58659
|
-
var validate = {
|
|
58660
|
-
components: validateComponents,
|
|
58661
|
-
text: validateText,
|
|
58662
|
-
url: validateUrl,
|
|
58663
|
-
attachmentUrl: validateAttachmentUrl,
|
|
58664
|
-
button: validateButton,
|
|
58665
|
-
row: validateRow,
|
|
58666
|
-
select: validateSelect,
|
|
58667
|
-
section: validateSection,
|
|
58668
|
-
color: validateColor,
|
|
58669
|
-
gallery: validateGallery
|
|
58670
|
-
};
|
|
58671
|
-
|
|
58672
|
-
// src/core/ui/normalizers/button.ts
|
|
58673
|
-
var import_discord2 = __toESM(require_src(), 1);
|
|
58674
|
-
function normalizeButton(button2) {
|
|
58675
|
-
validateButton(button2);
|
|
58676
|
-
const built = new import_discord2.ButtonBuilder().setLabel(button2.label).setCustomId(button2.customId).setStyle(button2.style ?? import_discord2.ButtonStyle.Primary);
|
|
58677
|
-
if (button2.emoji) {
|
|
58678
|
-
built.setEmoji({ name: button2.emoji });
|
|
58679
|
-
}
|
|
58680
|
-
return built;
|
|
58681
|
-
}
|
|
58682
|
-
function applyButtonData(button2, data) {
|
|
58683
|
-
button2.setLabel(data.label).setCustomId(data.customId).setStyle(data.style ?? import_discord2.ButtonStyle.Primary);
|
|
58684
|
-
if (data.emoji) {
|
|
58685
|
-
button2.setEmoji({ name: data.emoji });
|
|
58686
|
-
}
|
|
58687
|
-
return button2;
|
|
58688
|
-
}
|
|
58689
|
-
// src/core/ui/normalizers/container.ts
|
|
58690
|
-
var import_discord5 = __toESM(require_src(), 1);
|
|
58691
|
-
|
|
58692
|
-
// src/core/ui/normalizers/media.ts
|
|
58693
|
-
var import_discord3 = __toESM(require_src(), 1);
|
|
58694
|
-
function normalizeGallery(items) {
|
|
58695
|
-
validateGallery(items);
|
|
58696
|
-
const gallery2 = new import_discord3.MediaGalleryBuilder;
|
|
58697
|
-
gallery2.addItems(...items.map((item) => (media) => {
|
|
58698
|
-
validateUrl(item.url);
|
|
58699
|
-
media.setURL(item.url);
|
|
58700
|
-
if (item.description)
|
|
58701
|
-
media.setDescription(item.description);
|
|
58702
|
-
if (item.spoiler)
|
|
58703
|
-
media.setSpoiler(item.spoiler);
|
|
58704
|
-
return media;
|
|
58705
|
-
}));
|
|
58706
|
-
return gallery2;
|
|
58707
|
-
}
|
|
58708
|
-
function normalizeFile(fileInput) {
|
|
58709
|
-
validateAttachmentUrl(fileInput.url);
|
|
58710
|
-
const file2 = new import_discord3.FileBuilder().setURL(fileInput.url);
|
|
58711
|
-
if (fileInput.spoiler)
|
|
58712
|
-
file2.setSpoiler(fileInput.spoiler);
|
|
58713
|
-
return file2;
|
|
58714
|
-
}
|
|
58715
|
-
|
|
58716
|
-
// src/core/ui/normalizers/select.ts
|
|
58717
|
-
var import_discord4 = __toESM(require_src(), 1);
|
|
58718
|
-
function normalizeUserSelect(select) {
|
|
58719
|
-
validateSelect({ type: "select.user", ...select });
|
|
58720
|
-
return applySelectBase(new import_discord4.UserSelectMenuBuilder, select);
|
|
58721
|
-
}
|
|
58722
|
-
function normalizeRoleSelect(select) {
|
|
58723
|
-
validateSelect({ type: "select.role", ...select });
|
|
58724
|
-
return applySelectBase(new import_discord4.RoleSelectMenuBuilder, select);
|
|
58725
|
-
}
|
|
58726
|
-
function normalizeMentionableSelect(select) {
|
|
58727
|
-
validateSelect({ type: "select.mentionable", ...select });
|
|
58728
|
-
return applySelectBase(new import_discord4.MentionableSelectMenuBuilder, select);
|
|
58729
|
-
}
|
|
58730
|
-
function normalizeChannelSelect(select) {
|
|
58731
|
-
validateSelect(select);
|
|
58732
|
-
const builder = applySelectBase(new import_discord4.ChannelSelectMenuBuilder, select);
|
|
58733
|
-
if (select.channelTypes?.length)
|
|
58734
|
-
builder.setChannelTypes(...select.channelTypes);
|
|
58735
|
-
return builder;
|
|
58736
|
-
}
|
|
58737
|
-
function normalizeStringSelect(select) {
|
|
58738
|
-
validateSelect(select);
|
|
58739
|
-
const builder = applySelectBase(new import_discord4.StringSelectMenuBuilder, select);
|
|
58740
|
-
builder.setOptions(...select.options.map((option) => ({
|
|
58741
|
-
label: option.label,
|
|
58742
|
-
value: option.value,
|
|
58743
|
-
description: option.description,
|
|
58744
|
-
default: option.default
|
|
58745
|
-
})));
|
|
58746
|
-
return builder;
|
|
58747
|
-
}
|
|
58748
|
-
function normalizeSelect(select) {
|
|
58749
|
-
switch (select.type) {
|
|
58750
|
-
case "select.user":
|
|
58751
|
-
return normalizeUserSelect(select);
|
|
58752
|
-
case "select.role":
|
|
58753
|
-
return normalizeRoleSelect(select);
|
|
58754
|
-
case "select.mentionable":
|
|
58755
|
-
return normalizeMentionableSelect(select);
|
|
58756
|
-
case "select.channel":
|
|
58757
|
-
return normalizeChannelSelect(select);
|
|
58758
|
-
case "select.string":
|
|
58759
|
-
return normalizeStringSelect(select);
|
|
58760
|
-
default:
|
|
58761
|
-
throw new Error("Unknown select type");
|
|
58762
|
-
}
|
|
58763
|
-
}
|
|
58764
|
-
|
|
58765
|
-
// src/core/ui/normalizers/container.ts
|
|
58766
|
-
function isContainerChild(component) {
|
|
58767
|
-
return component instanceof import_discord5.TextDisplayBuilder || component instanceof import_discord5.SeparatorBuilder || component instanceof import_discord5.SectionBuilder || component instanceof import_discord5.MediaGalleryBuilder || component instanceof import_discord5.FileBuilder || component instanceof import_discord5.ActionRowBuilder;
|
|
58768
|
-
}
|
|
58769
|
-
function isDisplayComponent(component) {
|
|
58770
|
-
return component instanceof import_discord5.ContainerBuilder || isContainerChild(component);
|
|
58771
|
-
}
|
|
58772
|
-
function isContainerNode(component) {
|
|
58773
|
-
return !isContainerChild(component);
|
|
58774
|
-
}
|
|
58775
|
-
function normalizeRowComponent(component) {
|
|
58776
|
-
return "label" in component ? normalizeButton(component) : normalizeSelect(component);
|
|
58777
|
-
}
|
|
58778
|
-
function normalizeText(component) {
|
|
58779
|
-
validateText(component.content);
|
|
58780
|
-
return new import_discord5.TextDisplayBuilder().setContent(component.content);
|
|
58781
|
-
}
|
|
58782
|
-
function normalizeSeparator(component) {
|
|
58783
|
-
const separator2 = new import_discord5.SeparatorBuilder;
|
|
58784
|
-
if (typeof component.spacing !== "undefined") {
|
|
58785
|
-
separator2.setSpacing(component.spacing);
|
|
58786
|
-
}
|
|
58787
|
-
if (typeof component.divider !== "undefined") {
|
|
58788
|
-
separator2.setDivider(component.divider);
|
|
58789
|
-
}
|
|
58790
|
-
return separator2;
|
|
58791
|
-
}
|
|
58792
|
-
function normalizeSection(component) {
|
|
58793
|
-
validateSection(component);
|
|
58794
|
-
const section = new import_discord5.SectionBuilder;
|
|
58795
|
-
section.addTextDisplayComponents(...component.texts.map((content) => {
|
|
58796
|
-
validateText(content);
|
|
58797
|
-
return (text2) => text2.setContent(content);
|
|
58798
|
-
}));
|
|
58799
|
-
if (component.button) {
|
|
58800
|
-
section.setButtonAccessory((button2) => applyButtonData(button2, component.button));
|
|
58801
|
-
}
|
|
58802
|
-
if (component.thumbnail) {
|
|
58803
|
-
const thumbnail2 = component.thumbnail;
|
|
58804
|
-
validateUrl(thumbnail2.url);
|
|
58805
|
-
section.setThumbnailAccessory((thumb) => {
|
|
58806
|
-
thumb.setURL(thumbnail2.url);
|
|
58807
|
-
if (thumbnail2.description)
|
|
58808
|
-
thumb.setDescription(thumbnail2.description);
|
|
58809
|
-
if (thumbnail2.spoiler)
|
|
58810
|
-
thumb.setSpoiler(thumbnail2.spoiler);
|
|
58811
|
-
return thumb;
|
|
58812
|
-
});
|
|
58813
|
-
}
|
|
58814
|
-
return section;
|
|
58815
|
-
}
|
|
58816
|
-
function normalizeRow(component) {
|
|
58817
|
-
validateRow(component.components);
|
|
58818
|
-
return new import_discord5.ActionRowBuilder().addComponents(...component.components.map(normalizeRowComponent));
|
|
58819
|
-
}
|
|
58820
|
-
function normalizeContainerNode(component) {
|
|
58821
|
-
switch (component.type) {
|
|
58822
|
-
case "text":
|
|
58823
|
-
return normalizeText(component);
|
|
58824
|
-
case "separator":
|
|
58825
|
-
return normalizeSeparator(component);
|
|
58826
|
-
case "section":
|
|
58827
|
-
return normalizeSection(component);
|
|
58828
|
-
case "row":
|
|
58829
|
-
return normalizeRow(component);
|
|
58830
|
-
case "gallery":
|
|
58831
|
-
return normalizeGallery(component.items);
|
|
58832
|
-
case "file":
|
|
58833
|
-
return normalizeFile(component);
|
|
58834
|
-
default:
|
|
58835
|
-
throw new Error("Unknown container component");
|
|
58836
|
-
}
|
|
58837
|
-
}
|
|
58838
|
-
function toContainerChild(component) {
|
|
58839
|
-
if (isContainerChild(component))
|
|
58840
|
-
return component;
|
|
58841
|
-
if (isContainerNode(component))
|
|
58842
|
-
return normalizeContainerNode(component);
|
|
58843
|
-
return component;
|
|
58844
|
-
}
|
|
58845
|
-
function toDisplayComponent(component) {
|
|
58846
|
-
if (isDisplayComponent(component))
|
|
58847
|
-
return component;
|
|
58848
|
-
return normalizeContainerNode(component);
|
|
58849
|
-
}
|
|
58850
|
-
function toDisplayComponents(...components) {
|
|
58851
|
-
return components.map(toDisplayComponent);
|
|
58852
|
-
}
|
|
58853
|
-
function createRenderedComponents(components, attachments) {
|
|
58854
|
-
const rendered = components;
|
|
58855
|
-
rendered[RENDERED] = true;
|
|
58856
|
-
if (attachments.length > 0) {
|
|
58857
|
-
rendered[RENDERED_ATTACHMENTS] = attachments;
|
|
58858
|
-
}
|
|
58859
|
-
return rendered;
|
|
58860
|
-
}
|
|
58861
|
-
function isRenderedComponents(value) {
|
|
58862
|
-
return Array.isArray(value) && value[RENDERED] === true;
|
|
58863
|
-
}
|
|
58864
|
-
function getRenderedComponentsAttachments(components) {
|
|
58865
|
-
return components[RENDERED_ATTACHMENTS] ?? [];
|
|
58866
|
-
}
|
|
58867
|
-
function isEasyFileInput(component) {
|
|
58868
|
-
if (!component || typeof component !== "object" || Array.isArray(component)) {
|
|
58869
|
-
return false;
|
|
58870
|
-
}
|
|
58871
|
-
const candidate = component;
|
|
58872
|
-
return candidate.type === "file";
|
|
58873
|
-
}
|
|
58874
|
-
function getContainerAttachments(container) {
|
|
58875
|
-
return container[ATTACHMENTS] ?? [];
|
|
58876
|
-
}
|
|
58877
|
-
function collectAttachmentsFromContainerInputs(components) {
|
|
58878
|
-
return components.filter((component) => isEasyFileInput(component)).map((fileInput) => fileInput.attachment).filter((attachment) => attachment !== undefined);
|
|
58879
|
-
}
|
|
58880
|
-
function attachContainerAttachments(container, attachments) {
|
|
58881
|
-
if (attachments.length === 0)
|
|
58882
|
-
return container;
|
|
58883
|
-
container[ATTACHMENTS] = attachments;
|
|
58884
|
-
return container;
|
|
58885
|
-
}
|
|
58886
|
-
function collectAttachmentsFromDisplayInputs(components) {
|
|
58887
|
-
const attachments = [];
|
|
58888
|
-
for (const component of components) {
|
|
58889
|
-
if (component instanceof import_discord5.ContainerBuilder) {
|
|
58890
|
-
attachments.push(...getContainerAttachments(component));
|
|
58891
|
-
continue;
|
|
58892
|
-
}
|
|
58893
|
-
if (isEasyFileInput(component) && component.attachment !== undefined) {
|
|
58894
|
-
attachments.push(component.attachment);
|
|
58895
|
-
}
|
|
58896
|
-
}
|
|
58897
|
-
return attachments;
|
|
58898
|
-
}
|
|
58899
|
-
// src/core/ui/builders/container.ts
|
|
58900
|
-
function section(texts, opts = {}) {
|
|
58901
|
-
return { type: "section", texts, ...opts };
|
|
58902
|
-
}
|
|
58903
|
-
function container(...args) {
|
|
58904
|
-
const { options, components } = splitContainerArgs(args);
|
|
58905
|
-
const container2 = new import_discord6.ContainerBuilder;
|
|
58906
|
-
container2.components.push(...components.map(toContainerChild));
|
|
58907
|
-
if (options.color !== undefined) {
|
|
58908
|
-
const accentColor = validate.color(options.color);
|
|
58909
|
-
container2.setAccentColor(accentColor);
|
|
58910
|
-
}
|
|
58911
|
-
const attachments = collectAttachmentsFromContainerInputs(components);
|
|
58912
|
-
return attachContainerAttachments(container2, attachments);
|
|
58913
|
-
}
|
|
58914
|
-
function render(...components) {
|
|
58915
|
-
const rendered = toDisplayComponents(...components);
|
|
58916
|
-
validate.components(rendered);
|
|
58917
|
-
const files = collectAttachmentsFromDisplayInputs(components);
|
|
58918
|
-
return createRenderedComponents(rendered, files);
|
|
58919
|
-
}
|
|
58920
|
-
function send(interaction, payload) {
|
|
58921
|
-
if (!isRenderedComponents(payload.components)) {
|
|
58922
|
-
throw new Error("Components must be created with ui.render(...).");
|
|
58923
|
-
}
|
|
58924
|
-
validate.components(payload.components);
|
|
58925
|
-
const flags = payload.ephemeral ? [import_discord6.MessageFlags.IsComponentsV2, import_discord6.MessageFlags.Ephemeral] : [import_discord6.MessageFlags.IsComponentsV2];
|
|
58926
|
-
const autoFiles = getRenderedComponentsAttachments(payload.components);
|
|
58927
|
-
const files = [...autoFiles, ...payload.files ?? []];
|
|
58928
|
-
return interaction.reply({
|
|
58929
|
-
flags,
|
|
58930
|
-
components: payload.components,
|
|
58931
|
-
...files.length ? { files } : {}
|
|
58932
|
-
});
|
|
58933
|
-
}
|
|
58934
|
-
|
|
58935
|
-
// src/core/ui/builders/index.ts
|
|
58936
59345
|
var ui = {
|
|
58937
|
-
text
|
|
58938
|
-
|
|
58939
|
-
|
|
58940
|
-
|
|
59346
|
+
text(content) {
|
|
59347
|
+
return {
|
|
59348
|
+
type: "text",
|
|
59349
|
+
content
|
|
59350
|
+
};
|
|
59351
|
+
},
|
|
59352
|
+
divider() {
|
|
59353
|
+
return {
|
|
59354
|
+
type: "separator"
|
|
59355
|
+
};
|
|
59356
|
+
},
|
|
59357
|
+
button(options) {
|
|
59358
|
+
return options;
|
|
59359
|
+
},
|
|
58941
59360
|
select: {
|
|
58942
|
-
user,
|
|
58943
|
-
string,
|
|
58944
|
-
role,
|
|
58945
|
-
channel,
|
|
58946
|
-
mentionable
|
|
59361
|
+
user: user_select,
|
|
59362
|
+
string: string_select,
|
|
59363
|
+
role: role_select,
|
|
59364
|
+
channel: channel_select,
|
|
59365
|
+
mentionable: mentionable_select
|
|
59366
|
+
},
|
|
59367
|
+
section(texts, opts = {}) {
|
|
59368
|
+
return {
|
|
59369
|
+
type: "section",
|
|
59370
|
+
texts,
|
|
59371
|
+
...opts
|
|
59372
|
+
};
|
|
59373
|
+
},
|
|
59374
|
+
thumbnail(options) {
|
|
59375
|
+
return options;
|
|
59376
|
+
},
|
|
59377
|
+
gallery(...items) {
|
|
59378
|
+
return {
|
|
59379
|
+
type: "gallery",
|
|
59380
|
+
items
|
|
59381
|
+
};
|
|
59382
|
+
},
|
|
59383
|
+
image(options) {
|
|
59384
|
+
return options;
|
|
58947
59385
|
},
|
|
58948
|
-
section,
|
|
58949
|
-
thumbnail,
|
|
58950
|
-
gallery,
|
|
58951
|
-
image,
|
|
58952
59386
|
file,
|
|
58953
|
-
row
|
|
58954
|
-
|
|
58955
|
-
|
|
58956
|
-
|
|
59387
|
+
row(...components) {
|
|
59388
|
+
return {
|
|
59389
|
+
type: "row",
|
|
59390
|
+
components
|
|
59391
|
+
};
|
|
59392
|
+
},
|
|
59393
|
+
container(...args) {
|
|
59394
|
+
const { options, components } = split_container_args(args);
|
|
59395
|
+
const container = new import_discord2.ContainerBuilder;
|
|
59396
|
+
container.components.push(...components.map(to_container_child));
|
|
59397
|
+
if (options.color !== undefined) {
|
|
59398
|
+
container.setAccentColor(validate.color(options.color));
|
|
59399
|
+
}
|
|
59400
|
+
const attachments = collect_attachments_from_container_inputs(components);
|
|
59401
|
+
return attach_container_attachments(container, attachments);
|
|
59402
|
+
}
|
|
58957
59403
|
};
|
|
58958
59404
|
export {
|
|
58959
|
-
|
|
58960
|
-
ui,
|
|
58961
|
-
toDisplayComponents,
|
|
58962
|
-
toDisplayComponent,
|
|
58963
|
-
toContainerChild,
|
|
58964
|
-
normalizeUserSelect,
|
|
58965
|
-
normalizeStringSelect,
|
|
58966
|
-
normalizeSelect,
|
|
58967
|
-
normalizeRoleSelect,
|
|
58968
|
-
normalizeMentionableSelect,
|
|
58969
|
-
normalizeGallery,
|
|
58970
|
-
normalizeFile,
|
|
58971
|
-
normalizeChannelSelect,
|
|
58972
|
-
normalizeButton,
|
|
58973
|
-
isRenderedComponents,
|
|
58974
|
-
getRenderedComponentsAttachments,
|
|
58975
|
-
createRenderedComponents,
|
|
58976
|
-
collectAttachmentsFromDisplayInputs,
|
|
58977
|
-
collectAttachmentsFromContainerInputs,
|
|
58978
|
-
attachContainerAttachments,
|
|
58979
|
-
applyButtonData
|
|
59405
|
+
ui
|
|
58980
59406
|
};
|