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