@seedcord/errors 0.15.0-next.0 → 0.15.0-next.3

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.
@@ -1,4 +1,3 @@
1
- import { ColorSupportLevel } from "chalk";
2
1
  //#region src/ErrorCodes.d.ts
3
2
  /**
4
3
  * All Seedcord error codes.
@@ -106,6 +105,10 @@ declare enum SeedcordErrorCode {
106
105
  CorePluginKvOutsideAttach = 1233,
107
106
  /** The driver in `config.kv` threw, or reported a write as failed. */
108
107
  CoreKvDriverFailed = 1234,
108
+ /** The bot's own member is missing from the guild's member cache. */
109
+ CoreBotMemberMissing = 1235,
110
+ /** A module from a build read its path, but the build's `index.mjs` didn't run first. */
111
+ CoreBuiltModuleRanDirectly = 1236,
109
112
  /** A command class carries `@RegisterCommand` twice. */
110
113
  DecoratorCommandAlreadyRegistered = 1301,
111
114
  /** `@RegisterCommand('global')` was given guild ids. */
@@ -118,6 +121,8 @@ declare enum SeedcordErrorCode {
118
121
  DecoratorWebhookUrlMissing = 1305,
119
122
  /** A middleware decorator got an empty filter array. */
120
123
  DecoratorEmptyMiddlewareFilter = 1306,
124
+ /** `@Subscribe`, `@RegisterEvent`, or a component route decorator lists the same key or customId prefix twice. */
125
+ DecoratorDuplicateKey = 1307,
121
126
  /** A reply method was called in an ack state where Discord rejects it. */
122
127
  ReplyIllegalAckState = 1501,
123
128
  /** A reply component threw while seedcord serialized it. */
@@ -142,10 +147,8 @@ declare enum SeedcordErrorCode {
142
147
  CustomIdWireTooLong = 1606,
143
148
  /** A component handler is missing the route decorator that matches its base. */
144
149
  CustomIdHandlerRouteMissing = 1607,
145
- /** A handler's `match()` has no arm for the current route, field, event, or command. */
146
- MatchArmMissing = 1608,
147
- /** An event handler or middleware read the event name but was constructed without one. */
148
- EventNameUnavailable = 1609,
150
+ /** A handler's `match()` doesn't have a case for the current route, field, event, or command. */
151
+ MatchCaseMissing = 1608,
149
152
  /** Discord sent an autocomplete payload with no focused option. */
150
153
  AutocompleteNoFocusedOption = 1610,
151
154
  /** The submitted modal has no field with the requested custom id. */
@@ -302,6 +305,12 @@ declare enum SeedcordErrorCode {
302
305
  CliPluginCodegenValue = 3145,
303
306
  /** Two attachments of one plugin class returned different values at one key from `codegen()`. */
304
307
  CliPluginCodegenConflict = 3146,
308
+ /** The text passed to `seedcord ask` isn't a question the guide search accepts. */
309
+ CliAskBadQuestion = 3147,
310
+ /** The guide search refused `seedcord ask` until a search limit resets. */
311
+ CliAskHasToWait = 3148,
312
+ /** The guide search failed for a reason other than a search limit. */
313
+ CliAskFailed = 3149,
305
314
  /** A flag answers a question that the earlier answers skip. */
306
315
  CreateFlagNotApplicable = 3201,
307
316
  /** A flag has a value its question rejects. */
@@ -332,297 +341,5 @@ declare enum SeedcordErrorCode {
332
341
  MakePartialCallsItself = 3309
333
342
  }
334
343
  //#endregion
335
- //#region src/palette.d.ts
336
- declare function setColorLevel(level: ColorSupportLevel): void;
337
- declare const paint: {
338
- readonly sky: import("chalk").ChalkInstance;
339
- readonly path: (path: string) => string;
340
- readonly iris: import("chalk").ChalkInstance;
341
- readonly mint: import("chalk").ChalkInstance;
342
- readonly amber: import("chalk").ChalkInstance;
343
- readonly coral: import("chalk").ChalkInstance;
344
- readonly flesh: import("chalk").ChalkInstance;
345
- readonly rind: import("chalk").ChalkInstance;
346
- readonly pith: import("chalk").ChalkInstance;
347
- readonly mute: import("chalk").ChalkInstance;
348
- readonly check: "✔︎";
349
- readonly cross: "✘";
350
- readonly bold: import("chalk").ChalkInstance;
351
- readonly italic: import("chalk").ChalkInstance;
352
- readonly underline: import("chalk").ChalkInstance;
353
- };
354
- declare const WORDMARK: string;
355
- //#endregion
356
- //#region src/messageParts.d.ts
357
- interface VitePluginPlace {
358
- hook?: string | undefined;
359
- loading?: {
360
- kind: 'file';
361
- path: string;
362
- } | {
363
- kind: 'virtual';
364
- id: string;
365
- } | undefined;
366
- }
367
- declare const listedFolderProblems: {
368
- missing: string;
369
- file: string;
370
- outsideProject: string;
371
- };
372
- //#endregion
373
- //#region src/ErrorMessages.d.ts
374
- /** @internal */
375
- declare const messages: {
376
- 1001: (count: number) => string;
377
- 1002: (key: string) => string;
378
- 1003: (key: string, name: string, where: string) => string;
379
- 1004: (key: string, name: string, where: string, reason: string, fix: string) => string;
380
- 1005: (envKey: string) => string;
381
- 1006: (name: string) => string;
382
- 1007: (name: string, expected: string, why?: string) => string;
383
- 1008: (commands: readonly string[]) => string;
384
- 1009: (runtime: string, required: string, running: string) => string;
385
- 1010: (key: string) => string;
386
- 1011: (port: number, setting: string, configFile?: string) => string;
387
- 1101: (action: "add" | "remove", startup: "running" | "finished") => string;
388
- 1102: (phase: unknown) => string;
389
- 1103: (phase: string, failures: number) => string;
390
- 1104: (taskName: string, timeout: number) => string;
391
- 1105: () => string;
392
- 1106: (setting: string, value: number) => string;
393
- 1201: () => string;
394
- 1202: () => string;
395
- 1203: (key: string) => string;
396
- 1204: (guildId?: string) => string;
397
- 1205: (controllerName: string, pathKind: string) => string;
398
- 1206: (file: string, reason: string) => string;
399
- 1229: (plugin: string, place: VitePluginPlace, configFile: string, reason: string) => string;
400
- 1207: (path: string, reason: string) => string;
401
- 1219: (path: string, root: string) => string;
402
- 1223: (dir: string) => string;
403
- 1225: (dir: string, root: string) => string;
404
- 1230: (dir: string) => string;
405
- 1231: (dir: string) => string;
406
- 1232: () => string;
407
- 1234: (operation: "read" | "write" | "delete" | "list", key: string) => string;
408
- 1233: (plugin: string) => string;
409
- 1215: (head: string, key: string) => string;
410
- 1217: (key: string, reason: string) => string;
411
- 1218: (plugin: string) => string;
412
- 1220: (plugin: string, axis: string, declared: string, host: string) => string;
413
- 1216: (key: string) => string;
414
- 1208: (key: string) => string;
415
- 1209: () => string;
416
- 1222: () => string;
417
- 1221: () => string;
418
- 1210: (accessor: string, key: string) => string;
419
- 1211: () => string;
420
- 1212: (event: string) => string;
421
- 1213: (commandName: string) => string;
422
- 1214: (guildId: string, reason: string, status?: number) => string;
423
- 1224: (reason: string, status?: number) => string;
424
- 1226: (className: string) => string;
425
- 1227: (what: string, reason: string, fix?: string) => string;
426
- 1228: (kind: string, name: string, sources?: readonly string[], note?: string) => string;
427
- 1301: (commandName: string, existingCall: string, requestedCall: string) => string;
428
- 1302: (className: string) => string;
429
- 1303: (className: string) => string;
430
- 1304: (className: string, priority: string) => string;
431
- 1305: (className: string) => string;
432
- 1306: (className: string, key: string) => string;
433
- 1501: (method: string, reason: string, alternative: string, routeId: string) => string;
434
- 1502: (componentClass: string, index: number, detail: string, routeId: string) => string;
435
- 1503: (method: string, targetId: string, routeId: string) => string;
436
- 1504: (method: string, routeId: string) => string;
437
- 1505: (method: string, routeId: string) => string;
438
- 1601: (prefix: string) => string;
439
- 1602: (field: string) => string;
440
- 1603: (field: string, method: string) => string;
441
- 1604: (field: string, min: number, max: number) => string;
442
- 1605: (field: string, expected: string, value: string) => string;
443
- 1606: (prefix: string, length: number) => string;
444
- 1607: (className: string) => string;
445
- 1608: (handler: string, kind: string, value: string) => string;
446
- 1609: (handler: string, read: string) => string;
447
- 1610: () => string;
448
- 1611: (customId: string) => string;
449
- 1612: (customId: string, kind: string, getter?: string) => string;
450
- 1613: (customId: string) => string;
451
- 1614: (customId: string, picked: string, allowed: readonly string[]) => string;
452
- 1615: (prefix: string) => string;
453
- 1616: (detail: string) => string;
454
- 1617: (key: string) => string;
455
- 1701: (input: string) => string;
456
- 1801: (perPage: number) => string;
457
- 1802: (count: number, max: number) => string;
458
- 1803: (key: string) => string;
459
- 1901: (value: string) => string;
460
- 1902: (value: number) => string;
461
- 1951: (option: string, expected: string, value: number) => string;
462
- 1952: (value: string) => string;
463
- 1971: (filename: string, logsFolder: string) => string;
464
- 2001: (pluginName: string, reason: string) => string;
465
- 2002: (count: number) => string;
466
- 2003: (decorator: string, className: string) => string;
467
- 2004: (pluginName: string) => string;
468
- 2005: (service: string, target?: string) => string;
469
- 2006: (service: string) => string;
470
- 2101: (modelName: string, className: string) => string;
471
- 2102: (className: string) => string;
472
- 2201: (className: string) => string;
473
- 2202: (steps: number) => string;
474
- 2203: (direction: unknown) => string;
475
- 2204: (filePath: string) => string;
476
- 2205: (message: string) => string;
477
- 2206: (databaseName: string) => string;
478
- 3001: () => string;
479
- 3101: () => string;
480
- 3102: (baseDir: string, candidates: readonly string[]) => string;
481
- 3112: (field: string, expected: string) => string;
482
- 3103: (path: string, field: string) => string;
483
- 3104: (instancePath: string) => string;
484
- 3105: (instancePath: string, reason: string) => string;
485
- 3106: (configDir: string, configured?: string) => string;
486
- 3116: (packages: readonly string[], projectDir: string, why: string) => string;
487
- 3107: (diagnostics: string) => string;
488
- 3114: (reason: string) => string;
489
- 3115: (outDir: string, root: string) => string;
490
- 3117: (outDir: string) => string;
491
- 3118: (count: number) => string;
492
- 3130: (lines: readonly string[]) => string;
493
- 3131: (method: string) => string;
494
- 3132: (instance: string) => string;
495
- 3133: () => string;
496
- 3108: (flags: readonly string[], note?: string) => string;
497
- 3113: (name: string, file: string, reason: string) => string;
498
- 3134: (name: string, file: string) => string;
499
- 3135: () => string;
500
- 3136: () => string;
501
- 3137: (cloudflareConfig: string) => string;
502
- 3138: (cliDir: string, projectInstall: string) => string;
503
- 3139: (name: string, created: readonly string[]) => string;
504
- 3140: (folder: string, problem: keyof typeof listedFolderProblems) => string;
505
- 3141: (configDir: string, pid: number, startedAt: string, lockFile: string) => string;
506
- 3142: (folder: string) => string;
507
- 3143: (plugin: string, key: string, reason: string) => string;
508
- 3144: (plugin: string, key: string) => string;
509
- 3145: (id: string, key: string, path: string, value: string) => string;
510
- 3146: (id: string, first: string, second: string, path: string) => string;
511
- 3119: (outputPath: string) => string;
512
- 3121: (cloudflareConfig: string, tsconfig: string) => string;
513
- 3122: (tsconfig: string, configDir: string) => string;
514
- 3123: (tool: string, file: string, output: string) => string;
515
- 3125: (field: string, file: string, why: string) => string;
516
- 3126: (cloudflareConfig: string, date: string, firstDate: string) => string;
517
- 3127: (cloudflareConfig: string) => string;
518
- 3128: (reason: string) => string;
519
- 3129: (configFile: string, root: string) => string;
520
- 3124: (tsc: string, reason: string) => string;
521
- 3120: (path: string) => string;
522
- 3109: (seconds: number) => string;
523
- 3110: (url: string) => string;
524
- 3111: (url: string, seconds: number) => string;
525
- 3201: (flag: string) => string;
526
- 3202: (flag: string, reason: string) => string;
527
- 3203: (reason: string) => string;
528
- 3204: (target: string) => string;
529
- 3205: (command: string, reason: string) => string;
530
- 3301: (name: string) => string;
531
- 3302: (template: string, folder: string, count: number) => string;
532
- 3303: (template: string, value: string, first: "text" | "list" | "object", second: "text" | "list" | "object") => string;
533
- 3304: (file: string, from: string, reason: string) => string;
534
- 3305: (template: string, value: string) => string;
535
- 3306: () => string;
536
- 3307: (folder: string) => string;
537
- 3308: (path: string, takenByTemplate?: string) => string;
538
- 3309: (template: string, partial: string) => string;
539
- };
540
- /** @internal */
541
- type SeedcordErrorArguments<Code extends SeedcordErrorCode> = Parameters<(typeof messages)[Code]>;
542
- //#endregion
543
- //#region src/SeedcordError.d.ts
544
- /**
545
- * String literal type for Seedcord error identifiers.
546
- *
547
- * @internal
548
- */
549
- type SeedcordErrorIdentifier = keyof typeof SeedcordErrorCode;
550
- /**
551
- * Options for Seedcord errors.
552
- *
553
- * @internal
554
- */
555
- interface SeedcordErrorOptions extends ErrorOptions {}
556
- type SeedcordErrorCtorRest<Code extends SeedcordErrorCode> = SeedcordErrorArguments<Code> extends [] ? [options?: SeedcordErrorOptions] : [args: SeedcordErrorArguments<Code>, options?: SeedcordErrorOptions];
557
- /**
558
- * The Seedcord error class names as string literals. {@link isSeedcordError} takes one as its `type`
559
- * argument.
560
- */
561
- type SeedcordErrorTypeString = `Seedcord${'Error' | 'TypeError' | 'RangeError' | 'AggregateError'}`;
562
- declare const kIdentifier: unique symbol;
563
- interface BaseSeedcordError {
564
- readonly code: SeedcordErrorCode;
565
- readonly [kIdentifier]: SeedcordErrorIdentifier;
566
- readonly type: SeedcordErrorTypeString;
567
- }
568
- declare class SeedcordError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends Error implements BaseSeedcordError {
569
- readonly code: Code;
570
- readonly [kIdentifier]: SeedcordErrorIdentifier;
571
- readonly type = "SeedcordError";
572
- constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
573
- }
574
- declare class SeedcordTypeError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends TypeError implements BaseSeedcordError {
575
- readonly code: Code;
576
- readonly [kIdentifier]: SeedcordErrorIdentifier;
577
- readonly type = "SeedcordTypeError";
578
- constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
579
- }
580
- declare class SeedcordRangeError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends RangeError implements BaseSeedcordError {
581
- readonly code: Code;
582
- readonly [kIdentifier]: SeedcordErrorIdentifier;
583
- readonly type = "SeedcordRangeError";
584
- constructor(code: Code, ...rest: SeedcordErrorCtorRest<Code>);
585
- }
586
- declare class SeedcordAggregateError<Code extends SeedcordErrorCode = SeedcordErrorCode> extends AggregateError implements BaseSeedcordError {
587
- readonly code: Code;
588
- readonly [kIdentifier]: SeedcordErrorIdentifier;
589
- readonly type = "SeedcordAggregateError";
590
- constructor(code: Code, errors: readonly unknown[], ...rest: SeedcordErrorCtorRest<Code>);
591
- }
592
- /**
593
- * Variant type for Seedcord error classes.
594
- *
595
- * @internal
596
- */
597
- 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>;
598
- /**
599
- * Union type of all Seedcord error variants for a specific error code.
600
- *
601
- * @internal
602
- */
603
- type AnySeedcordErrorForCode<Code extends SeedcordErrorCode> = { [Variant in SeedcordErrorTypeString]: SeedcordErrorVariant<Variant, Code>; }[SeedcordErrorTypeString];
604
- /**
605
- * Union type of all Seedcord errors filtered by error class.
606
- *
607
- * @internal
608
- */
609
- type ErrorTypeFilter<Type extends SeedcordErrorTypeString | undefined> = Type extends SeedcordErrorTypeString ? { [Code in SeedcordErrorCode]: SeedcordErrorVariant<Type, Code>; }[SeedcordErrorCode] : AnySeedcordErrorForCode<SeedcordErrorCode>;
610
- /**
611
- * Union type of all Seedcord errors filtered by error class and error code.
612
- *
613
- * @internal
614
- */
615
- type ErrorCodeFilter<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined> = Code extends SeedcordErrorCode ? Type extends SeedcordErrorTypeString ? SeedcordErrorVariant<Type, Code> : AnySeedcordErrorForCode<Code> : ErrorTypeFilter<Type>;
616
- /**
617
- * Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.
618
- *
619
- * @param error - The value to inspect.
620
- * @param type - Optional error class discriminator.
621
- * @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.
622
- * @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.
623
- * @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.
624
- */
625
- declare function isSeedcordError<Type extends SeedcordErrorTypeString | undefined, Code extends SeedcordErrorCode | undefined>(error: unknown, type?: Type, code?: Code): error is ErrorCodeFilter<Type, Code>;
626
- //#endregion
627
- export { SeedcordTypeError as a, VitePluginPlace as c, setColorLevel as d, SeedcordErrorCode as f, SeedcordRangeError as i, WORDMARK as l, SeedcordError as n, isSeedcordError as o, SeedcordErrorTypeString as r, SeedcordErrorArguments as s, SeedcordAggregateError as t, paint as u };
628
- //# sourceMappingURL=SeedcordError-CUDze2Ar.d.mts.map
344
+ export { SeedcordErrorCode as t };
345
+ //# sourceMappingURL=ErrorCodes-BfhJtzPM.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { t as SeedcordErrorCode } from "./ErrorCodes-BfhJtzPM.mjs";
2
+ export { SeedcordErrorCode };