@seedcord/errors 0.3.0-next.5 → 0.3.0-next.6

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.
@@ -6,19 +6,19 @@ declare enum SeedcordErrorCode {
6
6
  /** DISCORD_BOT_TOKEN is not present in the environment. */
7
7
  ConfigMissingDiscordToken = 1001,
8
8
  /** DISCORD_BOT_TOKEN is present but fails validation. */
9
- ConfigIncorrectDiscordToken = 1004,
9
+ ConfigIncorrectDiscordToken = 1002,
10
10
  /** One or more configured emojis could not be resolved at startup. */
11
- ConfigEmojiUnresolved = 1005,
11
+ ConfigEmojiUnresolved = 1003,
12
12
  /** A webhook reporter's env var is set but fails webhook URL validation. */
13
- ConfigWebhookUrlInvalid = 1006,
13
+ ConfigWebhookUrlInvalid = 1004,
14
14
  /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
15
- ConfigWebhookNotFound = 1007,
15
+ ConfigWebhookNotFound = 1005,
16
16
  /** DISCORD_PUBLIC_KEY is not present in the environment. */
17
- ConfigMissingPublicKey = 1008,
17
+ ConfigMissingPublicKey = 1006,
18
18
  /** DISCORD_PUBLIC_KEY is present but fails validation. */
19
- ConfigIncorrectPublicKey = 1009,
19
+ ConfigIncorrectPublicKey = 1007,
20
20
  /** The generated route manifest was imported before `seedcord build` generated it. */
21
- ConfigManifestNotGenerated = 1010,
21
+ ConfigManifestNotGenerated = 1008,
22
22
  /** Attempted to add lifecycle tasks after startup already completed. */
23
23
  LifecycleAddAfterCompletion = 1101,
24
24
  /** Attempted to add lifecycle tasks while startup is still running. */
@@ -43,6 +43,12 @@ declare enum SeedcordErrorCode {
43
43
  CoreBotRoleMissing = 1204,
44
44
  /** A bot controller was constructed without its required handlers directory. */
45
45
  CoreControllerPathMissing = 1205,
46
+ /** A file in a scanned directory threw while being imported. */
47
+ CoreDirectoryImportFailed = 1206,
48
+ /** A scanned directory could not be read. */
49
+ CoreDirectoryUnreadable = 1207,
50
+ /** A plugin was attached under a key the framework logs on. */
51
+ CorePluginReservedChannel = 1208,
46
52
  /** Interaction middleware decorated with disallowed event filters. */
47
53
  DecoratorInteractionEventFilter = 1301,
48
54
  /** A decorator could not find the original method being decorated. */
@@ -61,6 +67,12 @@ declare enum SeedcordErrorCode {
61
67
  InteractionDuplicateRoute = 1401,
62
68
  /** Two different interaction middleware classes share a class name. */
63
69
  InteractionDuplicateMiddleware = 1402,
70
+ /** A route manifest row gives an export name its module does not have. */
71
+ InteractionRouteExportMissing = 1403,
72
+ /** A subscriber manifest row specifies an export that does not extend `Subscriber`. */
73
+ SubscriberRouteNotASubscriber = 1404,
74
+ /** A manifest row's module threw while importing. */
75
+ RouteModuleLoadFailed = 1405,
64
76
  /** A reply method was called in an ack state where it is illegal. */
65
77
  ReplyIllegalAckState = 1501,
66
78
  /** A reply component failed to serialize to raw API data. */
@@ -117,36 +129,42 @@ declare enum SeedcordErrorCode {
117
129
  PluginOptionsRejected = 2001,
118
130
  /** A plugin read `this.ctx` before `attach` finalized it. */
119
131
  PluginContextBeforeInit = 2002,
120
- /** Mongo service class is missing the `@RegisterMongoService` decorator. */
121
- PluginMongoServiceDecoratorMissing = 2101,
122
- /** Mongo model class is missing the `@RegisterMongoModel` decorator. */
123
- PluginMongoModelDecoratorMissing = 2102,
124
- /** Mongo client failed to establish a connection. */
125
- PluginMongoConnectionFailed = 2103,
126
- /** Mongo client failed to disconnect cleanly during shutdown. */
127
- PluginMongoDisconnectFailed = 2104,
128
- /** Mongo `services` was accessed before the plugin finished initializing. */
129
- PluginMongoServicesNotReady = 2105,
130
- /** KPG service class is missing the `@RegisterKpgService` decorator. */
131
- PluginKpgServiceDecoratorMissing = 2201,
132
- /** KPG service class is missing its table metadata. */
133
- PluginKpgServiceTableMissing = 2202,
132
+ /** Mongoose service class is missing the `@RegisterMongooseService` decorator. */
133
+ PluginMongooseServiceDecoratorMissing = 2101,
134
+ /** Mongoose client failed to establish a connection. */
135
+ PluginMongooseConnectionFailed = 2102,
136
+ /** Mongoose client failed to disconnect cleanly during shutdown. */
137
+ PluginMongooseDisconnectFailed = 2103,
138
+ /** Mongoose `services` was accessed before the plugin finished initializing. */
139
+ PluginMongooseServicesNotReady = 2104,
140
+ /** Mongoose rejected the model, usually a duplicate model name or an absent schema. */
141
+ PluginMongooseModelCreationFailed = 2105,
142
+ /** A mongoose service was registered with an empty model name override. */
143
+ PluginMongooseModelNameMissing = 2106,
144
+ /** Kysely service class is missing the `@RegisterKyselyService` decorator. */
145
+ PluginKyselyServiceDecoratorMissing = 2201,
146
+ /** Kysely service class is missing its table metadata. */
147
+ PluginKyselyServiceTableMissing = 2202,
134
148
  /** Migration manager received an invalid step count. */
135
- PluginKpgInvalidStepCount = 2203,
149
+ PluginKyselyInvalidStepCount = 2203,
136
150
  /** Migration direction was not recognized. */
137
- PluginKpgUnknownDirection = 2204,
151
+ PluginKyselyUnknownDirection = 2204,
138
152
  /** Provided migrations path could not be resolved. */
139
- PluginKpgUnresolvedMigrationsPath = 2205,
153
+ PluginKyselyUnresolvedMigrationsPath = 2205,
140
154
  /** No migration files were found for execution. */
141
- PluginKpgNoMigrationFiles = 2206,
155
+ PluginKyselyNoMigrationFiles = 2206,
142
156
  /** A migration module failed to export the expected functions. */
143
- PluginKpgInvalidMigrationModule = 2207,
157
+ PluginKyselyInvalidMigrationModule = 2207,
144
158
  /** An arbitrary (non-Error) failure was reported by a migration. */
145
- PluginKpgNonErrorFailure = 2208,
159
+ PluginKyselyNonErrorFailure = 2208,
146
160
  /** Postgres pool failed to close cleanly during shutdown. */
147
- PluginKpgDisconnectFailed = 2209,
148
- /** KPG `services` was accessed before the plugin finished initializing. */
149
- PluginKpgServicesNotReady = 2210,
161
+ PluginKyselyDisconnectFailed = 2209,
162
+ /** Kysely `services` was accessed before the plugin finished initializing. */
163
+ PluginKyselyServicesNotReady = 2210,
164
+ /** Postgres pool failed to establish a connection. */
165
+ PluginKyselyConnectionFailed = 2211,
166
+ /** Bootstrapper failed to ensure the target Postgres database exists. */
167
+ PluginKyselyBootstrapFailed = 2212,
150
168
  /** Config file default export was not an object. */
151
169
  CliConfigInvalidExport = 3101,
152
170
  /** Config is missing the required instance string. */
@@ -196,32 +214,32 @@ declare enum SeedcordErrorCode {
196
214
  /** Two context-menu commands of the same kind share a name during codegen. */
197
215
  CliCodegenDuplicateContextMenu = 3124,
198
216
  /** Could not resolve the application from the bot token during `commands --clean`. */
199
- CliCleanAppFetchFailed = 3126,
217
+ CliCleanAppFetchFailed = 3125,
200
218
  /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */
201
- CliCleanNoGuilds = 3127,
219
+ CliCleanNoGuilds = 3126,
202
220
  /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */
203
- CliCleanPurgeAllGuilds = 3128,
221
+ CliCleanPurgeAllGuilds = 3127,
204
222
  /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */
205
- CliCancelled = 3129,
223
+ CliCancelled = 3128,
206
224
  /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */
207
- CliCleanLargeBotUnconfirmed = 3130,
225
+ CliCleanLargeBotUnconfirmed = 3129,
208
226
  /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */
209
- CliCleanApplyNeedsYes = 3131,
227
+ CliCleanApplyNeedsYes = 3130,
210
228
  /** Config hmr rollback flag must be a boolean when provided. */
211
- CliConfigInvalidHmrRollback = 3132
229
+ CliConfigInvalidHmrRollback = 3131
212
230
  }
213
231
  //#endregion
214
232
  //#region src/ErrorMessages.d.ts
215
233
  /** @internal */
216
234
  declare const messages: {
217
235
  1001: () => string;
218
- 1004: () => string;
236
+ 1002: () => string;
237
+ 1006: () => string;
238
+ 1007: () => string;
219
239
  1008: () => string;
220
- 1009: () => string;
221
- 1010: () => string;
222
- 1006: (envKey: string) => string;
223
- 1007: (envKey: string) => string;
224
- 1005: (count: number, failures: string) => string;
240
+ 1004: (envKey: string) => string;
241
+ 1005: (envKey: string) => string;
242
+ 1003: (count: number, failures: string) => string;
225
243
  1101: () => string;
226
244
  1102: () => string;
227
245
  1103: () => string;
@@ -234,6 +252,9 @@ declare const messages: {
234
252
  1203: (key: string) => string;
235
253
  1204: (guildId?: string) => string;
236
254
  1205: (controllerName: string, pathKind: string) => string;
255
+ 1206: (file: string) => string;
256
+ 1207: (dir: string) => string;
257
+ 1208: (key: string) => string;
237
258
  1301: () => string;
238
259
  1302: () => string;
239
260
  1303: (commandName: string, existingScope: string, requestedScope: string) => string;
@@ -241,8 +262,11 @@ declare const messages: {
241
262
  1305: () => string;
242
263
  1306: () => string;
243
264
  1307: (className: string) => string;
244
- 1401: (route: string, firstClass: string, secondClass: string) => string;
265
+ 1401: (route: string, first: string, second: string) => string;
245
266
  1402: (name: string) => string;
267
+ 1403: (route: string, exportName: string, from: string) => string;
268
+ 1404: (keys: string, exportName: string, from: string) => string;
269
+ 1405: (route: string, from: string) => string;
246
270
  1501: (method: string, reason: string, alternative: string, routeId: string) => string;
247
271
  1502: (componentClass: string, index: number, detail: string, routeId: string) => string;
248
272
  1503: (method: string, targetId: string, routeId: string) => string;
@@ -272,10 +296,11 @@ declare const messages: {
272
296
  2001: (pluginName: string, reason: string) => string;
273
297
  2002: (pluginName: string) => string;
274
298
  2101: (className: string) => string;
275
- 2102: (className: string) => string;
276
- 2103: (databaseName?: string) => string;
299
+ 2102: (databaseName?: string) => string;
300
+ 2103: () => string;
277
301
  2104: () => string;
278
- 2105: () => string;
302
+ 2105: (modelName: string, className: string) => string;
303
+ 2106: (className: string) => string;
279
304
  2201: (className: string) => string;
280
305
  2202: (className: string) => string;
281
306
  2203: () => string;
@@ -286,6 +311,8 @@ declare const messages: {
286
311
  2208: (message: string) => string;
287
312
  2209: () => string;
288
313
  2210: () => string;
314
+ 2211: (databaseName?: string) => string;
315
+ 2212: (databaseName: string) => string;
289
316
  3101: () => string;
290
317
  3102: () => string;
291
318
  3103: () => string;
@@ -307,16 +334,16 @@ declare const messages: {
307
334
  3119: () => string;
308
335
  3120: () => string;
309
336
  3121: () => string;
310
- 3132: () => string;
337
+ 3131: () => string;
311
338
  3122: (route: string, firstFile: string, secondFile: string) => string;
312
339
  3123: (dir: string, reason: string) => string;
313
340
  3124: (kind: string, name: string, firstFile: string, secondFile: string) => string;
314
- 3126: (reason: string) => string;
341
+ 3125: (reason: string) => string;
342
+ 3126: () => string;
315
343
  3127: () => string;
316
344
  3128: () => string;
317
- 3129: () => string;
318
- 3130: (count: number) => string;
319
- 3131: () => string;
345
+ 3129: (count: number) => string;
346
+ 3130: () => string;
320
347
  };
321
348
  /** @internal */
322
349
  type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;
@@ -409,4 +436,4 @@ type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code exte
409
436
  declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
410
437
  //#endregion
411
438
  export { isSeedcordError as a, SeedcordTypeError as i, SeedcordErrorTypeString as n, SeedcordErrorCode as o, SeedcordRangeError as r, SeedcordError as t };
412
- //# sourceMappingURL=SeedcordError-Cs8JM8v4.d.mts.map
439
+ //# sourceMappingURL=SeedcordError-CV8l82MW.d.mts.map
@@ -36,19 +36,19 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
36
36
  /** DISCORD_BOT_TOKEN is not present in the environment. */
37
37
  SeedcordErrorCode[SeedcordErrorCode["ConfigMissingDiscordToken"] = 1001] = "ConfigMissingDiscordToken";
38
38
  /** DISCORD_BOT_TOKEN is present but fails validation. */
39
- SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectDiscordToken"] = 1004] = "ConfigIncorrectDiscordToken";
39
+ SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectDiscordToken"] = 1002] = "ConfigIncorrectDiscordToken";
40
40
  /** One or more configured emojis could not be resolved at startup. */
41
- SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1005] = "ConfigEmojiUnresolved";
41
+ SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1003] = "ConfigEmojiUnresolved";
42
42
  /** A webhook reporter's env var is set but fails webhook URL validation. */
43
- SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] = 1006] = "ConfigWebhookUrlInvalid";
43
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] = 1004] = "ConfigWebhookUrlInvalid";
44
44
  /** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
45
- SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] = 1007] = "ConfigWebhookNotFound";
45
+ SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] = 1005] = "ConfigWebhookNotFound";
46
46
  /** DISCORD_PUBLIC_KEY is not present in the environment. */
47
- SeedcordErrorCode[SeedcordErrorCode["ConfigMissingPublicKey"] = 1008] = "ConfigMissingPublicKey";
47
+ SeedcordErrorCode[SeedcordErrorCode["ConfigMissingPublicKey"] = 1006] = "ConfigMissingPublicKey";
48
48
  /** DISCORD_PUBLIC_KEY is present but fails validation. */
49
- SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectPublicKey"] = 1009] = "ConfigIncorrectPublicKey";
49
+ SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectPublicKey"] = 1007] = "ConfigIncorrectPublicKey";
50
50
  /** The generated route manifest was imported before `seedcord build` generated it. */
51
- SeedcordErrorCode[SeedcordErrorCode["ConfigManifestNotGenerated"] = 1010] = "ConfigManifestNotGenerated";
51
+ SeedcordErrorCode[SeedcordErrorCode["ConfigManifestNotGenerated"] = 1008] = "ConfigManifestNotGenerated";
52
52
  /** Attempted to add lifecycle tasks after startup already completed. */
53
53
  SeedcordErrorCode[SeedcordErrorCode["LifecycleAddAfterCompletion"] = 1101] = "LifecycleAddAfterCompletion";
54
54
  /** Attempted to add lifecycle tasks while startup is still running. */
@@ -73,6 +73,12 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
73
73
  SeedcordErrorCode[SeedcordErrorCode["CoreBotRoleMissing"] = 1204] = "CoreBotRoleMissing";
74
74
  /** A bot controller was constructed without its required handlers directory. */
75
75
  SeedcordErrorCode[SeedcordErrorCode["CoreControllerPathMissing"] = 1205] = "CoreControllerPathMissing";
76
+ /** A file in a scanned directory threw while being imported. */
77
+ SeedcordErrorCode[SeedcordErrorCode["CoreDirectoryImportFailed"] = 1206] = "CoreDirectoryImportFailed";
78
+ /** A scanned directory could not be read. */
79
+ SeedcordErrorCode[SeedcordErrorCode["CoreDirectoryUnreadable"] = 1207] = "CoreDirectoryUnreadable";
80
+ /** A plugin was attached under a key the framework logs on. */
81
+ SeedcordErrorCode[SeedcordErrorCode["CorePluginReservedChannel"] = 1208] = "CorePluginReservedChannel";
76
82
  /** Interaction middleware decorated with disallowed event filters. */
77
83
  SeedcordErrorCode[SeedcordErrorCode["DecoratorInteractionEventFilter"] = 1301] = "DecoratorInteractionEventFilter";
78
84
  /** A decorator could not find the original method being decorated. */
@@ -91,6 +97,12 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
91
97
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateRoute"] = 1401] = "InteractionDuplicateRoute";
92
98
  /** Two different interaction middleware classes share a class name. */
93
99
  SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateMiddleware"] = 1402] = "InteractionDuplicateMiddleware";
100
+ /** A route manifest row gives an export name its module does not have. */
101
+ SeedcordErrorCode[SeedcordErrorCode["InteractionRouteExportMissing"] = 1403] = "InteractionRouteExportMissing";
102
+ /** A subscriber manifest row specifies an export that does not extend `Subscriber`. */
103
+ SeedcordErrorCode[SeedcordErrorCode["SubscriberRouteNotASubscriber"] = 1404] = "SubscriberRouteNotASubscriber";
104
+ /** A manifest row's module threw while importing. */
105
+ SeedcordErrorCode[SeedcordErrorCode["RouteModuleLoadFailed"] = 1405] = "RouteModuleLoadFailed";
94
106
  /** A reply method was called in an ack state where it is illegal. */
95
107
  SeedcordErrorCode[SeedcordErrorCode["ReplyIllegalAckState"] = 1501] = "ReplyIllegalAckState";
96
108
  /** A reply component failed to serialize to raw API data. */
@@ -147,36 +159,42 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
147
159
  SeedcordErrorCode[SeedcordErrorCode["PluginOptionsRejected"] = 2001] = "PluginOptionsRejected";
148
160
  /** A plugin read `this.ctx` before `attach` finalized it. */
149
161
  SeedcordErrorCode[SeedcordErrorCode["PluginContextBeforeInit"] = 2002] = "PluginContextBeforeInit";
150
- /** Mongo service class is missing the `@RegisterMongoService` decorator. */
151
- SeedcordErrorCode[SeedcordErrorCode["PluginMongoServiceDecoratorMissing"] = 2101] = "PluginMongoServiceDecoratorMissing";
152
- /** Mongo model class is missing the `@RegisterMongoModel` decorator. */
153
- SeedcordErrorCode[SeedcordErrorCode["PluginMongoModelDecoratorMissing"] = 2102] = "PluginMongoModelDecoratorMissing";
154
- /** Mongo client failed to establish a connection. */
155
- SeedcordErrorCode[SeedcordErrorCode["PluginMongoConnectionFailed"] = 2103] = "PluginMongoConnectionFailed";
156
- /** Mongo client failed to disconnect cleanly during shutdown. */
157
- SeedcordErrorCode[SeedcordErrorCode["PluginMongoDisconnectFailed"] = 2104] = "PluginMongoDisconnectFailed";
158
- /** Mongo `services` was accessed before the plugin finished initializing. */
159
- SeedcordErrorCode[SeedcordErrorCode["PluginMongoServicesNotReady"] = 2105] = "PluginMongoServicesNotReady";
160
- /** KPG service class is missing the `@RegisterKpgService` decorator. */
161
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgServiceDecoratorMissing"] = 2201] = "PluginKpgServiceDecoratorMissing";
162
- /** KPG service class is missing its table metadata. */
163
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgServiceTableMissing"] = 2202] = "PluginKpgServiceTableMissing";
162
+ /** Mongoose service class is missing the `@RegisterMongooseService` decorator. */
163
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseServiceDecoratorMissing"] = 2101] = "PluginMongooseServiceDecoratorMissing";
164
+ /** Mongoose client failed to establish a connection. */
165
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseConnectionFailed"] = 2102] = "PluginMongooseConnectionFailed";
166
+ /** Mongoose client failed to disconnect cleanly during shutdown. */
167
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseDisconnectFailed"] = 2103] = "PluginMongooseDisconnectFailed";
168
+ /** Mongoose `services` was accessed before the plugin finished initializing. */
169
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseServicesNotReady"] = 2104] = "PluginMongooseServicesNotReady";
170
+ /** Mongoose rejected the model, usually a duplicate model name or an absent schema. */
171
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseModelCreationFailed"] = 2105] = "PluginMongooseModelCreationFailed";
172
+ /** A mongoose service was registered with an empty model name override. */
173
+ SeedcordErrorCode[SeedcordErrorCode["PluginMongooseModelNameMissing"] = 2106] = "PluginMongooseModelNameMissing";
174
+ /** Kysely service class is missing the `@RegisterKyselyService` decorator. */
175
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyServiceDecoratorMissing"] = 2201] = "PluginKyselyServiceDecoratorMissing";
176
+ /** Kysely service class is missing its table metadata. */
177
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyServiceTableMissing"] = 2202] = "PluginKyselyServiceTableMissing";
164
178
  /** Migration manager received an invalid step count. */
165
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgInvalidStepCount"] = 2203] = "PluginKpgInvalidStepCount";
179
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyInvalidStepCount"] = 2203] = "PluginKyselyInvalidStepCount";
166
180
  /** Migration direction was not recognized. */
167
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgUnknownDirection"] = 2204] = "PluginKpgUnknownDirection";
181
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyUnknownDirection"] = 2204] = "PluginKyselyUnknownDirection";
168
182
  /** Provided migrations path could not be resolved. */
169
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgUnresolvedMigrationsPath"] = 2205] = "PluginKpgUnresolvedMigrationsPath";
183
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyUnresolvedMigrationsPath"] = 2205] = "PluginKyselyUnresolvedMigrationsPath";
170
184
  /** No migration files were found for execution. */
171
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgNoMigrationFiles"] = 2206] = "PluginKpgNoMigrationFiles";
185
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyNoMigrationFiles"] = 2206] = "PluginKyselyNoMigrationFiles";
172
186
  /** A migration module failed to export the expected functions. */
173
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgInvalidMigrationModule"] = 2207] = "PluginKpgInvalidMigrationModule";
187
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyInvalidMigrationModule"] = 2207] = "PluginKyselyInvalidMigrationModule";
174
188
  /** An arbitrary (non-Error) failure was reported by a migration. */
175
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgNonErrorFailure"] = 2208] = "PluginKpgNonErrorFailure";
189
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyNonErrorFailure"] = 2208] = "PluginKyselyNonErrorFailure";
176
190
  /** Postgres pool failed to close cleanly during shutdown. */
177
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgDisconnectFailed"] = 2209] = "PluginKpgDisconnectFailed";
178
- /** KPG `services` was accessed before the plugin finished initializing. */
179
- SeedcordErrorCode[SeedcordErrorCode["PluginKpgServicesNotReady"] = 2210] = "PluginKpgServicesNotReady";
191
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyDisconnectFailed"] = 2209] = "PluginKyselyDisconnectFailed";
192
+ /** Kysely `services` was accessed before the plugin finished initializing. */
193
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyServicesNotReady"] = 2210] = "PluginKyselyServicesNotReady";
194
+ /** Postgres pool failed to establish a connection. */
195
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyConnectionFailed"] = 2211] = "PluginKyselyConnectionFailed";
196
+ /** Bootstrapper failed to ensure the target Postgres database exists. */
197
+ SeedcordErrorCode[SeedcordErrorCode["PluginKyselyBootstrapFailed"] = 2212] = "PluginKyselyBootstrapFailed";
180
198
  /** Config file default export was not an object. */
181
199
  SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidExport"] = 3101] = "CliConfigInvalidExport";
182
200
  /** Config is missing the required instance string. */
@@ -226,19 +244,19 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
226
244
  /** Two context-menu commands of the same kind share a name during codegen. */
227
245
  SeedcordErrorCode[SeedcordErrorCode["CliCodegenDuplicateContextMenu"] = 3124] = "CliCodegenDuplicateContextMenu";
228
246
  /** Could not resolve the application from the bot token during `commands --clean`. */
229
- SeedcordErrorCode[SeedcordErrorCode["CliCleanAppFetchFailed"] = 3126] = "CliCleanAppFetchFailed";
247
+ SeedcordErrorCode[SeedcordErrorCode["CliCleanAppFetchFailed"] = 3125] = "CliCleanAppFetchFailed";
230
248
  /** `commands --clean` ran with neither --guild nor --all-guilds, so there is nothing to scan. */
231
- SeedcordErrorCode[SeedcordErrorCode["CliCleanNoGuilds"] = 3127] = "CliCleanNoGuilds";
249
+ SeedcordErrorCode[SeedcordErrorCode["CliCleanNoGuilds"] = 3126] = "CliCleanNoGuilds";
232
250
  /** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */
233
- SeedcordErrorCode[SeedcordErrorCode["CliCleanPurgeAllGuilds"] = 3128] = "CliCleanPurgeAllGuilds";
251
+ SeedcordErrorCode[SeedcordErrorCode["CliCleanPurgeAllGuilds"] = 3127] = "CliCleanPurgeAllGuilds";
234
252
  /** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */
235
- SeedcordErrorCode[SeedcordErrorCode["CliCancelled"] = 3129] = "CliCancelled";
253
+ SeedcordErrorCode[SeedcordErrorCode["CliCancelled"] = 3128] = "CliCancelled";
236
254
  /** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */
237
- SeedcordErrorCode[SeedcordErrorCode["CliCleanLargeBotUnconfirmed"] = 3130] = "CliCleanLargeBotUnconfirmed";
255
+ SeedcordErrorCode[SeedcordErrorCode["CliCleanLargeBotUnconfirmed"] = 3129] = "CliCleanLargeBotUnconfirmed";
238
256
  /** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */
239
- SeedcordErrorCode[SeedcordErrorCode["CliCleanApplyNeedsYes"] = 3131] = "CliCleanApplyNeedsYes";
257
+ SeedcordErrorCode[SeedcordErrorCode["CliCleanApplyNeedsYes"] = 3130] = "CliCleanApplyNeedsYes";
240
258
  /** Config hmr rollback flag must be a boolean when provided. */
241
- SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidHmrRollback"] = 3132] = "CliConfigInvalidHmrRollback";
259
+ SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidHmrRollback"] = 3131] = "CliConfigInvalidHmrRollback";
242
260
  return SeedcordErrorCode;
243
261
  }({});
244
262
 
@@ -247,13 +265,13 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
247
265
  /** @internal */
248
266
  const messages = {
249
267
  [1001]: () => "Missing DISCORD_BOT_TOKEN environment variable.",
250
- [1004]: () => "Invalid DISCORD_BOT_TOKEN value.",
251
- [1008]: () => "Missing DISCORD_PUBLIC_KEY environment variable.",
252
- [1009]: () => "Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.",
253
- [1010]: () => "The route manifest is generated by `seedcord build`. Run the build before importing it.",
254
- [1006]: (envKey) => `${envKey} is not a well-formed Discord webhook url.`,
255
- [1007]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
256
- [1005]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
268
+ [1002]: () => "Invalid DISCORD_BOT_TOKEN value.",
269
+ [1006]: () => "Missing DISCORD_PUBLIC_KEY environment variable.",
270
+ [1007]: () => "Invalid DISCORD_PUBLIC_KEY value. Expected 64 hex characters.",
271
+ [1008]: () => "The route manifest is generated by `seedcord build`. Run the build before importing it.",
272
+ [1004]: (envKey) => `${envKey} is not a well-formed Discord webhook url.`,
273
+ [1005]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
274
+ [1003]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
257
275
  [1101]: () => "Cannot add tasks after startup sequence has already completed.",
258
276
  [1102]: () => "Cannot add tasks while startup sequence is in progress.",
259
277
  [1103]: () => "Cannot remove tasks while startup sequence is in progress.",
@@ -266,6 +284,9 @@ const messages = {
266
284
  [1203]: (key) => `Plugin with key "${key}" already exists.`,
267
285
  [1204]: (guildId) => guildId ? `Bot role not found in guild ${guildId}.` : "Bot role not found in guild.",
268
286
  [1205]: (controllerName, pathKind) => `${controllerName} was instantiated without a ${pathKind} path.`,
287
+ [1206]: (file) => `${file} threw while importing.`,
288
+ [1207]: (dir) => `${dir} could not be read.`,
289
+ [1208]: (key) => `Plugin key "${key}" is a channel the framework logs on. Pick another key.`,
269
290
  [1301]: () => "Interaction middleware cannot specify event filters.",
270
291
  [1302]: () => "Decorator could not locate the original method. Ensure the method exists before applying the decorator.",
271
292
  [1303]: (commandName, existingScope, requestedScope) => `Command "${commandName}" is already registered as a "${existingScope}" command and cannot be re-registered as a "${requestedScope}" command.`,
@@ -273,8 +294,11 @@ const messages = {
273
294
  [1305]: () => "RegisterCommand(\"guild\") requires a non-empty guilds array.",
274
295
  [1306]: () => "Middleware priority must be a finite number.",
275
296
  [1307]: (className) => `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,
276
- [1401]: (route, firstClass, secondClass) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${firstClass} and ${secondClass}. Rename one.`,
297
+ [1401]: (route, first, second) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${first} and ${second}. Rename one.`,
277
298
  [1402]: (name) => `Two different interaction middleware classes share the name \`${name}\`. Rename one so they do not collide.`,
299
+ [1403]: (route, exportName, from) => `Route \`${route}\` loads \`${exportName}\` from ${from}, which exports no such name.`,
300
+ [1404]: (keys, exportName, from) => `Subscriber row for \`${keys}\` loads \`${exportName}\` from ${from}, which does not extend Subscriber.`,
301
+ [1405]: (route, from) => `Route \`${route}\` failed to import ${from}.`,
278
302
  [1501]: (method, reason, alternative, routeId) => `${chalk.default.cyan(`${method}()`)} was called when ${reason}.\n${alternative} (route ${chalk.default.cyan(routeId)})`,
279
303
  [1502]: (componentClass, index, detail, routeId) => `${chalk.default.cyan(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\.$/, "")}. (route ${chalk.default.cyan(routeId)})`,
280
304
  [1503]: (method, targetId, routeId) => `${chalk.default.cyan(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${chalk.default.cyan(routeId)})`,
@@ -303,13 +327,14 @@ const messages = {
303
327
  [1902]: () => "Color must be within the range 0 to 16777215 (0xffffff).",
304
328
  [2001]: (pluginName, reason) => `${pluginName} rejected its options, ${reason.replace(/\.$/, "")}.`,
305
329
  [2002]: (pluginName) => `${pluginName} read this.ctx before attach finalized it. ctx is available from init() onward.`,
306
- [2101]: (className) => `Missing @RegisterMongoService on ${className}.`,
307
- [2102]: (className) => `Missing @RegisterMongoModel on ${className}.`,
308
- [2103]: (databaseName) => databaseName ? `Could not connect to MongoDB (${databaseName}).` : "Could not connect to MongoDB.",
309
- [2104]: () => "Failed to disconnect from MongoDB cleanly during shutdown.",
310
- [2105]: () => "Mongo services accessed before the plugin finished initializing.",
311
- [2201]: (className) => `Missing @RegisterKpgService on ${className}.`,
312
- [2202]: (className) => `Missing table metadata for ${className}. Provide a table via @RegisterKpgService().`,
330
+ [2101]: (className) => `Missing @RegisterMongooseService on ${className}.`,
331
+ [2102]: (databaseName) => databaseName ? `Could not connect to MongoDB (${databaseName}).` : "Could not connect to MongoDB.",
332
+ [2103]: () => "Failed to disconnect from MongoDB cleanly during shutdown.",
333
+ [2104]: () => "Mongoose services accessed before the plugin finished initializing.",
334
+ [2105]: (modelName, className) => `Could not build the mongoose model ${modelName} for ${className}.`,
335
+ [2106]: (className) => `Empty model name on ${className}. Provide a non-empty modelName via @RegisterMongooseService().`,
336
+ [2201]: (className) => `Missing @RegisterKyselyService on ${className}.`,
337
+ [2202]: (className) => `Missing table metadata for ${className}. Provide a table via @RegisterKyselyService().`,
313
338
  [2203]: () => "Migration step count must be a non-negative integer.",
314
339
  [2204]: (direction) => `Unknown migration direction: ${String(direction)}.`,
315
340
  [2205]: (label) => `Unable to resolve migrations at path: ${label}.`,
@@ -317,7 +342,9 @@ const messages = {
317
342
  [2207]: (filePath) => `Migration file ${filePath} must export async functions up and down.`,
318
343
  [2208]: (message) => `Migration failure: ${message}.`,
319
344
  [2209]: () => "Failed to close the Postgres pool cleanly during shutdown.",
320
- [2210]: () => "KPG services accessed before the plugin finished initializing.",
345
+ [2210]: () => "Kysely services accessed before the plugin finished initializing.",
346
+ [2211]: (databaseName) => databaseName ? `Could not connect to Postgres (${databaseName}).` : "Could not connect to Postgres.",
347
+ [2212]: (databaseName) => `Failed to ensure database ${databaseName} exists.`,
321
348
  [3101]: () => "Config file must default export an object.",
322
349
  [3102]: () => "Config must include an `instance` string that points to your Seedcord default export.",
323
350
  [3103]: () => "Config `root` must be a string when provided.",
@@ -329,26 +356,26 @@ const messages = {
329
356
  [3114]: () => "Config `build.bootstrap` must be a string when provided.",
330
357
  [3115]: (entryPath, root) => `Entry file ${entryPath} must reside inside configured root ${root}.`,
331
358
  [3105]: (entryPath) => `Cannot find entry file at ${entryPath}.`,
332
- [3106]: (entryPath, reason) => `Failed to import ${entryPath} via tsx: ${reason}.`,
333
- [3107]: (entryPath, nativeReason, fallbackReason) => `Failed to import ${entryPath}: ${nativeReason}. Fallback via jiti also failed: ${fallbackReason}.`,
359
+ [3106]: (entryPath, reason) => `Failed to import ${entryPath} via tsx: ${reason}`,
360
+ [3107]: (entryPath, nativeReason, fallbackReason) => `Failed to import ${entryPath}: ${nativeReason} (the jiti fallback also failed: ${fallbackReason})`,
334
361
  [3108]: () => "Seedcord instance must default export an object with a start() method.",
335
- [3109]: (instancePath, reason) => `Failed to start Seedcord from ${instancePath}: ${reason}.`,
362
+ [3109]: (instancePath, reason) => `Failed to start Seedcord from ${instancePath}: ${reason}`,
336
363
  [3116]: (hint) => `Unable to resolve a tsconfig for builds (${hint}). Provide build.tsconfig or add tsconfig.build.json / tsconfig.json.`,
337
364
  [3117]: (diagnostics) => `TypeScript build failed:\n${diagnostics}`,
338
- [3118]: (targetPath, reason) => `Failed to write bootstrap file at ${targetPath}: ${reason}.`,
365
+ [3118]: (targetPath, reason) => `Failed to write bootstrap file at ${targetPath}: ${reason}`,
339
366
  [3119]: () => "Config `tsconfig` must be a string when provided.",
340
367
  [3120]: () => "Config `hmr` must be an object when provided.",
341
368
  [3121]: () => "Config `hmr.restart` must be an array of strings when provided.",
342
- [3132]: () => "Config `hmr.rollback` must be a boolean when provided.",
369
+ [3131]: () => "Config `hmr.rollback` must be a boolean when provided.",
343
370
  [3122]: (route, firstFile, secondFile) => `Two commands resolve to the same slash route \`${route}\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,
344
- [3123]: (dir, reason) => `Could not read the commands directory ${dir} during codegen. ${reason}.`,
371
+ [3123]: (dir, reason) => `Could not read the commands directory ${dir} during codegen. ${reason}`,
345
372
  [3124]: (kind, name, firstFile, secondFile) => `Two ${kind} context-menu commands share the name \`${name}\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,
346
- [3126]: (reason) => `Could not resolve the application from the bot token. ${reason}.`,
347
- [3127]: () => "No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.",
348
- [3128]: () => "--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.",
349
- [3129]: () => "Cancelled.",
350
- [3130]: (count) => `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,
351
- [3131]: () => "Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes."
373
+ [3125]: (reason) => `Could not resolve the application from the bot token. ${reason}`,
374
+ [3126]: () => "No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.",
375
+ [3127]: () => "--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.",
376
+ [3128]: () => "Cancelled.",
377
+ [3129]: (count) => `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,
378
+ [3130]: () => "Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes."
352
379
  };
353
380
  /** @internal */
354
381
  function formatSeedcordErrorMessage(code, args) {
@@ -482,4 +509,4 @@ Object.defineProperty(exports, 'isSeedcordError', {
482
509
  return isSeedcordError;
483
510
  }
484
511
  });
485
- //# sourceMappingURL=SeedcordError-Cjk81dnd.cjs.map
512
+ //# sourceMappingURL=SeedcordError-Co6sHdk8.cjs.map