@seedcord/errors 0.13.0 → 0.14.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/README.md +9 -11
- package/dist/SeedcordError-Cce9qKW3.d.mts +583 -0
- package/dist/SeedcordError-D9SmwpVL.mjs +676 -0
- package/dist/SeedcordError-D9SmwpVL.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal.index.d.mts +20 -6
- package/dist/internal.index.mjs +44 -18
- package/dist/internal.index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/SeedcordError-CJfXnVTd.d.mts +0 -526
- package/dist/SeedcordError-UFUYeAQ_.mjs +0 -561
- package/dist/SeedcordError-UFUYeAQ_.mjs.map +0 -1
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
//#region src/ErrorCodes.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* All Seedcord error codes.
|
|
4
|
-
*/
|
|
5
|
-
declare enum SeedcordErrorCode {
|
|
6
|
-
/** One or more configured emojis could not be resolved at startup. */
|
|
7
|
-
ConfigEmojiUnresolved = 1001,
|
|
8
|
-
/** A webhook reporter's env var is set but fails webhook URL validation. */
|
|
9
|
-
ConfigWebhookUrlInvalid = 1002,
|
|
10
|
-
/** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
|
|
11
|
-
ConfigWebhookNotFound = 1003,
|
|
12
|
-
/** The generated route manifest was imported before `seedcord build` generated it. */
|
|
13
|
-
ConfigManifestNotGenerated = 1004,
|
|
14
|
-
/** A required environment variable is not present. */
|
|
15
|
-
ConfigMissingEnv = 1005,
|
|
16
|
-
/** An environment variable is present and fails validation. */
|
|
17
|
-
ConfigInvalidEnv = 1006,
|
|
18
|
-
/** A command usable in a guild is registered without the `Guilds` intent that caches guilds. */
|
|
19
|
-
MissingGuildsIntent = 1007,
|
|
20
|
-
/** The running Node or Bun version is below the range seedcord declares for it in `engines`. */
|
|
21
|
-
UnsupportedRuntimeVersion = 1008,
|
|
22
|
-
/** `DISCORD_BOT_TOKEN` passed its shape check and carries no readable application id. */
|
|
23
|
-
ConfigTokenUnreadable = 1009,
|
|
24
|
-
/** An edge config sets a REST sweeper interval. */
|
|
25
|
-
ConfigEdgeRestSweeper = 1010,
|
|
26
|
-
/** Attempted to add lifecycle tasks after startup already completed. */
|
|
27
|
-
LifecycleAddAfterCompletion = 1101,
|
|
28
|
-
/** Attempted to add lifecycle tasks while startup is still running. */
|
|
29
|
-
LifecycleAddDuringRun = 1102,
|
|
30
|
-
/** Attempted to remove lifecycle tasks while startup is still running. */
|
|
31
|
-
LifecycleRemoveDuringRun = 1103,
|
|
32
|
-
/** Provided lifecycle phase identifier is not recognized. */
|
|
33
|
-
LifecycleUnknownPhase = 1104,
|
|
34
|
-
/** Startup phase completed with one or more task failures. */
|
|
35
|
-
LifecyclePhaseFailures = 1105,
|
|
36
|
-
/** A lifecycle task exceeded its configured timeout. */
|
|
37
|
-
LifecycleTaskTimeout = 1106,
|
|
38
|
-
/** A host whose startup failed was started again. */
|
|
39
|
-
LifecycleRestartAfterFailure = 1107,
|
|
40
|
-
/** The configured shutdown deadline is zero, negative, or not finite. */
|
|
41
|
-
LifecycleInvalidShutdownDeadline = 1108,
|
|
42
|
-
/** Multiple Seedcord instances were created simultaneously. */
|
|
43
|
-
CoreSingletonViolation = 1201,
|
|
44
|
-
/** Plugins cannot be mutated after the core has finished initializing. */
|
|
45
|
-
CorePluginAfterInit = 1202,
|
|
46
|
-
/** A plugin tried to register with a key that already exists. */
|
|
47
|
-
CorePluginKeyExists = 1203,
|
|
48
|
-
/** Bot role lookup failed within the provided guild. */
|
|
49
|
-
CoreBotRoleMissing = 1204,
|
|
50
|
-
/** A bot controller was constructed without its required handlers directory. */
|
|
51
|
-
CoreControllerPathMissing = 1205,
|
|
52
|
-
/** A file in a scanned directory threw while being imported. */
|
|
53
|
-
CoreDirectoryImportFailed = 1206,
|
|
54
|
-
/** A scanned directory could not be read. */
|
|
55
|
-
CoreDirectoryUnreadable = 1207,
|
|
56
|
-
/** A plugin was attached under a key the framework logs on. */
|
|
57
|
-
CorePluginReservedChannel = 1208,
|
|
58
|
-
/** The application id was read before startup resolved it. */
|
|
59
|
-
CoreApplicationUnavailable = 1209,
|
|
60
|
-
/** A generated accessor was read before startup resolved its values. */
|
|
61
|
-
CoreAccessorUnresolved = 1210,
|
|
62
|
-
/** A startup or shutdown task was added to a core built by `createSeedcord`. */
|
|
63
|
-
CoreLifecycleUnavailable = 1211,
|
|
64
|
-
/** `emit` was called on the bus. It reaches listeners and skips every subscriber. */
|
|
65
|
-
CoreBusEmitUnavailable = 1212,
|
|
66
|
-
/** A command decorator passed `'config'` while `commands.guilds` is empty. */
|
|
67
|
-
CoreCommandGuildsEmpty = 1213,
|
|
68
|
-
/** Discord refused the command deploy for one guild. */
|
|
69
|
-
CoreCommandGuildDeployFailed = 1214,
|
|
70
|
-
/** A plugin was attached under a group name the bot already uses. */
|
|
71
|
-
CorePluginGroupTaken = 1215,
|
|
72
|
-
/** A plugin was attached at a name that holds a group of plugins. */
|
|
73
|
-
CorePluginKeyHoldsGroup = 1216,
|
|
74
|
-
/** A plugin key is empty, has an empty part, or carries more than one dot. */
|
|
75
|
-
CorePluginKeyMalformed = 1217,
|
|
76
|
-
/** An attached plugin doesn't extend the `Plugin` class of the bot's `@seedcord/core`. */
|
|
77
|
-
CorePluginFromOtherCore = 1218,
|
|
78
|
-
/** A command decorator attempted to re-register an existing command scope. */
|
|
79
|
-
DecoratorCommandAlreadyRegistered = 1301,
|
|
80
|
-
/** A global command decorator specified guild IDs, which is not allowed. */
|
|
81
|
-
DecoratorCommandGlobalWithGuilds = 1302,
|
|
82
|
-
/** A guild command decorator omitted the required guild ID list. */
|
|
83
|
-
DecoratorCommandGuildWithoutGuilds = 1303,
|
|
84
|
-
/** Middleware priority provided by the decorator was not a finite number. */
|
|
85
|
-
DecoratorInvalidMiddlewarePriority = 1304,
|
|
86
|
-
/** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */
|
|
87
|
-
DecoratorWebhookUrlMissing = 1305,
|
|
88
|
-
/** A middleware decorator was given an empty filter array. */
|
|
89
|
-
DecoratorEmptyMiddlewareFilter = 1306,
|
|
90
|
-
/** Two interaction handlers registered the same route within a scope. */
|
|
91
|
-
InteractionDuplicateRoute = 1401,
|
|
92
|
-
/** Two different middleware classes share a class name. */
|
|
93
|
-
DuplicateMiddleware = 1402,
|
|
94
|
-
/** A manifest array lists a class that does not extend the base for that array. */
|
|
95
|
-
ManifestEntryWrongClass = 1403,
|
|
96
|
-
/** A manifest array lists a class whose decorator is missing. Nothing registered. */
|
|
97
|
-
ManifestEntryNoRoutes = 1404,
|
|
98
|
-
/** A reply method was called in an ack state where it is illegal. */
|
|
99
|
-
ReplyIllegalAckState = 1501,
|
|
100
|
-
/** A reply component failed to serialize to raw API data. */
|
|
101
|
-
ReplyComponentSerialization = 1502,
|
|
102
|
-
/** edit() was passed a message the interaction did not send. */
|
|
103
|
-
ReplyForeignEditTarget = 1503,
|
|
104
|
-
/** update() or deferUpdate() was called on a modal with no source message. */
|
|
105
|
-
ReplyUpdateWithoutSource = 1504,
|
|
106
|
-
/** A withResponse interaction callback returned no created message. */
|
|
107
|
-
ReplyCallbackMissingMessage = 1505,
|
|
108
|
-
/** A customId definition prefix contains a reserved character (a colon or a control char). */
|
|
109
|
-
CustomIdInvalidPrefix = 1601,
|
|
110
|
-
/** A customId field name is integer-like, which JS would silently reorder. */
|
|
111
|
-
CustomIdReservedFieldName = 1602,
|
|
112
|
-
/** A oneOf() or someOf() field was declared with no choices. */
|
|
113
|
-
CustomIdEmptyChoices = 1603,
|
|
114
|
-
/** An int() field was declared with min greater than max. */
|
|
115
|
-
CustomIdInvalidBounds = 1604,
|
|
116
|
-
/** A field rejected the value given to encode(). */
|
|
117
|
-
CustomIdValueRejected = 1605,
|
|
118
|
-
/** An encoded customId exceeds Discord's 100-character limit. */
|
|
119
|
-
CustomIdWireTooLong = 1606,
|
|
120
|
-
/** A field name is declared more than once in the same customId chain. */
|
|
121
|
-
CustomIdDuplicateFieldName = 1607,
|
|
122
|
-
/** A component handler is missing the route decorator that matches its base. */
|
|
123
|
-
CustomIdHandlerRouteMissing = 1608,
|
|
124
|
-
/** match() received a decoded route with no matching arm. */
|
|
125
|
-
CustomIdMatchArmMissing = 1609,
|
|
126
|
-
/** A slash handler's match() has no arm for the command route that fired. */
|
|
127
|
-
SlashMatchArmMissing = 1610,
|
|
128
|
-
/** An autocomplete handler's match() has no arm for the focused field that fired. */
|
|
129
|
-
AutocompleteMatchArmMissing = 1611,
|
|
130
|
-
/** An event handler's match() has no arm for the event name that fired. */
|
|
131
|
-
EventMatchArmMissing = 1612,
|
|
132
|
-
/** Event middleware read `this.eventName` but was constructed without a fired event name. */
|
|
133
|
-
EventMiddlewareNameUnavailable = 1613,
|
|
134
|
-
/** An autocomplete payload carried no focused option. */
|
|
135
|
-
AutocompleteNoFocusedOption = 1614,
|
|
136
|
-
/** A context menu handler's match() has no arm for the command name that fired. */
|
|
137
|
-
ContextMenuMatchArmMissing = 1615,
|
|
138
|
-
/** No field in the submitted modal carries the requested custom id. */
|
|
139
|
-
ModalFieldNotFound = 1616,
|
|
140
|
-
/** A modal field getter was called on a field of another kind. */
|
|
141
|
-
ModalFieldWrongKind = 1617,
|
|
142
|
-
/** Nothing was picked in a modal field read as required. */
|
|
143
|
-
ModalFieldEmpty = 1618,
|
|
144
|
-
/** A channel select field picked a channel outside the types getSelectedChannels() allows. */
|
|
145
|
-
ModalFieldChannelType = 1619,
|
|
146
|
-
/** A customId was minted under an older shape of the same definition. */
|
|
147
|
-
CustomIdWireStale = 1620,
|
|
148
|
-
/** A customId wire is corrupt, truncated, or was minted by a different definition. */
|
|
149
|
-
CustomIdWireInvalid = 1621,
|
|
150
|
-
/** `dispatch.require()` was called for a key nothing wrote on this dispatch. */
|
|
151
|
-
DispatchStateMissing = 1622,
|
|
152
|
-
/** A Cooldown gate was given a duration string that is not a well-formed positive duration. */
|
|
153
|
-
GateInvalidCooldownDuration = 1701,
|
|
154
|
-
/** A paginator source was given a perPage that is not a positive integer. */
|
|
155
|
-
PaginationInvalidPerPage = 1801,
|
|
156
|
-
/** A control row was assembled with more than the five buttons Discord allows. */
|
|
157
|
-
PaginationTooManyControls = 1802,
|
|
158
|
-
/** A control row was assembled with no controls. */
|
|
159
|
-
PaginationEmptyControls = 1803,
|
|
160
|
-
/** A control row repeats the same control, which would collide the custom_ids. */
|
|
161
|
-
PaginationDuplicateControls = 1804,
|
|
162
|
-
/** A color value could not be resolved to a Discord color integer. */
|
|
163
|
-
ColorUnresolvable = 1901,
|
|
164
|
-
/** A resolved color fell outside Discord's 0x000000 to 0xffffff range. */
|
|
165
|
-
ColorOutOfRange = 1902,
|
|
166
|
-
/** A plugin's constructor rejected its options through `rejectOptions`. */
|
|
167
|
-
PluginOptionsRejected = 2001,
|
|
168
|
-
/** Two or more plugins threw while disposing. */
|
|
169
|
-
PluginDisposeFailures = 2002,
|
|
170
|
-
/** A plugin declared a lifecycle timeout that is not a positive, finite number of milliseconds. */
|
|
171
|
-
PluginInvalidLifecycleTimeout = 2003,
|
|
172
|
-
/** Mongoose service class is missing the `@RegisterMongooseService` decorator. */
|
|
173
|
-
PluginMongooseServiceDecoratorMissing = 2101,
|
|
174
|
-
/** Mongoose client failed to establish a connection. */
|
|
175
|
-
PluginMongooseConnectionFailed = 2102,
|
|
176
|
-
/** Mongoose client failed to disconnect cleanly during shutdown. */
|
|
177
|
-
PluginMongooseDisconnectFailed = 2103,
|
|
178
|
-
/** Mongoose `services` was accessed before the plugin finished initializing. */
|
|
179
|
-
PluginMongooseServicesNotReady = 2104,
|
|
180
|
-
/** Mongoose rejected the model, usually a duplicate model name or an absent schema. */
|
|
181
|
-
PluginMongooseModelCreationFailed = 2105,
|
|
182
|
-
/** A mongoose service was registered with an empty model name override. */
|
|
183
|
-
PluginMongooseModelNameMissing = 2106,
|
|
184
|
-
/** Kysely service class is missing the `@RegisterKyselyService` decorator. */
|
|
185
|
-
PluginKyselyServiceDecoratorMissing = 2201,
|
|
186
|
-
/** Kysely service class is missing its table metadata. */
|
|
187
|
-
PluginKyselyServiceTableMissing = 2202,
|
|
188
|
-
/** Migration manager received an invalid step count. */
|
|
189
|
-
PluginKyselyInvalidStepCount = 2203,
|
|
190
|
-
/** Migration direction was not recognized. */
|
|
191
|
-
PluginKyselyUnknownDirection = 2204,
|
|
192
|
-
/** Provided migrations path could not be resolved. */
|
|
193
|
-
PluginKyselyUnresolvedMigrationsPath = 2205,
|
|
194
|
-
/** No migration files were found for execution. */
|
|
195
|
-
PluginKyselyNoMigrationFiles = 2206,
|
|
196
|
-
/** A migration module failed to export the expected functions. */
|
|
197
|
-
PluginKyselyInvalidMigrationModule = 2207,
|
|
198
|
-
/** An arbitrary (non-Error) failure was reported by a migration. */
|
|
199
|
-
PluginKyselyNonErrorFailure = 2208,
|
|
200
|
-
/** Postgres pool failed to close cleanly during shutdown. */
|
|
201
|
-
PluginKyselyDisconnectFailed = 2209,
|
|
202
|
-
/** Kysely `services` was accessed before the plugin finished initializing. */
|
|
203
|
-
PluginKyselyServicesNotReady = 2210,
|
|
204
|
-
/** Postgres pool failed to establish a connection. */
|
|
205
|
-
PluginKyselyConnectionFailed = 2211,
|
|
206
|
-
/** Bootstrapper failed to ensure the target Postgres database exists. */
|
|
207
|
-
PluginKyselyBootstrapFailed = 2212,
|
|
208
|
-
/** Two listed migration files share a name once their extensions are stripped. */
|
|
209
|
-
PluginKyselyDuplicateMigrationName = 2213,
|
|
210
|
-
/** Config file default export was not an object. */
|
|
211
|
-
CliConfigInvalidExport = 3101,
|
|
212
|
-
/** Config is missing the required instance string. */
|
|
213
|
-
CliConfigMissingInstance = 3102,
|
|
214
|
-
/** Unable to locate a Seedcord config file. */
|
|
215
|
-
CliConfigNotFound = 3103,
|
|
216
|
-
/** CLI entry file does not exist. */
|
|
217
|
-
CliEntryNotFound = 3104,
|
|
218
|
-
/** Failed to import a TypeScript entry file. */
|
|
219
|
-
CliTsImportFailed = 3105,
|
|
220
|
-
/** Native import and jiti fallback both failed. */
|
|
221
|
-
CliImportFailed = 3106,
|
|
222
|
-
/** Seedcord instance export is missing a start() method. */
|
|
223
|
-
CliInstanceInvalid = 3107,
|
|
224
|
-
/** Seedcord instance threw during startup. */
|
|
225
|
-
CliStartFailed = 3108,
|
|
226
|
-
/** Config is missing the required entry string. */
|
|
227
|
-
CliConfigMissingEntry = 3109,
|
|
228
|
-
/** Entry file must be inside the configured root directory. */
|
|
229
|
-
CliConfigEntryOutsideRoot = 3110,
|
|
230
|
-
/** Unable to locate a TypeScript config file for builds. */
|
|
231
|
-
CliBuildTsconfigNotFound = 3111,
|
|
232
|
-
/** TypeScript reported diagnostics during emit. */
|
|
233
|
-
CliBuildFailed = 3112,
|
|
234
|
-
/** Unable to write the generated bootstrap file. */
|
|
235
|
-
CliBootstrapWriteFailed = 3113,
|
|
236
|
-
/** Two commands resolve to the same slash route during codegen. */
|
|
237
|
-
CliCodegenDuplicateRoute = 3114,
|
|
238
|
-
/** The commands directory could not be read during codegen. */
|
|
239
|
-
CliCodegenCommandsDirUnreadable = 3115,
|
|
240
|
-
/** Two context-menu commands of the same kind share a name during codegen. */
|
|
241
|
-
CliCodegenDuplicateContextMenu = 3116,
|
|
242
|
-
/** Could not resolve the application from the bot token during `commands --clean`. */
|
|
243
|
-
CliCleanAppFetchFailed = 3117,
|
|
244
|
-
/** `commands --clean` ran with neither --guild nor --all-guilds. */
|
|
245
|
-
CliCleanNoGuilds = 3118,
|
|
246
|
-
/** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */
|
|
247
|
-
CliCleanPurgeAllGuilds = 3119,
|
|
248
|
-
/** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */
|
|
249
|
-
CliCancelled = 3120,
|
|
250
|
-
/** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */
|
|
251
|
-
CliCleanLargeBotUnconfirmed = 3121,
|
|
252
|
-
/** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */
|
|
253
|
-
CliCleanApplyNeedsYes = 3122,
|
|
254
|
-
/** The cloudflared metrics server never reported a quick-tunnel hostname. */
|
|
255
|
-
CliTunnelUrlUnavailable = 3123,
|
|
256
|
-
/** Discord rejected the tunnel URL as an interactions endpoint. */
|
|
257
|
-
CliTunnelNotVerified = 3124,
|
|
258
|
-
/** The tunnel URL never answered its health probe. */
|
|
259
|
-
CliTunnelUnreachable = 3125,
|
|
260
|
-
/** A config field is present with the wrong shape. */
|
|
261
|
-
CliConfigInvalidField = 3126,
|
|
262
|
-
/** A class carrying `@RegisterCommand` threw while codegen constructed it. */
|
|
263
|
-
CliCodegenCommandConstructorThrew = 3127,
|
|
264
|
-
/** A create prompt was cancelled (Ctrl-C), and nothing has been written yet. */
|
|
265
|
-
CreateCancelled = 3201,
|
|
266
|
-
/** A flag supplied an answer for a question the earlier answers skip. */
|
|
267
|
-
CreateFlagNotApplicable = 3202,
|
|
268
|
-
/** A flag carried a value its question rejects. */
|
|
269
|
-
CreateInvalidAnswer = 3203,
|
|
270
|
-
/** The command line did not parse. */
|
|
271
|
-
CreateBadUsage = 3204,
|
|
272
|
-
/** The target path already holds something. */
|
|
273
|
-
CreateTargetNotEmpty = 3205,
|
|
274
|
-
/** A command the scaffolder shelled out to exited non-zero. */
|
|
275
|
-
CreateStepFailed = 3206
|
|
276
|
-
}
|
|
277
|
-
//#endregion
|
|
278
|
-
//#region src/palette.d.ts
|
|
279
|
-
declare const BRAND: {
|
|
280
|
-
readonly flesh: "#f04e36";
|
|
281
|
-
readonly rind: "#6fab49";
|
|
282
|
-
readonly pith: "#f8f6e8";
|
|
283
|
-
};
|
|
284
|
-
declare const paint: {
|
|
285
|
-
readonly sky: import("chalk").ChalkInstance;
|
|
286
|
-
readonly iris: import("chalk").ChalkInstance;
|
|
287
|
-
readonly mint: import("chalk").ChalkInstance;
|
|
288
|
-
readonly amber: import("chalk").ChalkInstance;
|
|
289
|
-
readonly coral: import("chalk").ChalkInstance;
|
|
290
|
-
readonly flesh: import("chalk").ChalkInstance;
|
|
291
|
-
readonly rind: import("chalk").ChalkInstance;
|
|
292
|
-
readonly pith: import("chalk").ChalkInstance;
|
|
293
|
-
readonly mute: import("chalk").ChalkInstance;
|
|
294
|
-
readonly bold: import("chalk").ChalkInstance;
|
|
295
|
-
readonly italic: import("chalk").ChalkInstance;
|
|
296
|
-
readonly underline: import("chalk").ChalkInstance;
|
|
297
|
-
};
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region src/ErrorMessages.d.ts
|
|
300
|
-
/** @internal */
|
|
301
|
-
declare const messages: {
|
|
302
|
-
1005: (name: string) => string;
|
|
303
|
-
1006: (name: string, expected?: string) => string;
|
|
304
|
-
1004: () => string;
|
|
305
|
-
1002: (envKey: string) => string;
|
|
306
|
-
1003: (envKey: string) => string;
|
|
307
|
-
1001: (count: number, failures: string) => string;
|
|
308
|
-
1009: () => string;
|
|
309
|
-
1007: (commands: string) => string;
|
|
310
|
-
1010: (key: string) => string;
|
|
311
|
-
1008: (runtime: string, required: string, running: string) => string;
|
|
312
|
-
1101: () => string;
|
|
313
|
-
1102: () => string;
|
|
314
|
-
1103: () => string;
|
|
315
|
-
1104: (phase: unknown) => string;
|
|
316
|
-
1105: (phase: string, failures: number) => string;
|
|
317
|
-
1106: (taskName: string, timeout: number) => string;
|
|
318
|
-
1107: () => string;
|
|
319
|
-
1108: (declared: number) => string;
|
|
320
|
-
1201: () => string;
|
|
321
|
-
1202: () => string;
|
|
322
|
-
1203: (key: string) => string;
|
|
323
|
-
1204: (guildId?: string) => string;
|
|
324
|
-
1205: (controllerName: string, pathKind: string) => string;
|
|
325
|
-
1206: (file: string) => string;
|
|
326
|
-
1207: (dir: string) => string;
|
|
327
|
-
1215: (head: string, key: string) => string;
|
|
328
|
-
1217: (key: string, reason: string) => string;
|
|
329
|
-
1218: (plugin: string) => string;
|
|
330
|
-
1216: (key: string) => string;
|
|
331
|
-
1208: (key: string) => string;
|
|
332
|
-
1209: () => string;
|
|
333
|
-
1210: (accessor: string, key: string) => string;
|
|
334
|
-
1211: (accessor: string) => string;
|
|
335
|
-
1212: (event: string) => string;
|
|
336
|
-
1213: (commandName: string) => string;
|
|
337
|
-
1214: (guildId: string) => string;
|
|
338
|
-
1301: (commandName: string, existingCall: string, requestedCall: string) => string;
|
|
339
|
-
1302: () => string;
|
|
340
|
-
1303: () => string;
|
|
341
|
-
1304: () => string;
|
|
342
|
-
1305: (className: string) => string;
|
|
343
|
-
1306: (key: string) => string;
|
|
344
|
-
1401: (route: string, first: string, second: string) => string;
|
|
345
|
-
1402: (name: string) => string;
|
|
346
|
-
1403: (array: string, className: string, base: string) => string;
|
|
347
|
-
1404: (array: string, className: string, decorator: string) => string;
|
|
348
|
-
1501: (method: string, reason: string, alternative: string, routeId: string) => string;
|
|
349
|
-
1502: (componentClass: string, index: number, detail: string, routeId: string) => string;
|
|
350
|
-
1503: (method: string, targetId: string, routeId: string) => string;
|
|
351
|
-
1504: (method: string, routeId: string) => string;
|
|
352
|
-
1505: (method: string, routeId: string) => string;
|
|
353
|
-
1601: (prefix: string) => string;
|
|
354
|
-
1602: (field: string) => string;
|
|
355
|
-
1603: (field: string, method: string) => string;
|
|
356
|
-
1604: (field: string, min: number, max: number) => string;
|
|
357
|
-
1605: (field: string, expected: string, value: string) => string;
|
|
358
|
-
1606: (length: number) => string;
|
|
359
|
-
1607: (field: string) => string;
|
|
360
|
-
1608: (className: string) => string;
|
|
361
|
-
1609: (prefix: string) => string;
|
|
362
|
-
1620: (prefix: string) => string;
|
|
363
|
-
1621: (detail: string) => string;
|
|
364
|
-
1610: (route: string) => string;
|
|
365
|
-
1611: (field: string) => string;
|
|
366
|
-
1612: (event: string) => string;
|
|
367
|
-
1615: (name: string) => string;
|
|
368
|
-
1613: () => string;
|
|
369
|
-
1614: () => string;
|
|
370
|
-
1616: (customId: string) => string;
|
|
371
|
-
1617: (customId: string, kind: string, getter?: string) => string;
|
|
372
|
-
1618: (customId: string) => string;
|
|
373
|
-
1619: (customId: string, picked: string, allowed: string) => string;
|
|
374
|
-
1622: (key: string) => string;
|
|
375
|
-
1701: (input: string) => string;
|
|
376
|
-
1801: (perPage: number) => string;
|
|
377
|
-
1802: (count: number) => string;
|
|
378
|
-
1803: () => string;
|
|
379
|
-
1804: (key: string) => string;
|
|
380
|
-
1901: (value: string) => string;
|
|
381
|
-
1902: () => string;
|
|
382
|
-
2001: (pluginName: string, reason: string) => string;
|
|
383
|
-
2002: (count: number) => string;
|
|
384
|
-
2003: (pluginName: string, field: string, declared: number) => string;
|
|
385
|
-
2101: (className: string) => string;
|
|
386
|
-
2102: (databaseName?: string) => string;
|
|
387
|
-
2103: () => string;
|
|
388
|
-
2104: () => string;
|
|
389
|
-
2105: (modelName: string, className: string) => string;
|
|
390
|
-
2106: (className: string) => string;
|
|
391
|
-
2201: (className: string) => string;
|
|
392
|
-
2202: (className: string) => string;
|
|
393
|
-
2203: () => string;
|
|
394
|
-
2204: (direction: unknown) => string;
|
|
395
|
-
2205: (label: string) => string;
|
|
396
|
-
2206: () => string;
|
|
397
|
-
2207: (filePath: string) => string;
|
|
398
|
-
2208: (message: string) => string;
|
|
399
|
-
2209: () => string;
|
|
400
|
-
2210: () => string;
|
|
401
|
-
2211: (databaseName?: string) => string;
|
|
402
|
-
2212: (databaseName: string) => string;
|
|
403
|
-
2213: (name: string, first: string, second: string) => string;
|
|
404
|
-
3101: () => string;
|
|
405
|
-
3102: () => string;
|
|
406
|
-
3103: (baseDir: string, candidates: readonly string[]) => string;
|
|
407
|
-
3109: () => string;
|
|
408
|
-
3110: (entryPath: string, root: string) => string;
|
|
409
|
-
3104: (entryPath: string) => string;
|
|
410
|
-
3105: (entryPath: string, reason: string) => string;
|
|
411
|
-
3106: (entryPath: string, nativeReason: string, fallbackReason: string) => string;
|
|
412
|
-
3107: () => string;
|
|
413
|
-
3108: (instancePath: string, reason: string) => string;
|
|
414
|
-
3111: (hint: string) => string;
|
|
415
|
-
3112: (diagnostics: string) => string;
|
|
416
|
-
3113: (targetPath: string, reason: string) => string;
|
|
417
|
-
3114: (route: string, firstFile: string, secondFile: string) => string;
|
|
418
|
-
3115: (dir: string, reason: string) => string;
|
|
419
|
-
3127: (name: string, file: string, reason: string) => string;
|
|
420
|
-
3116: (kind: string, name: string, firstFile: string, secondFile: string) => string;
|
|
421
|
-
3117: (reason: string) => string;
|
|
422
|
-
3118: () => string;
|
|
423
|
-
3119: () => string;
|
|
424
|
-
3120: () => string;
|
|
425
|
-
3121: (count: number) => string;
|
|
426
|
-
3122: () => string;
|
|
427
|
-
3123: (seconds: number) => string;
|
|
428
|
-
3124: (url: string) => string;
|
|
429
|
-
3125: (url: string, seconds: number) => string;
|
|
430
|
-
3126: (field: string, expected: string) => string;
|
|
431
|
-
3201: () => string;
|
|
432
|
-
3202: (flag: string) => string;
|
|
433
|
-
3203: (flag: string, reason: string) => string;
|
|
434
|
-
3204: (reason: string) => string;
|
|
435
|
-
3205: (target: string) => string;
|
|
436
|
-
3206: (command: string, reason: string) => string;
|
|
437
|
-
};
|
|
438
|
-
/** @internal */
|
|
439
|
-
type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;
|
|
440
|
-
//#endregion
|
|
441
|
-
//#region src/SeedcordError.d.ts
|
|
442
|
-
/**
|
|
443
|
-
* String literal type for Seedcord error identifiers.
|
|
444
|
-
*
|
|
445
|
-
* @internal
|
|
446
|
-
*/
|
|
447
|
-
type SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;
|
|
448
|
-
/**
|
|
449
|
-
* Options for Seedcord errors.
|
|
450
|
-
*
|
|
451
|
-
* @internal
|
|
452
|
-
*/
|
|
453
|
-
interface SeedcordErrorOptions extends ErrorOptions {}
|
|
454
|
-
type SeedcordErrorCtorRest<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> extends [] ? [options?: SeedcordErrorOptions] : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];
|
|
455
|
-
/**
|
|
456
|
-
* String literal type for Seedcord error class names. Names the `type` argument of
|
|
457
|
-
* {@link isSeedcordError}.
|
|
458
|
-
*/
|
|
459
|
-
type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;
|
|
460
|
-
declare const kIdentifier: unique symbol;
|
|
461
|
-
interface BaseSeedcordError {
|
|
462
|
-
readonly code: SeedcordErrorCode;
|
|
463
|
-
readonly [kIdentifier]: SeedcordErrorIdentifier;
|
|
464
|
-
readonly type: SeedcordErrorTypeString;
|
|
465
|
-
}
|
|
466
|
-
declare class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends Error implements BaseSeedcordError {
|
|
467
|
-
readonly code: Code;
|
|
468
|
-
readonly [kIdentifier]: SeedcordErrorIdentifier;
|
|
469
|
-
readonly type = "SeedcordError";
|
|
470
|
-
constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
|
|
471
|
-
}
|
|
472
|
-
declare class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends TypeError implements BaseSeedcordError {
|
|
473
|
-
readonly code: Code;
|
|
474
|
-
readonly [kIdentifier]: SeedcordErrorIdentifier;
|
|
475
|
-
readonly type = "SeedcordTypeError";
|
|
476
|
-
constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
|
|
477
|
-
}
|
|
478
|
-
declare class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends RangeError implements BaseSeedcordError {
|
|
479
|
-
readonly code: Code;
|
|
480
|
-
readonly [kIdentifier]: SeedcordErrorIdentifier;
|
|
481
|
-
readonly type = "SeedcordRangeError";
|
|
482
|
-
constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
|
|
483
|
-
}
|
|
484
|
-
declare class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends AggregateError implements BaseSeedcordError {
|
|
485
|
-
readonly code: Code;
|
|
486
|
-
readonly [kIdentifier]: SeedcordErrorIdentifier;
|
|
487
|
-
readonly type = "SeedcordAggregateError";
|
|
488
|
-
constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>);
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Variant type for Seedcord error classes.
|
|
492
|
-
*
|
|
493
|
-
* @internal
|
|
494
|
-
*/
|
|
495
|
-
type SeedcordErrorVariant<Type extends SeedcordErrorTypeString, Code extends SeedcordErrorCode> = Type extends 'SeedcordError' ? SeedcordError<Code> : Type extends 'SeedcordTypeError' ? SeedcordTypeError<Code> : Type extends 'SeedcordRangeError' ? SeedcordRangeError<Code> : SeedcordAggregateError<Code>;
|
|
496
|
-
/**
|
|
497
|
-
* Union type of all Seedcord error variants for a specific error code.
|
|
498
|
-
*
|
|
499
|
-
* @internal
|
|
500
|
-
*/
|
|
501
|
-
type AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = { [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>; }[SeedcordErrorTypeString];
|
|
502
|
-
/**
|
|
503
|
-
* Union type of all Seedcord errors filtered by error class.
|
|
504
|
-
*
|
|
505
|
-
* @internal
|
|
506
|
-
*/
|
|
507
|
-
type ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString ? { [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>; }[SeedcordErrorCode] : AnySeedcordErrorForCode<SeedcordErrorCode>;
|
|
508
|
-
/**
|
|
509
|
-
* Union type of all Seedcord errors filtered by error class and error code.
|
|
510
|
-
*
|
|
511
|
-
* @internal
|
|
512
|
-
*/
|
|
513
|
-
type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined> = Code extends SeedcordErrorCode ? Type extends SeedcordErrorTypeString ? SeedcordErrorVariant<Type, Code> : AnySeedcordErrorForCode<Code> : ErrorTypeFilter<Type>;
|
|
514
|
-
/**
|
|
515
|
-
* Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.
|
|
516
|
-
*
|
|
517
|
-
* @param error - The value to inspect.
|
|
518
|
-
* @param type - Optional error class discriminator.
|
|
519
|
-
* @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.
|
|
520
|
-
* @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.
|
|
521
|
-
* @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.
|
|
522
|
-
*/
|
|
523
|
-
declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
|
|
524
|
-
//#endregion
|
|
525
|
-
export { SeedcordTypeError as a, paint as c, SeedcordRangeError as i, SeedcordErrorCode as l, SeedcordError as n, isSeedcordError as o, SeedcordErrorTypeString as r, BRAND as s, SeedcordAggregateError as t };
|
|
526
|
-
//# sourceMappingURL=SeedcordError-CJfXnVTd.d.mts.map
|