@zerotal/core 1.6.3 → 1.7.2

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/api-surface.md ADDED
@@ -0,0 +1,3609 @@
1
+ # @zerotal/core — public API surface
2
+
3
+ <!-- AUTO-GENERATED by scripts/api-surface.ts. Do not edit by hand.
4
+ Run `bun run api:surface` to regenerate after an intentional API change. -->
5
+
6
+ ## . `(./src/index.ts)`
7
+
8
+ class AppBooted = {
9
+ new (durationMs: number, environment: string, providerCount: number): AppBooted
10
+ readonly durationMs: number
11
+ readonly environment: string
12
+ readonly providerCount: number
13
+ }
14
+
15
+ class Application = {
16
+ new (): Application
17
+ static _resetInstance: () => void
18
+ static create: (options?: CreateOptions) => Application
19
+ _activeProviders: ServiceProvider[]
20
+ _allowedOrigins: () => string[]
21
+ _env: Environment
22
+ _swapExceptionHandler: (handler: ExceptionHandler | undefined) => ExceptionHandler | undefined
23
+ _userResolver: ((id: number) => Promise<AuthenticatedUser | null>) | undefined
24
+ adoptAsCurrent: () => Application
25
+ bind: (callback: (container: Container) => void) => Application
26
+ boot: () => Promise<void>
27
+ bootAsWorker: () => Promise<void>
28
+ bootDurationMs: number | undefined
29
+ booted: boolean
30
+ close: () => Promise<void>
31
+ declareWebSocketPath: (path: string) => Application
32
+ defer: { (token: keyof ContainerBindings, Provider: ProviderClass): Application; (map: Partial<Record<keyof ContainerBindings, ProviderClass>>): Application; (providers: DeferrableProviderClass[]): Application;}
33
+ doctorChecks: readonly DoctorCheck[]
34
+ enableDevWs: () => Application
35
+ environment: Environment
36
+ fileBasedRouting: (config: string | FileRoutingConfig | (FileRoutingEntry & { dir: string;})) => Application
37
+ globalMiddleware: PipeClass[]
38
+ providerReport: readonly ProviderReport[]
39
+ readonly _configValidators: RegisteredConfigValidator[]
40
+ readonly container: Container
41
+ readonly routerState: RouterState
42
+ register: (providers: ProviderClass[]) => Application
43
+ registerConcern: (descriptor: ConcernDescriptor) => Application
44
+ registerConfigValidator: (namespace: string, validate: ConfigValidator) => Application
45
+ registerDoctorCheck: (check: DoctorCheck) => Application
46
+ routedFiles: string[]
47
+ routing: (config: string | RoutingConfig | (RoutingEntry & { file: string;})) => Application
48
+ serverMetrics: () => { pendingRequests: number; pendingWebSockets: number;}
49
+ start: (port?: number) => Promise<void>
50
+ stop: (options?: { exit?: boolean;}) => Promise<void>
51
+ use: (middleware: PipeClass | PipeClass[]) => Application
52
+ useConfig: (input: ConfigMap | ConfigLoader) => Application
53
+ useOnce: (middlewareClass: PipeClass) => void
54
+ webSocketPaths: () => string[]
55
+ withExceptionHandler: (Handler: new () => ExceptionHandler) => Application
56
+ withUserResolver: (fn: (id: number) => Promise<AuthenticatedUser | null>) => Application
57
+ withWebSocket: (handlers: WebSocketHandlers, upgradeData?: (req: Request, server?: unknown) => Record<string, unknown>, path?: string) => Application
58
+ }
59
+
60
+ class BadRequestError = {
61
+ new (message?: string): BadRequestError
62
+ headers?: Record<string, string>
63
+ readonly code: string
64
+ readonly context?: Record<string, unknown> | undefined
65
+ readonly status: number
66
+ }
67
+
68
+ class BaseMiddleware = {
69
+ new <O extends object = object>(): BaseMiddleware<O>
70
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
71
+ afterResponse?: (ctx: HttpContext) => Promise<void>
72
+ handle: (ctx: HttpContext, next: NextFn) => Promise<Response | void>
73
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
74
+ }
75
+
76
+ class BindingNotFoundError = {
77
+ new (token: string): BindingNotFoundError
78
+ readonly code: string
79
+ readonly context?: Record<string, unknown> | undefined
80
+ readonly status: number
81
+ }
82
+
83
+ class BufferWriter = {
84
+ new (): BufferWriter
85
+ flush: () => string
86
+ write: (message: string) => void
87
+ writeError: (message: string) => void
88
+ writeLine: (message: string) => void
89
+ }
90
+
91
+ class CallQueuedListener = {
92
+ new (listenerName: string, eventName: string, eventPayload: any, queueName?: string | boolean, maxAttempts?: number, retryDelay?: number): CallQueuedListener
93
+ static fromPayload: (payload: Record<string, unknown>) => CallQueuedListener
94
+ className: string
95
+ handle: () => Promise<void>
96
+ payload: () => Record<string, unknown>
97
+ readonly eventName: string
98
+ readonly eventPayload: any
99
+ readonly listenerName: string
100
+ readonly maxAttempts: number
101
+ readonly queue: string
102
+ readonly retryDelay: number
103
+ }
104
+
105
+ class Collection = {
106
+ new <T>(_items: T[]): Collection<T>
107
+ static macro: (name: string, fn: (this: Collection<unknown>, ...args: unknown[]) => unknown) => void
108
+ __@iterator: () => Iterator<T>
109
+ avg: (key?: keyof T) => number
110
+ chunk: (size: number) => Collection<T[]>
111
+ contains: (valueOrFn: T | ((item: T) => boolean)) => boolean
112
+ count: () => number
113
+ each: (fn: (item: T, index: number) => void) => Collection<T>
114
+ filter: (fn: (item: T, index: number) => boolean) => Collection<T>
115
+ first: (fn?: (item: T) => boolean) => T | undefined
116
+ flatMap: <U>(fn: (item: T, index: number) => U[]) => Collection<U>
117
+ flatten: () => Collection<T extends unknown[] ? T[number] : T>
118
+ groupBy: <K extends string>(keyOrFn: keyof T | ((item: T) => K)) => Record<K, T[]>
119
+ isEmpty: () => boolean
120
+ isNotEmpty: () => boolean
121
+ keyBy: <K extends keyof T>(key: K) => Record<string, T>
122
+ last: (fn?: (item: T) => boolean) => T | undefined
123
+ length: number
124
+ map: <U>(fn: (item: T, index: number) => U) => Collection<U>
125
+ max: (key?: keyof T) => number
126
+ min: (key?: keyof T) => number
127
+ pluck: <K extends keyof T>(key: K) => Collection<T[K]>
128
+ reject: (fn: (item: T, index: number) => boolean) => Collection<T>
129
+ reverse: () => Collection<T>
130
+ skip: (count: number) => Collection<T>
131
+ sortBy: <K extends keyof T>(key: K, direction?: 'asc' | 'desc') => Collection<T>
132
+ sum: (key?: keyof T) => number
133
+ take: <N extends number | undefined = undefined>(count?: N) => N extends undefined ? T | undefined : Collection<T>
134
+ toArray: () => T[]
135
+ toJson: () => string
136
+ unique: (key?: keyof T) => Collection<T>
137
+ values: () => T[]
138
+ where: (key: keyof T, operatorOrValue: unknown, value?: unknown) => Collection<T>
139
+ whereIn: <K extends keyof T>(key: K, values: T[K][]) => Collection<T>
140
+ whereNotIn: <K extends keyof T>(key: K, values: T[K][]) => Collection<T>
141
+ }
142
+
143
+ class Command = {
144
+ new (): Command
145
+ static args: ArgDef[]
146
+ static commandName: string
147
+ static description: string
148
+ static flags: FlagDef[]
149
+ static needsApp: boolean
150
+ _readLine: () => Promise<string>
151
+ _writer: OutputWriter
152
+ app: unknown
153
+ args: Record<string, string>
154
+ ask: (question: string, defaultValue?: string) => Promise<string>
155
+ choice: (question: string, options: string[]) => Promise<string>
156
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
157
+ dim: (msg: string) => void
158
+ error: (msg: string) => void
159
+ flags: Record<string, string | number | boolean>
160
+ info: (msg: string) => void
161
+ line: (msg: string) => void
162
+ newLine: () => void
163
+ run: () => Promise<void>
164
+ secret: (question: string) => Promise<string>
165
+ section: (title: string) => void
166
+ table: (rows: [string, string][], indent?: number) => void
167
+ warn: (msg: string) => void
168
+ write: (msg: string) => void
169
+ }
170
+
171
+ class CommandRan = {
172
+ new (name: string, durationMs: number, exitCode: number, ok: boolean, error?: string | undefined): CommandRan
173
+ readonly durationMs: number
174
+ readonly error?: string | undefined
175
+ readonly exitCode: number
176
+ readonly name: string
177
+ readonly ok: boolean
178
+ }
179
+
180
+ class CommandRunner = {
181
+ new (_app: Application): CommandRunner
182
+ boot: () => Promise<void>
183
+ callInProcess: (argv: string[], parameters?: Record<string, string | boolean | number>) => Promise<{ code: number; output: string;}>
184
+ command: (definition: CommandDefinition, aliases?: string[]) => CommandClass
185
+ discover: (dir: string) => Promise<string[]>
186
+ has: (name: string) => boolean
187
+ register: (Cmd: CommandClass, aliases?: string[]) => void
188
+ registerAll: (commandClasses: CommandClass[]) => void
189
+ registerCommand: (definition: CommandDefinition, aliases?: string[]) => CommandClass
190
+ registerLazy: (name: string, thunk: CommandThunk, aliases?: string[]) => void
191
+ run: (argv: string[]) => Promise<void>
192
+ }
193
+
194
+ class ConfigError = {
195
+ new (message: string): ConfigError
196
+ readonly code: string
197
+ readonly context?: Record<string, unknown> | undefined
198
+ readonly status: number
199
+ }
200
+
201
+ class ConflictError = {
202
+ new (message?: string): ConflictError
203
+ headers?: Record<string, string>
204
+ readonly code: string
205
+ readonly context?: Record<string, unknown> | undefined
206
+ readonly status: number
207
+ }
208
+
209
+ class Container = {
210
+ new (): Container
211
+ static createEmpty: () => Container
212
+ _app: Application | undefined
213
+ _resolveAlias: (token: unknown) => unknown
214
+ _setContextual: (consumer: unknown, dependency: unknown, binding: Binding<unknown>) => void
215
+ alias: (from: unknown, to: unknown) => Container
216
+ bind: <T>(token: BindingToken<T>, factory: Factory<T>) => Container
217
+ bound: (token: BindingToken) => boolean
218
+ build: <T>(ctor: new (...args: unknown[]) => T) => Promise<T>
219
+ createScopedResolver: () => ScopedResolver
220
+ defer: (token: unknown, provider: new (app: unknown) => unknown) => Container
221
+ for: <C>(consumer: BindingToken<C>) => ContextualBindingBuilder<C>
222
+ forget: (token: BindingToken) => boolean
223
+ isDeferred: (token: BindingToken) => boolean
224
+ make: <T>(token: BindingToken<T>, consumer?: unknown) => Promise<T>
225
+ makeSync: <T>(token: BindingToken<T>) => T
226
+ registry: Map<unknown, Binding<unknown>>
227
+ resolving: <T>(token: BindingToken<T>, hook: (instance: T) => void) => Container
228
+ runScoped: <T>(callback: (scoped: ScopedResolver) => Promise<T>) => Promise<T>
229
+ scoped: <T>(token: BindingToken<T>, factory: Factory<T>) => Container
230
+ singleton: <T>(token: BindingToken<T>, factory: Factory<T>) => Container
231
+ tryMake: <K extends keyof ContainerBindings>(token: K) => ContainerBindings[K] | undefined
232
+ value: <T>(token: BindingToken<T>, instance: T) => Container
233
+ }
234
+
235
+ class ContainerLockedError = {
236
+ new (method: string): ContainerLockedError
237
+ readonly code: string
238
+ readonly context?: Record<string, unknown> | undefined
239
+ readonly status: number
240
+ }
241
+
242
+ class CorsMiddleware = {
243
+ new (options?: CorsOptions): CorsMiddleware
244
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
245
+ afterResponse?: (ctx: HttpContext) => Promise<void>
246
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
247
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
248
+ }
249
+
250
+ class Emitter = {
251
+ new (application?: any): Emitter
252
+ clear: () => void
253
+ dispatchQueuedListener: (listenerName: string, eventPayload: any) => Promise<void>
254
+ emit: <T extends object>(event: T) => Promise<void>
255
+ emitSync: <T extends object>(event: T) => Promise<void>
256
+ hasListeners: <T extends object>(eventClass: EventClass<T>) => boolean
257
+ off: <T extends object>(eventClass: EventClass<T>, listenerClass: ListenerClass<T>) => void
258
+ on: <T extends object>(eventClass: EventClass<T>, listenerClass: ListenerClass<T>) => void
259
+ registrations: () => Array<{ event: string; listeners: string[];}>
260
+ setBroadcaster: (fn: ((event: object) => void) | null) => void
261
+ }
262
+
263
+ class EventFake = {
264
+ new (_app: Application, _original: Binding<unknown> | undefined): EventFake
265
+ static install: () => EventFake
266
+ assertEmitted: <T extends object>(EventType: EventClass<T>, filter?: (event: T) => boolean) => void
267
+ assertEmittedCount: <T extends object>(EventType: EventClass<T>, count: number) => void
268
+ assertNotEmitted: <T extends object>(EventType: EventClass<T>, filter?: (event: T) => boolean) => void
269
+ assertNothingEmitted: () => void
270
+ clear: () => void
271
+ dispatchQueuedListener: (listenerName: string, eventPayload: any) => Promise<void>
272
+ emit: <T extends object>(event: T) => Promise<void>
273
+ emitSync: <T extends object>(event: T) => Promise<void>
274
+ emitted: () => object[]
275
+ emittedOf: <T extends object>(EventType: EventClass<T>) => T[]
276
+ hasListeners: <T extends object>(eventClass: new (...args: unknown[]) => T) => boolean
277
+ off: <T extends object>(eventClass: new (...args: unknown[]) => T, listenerClass: new (...args: unknown[]) => { handle(event: T): Promise<void> | void; queue?: boolean | string; maxAttempts?: number; retryDelay?: number;}) => void
278
+ on: <T extends object>(eventClass: new (...args: unknown[]) => T, listenerClass: new (...args: unknown[]) => { handle(event: T): Promise<void> | void; queue?: boolean | string; maxAttempts?: number; retryDelay?: number;}) => void
279
+ registrations: () => Array<{ event: string; listeners: string[];}>
280
+ restore: () => void
281
+ setBroadcaster: (fn: ((event: object) => void) | null) => void
282
+ }
283
+
284
+ class ExceptionHandler = {
285
+ new (): ExceptionHandler
286
+ static defaultRender: (error: unknown, ctx?: HttpContext) => Promise<Response>
287
+ render: (error: unknown, ctx: HttpContext) => Promise<Response>
288
+ report: (error: unknown, _ctx?: HttpContext) => Promise<void>
289
+ }
290
+
291
+ class Fluent = {
292
+ new <T>(value: T): Fluent<T>
293
+ get: () => T
294
+ pipe: <R>(fn: (val: T) => R) => Fluent<R>
295
+ tap: (fn: (val: T) => void) => Fluent<T>
296
+ toString: () => string
297
+ }
298
+
299
+ class ForbiddenError = {
300
+ new (message?: string): ForbiddenError
301
+ headers?: Record<string, string>
302
+ readonly code: string
303
+ readonly context?: Record<string, unknown> | undefined
304
+ readonly status: number
305
+ }
306
+
307
+ class GoneError = {
308
+ new (message?: string): GoneError
309
+ headers?: Record<string, string>
310
+ readonly code: string
311
+ readonly context?: Record<string, unknown> | undefined
312
+ readonly status: number
313
+ }
314
+
315
+ class HttpContext = {
316
+ new <TParams extends Record<string, unknown> = Record<string, string>>(request: Request, container: ScopedResolver): HttpContext<TParams>
317
+ static fake: (url?: string, init?: RequestInit, container?: ScopedResolver) => HttpContext
318
+ static tryGet: () => HttpContext | undefined
319
+ _afterResponseCallbacks: (() => Promise<void>)[]
320
+ _pageResolver?: (pageName: string) => number | undefined
321
+ _primeBody: (data: Record<string, unknown>) => void
322
+ _responseFinalizers: ((response: Response) => Promise<void>)[]
323
+ _routeDef?: { pattern: string; controller: string; action: string;}
324
+ _server: RequestIPProvider | undefined
325
+ _transaction?: TransactionContext | undefined
326
+ afterResponse: (callback: () => Promise<void>) => HttpContext<TParams>
327
+ authorize: <M>(PolicyClass: new () => Policy<M>, ability: string, model?: M | undefined) => Promise<void>
328
+ back: (status?: 301 | 302 | 303 | 307 | 308) => void
329
+ bearerToken: () => string | null
330
+ body: <T extends Record<string, unknown> = Record<string, unknown>>() => Promise<T>
331
+ boolean: (key: string, fallback?: boolean) => boolean
332
+ deleteInternal: (key: ContextKey | (string & {})) => HttpContext<TParams>
333
+ file: (field: string) => Promise<UploadedFile | null>
334
+ files: (field: string) => Promise<UploadedFile[]>
335
+ flash: (key: string, value: unknown) => void
336
+ flashed: <T = unknown>(key: string) => T | undefined
337
+ fullUrl: () => string
338
+ getInternal: { <K extends ContextKey>(key: K): ContextRegistry[K] | undefined; <T = unknown>(key: string): T | undefined;}
339
+ hasInternal: (key: ContextKey | (string & {})) => boolean
340
+ header: (key: string, fallback?: string | null) => string | null
341
+ host: () => string
342
+ html: (markup: string | { toString(): string;}, status?: number) => void
343
+ input: <T = unknown>(key: string, fallback?: T | undefined) => T
344
+ integer: (key: string, fallback?: number) => number | undefined
345
+ ip: () => string | null
346
+ is: (pattern: string) => boolean
347
+ isJson: () => boolean
348
+ json: (data: unknown, status?: number) => void
349
+ locale: string
350
+ markdown: (content: string, options?: (BunMarkdownOptions & { title?: string;}) | undefined, status?: number) => void
351
+ model: <T = unknown>(name: string) => T
352
+ onResponseReady: (callback: (response: Response) => Promise<void>) => HttpContext<TParams>
353
+ param: (key: string, fallback?: string) => string | undefined
354
+ params: TParams
355
+ path: () => string
356
+ query: (key: string, fallback?: string) => string | undefined
357
+ readonly _models: Map<string, unknown>
358
+ readonly container: ScopedResolver
359
+ readonly request: Request
360
+ readonly requestId: string
361
+ readonly startedAt: number
362
+ readonly url: URL
363
+ redirect: (url: string, status?: 301 | 302 | 303 | 307 | 308) => void
364
+ response: Response | undefined
365
+ session?: SessionContract
366
+ sessionId?: string
367
+ setInternal: { <K extends ContextKey>(key: K, value: ContextRegistry[K]): HttpContext<TParams>; (key: string, value: unknown): HttpContext<TParams>;}
368
+ string: (key: string, fallback?: string) => string | undefined
369
+ subdomain: (name: string) => string | null
370
+ subdomains: Record<string, string>
371
+ t: (key: string, replacements?: Replacements, locale?: string) => string
372
+ took: number
373
+ user?: UserModel | undefined
374
+ view: { (markup: ViewMarkup, status?: number): void; <P extends Record<string, unknown> = Record<string, never>>(component: (ctx: HttpContext, props: P) => ViewMarkup | Promise<ViewMarkup>, props?: P | undefined, status?: number): void | Promise<void>;}
375
+ wantsJson: () => boolean
376
+ }
377
+
378
+ class HttpError = {
379
+ new (message: string, status: number, code?: string, headers?: Record<string, string>): HttpError
380
+ headers?: Record<string, string>
381
+ readonly code: string
382
+ readonly context?: Record<string, unknown> | undefined
383
+ readonly status: number
384
+ }
385
+
386
+ class LimiterDefinition = {
387
+ new (_name: string): LimiterDefinition
388
+ by: (fn: (ctx: HttpContext) => string) => LimiterDefinition
389
+ byApiKey: (header?: string) => LimiterDefinition
390
+ byIp: () => LimiterDefinition
391
+ byUser: () => LimiterDefinition
392
+ every: (seconds: number) => LimiterDefinition
393
+ limit: (max: number) => LimiterDefinition
394
+ register: () => LimiterDefinition
395
+ toMiddleware: () => ThrottleMiddleware
396
+ toMiddlewareClass: () => new () => ThrottleMiddleware
397
+ }
398
+
399
+ class MarkdownBuilder = {
400
+ new (content: string, options?: BunMarkdownOptions & { title?: string; }, status?: number): MarkdownBuilder
401
+ then: <TResult1 = void, TResult2 = never>(onfulfilled?: ((value: void) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null) => PromiseLike<TResult1 | TResult2>
402
+ withLayout: <P extends { content: string;}>(layoutFn: (props: P) => string, props: Omit<P, 'content'>) => void
403
+ }
404
+
405
+ class MethodNotAllowedError = {
406
+ new (allowed?: string[], message?: string): MethodNotAllowedError
407
+ headers?: Record<string, string>
408
+ readonly code: string
409
+ readonly context?: Record<string, unknown> | undefined
410
+ readonly status: number
411
+ }
412
+
413
+ class MiddlewareSkipped = {
414
+ new (name: string, reason: string, ctx: object): MiddlewareSkipped
415
+ readonly ctx: object
416
+ readonly name: string
417
+ readonly reason: string
418
+ }
419
+
420
+ class NotFoundError = {
421
+ new (message?: string): NotFoundError
422
+ headers?: Record<string, string>
423
+ readonly code: string
424
+ readonly context?: Record<string, unknown> | undefined
425
+ readonly status: number
426
+ }
427
+
428
+ class OutgoingRequestCompleted = {
429
+ new (host: string, method: string, url: string, status: number, durationMs: number, ok: boolean): OutgoingRequestCompleted
430
+ readonly durationMs: number
431
+ readonly host: string
432
+ readonly method: string
433
+ readonly ok: boolean
434
+ readonly status: number
435
+ readonly url: string
436
+ }
437
+
438
+ class Pipeline = {
439
+ new <T>(): Pipeline<T>
440
+ static send: <T>(payload: T) => Pipeline<T>
441
+ then: <R>(destination: (payload: T) => Promise<R> | R) => Promise<R>
442
+ thenReturn: () => Promise<T>
443
+ through: (pipes: PipeClass<T>[]) => Pipeline<T>
444
+ via: (container: Container) => Pipeline<T>
445
+ }
446
+
447
+ class RateLimiter = {
448
+ new (): RateLimiter
449
+ static _instance: (name: string) => ThrottleMiddleware
450
+ static _register: (name: string, definition: LimiterDefinition) => void
451
+ static clear: () => void
452
+ static for: (name: string) => LimiterDefinition
453
+ static middleware: (name: string) => new () => ThrottleMiddleware
454
+ static resetFor: (name: string, ctx: HttpContext) => void
455
+ static tooManyAttempts: (name: string, ctx: HttpContext) => Promise<boolean>
456
+ }
457
+
458
+ class RedirectBuilder = {
459
+ new (ctx: HttpContext): RedirectBuilder
460
+ away: (url: string, status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
461
+ back: (status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
462
+ intended: (fallback?: string, status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
463
+ to: <N extends RouteTarget>(name: N, params?: RouteParamsArg<N>, status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
464
+ }
465
+
466
+ class RequestContext = {
467
+ new (): RequestContext
468
+ static forget: (key: string) => void
469
+ static get: () => HttpContext
470
+ static locale: () => string
471
+ static remember: <T>(key: string, factory: () => Promise<T> | T) => Promise<T>
472
+ static request: () => Request
473
+ static requestId: () => string
474
+ static run: <T>(ctx: HttpContext, callback: () => T) => T
475
+ static took: () => number
476
+ static transaction: () => TransactionContext | undefined
477
+ static tryGet: () => HttpContext | undefined
478
+ }
479
+
480
+ class RequestFailed = {
481
+ new (ctx: object, startMs: number, durationMs: number, error: string, status: number, type?: string | undefined, stack?: string | undefined): RequestFailed
482
+ readonly ctx: object
483
+ readonly durationMs: number
484
+ readonly error: string
485
+ readonly stack?: string | undefined
486
+ readonly startMs: number
487
+ readonly status: number
488
+ readonly type?: string | undefined
489
+ }
490
+
491
+ class RequestHandled = {
492
+ new (ctx: object, startMs: number, durationMs: number): RequestHandled
493
+ readonly ctx: object
494
+ readonly durationMs: number
495
+ readonly startMs: number
496
+ }
497
+
498
+ class ResourceRouteBuilder = {
499
+ new (_base: string, _controller: ControllerClass, _middleware: MiddlewareClass[]): ResourceRouteBuilder
500
+ except: (actions: ResourceAction[]) => ResourceRouteBuilder
501
+ only: (actions: ResourceAction[]) => ResourceRouteBuilder
502
+ }
503
+
504
+ class ResponseBuilder = {
505
+ new (ctx: HttpContext): ResponseBuilder
506
+ then: <TResult1 = void, TResult2 = never>(onfulfilled?: ((value: void) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null) => PromiseLike<TResult1 | TResult2>
507
+ with: (key: string, value: unknown) => ResponseBuilder
508
+ withError: (message: string) => ResponseBuilder
509
+ withErrors: (errors: Record<string, string>) => ResponseBuilder
510
+ withInfo: (message: string) => ResponseBuilder
511
+ withSuccess: (message: string) => ResponseBuilder
512
+ withWarning: (message: string) => ResponseBuilder
513
+ }
514
+
515
+ class RouterState = {
516
+ new (): RouterState
517
+ domain: string | undefined
518
+ groupMiddleware: MiddlewareClass[]
519
+ implicitModelResolver: ((paramName: string) => ModelBindingResolver | undefined) | null
520
+ markdownDirs: MarkdownDir[]
521
+ middlewareGroups: Map<string, MiddlewareClass[]>
522
+ namedRoutes: Map<string, string>
523
+ prefix: string
524
+ rawRoutes: Map<string, (req: Request) => Response | Promise<Response>>
525
+ routes: Map<string, RouteDefinition>
526
+ staticDirs: StaticDir[]
527
+ }
528
+
529
+ class ScopedResolver = {
530
+ new (_container?: Container | undefined): ScopedResolver
531
+ acquire: () => void
532
+ cacheSize: number
533
+ container: Container | undefined
534
+ flush: () => void
535
+ isFlushed: boolean
536
+ refCount: number
537
+ release: () => void
538
+ resolve: <T>(token: unknown, factory: Factory<T>) => Promise<T>
539
+ }
540
+
541
+ class SecureHeadersMiddleware = {
542
+ new (): SecureHeadersMiddleware
543
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
544
+ afterResponse?: (ctx: HttpContext) => Promise<void>
545
+ handle: (_ctx: HttpContext, next: NextFn) => Promise<Response | void>
546
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
547
+ }
548
+
549
+ class ServiceProvider = {
550
+ new (app: Application): ServiceProvider
551
+ static dependsOn?: (new (app: Application) => ServiceProvider)[]
552
+ static environments: AppEnvironment[]
553
+ static priority?: number
554
+ static provides?: readonly (keyof ContainerBindings)[]
555
+ devProcesses: () => DevProcessDefinition[]
556
+ doctorChecks: () => DoctorCheck[]
557
+ onBooted: () => Promise<void>
558
+ onBooting: () => Promise<void>
559
+ onRegister: () => void
560
+ onRequestProcessed: (_ctx: HttpContext) => Promise<void>
561
+ onRequestReceived: (_ctx: HttpContext) => Promise<void>
562
+ onResponseSent: (_ctx: HttpContext) => Promise<void>
563
+ onStarted: () => Promise<void>
564
+ onStarting: () => Promise<void>
565
+ onStopped: () => Promise<void>
566
+ onStopping: () => Promise<void>
567
+ replContext: () => Record<string, unknown>
568
+ }
569
+
570
+ class ServiceUnavailableError = {
571
+ new (reason?: string, retryAfter?: number): ServiceUnavailableError
572
+ headers?: Record<string, string>
573
+ readonly code: string
574
+ readonly context?: Record<string, unknown> | undefined
575
+ readonly retryAfter?: number | undefined
576
+ readonly status: number
577
+ }
578
+
579
+ class TerminalWriter = {
580
+ new (): TerminalWriter
581
+ write: (message: string) => void
582
+ writeError: (message: string) => void
583
+ writeLine: (message: string) => void
584
+ }
585
+
586
+ class ThrottleMiddleware = {
587
+ new (options?: Partial<ThrottleOptions>): ThrottleMiddleware
588
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
589
+ afterResponse?: (ctx: HttpContext) => Promise<void>
590
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
591
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
592
+ reset: () => void
593
+ resetKey: (ctx: HttpContext) => void
594
+ }
595
+
596
+ class TooManyRequestsError = {
597
+ new (retryAfter?: number, message?: string): TooManyRequestsError
598
+ headers?: Record<string, string>
599
+ readonly code: string
600
+ readonly context?: Record<string, unknown> | undefined
601
+ readonly retryAfter?: number | undefined
602
+ readonly status: number
603
+ }
604
+
605
+ class UnauthorizedError = {
606
+ new (message?: string): UnauthorizedError
607
+ headers?: Record<string, string>
608
+ readonly code: string
609
+ readonly context?: Record<string, unknown> | undefined
610
+ readonly status: number
611
+ }
612
+
613
+ class UnprocessableEntityError = {
614
+ new (message?: string): UnprocessableEntityError
615
+ headers?: Record<string, string>
616
+ readonly code: string
617
+ readonly context?: Record<string, unknown> | undefined
618
+ readonly status: number
619
+ }
620
+
621
+ class ValidationError = {
622
+ new (message: string, errors: Record<string, string[]>): ValidationError
623
+ headers?: Record<string, string>
624
+ readonly code: string
625
+ readonly context?: Record<string, unknown> | undefined
626
+ readonly errors: Record<string, string[]>
627
+ readonly status: number
628
+ }
629
+
630
+ class WebhookMiddleware = {
631
+ new (options?: Partial<WebhookOptions>): WebhookMiddleware
632
+ static github: (secret: string) => WebhookMiddleware
633
+ static stripe: (secret: string, toleranceSeconds?: number) => WebhookMiddleware
634
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
635
+ afterResponse?: (ctx: HttpContext) => Promise<void>
636
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
637
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
638
+ }
639
+
640
+ class ZerotalError = {
641
+ new (message: string, code: string, status?: number, context?: Record<string, unknown> | undefined): ZerotalError
642
+ readonly code: string
643
+ readonly context?: Record<string, unknown> | undefined
644
+ readonly status: number
645
+ }
646
+
647
+ const App = { readonly container: Container; readonly instance: () => Application; readonly environment: () => Application['environment']; readonly isProduction: () => boolean; readonly isLocal: () => boolean; readonly make: <T>(token: BindingToken<T>, consumer?: unknown) => Promise<T>; readonly makeSync: <T>(token: BindingToken<T>) => T; readonly build: <T>(ctor: new (...args: unknown[]) => T) => Promise<T>; readonly tryMake: <K extends keyof ContainerBindings>(token: K) => ContainerBindings[K] | undefined; readonly bound: (token: BindingToken) => boolean; readonly bind: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly singleton: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly scoped: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly value: <T>(token: BindingToken<T>, instance: T) => Container; readonly alias: (from: unknown, to: unknown) => Container; readonly forget: (token: BindingToken) => boolean;}
648
+
649
+ const Artisan = { call(commandName: string, parameters?: Record<string, string | boolean | number>): Promise<ArtisanResult>;}
650
+
651
+ const builtinDoctorChecks = DoctorCheck[]
652
+
653
+ const Config = ConfigManager
654
+
655
+ const Events = Emitter
656
+
657
+ const FrameworkEvents = { on<E extends object>(target: (new (...args: any[]) => E) | string, handler: Handler<E>): () => void; emit<E extends object>(event: E): void; clear(): void; handlerCount(): number; subscriptions(): Array<{ event: string; handlers: number; }>;}
658
+
659
+ const route = RouteBuilder
660
+
661
+ const Router = typeof _Router & _RouterMacros
662
+
663
+ const Str = { camelCase(value: string): string; snakeCase(value: string): string; slugify(value: string): string; titleCase(value: string): string; pascalCase(value: string): string; capitalize(value: string): string; lcfirst(value: string): string; truncate(value: string, maxLength: number, suffix?: string): string; isAlphanumeric(value: string): boolean; padLeft(value: string, length: number, char?: string): string; kebab(value: string): string; squish(value: string): string; finish(value: string, cap: string): string; start(value: string, prefix: string): string; after(value: string, needle: string): string; before(value: string, needle: string): string; afterLast(value: string, needle: string): string; beforeLast(value: string, needle: string): string; contains(value: string, substring: string): boolean; random(length?: number): string; replaceFirst(value: string, search: string, replace: string): string; replaceLast(value: string, search: string, replace: string): string; reverse(value: string): string; words(value: string, maxWords: number, suffix?: string): string; macro(name: string, fn: (...args: unknown[]) => unknown): void;}
664
+
665
+ function abort = { (message: string): never; (status: number, message: string): never; (ErrorClass: new () => ZerotalError): never;}
666
+
667
+ function app = { (): Application; <T>(token: BindingToken<T>): Promise<T>;}
668
+
669
+ function basePath = (...segments: string[]) => string
670
+
671
+ function buildCookie = (options: CookieOptions) => string
672
+
673
+ function camelCase = (value: string) => string
674
+
675
+ function collect = <T>(items: T[]) => Collection<T>
676
+
677
+ function config = typeof config
678
+
679
+ function createFacade = <K extends keyof ContainerBindings>(key: K) => ContainerBindings[K]
680
+
681
+ function currentApp = () => Application
682
+
683
+ function currentPage = (pageName?: string) => number
684
+
685
+ function data_get = (target: unknown, key: string, defaultValue?: unknown) => unknown
686
+
687
+ function deepMerge = <T extends object>(base: T, override: DeepPartial<T>) => T
688
+
689
+ function deployEnv = () => string
690
+
691
+ function devSurfacesEnabled = () => boolean
692
+
693
+ function env = { (key: string): string | undefined; (key: string, fallback: string): string; (key: string, fallback: boolean): boolean; (key: string, fallback: number): number;}
694
+
695
+ function file = (path: string, options?: { filename?: string; disposition?: 'attachment' | 'inline';}) => Promise<void>
696
+
697
+ function fluent = <T>(value: T) => Fluent<T>
698
+
699
+ function hmacHex = (payload: string | Uint8Array, key: string) => string
700
+
701
+ function html = (markup: string | { toString(): string;}, status?: number) => void
702
+
703
+ function inject = (...tokens: BindingToken[]) => (target: new (...args: any[]) => unknown, _context: ClassDecoratorContext) => void
704
+
705
+ function isDevSurfaceAllowed = (env: string) => boolean
706
+
707
+ function isProdLike = (env: string) => boolean
708
+
709
+ function json = (data: unknown, status?: number) => void
710
+
711
+ function make = <T>(token: BindingToken<T>) => Promise<T>
712
+
713
+ function markdown = (content: string, options?: BunMarkdownOptions & { title?: string;}, status?: number) => MarkdownBuilder
714
+
715
+ function pageElements = (current: number, last: number, each?: number) => (number | '...')[]
716
+
717
+ function parseCookieHeader = (header: string, name: string) => string | undefined
718
+
719
+ function pipe = <T, R>(value: T, fn: (val: T) => R) => R
720
+
721
+ function pipeAsync = <T, R>(value: T, fn: (val: T) => Promise<R>) => Promise<R>
722
+
723
+ function pluralize = (value: string) => string
724
+
725
+ function readCookie = (request: Request, name: string) => string | undefined
726
+
727
+ function redirect = { (url: string, status?: 301 | 302 | 303 | 307 | 308): ResponseBuilder; (): RedirectBuilder;}
728
+
729
+ function redirectTo = <N extends RouteTarget>(name: N, params?: RouteParamsArg<N>, status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
730
+
731
+ function registerAppScope = (installer: AppScopeInstaller) => void
732
+
733
+ function registerErrorDiagnoser = (diagnoser: ErrorDiagnoser) => void
734
+
735
+ function registerFileRouteResolver = (resolver: FileRouteResolver) => void
736
+
737
+ function request = { (): HttpContext; <T = string>(key: string, fallback?: T): T | undefined;}
738
+
739
+ function requireEnv = (key: string) => string
740
+
741
+ function rescue = <T>(callback: () => Promise<T> | T, fallback: T | ((error: unknown) => T | Promise<T>)) => Promise<T>
742
+
743
+ function rescueSync = <T>(callback: () => T, fallback: T | ((error: unknown) => T)) => T
744
+
745
+ function runDoctor = (app: Application, extraChecks?: DoctorCheck[]) => Promise<DoctorReportEntry[]>
746
+
747
+ function safeEqual = (a: string, b: string) => boolean
748
+
749
+ function safeRedirectPath = (url: string | null | undefined, origin: string) => string | undefined
750
+
751
+ function scanFileRoutes = (baseDir: string, reloadId?: string) => Promise<number>
752
+
753
+ function setAppEnv = (command?: string) => void
754
+
755
+ function setCurrentPageResolver = (resolver: CurrentPageResolver) => void
756
+
757
+ function setImplicitModelResolver = (fn: ((paramName: string) => ModelBindingResolver | undefined) | null) => void
758
+
759
+ function sha256Hex = (input: string | Uint8Array) => string
760
+
761
+ function singularize = (value: string) => string
762
+
763
+ function snakeCase = (value: string) => string
764
+
765
+ function startZerotal = (loadApp: () => Promise<{ default: Application;}>, options?: StartZerotalOptions) => Promise<void>
766
+
767
+ function tableNameFor = (className: string) => string
768
+
769
+ function tap = <T>(value: T, callback: (val: T) => void) => T
770
+
771
+ function tapAsync = <T>(value: T, callback: (val: T) => Promise<void>) => Promise<T>
772
+
773
+ function tryCurrentApp = () => Application | undefined
774
+
775
+ function view = { (markup: string | { toString(): string; }, status?: number): void; <P extends Record<string, unknown> = Record<string, never>>(component: (ctx: HttpContext, props: P) => ViewMarkup | Promise<ViewMarkup>, props?: P, status?: number): void | Promise<void>;}
776
+
777
+ function withApp = <T>(app: Application, fn: () => T) => T
778
+
779
+ function withHeaders = (res: Response, headers: Record<string, string>) => Response
780
+
781
+ interface ArtisanResult = {
782
+ code: number
783
+ output: string
784
+ }
785
+
786
+ interface AuthenticatedUser = {}
787
+
788
+ interface CompiledDomain = {
789
+ params: string[]
790
+ regex: RegExp
791
+ source: string
792
+ }
793
+
794
+ interface ConcernContext = {
795
+ app: Application
796
+ env: AppEnvironment
797
+ resolve: <T = unknown>(token: string) => T | undefined
798
+ }
799
+
800
+ interface ConcernDescriptor = {
801
+ dir?: string
802
+ envs?: AppEnvironment[]
803
+ name: string
804
+ order: number
805
+ register?: (exports: Record<string, unknown>, ctx: ConcernContext) => void | Promise<void>
806
+ run?: (ctx: ConcernContext) => void | Promise<void>
807
+ }
808
+
809
+ interface ConfigRegistry = {
810
+ admin: AdminConfigShape
811
+ ai: AiConfigShape
812
+ arch: ArchConfigShape
813
+ audit: AuditConfigShape
814
+ auth: AuthConfigShape
815
+ broadcasting: BroadcastConfigShape
816
+ cache: CacheConfigShape
817
+ client: ClientConfigShape
818
+ database: DatabaseConfigShape
819
+ devtools: DevtoolsConfigShape
820
+ flow: FlowConfigShape
821
+ i18n: I18nConfigShape
822
+ inertia: InertiaConfigShape
823
+ media: MediaConfigShape
824
+ monitor: MonitorConfigShape
825
+ notifications: NotificationConfigShape
826
+ queue: QueueConfigShape
827
+ scheduler: SchedulerConfigShape
828
+ session: SessionConfigShape
829
+ social: SocialConfigShape
830
+ storage: StorageConfigShape
831
+ telemetry: TelemetryConfigShape
832
+ tenancy: TenancyConfigShape
833
+ validator: ValidatorConfigShape
834
+ }
835
+
836
+ interface ContainerBindings = {
837
+ admin.panel: AdminPanelHost
838
+ ai: AiManager
839
+ audit: Auditor
840
+ auth.userLoader: (id: number) => Promise<UserModel | null>
841
+ broadcast: BroadcastManager
842
+ cache: CacheManager
843
+ client: ApiClient<Partial<Record<`GET ${string}` | `POST ${string}` | `PUT ${string}` | `PATCH ${string}` | `DELETE ${string}`, RouteShape>>>
844
+ commands: CommandRunner
845
+ config: ConfigManager
846
+ db: SQLInstance
847
+ devtools.trace: TraceSink
848
+ events: Emitter
849
+ gate: GateService
850
+ hash: HashService
851
+ i18n: Translator
852
+ lock: LockManager
853
+ log: LogManager
854
+ media: MediaManager
855
+ monitor.panel: MonitorPanelHost
856
+ monitor.store: MonitorStore
857
+ monitor: ResolvedMonitorConfig
858
+ notifications: NotificationManager
859
+ queue: QueueManager
860
+ scheduler.runs: ScheduleRunStore
861
+ scheduler: SchedulerManager
862
+ session.driver: SessionDriver
863
+ session: SessionAccessor
864
+ social: SocialManager
865
+ storage: StorageManager
866
+ telemetry: Tracer
867
+ tenancy: Tenancy
868
+ two_factor: TwoFactorService
869
+ }
870
+
871
+ interface ContextRegistry = {}
872
+
873
+ interface CookieOptions = {
874
+ domain?: string
875
+ httpOnly?: boolean
876
+ maxAge?: number
877
+ name: string
878
+ path?: string
879
+ sameSite?: SameSite
880
+ secure?: boolean
881
+ value: string
882
+ }
883
+
884
+ interface CorsOptions = {
885
+ allowedHeaders?: string[]
886
+ credentials?: boolean
887
+ exposedHeaders?: string[]
888
+ maxAge?: number
889
+ methods?: string[]
890
+ origin?: string | string[] | ((origin: string) => boolean)
891
+ }
892
+
893
+ interface DevConfigShape = {
894
+ disable?: string[]
895
+ processes?: DevProcessDefinition[]
896
+ }
897
+
898
+ interface DevProcessDefinition = {
899
+ after?: 'server' | 'none'
900
+ color?: DevProcessColor
901
+ command?: string | string[] | (() => string[])
902
+ enabled?: boolean | (() => boolean | Promise<boolean>)
903
+ label?: string
904
+ name: string
905
+ restart?: 'always' | 'on-failure' | 'never'
906
+ run?: (signal: AbortSignal) => Promise<void>
907
+ }
908
+
909
+ interface DiagnosisAction = {
910
+ label: string
911
+ pendingLabel?: string
912
+ token: string
913
+ url: string
914
+ }
915
+
916
+ interface DoctorCheck = {
917
+ id: string
918
+ label: string
919
+ run: (app: Application) => DoctorCheckResult | Promise<DoctorCheckResult>
920
+ }
921
+
922
+ interface DoctorCheckResult = {
923
+ fix?: string
924
+ message: string
925
+ status: 'ok' | 'warn' | 'fail'
926
+ }
927
+
928
+ interface DoctorReportEntry = {
929
+ check: DoctorCheck
930
+ result: DoctorCheckResult
931
+ }
932
+
933
+ interface ErrorDiagnosis = {
934
+ action?: DiagnosisAction
935
+ detail: string
936
+ items?: string[]
937
+ title: string
938
+ }
939
+
940
+ interface FileRouteContext = {
941
+ filePath: string
942
+ isIndex: boolean
943
+ layout?: ViewComponent | undefined
944
+ middleware: MiddlewareClass[]
945
+ module: Record<string, unknown>
946
+ name: string
947
+ urlPath: string
948
+ }
949
+
950
+ interface GroupOptions = {
951
+ domain?: string
952
+ middleware?: string | string[] | MiddlewareClass | MiddlewareClass[]
953
+ prefix?: string
954
+ }
955
+
956
+ interface HasResponse = {
957
+ response: Response | undefined
958
+ }
959
+
960
+ interface MiddlewareModule = {
961
+ middleware: MiddlewareClass[]
962
+ }
963
+
964
+ interface ModelClass = {
965
+ findOrFail: (id: number | string) => Promise<unknown>
966
+ }
967
+
968
+ interface OutputWriter = {
969
+ write: (message: string) => void
970
+ writeError: (message: string) => void
971
+ writeLine: (message: string) => void
972
+ }
973
+
974
+ interface Pipe = {
975
+ handle: (payload: T, next: NextFn) => Promise<Response | void>
976
+ }
977
+
978
+ interface ProviderReport = {
979
+ bindings: string[]
980
+ durationMs: number
981
+ name: string
982
+ }
983
+
984
+ interface QueuedListener = {
985
+ handle: (event: T) => Promise<void> | void
986
+ maxAttempts?: number
987
+ queue: string | boolean
988
+ retryDelay?: number
989
+ }
990
+
991
+ interface RequestIPProvider = {
992
+ requestIP: (req: Request) => { address: string; family: string; port: number;} | null
993
+ }
994
+
995
+ interface ResolvedDevProcess = {
996
+ after: 'server' | 'none'
997
+ argv?: string[]
998
+ color: DevProcessColor
999
+ label: string
1000
+ name: string
1001
+ registrant: string
1002
+ restart: 'always' | 'on-failure' | 'never'
1003
+ run?: (signal: AbortSignal) => Promise<void>
1004
+ }
1005
+
1006
+ interface RouteBuilder = {
1007
+ <N extends RouteTarget>(name: N, params?: RouteParamValues | undefined, query?: RouteQuery | undefined): string
1008
+ dynamic: (name: string, params?: RouteParamValues, query?: RouteQuery) => string
1009
+ }
1010
+
1011
+ interface RouteDefinition = {
1012
+ action: string
1013
+ bindings: Map<string, ModelBindingResolver>
1014
+ controller: ControllerClass
1015
+ domain?: string
1016
+ method: HttpMethod
1017
+ middleware: MiddlewareClass[]
1018
+ name: string | undefined
1019
+ path: string
1020
+ }
1021
+
1022
+ interface RouteFileMeta = {
1023
+ DELETE?: { name?: string;}
1024
+ GET?: { name?: string;}
1025
+ PATCH?: { name?: string;}
1026
+ POST?: { name?: string;}
1027
+ PUT?: { name?: string;}
1028
+ }
1029
+
1030
+ interface RouteMethodMiddleware = {
1031
+ ALL?: MiddlewareClass[]
1032
+ DELETE?: MiddlewareClass[]
1033
+ GET?: MiddlewareClass[]
1034
+ PATCH?: MiddlewareClass[]
1035
+ POST?: MiddlewareClass[]
1036
+ PUT?: MiddlewareClass[]
1037
+ }
1038
+
1039
+ interface RouteModule = {
1040
+ DELETE?: FileHandler
1041
+ GET?: FileHandler
1042
+ PATCH?: FileHandler
1043
+ POST?: FileHandler
1044
+ PUT?: FileHandler
1045
+ default?: ViewComponent | FileHandler
1046
+ layout?: ViewComponent | null
1047
+ middleware?: RouteMiddleware
1048
+ }
1049
+
1050
+ interface RouteRegistration = {
1051
+ bind: (paramName: string, model: ModelClass | ModelBindingResolver) => RouteRegistration
1052
+ name: (routeName: string) => RouteRegistration
1053
+ }
1054
+
1055
+ interface RouteRegistry = {}
1056
+
1057
+ interface RouterMacros = {
1058
+ flow: (path: string, PageClass: PageClassWithMeta, middleware?: MiddlewareClass[]) => RouteRegistration
1059
+ inertia: <N extends PageTarget>(path: string, component: N, props?: RenderProps<N> | MiddlewareClass[], middleware?: MiddlewareClass[]) => RouteRegistration
1060
+ social: (prefix: string, controller: new (...args: unknown[]) => unknown) => void
1061
+ }
1062
+
1063
+ interface SecureHeadersOptions = {
1064
+ contentSecurityPolicy?: string
1065
+ frameOptions?: false | 'DENY' | 'SAMEORIGIN'
1066
+ hstsIncludeSubDomains?: boolean
1067
+ hstsMaxAge?: number
1068
+ hstsPreload?: boolean
1069
+ permissionsPolicy?: string | false
1070
+ referrerPolicy?: string
1071
+ secure?: boolean
1072
+ }
1073
+
1074
+ interface StartZerotalOptions = {
1075
+ configDir?: string
1076
+ }
1077
+
1078
+ interface ThrottleOptions = {
1079
+ keyResolver?: (ctx: HttpContext) => string
1080
+ maxAttempts: number
1081
+ trustedProxies?: number
1082
+ windowSeconds?: number
1083
+ }
1084
+
1085
+ interface ViewRegistration = {
1086
+ name: (routeName: string) => ViewRegistration
1087
+ withLayout: (layout: ViewLayout) => ViewRegistration
1088
+ }
1089
+
1090
+ interface WebhookOptions = {
1091
+ algorithm?: 'sha256' | 'sha1' | 'sha512'
1092
+ format?: 'raw' | 'stripe'
1093
+ header?: string
1094
+ prefix?: string
1095
+ secret: string
1096
+ timestampHeader?: string
1097
+ timestampSeparator?: string
1098
+ tolerance?: number
1099
+ }
1100
+
1101
+ interface WebSocketHandlers = {
1102
+ close?: (ws: unknown, code: number, reason: string) => void
1103
+ drain?: (ws: unknown) => void
1104
+ message: (ws: unknown, message: string | Uint8Array) => void
1105
+ open?: (ws: unknown) => void
1106
+ }
1107
+
1108
+ type AppEnvironment = 'web' | 'console' | 'worker' | 'test' | 'repl'
1109
+
1110
+ type AppScopeInstaller = () => () => void
1111
+
1112
+ type ArgDef = { name: string; required?: boolean; default?: string;}
1113
+
1114
+ type BindingToken = keyof ContainerBindings | ClassToken<T> | AbstractToken<T>
1115
+
1116
+ type ClassRef = abstract new (...args: never[]) => unknown
1117
+
1118
+ type ContextKey = never
1119
+
1120
+ type ContextValue = ContextRegistry[K]
1121
+
1122
+ type ControllerResponse = void | ResponseBuilder | MarkdownBuilder
1123
+
1124
+ type CurrentPageResolver = (pageName: string) => number | undefined
1125
+
1126
+ type DeepPartial = { [K in keyof T]?: (NonNullable<T[K]> extends _Atomic ? T[K] : NonNullable<T[K]> extends object ? DeepPartial<NonNullable<T[K]>> : T[K]) | undefined; }
1127
+
1128
+ type DevProcessColor = 'cyan' | 'magenta' | 'yellow' | 'green' | 'blue' | 'red'
1129
+
1130
+ type ErrorDiagnoser = (error: Error, ctx?: HttpContext) => ErrorDiagnosis | null | Promise<ErrorDiagnosis | null>
1131
+
1132
+ type Factory = (container: Container) => T | Promise<T>
1133
+
1134
+ type FileHandler = (ctx: HttpContext) => void | Response | Promise<void | Response>
1135
+
1136
+ type FileRouteHandler = (ctx: HttpContext) => void | Response | Promise<void | Response>
1137
+
1138
+ type FileRouteResolver = (ctx: FileRouteContext) => boolean
1139
+
1140
+ type FileRoutingConfig = { [x: string]: FileRoutingEntry;}
1141
+
1142
+ type FileRoutingEntry = string | { dir: string; prefix?: string; middleware?: MiddlewareInput;}
1143
+
1144
+ type FlagDef = { name: string; short?: string; type: 'string' | 'boolean' | 'number'; description?: string; default?: unknown;}
1145
+
1146
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
1147
+
1148
+ type HttpResponse = Promise<void>
1149
+
1150
+ type MiddlewareClass = new (...args: any[]) => Pipe<HttpContext>
1151
+
1152
+ type ModelBindingResolver = (value: string, ctx: HttpContext) => Promise<unknown>
1153
+
1154
+ type NextFn = () => Promise<Response | void>
1155
+
1156
+ type ParamsOf = P extends `${string}:${infer Name}/${infer Rest}` ? { [K in Name]: RouteParamValue; } & ParamsOf<`/${Rest}`> : P extends `${string}:${infer Name}` ? { [K in Name]: RouteParamValue; } : P extends `${string}*${string}` ? { "*": RouteParamValue | readonly RouteParamValue[];} : Record<never, never>
1157
+
1158
+ type RouteArgs = [params?: RouteParamValues, query?: RouteQuery]
1159
+
1160
+ type RouteMiddleware = MiddlewareClass[] | RouteMethodMiddleware
1161
+
1162
+ type RouteName = never
1163
+
1164
+ type RouteParams = { [K in keyof ParamsOf<RoutePattern<N>>]: ParamsOf<RoutePattern<N>>[K]; }
1165
+
1166
+ type RouteParamsArg = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
1167
+
1168
+ type RouteParamValue = string | number
1169
+
1170
+ type RouteParamValues = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
1171
+
1172
+ type RoutePattern = N extends never ? RouteRegistry[N] extends string ? RouteRegistry[N] : string : string
1173
+
1174
+ type RouteQuery = { [x: string]: string | number | boolean | readonly (string | number | boolean)[] | null | undefined;}
1175
+
1176
+ type RouteTarget = string
1177
+
1178
+ type RoutingConfig = { [x: string]: RoutingEntry;}
1179
+
1180
+ type RoutingEntry = string | { file: string; prefix?: string; middleware?: MiddlewareInput;}
1181
+
1182
+ type SameSite = 'Strict' | 'Lax' | 'None'
1183
+
1184
+ type ViewComponent = (ctx: HttpContext, props: P) => unknown
1185
+
1186
+ type ViewLayout = (ctx: HttpContext, props: { children: unknown;}) => unknown
1187
+
1188
+ ## ./assets `(./src/assets/index.ts)`
1189
+
1190
+ function asset = (path: string) => string
1191
+
1192
+ function assetVersion = () => string
1193
+
1194
+ function setAssetVersion = (version: string) => void
1195
+
1196
+ ## ./build `(./src/build/index.ts)`
1197
+
1198
+ function addImport = (source: string, importStatement: string) => string
1199
+
1200
+ function addToDefaultArrayExport = (source: string, identifier: string) => string
1201
+
1202
+ function registerProvider = (options: RegisterProviderOptions) => Promise<RegisterResult>
1203
+
1204
+ interface RegisterProviderOptions = {
1205
+ bootstrapPath?: string
1206
+ className: string
1207
+ importPath: string
1208
+ }
1209
+
1210
+ type RegisterResult = 'added' | 'exists' | 'missing'
1211
+
1212
+ ## ./carbon `(./src/datetime/index.ts)`
1213
+
1214
+ class Carbon = {
1215
+ new (input?: CarbonInput, timezone?: string): Carbon
1216
+ static create: (input?: CarbonInput, timezone?: string) => Carbon
1217
+ static endOfMonth: (timezone?: string) => Carbon
1218
+ static endOfWeek: (timezone?: string) => Carbon
1219
+ static endOfYear: (timezone?: string) => Carbon
1220
+ static freeze: (value?: CarbonInput) => Carbon
1221
+ static fromMilliseconds: (ms: number, timezone?: string) => Carbon
1222
+ static fromTimestamp: (ts: number, timezone?: string) => Carbon
1223
+ static isFrozen: () => boolean
1224
+ static now: (timezone?: string) => Carbon
1225
+ static release: () => void
1226
+ static setTestNow: (value: CarbonInput | null) => void
1227
+ static startOfMonth: (timezone?: string) => Carbon
1228
+ static startOfWeek: (timezone?: string) => Carbon
1229
+ static startOfYear: (timezone?: string) => Carbon
1230
+ static today: (timezone?: string) => Carbon
1231
+ static tomorrow: (timezone?: string) => Carbon
1232
+ static travel: (amount: TravelAmount) => Carbon
1233
+ static travelTo: (value: CarbonInput) => Carbon
1234
+ static withTestNow: <T>(value: CarbonInput, fn: () => T | Promise<T>) => Promise<T>
1235
+ static yesterday: (timezone?: string) => Carbon
1236
+ add: (interval: { _duration: Temporal.Duration;}) => Carbon
1237
+ addCenturies: (amount: number) => Carbon
1238
+ addDays: (amount: number) => Carbon
1239
+ addDecades: (amount: number) => Carbon
1240
+ addHours: (amount: number) => Carbon
1241
+ addMicroseconds: (amount: number) => Carbon
1242
+ addMillennia: (amount: number) => Carbon
1243
+ addMilliseconds: (amount: number) => Carbon
1244
+ addMinutes: (amount: number) => Carbon
1245
+ addMonths: (amount: number) => Carbon
1246
+ addNanoseconds: (amount: number) => Carbon
1247
+ addSeconds: (amount: number) => Carbon
1248
+ addWeeks: (amount: number) => Carbon
1249
+ addYears: (amount: number) => Carbon
1250
+ day: number
1251
+ dayName: string
1252
+ dayOfWeek: number
1253
+ dayOfYear: number
1254
+ daysInMonth: () => number
1255
+ daysInYear: () => number
1256
+ diffAsCarbonInterval: (other: Carbon, largestUnit?: Temporal.DateTimeUnit) => CarbonInterval
1257
+ diffForHumans: { (): string; (options: DiffForHumansOptions): string; (other: Carbon | Date | string, options?: DiffForHumansOptions): string;}
1258
+ diffInDays: (other: Carbon) => number
1259
+ diffInHours: (other: Carbon) => number
1260
+ diffInMilliseconds: (other: Carbon) => number
1261
+ diffInMinutes: (other: Carbon) => number
1262
+ diffInMonths: (other: Carbon) => number
1263
+ diffInSeconds: (other: Carbon) => number
1264
+ diffInWeeks: (other: Carbon) => number
1265
+ diffInYears: (other: Carbon) => number
1266
+ endOfCentury: () => Carbon
1267
+ endOfDay: () => Carbon
1268
+ endOfDecade: () => Carbon
1269
+ endOfHour: () => Carbon
1270
+ endOfMinute: () => Carbon
1271
+ endOfMonth: () => Carbon
1272
+ endOfWeek: () => Carbon
1273
+ endOfYear: () => Carbon
1274
+ format: (template?: string) => string
1275
+ hour: number
1276
+ inTimezone: (tz: string) => Carbon
1277
+ intlFormat: (locale?: string, options?: Intl.DateTimeFormatOptions) => string
1278
+ isAfter: (other: Carbon) => boolean
1279
+ isBefore: (other: Carbon) => boolean
1280
+ isBetween: (start: Carbon, end: Carbon, inclusive?: boolean) => boolean
1281
+ isEqual: (other: Carbon) => boolean
1282
+ isFuture: () => boolean
1283
+ isLeapYear: () => boolean
1284
+ isPast: () => boolean
1285
+ isSameDay: (other: Carbon) => boolean
1286
+ isSameMonth: (other: Carbon) => boolean
1287
+ isSameYear: (other: Carbon) => boolean
1288
+ isToday: () => boolean
1289
+ isTomorrow: () => boolean
1290
+ isWeekday: () => boolean
1291
+ isWeekend: () => boolean
1292
+ isYesterday: () => boolean
1293
+ microsecond: number
1294
+ millisecond: number
1295
+ minute: number
1296
+ month: number
1297
+ monthName: string
1298
+ nanosecond: number
1299
+ readonly _zdt: Temporal.ZonedDateTime
1300
+ second: number
1301
+ startOfCentury: () => Carbon
1302
+ startOfDay: () => Carbon
1303
+ startOfDecade: () => Carbon
1304
+ startOfHour: () => Carbon
1305
+ startOfMinute: () => Carbon
1306
+ startOfMonth: () => Carbon
1307
+ startOfWeek: () => Carbon
1308
+ startOfYear: () => Carbon
1309
+ subDays: (amount: number) => Carbon
1310
+ subDecades: (amount: number) => Carbon
1311
+ subHours: (amount: number) => Carbon
1312
+ subMicroseconds: (amount: number) => Carbon
1313
+ subMilliseconds: (amount: number) => Carbon
1314
+ subMinutes: (amount: number) => Carbon
1315
+ subMonths: (amount: number) => Carbon
1316
+ subNanoseconds: (amount: number) => Carbon
1317
+ subSeconds: (amount: number) => Carbon
1318
+ subWeeks: (amount: number) => Carbon
1319
+ subYears: (amount: number) => Carbon
1320
+ subtract: (interval: { _duration: Temporal.Duration;}) => Carbon
1321
+ subtractCenturies: (amount: number) => Carbon
1322
+ subtractDays: (amount: number) => Carbon
1323
+ subtractDecades: (amount: number) => Carbon
1324
+ subtractHours: (amount: number) => Carbon
1325
+ subtractMicroseconds: (amount: number) => Carbon
1326
+ subtractMillennia: (amount: number) => Carbon
1327
+ subtractMilliseconds: (amount: number) => Carbon
1328
+ subtractMinutes: (amount: number) => Carbon
1329
+ subtractMonths: (amount: number) => Carbon
1330
+ subtractNanoseconds: (amount: number) => Carbon
1331
+ subtractSeconds: (amount: number) => Carbon
1332
+ subtractWeeks: (amount: number) => Carbon
1333
+ subtractYears: (amount: number) => Carbon
1334
+ timezone: string
1335
+ toDatabase: () => string
1336
+ toDate: () => Date
1337
+ toDateString: () => string
1338
+ toDateTimeString: () => string
1339
+ toISOString: () => string
1340
+ toInstant: () => Temporal.Instant
1341
+ toJSON: () => string
1342
+ toLongDate: () => string
1343
+ toMilliseconds: () => number
1344
+ toPlainDate: () => Temporal.PlainDate
1345
+ toPlainDateTime: () => Temporal.PlainDateTime
1346
+ toShortDate: () => string
1347
+ toString: () => string
1348
+ toTimeString: () => string
1349
+ toUnix: () => number
1350
+ toZonedDateTime: () => Temporal.ZonedDateTime
1351
+ valueOf: () => number
1352
+ weekOfYear: number
1353
+ weeksInYear: () => number
1354
+ withDay: (amount: number) => Carbon
1355
+ withHour: (amount: number) => Carbon
1356
+ withMicrosecond: (amount: number) => Carbon
1357
+ withMillisecond: (amount: number) => Carbon
1358
+ withMinute: (amount: number) => Carbon
1359
+ withMonth: (amount: number) => Carbon
1360
+ withNanosecond: (amount: number) => Carbon
1361
+ withSecond: (amount: number) => Carbon
1362
+ withTime: (hours: number, minutes: number, seconds?: number, ms?: number) => Carbon
1363
+ withYear: (amount: number) => Carbon
1364
+ year: number
1365
+ }
1366
+
1367
+ class CarbonInterval = {
1368
+ new (duration?: Temporal.Duration | DurationLike): CarbonInterval
1369
+ static abs: (interval: CarbonInterval) => CarbonInterval
1370
+ static compare: (a: CarbonInterval, b: CarbonInterval) => -1 | 0 | 1
1371
+ static days: (amount: number) => CarbonInterval
1372
+ static fromDuration: (duration: Temporal.Duration) => CarbonInterval
1373
+ static fromISO: (iso: string) => CarbonInterval
1374
+ static hours: (amount: number) => CarbonInterval
1375
+ static microseconds: (amount: number) => CarbonInterval
1376
+ static milliseconds: (amount: number) => CarbonInterval
1377
+ static minutes: (amount: number) => CarbonInterval
1378
+ static months: (amount: number) => CarbonInterval
1379
+ static nanoseconds: (amount: number) => CarbonInterval
1380
+ static seconds: (amount: number) => CarbonInterval
1381
+ static weeks: (amount: number) => CarbonInterval
1382
+ static years: (amount: number) => CarbonInterval
1383
+ abs: () => CarbonInterval
1384
+ add: (other: CarbonInterval) => CarbonInterval
1385
+ andDays: (amount: number) => CarbonInterval
1386
+ andHours: (amount: number) => CarbonInterval
1387
+ andMicroseconds: (amount: number) => CarbonInterval
1388
+ andMilliseconds: (amount: number) => CarbonInterval
1389
+ andMinutes: (amount: number) => CarbonInterval
1390
+ andMonths: (amount: number) => CarbonInterval
1391
+ andNanoseconds: (amount: number) => CarbonInterval
1392
+ andSeconds: (amount: number) => CarbonInterval
1393
+ andWeeks: (amount: number) => CarbonInterval
1394
+ andYears: (amount: number) => CarbonInterval
1395
+ cascade: (relativeTo?: Temporal.ZonedDateTime) => CarbonInterval
1396
+ days: number
1397
+ forHumans: (options?: { join?: string; short?: boolean;}) => string
1398
+ hours: number
1399
+ isEqualTo: (other: CarbonInterval) => boolean
1400
+ isGreaterThan: (other: CarbonInterval) => boolean
1401
+ isLessThan: (other: CarbonInterval) => boolean
1402
+ isZero: boolean
1403
+ microseconds: number
1404
+ milliseconds: number
1405
+ minutes: number
1406
+ months: number
1407
+ multiply: (factor: number) => CarbonInterval
1408
+ nanoseconds: number
1409
+ negate: () => CarbonInterval
1410
+ readonly _duration: Temporal.Duration
1411
+ seconds: number
1412
+ sign: 0 | 1 | -1
1413
+ subtract: (other: CarbonInterval) => CarbonInterval
1414
+ toDuration: () => Temporal.Duration
1415
+ toISO: () => string
1416
+ toJSON: () => string
1417
+ toString: () => string
1418
+ totalDays: () => number
1419
+ totalHours: () => number
1420
+ totalMinutes: () => number
1421
+ totalSeconds: () => number
1422
+ totalWeeks: () => number
1423
+ weeks: number
1424
+ years: number
1425
+ }
1426
+
1427
+ interface DurationLike = {
1428
+ days?: number
1429
+ hours?: number
1430
+ microseconds?: number
1431
+ milliseconds?: number
1432
+ minutes?: number
1433
+ months?: number
1434
+ nanoseconds?: number
1435
+ seconds?: number
1436
+ weeks?: number
1437
+ years?: number
1438
+ }
1439
+
1440
+ type CarbonInput = string | number | Date | Carbon | Temporal.ZonedDateTime | Temporal.Instant | Temporal.PlainDateTime | Temporal.PlainDate
1441
+
1442
+ ## ./commands `(./src/command/builtin/index.ts)`
1443
+
1444
+ class AssetsBuildCommand = {
1445
+ new (): AssetsBuildCommand
1446
+ static args: ArgDef[]
1447
+ static commandName: string
1448
+ static description: string
1449
+ static flags: { name: string; short: string; type: 'boolean'; description: string; default: boolean;}[]
1450
+ static needsApp: boolean
1451
+ _readLine: () => Promise<string>
1452
+ _writer: OutputWriter
1453
+ app: unknown
1454
+ args: Record<string, string>
1455
+ ask: (question: string, defaultValue?: string) => Promise<string>
1456
+ choice: (question: string, options: string[]) => Promise<string>
1457
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1458
+ dim: (msg: string) => void
1459
+ error: (msg: string) => void
1460
+ flags: Record<string, string | number | boolean>
1461
+ info: (msg: string) => void
1462
+ line: (msg: string) => void
1463
+ newLine: () => void
1464
+ run: () => Promise<void>
1465
+ secret: (question: string) => Promise<string>
1466
+ section: (title: string) => void
1467
+ table: (rows: [string, string][], indent?: number) => void
1468
+ warn: (msg: string) => void
1469
+ write: (msg: string) => void
1470
+ }
1471
+
1472
+ class CompileCommand = {
1473
+ new (): CompileCommand
1474
+ static args: ArgDef[]
1475
+ static commandName: string
1476
+ static description: string
1477
+ static flags: { name: string; type: 'string'; description: string; default: string;}[]
1478
+ static needsApp: boolean
1479
+ _readLine: () => Promise<string>
1480
+ _writer: OutputWriter
1481
+ app: unknown
1482
+ args: Record<string, string>
1483
+ ask: (question: string, defaultValue?: string) => Promise<string>
1484
+ choice: (question: string, options: string[]) => Promise<string>
1485
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1486
+ dim: (msg: string) => void
1487
+ error: (msg: string) => void
1488
+ flags: Record<string, string | number | boolean>
1489
+ info: (msg: string) => void
1490
+ line: (msg: string) => void
1491
+ newLine: () => void
1492
+ run: () => Promise<void>
1493
+ secret: (question: string) => Promise<string>
1494
+ section: (title: string) => void
1495
+ table: (rows: [string, string][], indent?: number) => void
1496
+ warn: (msg: string) => void
1497
+ write: (msg: string) => void
1498
+ }
1499
+
1500
+ class CssBuildCommand = {
1501
+ new (): CssBuildCommand
1502
+ static args: ArgDef[]
1503
+ static commandName: string
1504
+ static description: string
1505
+ static flags: ({ name: string; short: string; type: 'string'; description: string; default: string;} | { name: string; short: string; type: 'boolean'; description: string; default: boolean;})[]
1506
+ static needsApp: boolean
1507
+ _readLine: () => Promise<string>
1508
+ _writer: OutputWriter
1509
+ app: unknown
1510
+ args: Record<string, string>
1511
+ ask: (question: string, defaultValue?: string) => Promise<string>
1512
+ choice: (question: string, options: string[]) => Promise<string>
1513
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1514
+ dim: (msg: string) => void
1515
+ error: (msg: string) => void
1516
+ flags: Record<string, string | number | boolean>
1517
+ info: (msg: string) => void
1518
+ line: (msg: string) => void
1519
+ newLine: () => void
1520
+ run: () => Promise<void>
1521
+ secret: (question: string) => Promise<string>
1522
+ section: (title: string) => void
1523
+ table: (rows: [string, string][], indent?: number) => void
1524
+ warn: (msg: string) => void
1525
+ write: (msg: string) => void
1526
+ }
1527
+
1528
+ class DeployCommand = {
1529
+ new (): DeployCommand
1530
+ static args: ArgDef[]
1531
+ static commandName: string
1532
+ static description: string
1533
+ static flags: ({ name: string; type: 'boolean'; description: string; default: boolean;} | { name: string; type: 'string'; description: string; default?: never;})[]
1534
+ static needsApp: boolean
1535
+ static target: string
1536
+ _readLine: () => Promise<string>
1537
+ _writer: OutputWriter
1538
+ app: unknown
1539
+ args: Record<string, string>
1540
+ ask: (question: string, defaultValue?: string) => Promise<string>
1541
+ choice: (question: string, options: string[]) => Promise<string>
1542
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1543
+ dim: (msg: string) => void
1544
+ error: (msg: string) => void
1545
+ flags: Record<string, string | number | boolean>
1546
+ info: (msg: string) => void
1547
+ line: (msg: string) => void
1548
+ newLine: () => void
1549
+ run: () => Promise<void>
1550
+ secret: (question: string) => Promise<string>
1551
+ section: (title: string) => void
1552
+ table: (rows: [string, string][], indent?: number) => void
1553
+ warn: (msg: string) => void
1554
+ write: (msg: string) => void
1555
+ }
1556
+
1557
+ class DevCommand = {
1558
+ new (): DevCommand
1559
+ static aliases: string[]
1560
+ static args: ArgDef[]
1561
+ static commandName: string
1562
+ static description: string
1563
+ static flags: FlagDef[]
1564
+ static needsApp: boolean
1565
+ _readLine: () => Promise<string>
1566
+ _writer: OutputWriter
1567
+ app: unknown
1568
+ args: Record<string, string>
1569
+ ask: (question: string, defaultValue?: string) => Promise<string>
1570
+ choice: (question: string, options: string[]) => Promise<string>
1571
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1572
+ dim: (msg: string) => void
1573
+ error: (msg: string) => void
1574
+ flags: Record<string, string | number | boolean>
1575
+ info: (msg: string) => void
1576
+ line: (msg: string) => void
1577
+ newLine: () => void
1578
+ run: () => Promise<void>
1579
+ secret: (question: string) => Promise<string>
1580
+ section: (title: string) => void
1581
+ table: (rows: [string, string][], indent?: number) => void
1582
+ warn: (msg: string) => void
1583
+ write: (msg: string) => void
1584
+ }
1585
+
1586
+ class DoctorCommand = {
1587
+ new (): DoctorCommand
1588
+ static args: ArgDef[]
1589
+ static commandName: string
1590
+ static description: string
1591
+ static flags: { name: string; type: 'string'; description: string;}[]
1592
+ static needsApp: boolean
1593
+ _readLine: () => Promise<string>
1594
+ _writer: OutputWriter
1595
+ app: unknown
1596
+ args: Record<string, string>
1597
+ ask: (question: string, defaultValue?: string) => Promise<string>
1598
+ choice: (question: string, options: string[]) => Promise<string>
1599
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1600
+ dim: (msg: string) => void
1601
+ error: (msg: string) => void
1602
+ flags: Record<string, string | number | boolean>
1603
+ info: (msg: string) => void
1604
+ line: (msg: string) => void
1605
+ newLine: () => void
1606
+ run: () => Promise<void>
1607
+ secret: (question: string) => Promise<string>
1608
+ section: (title: string) => void
1609
+ table: (rows: [string, string][], indent?: number) => void
1610
+ warn: (msg: string) => void
1611
+ write: (msg: string) => void
1612
+ }
1613
+
1614
+ class KeyGenerateCommand = {
1615
+ new (): KeyGenerateCommand
1616
+ static args: never[]
1617
+ static commandName: string
1618
+ static description: string
1619
+ static flags: never[]
1620
+ static needsApp: boolean
1621
+ _readLine: () => Promise<string>
1622
+ _writer: OutputWriter
1623
+ app: unknown
1624
+ args: Record<string, string>
1625
+ ask: (question: string, defaultValue?: string) => Promise<string>
1626
+ choice: (question: string, options: string[]) => Promise<string>
1627
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1628
+ dim: (msg: string) => void
1629
+ error: (msg: string) => void
1630
+ flags: Record<string, string | number | boolean>
1631
+ info: (msg: string) => void
1632
+ line: (msg: string) => void
1633
+ newLine: () => void
1634
+ run: () => Promise<void>
1635
+ secret: (question: string) => Promise<string>
1636
+ section: (title: string) => void
1637
+ table: (rows: [string, string][], indent?: number) => void
1638
+ warn: (msg: string) => void
1639
+ write: (msg: string) => void
1640
+ }
1641
+
1642
+ class LintPackagesCommand = {
1643
+ new (): LintPackagesCommand
1644
+ static args: { name: string; required: boolean; default: string;}[]
1645
+ static commandName: string
1646
+ static description: string
1647
+ static flags: { name: string; short: string; type: 'boolean'; description: string; default: boolean;}[]
1648
+ static needsApp: boolean
1649
+ _readLine: () => Promise<string>
1650
+ _writer: OutputWriter
1651
+ app: unknown
1652
+ args: Record<string, string>
1653
+ ask: (question: string, defaultValue?: string) => Promise<string>
1654
+ choice: (question: string, options: string[]) => Promise<string>
1655
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1656
+ dim: (msg: string) => void
1657
+ error: (msg: string) => void
1658
+ flags: Record<string, string | number | boolean>
1659
+ info: (msg: string) => void
1660
+ line: (msg: string) => void
1661
+ newLine: () => void
1662
+ run: () => Promise<void>
1663
+ secret: (question: string) => Promise<string>
1664
+ section: (title: string) => void
1665
+ table: (rows: [string, string][], indent?: number) => void
1666
+ warn: (msg: string) => void
1667
+ write: (msg: string) => void
1668
+ }
1669
+
1670
+ class MakeCommandCommand = {
1671
+ new (): MakeCommandCommand
1672
+ static args: { name: string; required: boolean; description: string;}[]
1673
+ static commandName: string
1674
+ static description: string
1675
+ static flags: never[]
1676
+ static needsApp: boolean
1677
+ _readLine: () => Promise<string>
1678
+ _writer: OutputWriter
1679
+ app: unknown
1680
+ args: Record<string, string>
1681
+ ask: (question: string, defaultValue?: string) => Promise<string>
1682
+ choice: (question: string, options: string[]) => Promise<string>
1683
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1684
+ dim: (msg: string) => void
1685
+ error: (msg: string) => void
1686
+ flags: Record<string, string | number | boolean>
1687
+ info: (msg: string) => void
1688
+ line: (msg: string) => void
1689
+ newLine: () => void
1690
+ run: () => Promise<void>
1691
+ secret: (question: string) => Promise<string>
1692
+ section: (title: string) => void
1693
+ table: (rows: [string, string][], indent?: number) => void
1694
+ warn: (msg: string) => void
1695
+ write: (msg: string) => void
1696
+ }
1697
+
1698
+ class MakeControllerCommand = {
1699
+ new (): MakeControllerCommand
1700
+ static args: { name: string; required: boolean; description: string;}[]
1701
+ static commandName: string
1702
+ static description: string
1703
+ static flags: { name: string; type: 'boolean'; description: string; default: boolean;}[]
1704
+ static needsApp: boolean
1705
+ _readLine: () => Promise<string>
1706
+ _writer: OutputWriter
1707
+ app: unknown
1708
+ args: Record<string, string>
1709
+ ask: (question: string, defaultValue?: string) => Promise<string>
1710
+ choice: (question: string, options: string[]) => Promise<string>
1711
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1712
+ dim: (msg: string) => void
1713
+ error: (msg: string) => void
1714
+ flags: Record<string, string | number | boolean>
1715
+ info: (msg: string) => void
1716
+ line: (msg: string) => void
1717
+ newLine: () => void
1718
+ run: () => Promise<void>
1719
+ secret: (question: string) => Promise<string>
1720
+ section: (title: string) => void
1721
+ table: (rows: [string, string][], indent?: number) => void
1722
+ warn: (msg: string) => void
1723
+ write: (msg: string) => void
1724
+ }
1725
+
1726
+ class MakeEventCommand = {
1727
+ new (): MakeEventCommand
1728
+ static args: { name: string; required: boolean; default: string;}[]
1729
+ static commandName: string
1730
+ static description: string
1731
+ static flags: { name: string; short: string; type: 'boolean'; description: string; default: boolean;}[]
1732
+ static needsApp: boolean
1733
+ _readLine: () => Promise<string>
1734
+ _writer: OutputWriter
1735
+ app: unknown
1736
+ args: Record<string, string>
1737
+ ask: (question: string, defaultValue?: string) => Promise<string>
1738
+ choice: (question: string, options: string[]) => Promise<string>
1739
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1740
+ dim: (msg: string) => void
1741
+ error: (msg: string) => void
1742
+ flags: Record<string, string | number | boolean>
1743
+ info: (msg: string) => void
1744
+ line: (msg: string) => void
1745
+ newLine: () => void
1746
+ run: () => Promise<void>
1747
+ secret: (question: string) => Promise<string>
1748
+ section: (title: string) => void
1749
+ table: (rows: [string, string][], indent?: number) => void
1750
+ warn: (msg: string) => void
1751
+ write: (msg: string) => void
1752
+ }
1753
+
1754
+ class MakeJobCommand = {
1755
+ new (): MakeJobCommand
1756
+ static args: { name: string; required: boolean; default: string;}[]
1757
+ static commandName: string
1758
+ static description: string
1759
+ static flags: FlagDef[]
1760
+ static needsApp: boolean
1761
+ _readLine: () => Promise<string>
1762
+ _writer: OutputWriter
1763
+ app: unknown
1764
+ args: Record<string, string>
1765
+ ask: (question: string, defaultValue?: string) => Promise<string>
1766
+ choice: (question: string, options: string[]) => Promise<string>
1767
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1768
+ dim: (msg: string) => void
1769
+ error: (msg: string) => void
1770
+ flags: Record<string, string | number | boolean>
1771
+ info: (msg: string) => void
1772
+ line: (msg: string) => void
1773
+ newLine: () => void
1774
+ run: () => Promise<void>
1775
+ secret: (question: string) => Promise<string>
1776
+ section: (title: string) => void
1777
+ table: (rows: [string, string][], indent?: number) => void
1778
+ warn: (msg: string) => void
1779
+ write: (msg: string) => void
1780
+ }
1781
+
1782
+ class MakeListenerCommand = {
1783
+ new (): MakeListenerCommand
1784
+ static args: { name: string; required: boolean; default: string;}[]
1785
+ static commandName: string
1786
+ static description: string
1787
+ static flags: FlagDef[]
1788
+ static needsApp: boolean
1789
+ _readLine: () => Promise<string>
1790
+ _writer: OutputWriter
1791
+ app: unknown
1792
+ args: Record<string, string>
1793
+ ask: (question: string, defaultValue?: string) => Promise<string>
1794
+ choice: (question: string, options: string[]) => Promise<string>
1795
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1796
+ dim: (msg: string) => void
1797
+ error: (msg: string) => void
1798
+ flags: Record<string, string | number | boolean>
1799
+ info: (msg: string) => void
1800
+ line: (msg: string) => void
1801
+ newLine: () => void
1802
+ run: () => Promise<void>
1803
+ secret: (question: string) => Promise<string>
1804
+ section: (title: string) => void
1805
+ table: (rows: [string, string][], indent?: number) => void
1806
+ warn: (msg: string) => void
1807
+ write: (msg: string) => void
1808
+ }
1809
+
1810
+ class MakeMiddlewareCommand = {
1811
+ new (): MakeMiddlewareCommand
1812
+ static args: { name: string; required: boolean; description: string;}[]
1813
+ static commandName: string
1814
+ static description: string
1815
+ static flags: never[]
1816
+ static needsApp: boolean
1817
+ _readLine: () => Promise<string>
1818
+ _writer: OutputWriter
1819
+ app: unknown
1820
+ args: Record<string, string>
1821
+ ask: (question: string, defaultValue?: string) => Promise<string>
1822
+ choice: (question: string, options: string[]) => Promise<string>
1823
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1824
+ dim: (msg: string) => void
1825
+ error: (msg: string) => void
1826
+ flags: Record<string, string | number | boolean>
1827
+ info: (msg: string) => void
1828
+ line: (msg: string) => void
1829
+ newLine: () => void
1830
+ run: () => Promise<void>
1831
+ secret: (question: string) => Promise<string>
1832
+ section: (title: string) => void
1833
+ table: (rows: [string, string][], indent?: number) => void
1834
+ warn: (msg: string) => void
1835
+ write: (msg: string) => void
1836
+ }
1837
+
1838
+ class MakeNotificationCommand = {
1839
+ new (): MakeNotificationCommand
1840
+ static args: { name: string; required: boolean; description: string;}[]
1841
+ static commandName: string
1842
+ static description: string
1843
+ static flags: FlagDef[]
1844
+ static needsApp: boolean
1845
+ _readLine: () => Promise<string>
1846
+ _writer: OutputWriter
1847
+ app: unknown
1848
+ args: Record<string, string>
1849
+ ask: (question: string, defaultValue?: string) => Promise<string>
1850
+ choice: (question: string, options: string[]) => Promise<string>
1851
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1852
+ dim: (msg: string) => void
1853
+ error: (msg: string) => void
1854
+ flags: Record<string, string | number | boolean>
1855
+ info: (msg: string) => void
1856
+ line: (msg: string) => void
1857
+ newLine: () => void
1858
+ run: () => Promise<void>
1859
+ secret: (question: string) => Promise<string>
1860
+ section: (title: string) => void
1861
+ table: (rows: [string, string][], indent?: number) => void
1862
+ warn: (msg: string) => void
1863
+ write: (msg: string) => void
1864
+ }
1865
+
1866
+ class MakeObserverCommand = {
1867
+ new (): MakeObserverCommand
1868
+ static args: { name: string; required: boolean; description: string;}[]
1869
+ static commandName: string
1870
+ static description: string
1871
+ static flags: { name: string; short: string; type: 'string'; description: string; default: string;}[]
1872
+ static needsApp: boolean
1873
+ _readLine: () => Promise<string>
1874
+ _writer: OutputWriter
1875
+ app: unknown
1876
+ args: Record<string, string>
1877
+ ask: (question: string, defaultValue?: string) => Promise<string>
1878
+ choice: (question: string, options: string[]) => Promise<string>
1879
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1880
+ dim: (msg: string) => void
1881
+ error: (msg: string) => void
1882
+ flags: Record<string, string | number | boolean>
1883
+ info: (msg: string) => void
1884
+ line: (msg: string) => void
1885
+ newLine: () => void
1886
+ run: () => Promise<void>
1887
+ secret: (question: string) => Promise<string>
1888
+ section: (title: string) => void
1889
+ table: (rows: [string, string][], indent?: number) => void
1890
+ warn: (msg: string) => void
1891
+ write: (msg: string) => void
1892
+ }
1893
+
1894
+ class MakePackageCommand = {
1895
+ new (): MakePackageCommand
1896
+ static args: ({ name: string; required: boolean; default?: never;} | { name: string; required: boolean; default: string;})[]
1897
+ static commandName: string
1898
+ static description: string
1899
+ static flags: never[]
1900
+ static needsApp: boolean
1901
+ _readLine: () => Promise<string>
1902
+ _writer: OutputWriter
1903
+ app: unknown
1904
+ args: Record<string, string>
1905
+ ask: (question: string, defaultValue?: string) => Promise<string>
1906
+ choice: (question: string, options: string[]) => Promise<string>
1907
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1908
+ dim: (msg: string) => void
1909
+ error: (msg: string) => void
1910
+ flags: Record<string, string | number | boolean>
1911
+ info: (msg: string) => void
1912
+ line: (msg: string) => void
1913
+ newLine: () => void
1914
+ run: () => Promise<void>
1915
+ secret: (question: string) => Promise<string>
1916
+ section: (title: string) => void
1917
+ table: (rows: [string, string][], indent?: number) => void
1918
+ warn: (msg: string) => void
1919
+ write: (msg: string) => void
1920
+ }
1921
+
1922
+ class MakePolicyCommand = {
1923
+ new (): MakePolicyCommand
1924
+ static args: { name: string; required: boolean; description: string;}[]
1925
+ static commandName: string
1926
+ static description: string
1927
+ static flags: { name: string; short: string; type: 'string'; description: string; default: string;}[]
1928
+ static needsApp: boolean
1929
+ _readLine: () => Promise<string>
1930
+ _writer: OutputWriter
1931
+ app: unknown
1932
+ args: Record<string, string>
1933
+ ask: (question: string, defaultValue?: string) => Promise<string>
1934
+ choice: (question: string, options: string[]) => Promise<string>
1935
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1936
+ dim: (msg: string) => void
1937
+ error: (msg: string) => void
1938
+ flags: Record<string, string | number | boolean>
1939
+ info: (msg: string) => void
1940
+ line: (msg: string) => void
1941
+ newLine: () => void
1942
+ run: () => Promise<void>
1943
+ secret: (question: string) => Promise<string>
1944
+ section: (title: string) => void
1945
+ table: (rows: [string, string][], indent?: number) => void
1946
+ warn: (msg: string) => void
1947
+ write: (msg: string) => void
1948
+ }
1949
+
1950
+ class MakeProviderCommand = {
1951
+ new (): MakeProviderCommand
1952
+ static args: { name: string; required: boolean;}[]
1953
+ static commandName: string
1954
+ static description: string
1955
+ static flags: { name: string; type: 'boolean'; description: string; default: boolean;}[]
1956
+ static needsApp: boolean
1957
+ _readLine: () => Promise<string>
1958
+ _writer: OutputWriter
1959
+ app: unknown
1960
+ args: Record<string, string>
1961
+ ask: (question: string, defaultValue?: string) => Promise<string>
1962
+ choice: (question: string, options: string[]) => Promise<string>
1963
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1964
+ dim: (msg: string) => void
1965
+ error: (msg: string) => void
1966
+ flags: Record<string, string | number | boolean>
1967
+ info: (msg: string) => void
1968
+ line: (msg: string) => void
1969
+ newLine: () => void
1970
+ run: () => Promise<void>
1971
+ secret: (question: string) => Promise<string>
1972
+ section: (title: string) => void
1973
+ table: (rows: [string, string][], indent?: number) => void
1974
+ warn: (msg: string) => void
1975
+ write: (msg: string) => void
1976
+ }
1977
+
1978
+ class MakeRequestCommand = {
1979
+ new (): MakeRequestCommand
1980
+ static args: { name: string; required: boolean; default: string;}[]
1981
+ static commandName: string
1982
+ static description: string
1983
+ static flags: FlagDef[]
1984
+ static needsApp: boolean
1985
+ _readLine: () => Promise<string>
1986
+ _writer: OutputWriter
1987
+ app: unknown
1988
+ args: Record<string, string>
1989
+ ask: (question: string, defaultValue?: string) => Promise<string>
1990
+ choice: (question: string, options: string[]) => Promise<string>
1991
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
1992
+ dim: (msg: string) => void
1993
+ error: (msg: string) => void
1994
+ flags: Record<string, string | number | boolean>
1995
+ info: (msg: string) => void
1996
+ line: (msg: string) => void
1997
+ newLine: () => void
1998
+ run: () => Promise<void>
1999
+ secret: (question: string) => Promise<string>
2000
+ section: (title: string) => void
2001
+ table: (rows: [string, string][], indent?: number) => void
2002
+ warn: (msg: string) => void
2003
+ write: (msg: string) => void
2004
+ }
2005
+
2006
+ class MakeResourceCommand = {
2007
+ new (): MakeResourceCommand
2008
+ static args: { name: string; required: boolean; description: string;}[]
2009
+ static commandName: string
2010
+ static description: string
2011
+ static flags: FlagDef[]
2012
+ static needsApp: boolean
2013
+ _readLine: () => Promise<string>
2014
+ _writer: OutputWriter
2015
+ app: unknown
2016
+ args: Record<string, string>
2017
+ ask: (question: string, defaultValue?: string) => Promise<string>
2018
+ choice: (question: string, options: string[]) => Promise<string>
2019
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2020
+ dim: (msg: string) => void
2021
+ error: (msg: string) => void
2022
+ flags: Record<string, string | number | boolean>
2023
+ info: (msg: string) => void
2024
+ line: (msg: string) => void
2025
+ newLine: () => void
2026
+ run: () => Promise<void>
2027
+ secret: (question: string) => Promise<string>
2028
+ section: (title: string) => void
2029
+ table: (rows: [string, string][], indent?: number) => void
2030
+ warn: (msg: string) => void
2031
+ write: (msg: string) => void
2032
+ }
2033
+
2034
+ class MakeTestCommand = {
2035
+ new (): MakeTestCommand
2036
+ static args: { name: string; required: boolean; description: string;}[]
2037
+ static commandName: string
2038
+ static description: string
2039
+ static flags: { name: string; type: 'boolean'; description: string; default: boolean;}[]
2040
+ static needsApp: boolean
2041
+ _readLine: () => Promise<string>
2042
+ _writer: OutputWriter
2043
+ app: unknown
2044
+ args: Record<string, string>
2045
+ ask: (question: string, defaultValue?: string) => Promise<string>
2046
+ choice: (question: string, options: string[]) => Promise<string>
2047
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2048
+ dim: (msg: string) => void
2049
+ error: (msg: string) => void
2050
+ flags: Record<string, string | number | boolean>
2051
+ info: (msg: string) => void
2052
+ line: (msg: string) => void
2053
+ newLine: () => void
2054
+ run: () => Promise<void>
2055
+ secret: (question: string) => Promise<string>
2056
+ section: (title: string) => void
2057
+ table: (rows: [string, string][], indent?: number) => void
2058
+ warn: (msg: string) => void
2059
+ write: (msg: string) => void
2060
+ }
2061
+
2062
+ class ReloadCommand = {
2063
+ new (): ReloadCommand
2064
+ static args: never[]
2065
+ static commandName: string
2066
+ static description: string
2067
+ static flags: never[]
2068
+ static needsApp: boolean
2069
+ _readLine: () => Promise<string>
2070
+ _writer: OutputWriter
2071
+ app: unknown
2072
+ args: Record<string, string>
2073
+ ask: (question: string, defaultValue?: string) => Promise<string>
2074
+ choice: (question: string, options: string[]) => Promise<string>
2075
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2076
+ dim: (msg: string) => void
2077
+ error: (msg: string) => void
2078
+ flags: Record<string, string | number | boolean>
2079
+ info: (msg: string) => void
2080
+ line: (msg: string) => void
2081
+ newLine: () => void
2082
+ run: () => Promise<void>
2083
+ secret: (question: string) => Promise<string>
2084
+ section: (title: string) => void
2085
+ table: (rows: [string, string][], indent?: number) => void
2086
+ warn: (msg: string) => void
2087
+ write: (msg: string) => void
2088
+ }
2089
+
2090
+ class ReplCommand = {
2091
+ new (): ReplCommand
2092
+ static args: ArgDef[]
2093
+ static commandName: string
2094
+ static description: string
2095
+ static flags: FlagDef[]
2096
+ static needsApp: boolean
2097
+ _readLine: () => Promise<string>
2098
+ _writer: OutputWriter
2099
+ app: unknown
2100
+ args: Record<string, string>
2101
+ ask: (question: string, defaultValue?: string) => Promise<string>
2102
+ choice: (question: string, options: string[]) => Promise<string>
2103
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2104
+ dim: (msg: string) => void
2105
+ error: (msg: string) => void
2106
+ flags: Record<string, string | number | boolean>
2107
+ info: (msg: string) => void
2108
+ line: (msg: string) => void
2109
+ newLine: () => void
2110
+ run: () => Promise<void>
2111
+ secret: (question: string) => Promise<string>
2112
+ section: (title: string) => void
2113
+ table: (rows: [string, string][], indent?: number) => void
2114
+ warn: (msg: string) => void
2115
+ write: (msg: string) => void
2116
+ }
2117
+
2118
+ class RouteListCommand = {
2119
+ new (): RouteListCommand
2120
+ static args: never[]
2121
+ static commandName: string
2122
+ static description: string
2123
+ static flags: ({ name: string; short: string; type: 'string'; description: string; default?: never;} | { name: string; short: string; type: 'boolean'; description: string; default: boolean;})[]
2124
+ static needsApp: boolean
2125
+ _readLine: () => Promise<string>
2126
+ _writer: OutputWriter
2127
+ app: unknown
2128
+ args: Record<string, string>
2129
+ ask: (question: string, defaultValue?: string) => Promise<string>
2130
+ choice: (question: string, options: string[]) => Promise<string>
2131
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2132
+ dim: (msg: string) => void
2133
+ error: (msg: string) => void
2134
+ flags: Record<string, string | number | boolean>
2135
+ info: (msg: string) => void
2136
+ line: (msg: string) => void
2137
+ newLine: () => void
2138
+ run: () => Promise<void>
2139
+ secret: (question: string) => Promise<string>
2140
+ section: (title: string) => void
2141
+ table: (rows: [string, string][], indent?: number) => void
2142
+ warn: (msg: string) => void
2143
+ write: (msg: string) => void
2144
+ }
2145
+
2146
+ class RouteTypesCommand = {
2147
+ new (): RouteTypesCommand
2148
+ static args: never[]
2149
+ static commandName: string
2150
+ static description: string
2151
+ static flags: FlagDef[]
2152
+ static needsApp: boolean
2153
+ _readLine: () => Promise<string>
2154
+ _writer: OutputWriter
2155
+ app: unknown
2156
+ args: Record<string, string>
2157
+ ask: (question: string, defaultValue?: string) => Promise<string>
2158
+ choice: (question: string, options: string[]) => Promise<string>
2159
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2160
+ dim: (msg: string) => void
2161
+ error: (msg: string) => void
2162
+ flags: Record<string, string | number | boolean>
2163
+ info: (msg: string) => void
2164
+ line: (msg: string) => void
2165
+ newLine: () => void
2166
+ run: () => Promise<void>
2167
+ secret: (question: string) => Promise<string>
2168
+ section: (title: string) => void
2169
+ table: (rows: [string, string][], indent?: number) => void
2170
+ warn: (msg: string) => void
2171
+ write: (msg: string) => void
2172
+ }
2173
+
2174
+ class ServeCommand = {
2175
+ new (): ServeCommand
2176
+ static aliases: string[]
2177
+ static args: ArgDef[]
2178
+ static commandName: string
2179
+ static description: string
2180
+ static flags: FlagDef[]
2181
+ static needsApp: boolean
2182
+ _readLine: () => Promise<string>
2183
+ _writer: OutputWriter
2184
+ app: unknown
2185
+ args: Record<string, string>
2186
+ ask: (question: string, defaultValue?: string) => Promise<string>
2187
+ choice: (question: string, options: string[]) => Promise<string>
2188
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2189
+ dim: (msg: string) => void
2190
+ error: (msg: string) => void
2191
+ flags: Record<string, string | number | boolean>
2192
+ info: (msg: string) => void
2193
+ line: (msg: string) => void
2194
+ newLine: () => void
2195
+ run: () => Promise<void>
2196
+ secret: (question: string) => Promise<string>
2197
+ section: (title: string) => void
2198
+ table: (rows: [string, string][], indent?: number) => void
2199
+ warn: (msg: string) => void
2200
+ write: (msg: string) => void
2201
+ }
2202
+
2203
+ class StartCommand = {
2204
+ new (): ServeCommand
2205
+ static aliases: string[]
2206
+ static args: ArgDef[]
2207
+ static commandName: string
2208
+ static description: string
2209
+ static flags: FlagDef[]
2210
+ static needsApp: boolean
2211
+ _readLine: () => Promise<string>
2212
+ _writer: OutputWriter
2213
+ app: unknown
2214
+ args: Record<string, string>
2215
+ ask: (question: string, defaultValue?: string) => Promise<string>
2216
+ choice: (question: string, options: string[]) => Promise<string>
2217
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2218
+ dim: (msg: string) => void
2219
+ error: (msg: string) => void
2220
+ flags: Record<string, string | number | boolean>
2221
+ info: (msg: string) => void
2222
+ line: (msg: string) => void
2223
+ newLine: () => void
2224
+ run: () => Promise<void>
2225
+ secret: (question: string) => Promise<string>
2226
+ section: (title: string) => void
2227
+ table: (rows: [string, string][], indent?: number) => void
2228
+ warn: (msg: string) => void
2229
+ write: (msg: string) => void
2230
+ }
2231
+
2232
+ class StatusCommand = {
2233
+ new (): StatusCommand
2234
+ static args: never[]
2235
+ static commandName: string
2236
+ static description: string
2237
+ static flags: ({ name: string; short: string; type: 'number'; description: string; default: number;} | { name: string; type: 'string'; description: string; default: string; short?: never;})[]
2238
+ static needsApp: boolean
2239
+ _readLine: () => Promise<string>
2240
+ _writer: OutputWriter
2241
+ app: unknown
2242
+ args: Record<string, string>
2243
+ ask: (question: string, defaultValue?: string) => Promise<string>
2244
+ choice: (question: string, options: string[]) => Promise<string>
2245
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2246
+ dim: (msg: string) => void
2247
+ error: (msg: string) => void
2248
+ flags: Record<string, string | number | boolean>
2249
+ info: (msg: string) => void
2250
+ line: (msg: string) => void
2251
+ newLine: () => void
2252
+ run: () => Promise<void>
2253
+ secret: (question: string) => Promise<string>
2254
+ section: (title: string) => void
2255
+ table: (rows: [string, string][], indent?: number) => void
2256
+ warn: (msg: string) => void
2257
+ write: (msg: string) => void
2258
+ }
2259
+
2260
+ class TestCommand = {
2261
+ new (): TestCommand
2262
+ static args: { name: string; required: boolean; default: string;}[]
2263
+ static commandName: string
2264
+ static description: string
2265
+ static flags: ({ name: string; type: 'boolean'; description: string; default: boolean; short?: never;} | { name: string; short: string; type: 'boolean'; description: string; default: boolean;} | { name: string; type: 'number'; description: string; default: number; short?: never;})[]
2266
+ static needsApp: boolean
2267
+ static readonly DEFAULT_TIMEOUT_MS: 30000
2268
+ _readLine: () => Promise<string>
2269
+ _writer: OutputWriter
2270
+ app: unknown
2271
+ args: Record<string, string>
2272
+ ask: (question: string, defaultValue?: string) => Promise<string>
2273
+ choice: (question: string, options: string[]) => Promise<string>
2274
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2275
+ dim: (msg: string) => void
2276
+ error: (msg: string) => void
2277
+ flags: Record<string, string | number | boolean>
2278
+ info: (msg: string) => void
2279
+ line: (msg: string) => void
2280
+ newLine: () => void
2281
+ run: () => Promise<void>
2282
+ secret: (question: string) => Promise<string>
2283
+ section: (title: string) => void
2284
+ table: (rows: [string, string][], indent?: number) => void
2285
+ warn: (msg: string) => void
2286
+ write: (msg: string) => void
2287
+ }
2288
+
2289
+ class WorkerCommand = {
2290
+ new (): WorkerCommand
2291
+ static aliases: string[]
2292
+ static args: ArgDef[]
2293
+ static commandName: string
2294
+ static description: string
2295
+ static flags: FlagDef[]
2296
+ static needsApp: boolean
2297
+ _readLine: () => Promise<string>
2298
+ _writer: OutputWriter
2299
+ app: unknown
2300
+ args: Record<string, string>
2301
+ ask: (question: string, defaultValue?: string) => Promise<string>
2302
+ choice: (question: string, options: string[]) => Promise<string>
2303
+ confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
2304
+ dim: (msg: string) => void
2305
+ error: (msg: string) => void
2306
+ flags: Record<string, string | number | boolean>
2307
+ info: (msg: string) => void
2308
+ line: (msg: string) => void
2309
+ newLine: () => void
2310
+ run: () => Promise<void>
2311
+ secret: (question: string) => Promise<string>
2312
+ section: (title: string) => void
2313
+ table: (rows: [string, string][], indent?: number) => void
2314
+ warn: (msg: string) => void
2315
+ write: (msg: string) => void
2316
+ }
2317
+
2318
+ function makeDeployCommand = (target: string) => DeployCommandClass
2319
+
2320
+ ## ./config `(./src/config/index.ts)`
2321
+
2322
+ class ConfigLoader = {
2323
+ new (_map: ConfigMap, _validators?: ReadonlyArray<{ ns: string; fn: Validator; }>): ConfigLoader
2324
+ all: () => ConfigMap
2325
+ get: <T = unknown>(key: string, fallback?: T) => T
2326
+ has: (key: string) => boolean
2327
+ validate: () => ConfigLoader
2328
+ }
2329
+
2330
+ class ConfigManager = {
2331
+ new (): ConfigManager
2332
+ all: () => Record<string, unknown>
2333
+ get: <T = unknown>(path: string, fallback?: T) => T
2334
+ has: (path: string) => boolean
2335
+ load: (namespace: string, values: Record<string, unknown>) => void
2336
+ require: <T = unknown>(path: string) => T
2337
+ set: (path: string, value: unknown) => void
2338
+ }
2339
+
2340
+ class ConfigValidationError = {
2341
+ new (issues: Array<{ namespace: string; message: string; }>): ConfigValidationError
2342
+ readonly code: string
2343
+ readonly context?: Record<string, unknown> | undefined
2344
+ readonly issues: { namespace: string; message: string;}[]
2345
+ readonly status: number
2346
+ }
2347
+
2348
+ const DEFAULT_DEPLOY_STEPS = readonly string[]
2349
+
2350
+ const DEFAULT_DEPLOY_TARGETS = Record<string, DeployTarget>
2351
+
2352
+ function AppConfig = (options: { name?: string; env?: string; key?: string; debug?: boolean; url?: string; port?: number; locale?: string; timezone?: string; http3?: boolean; tls?: AppTlsConfig; maxRequestBodySize?: number; health?: boolean | HealthConfigShape; allowedOrigins?: string[]; cors?: Partial<AppCorsConfig>; throttle?: Partial<AppThrottleConfig>; secureHeaders?: Partial<AppSecureHeadersConfig>; assets?: { entrypoint: string | string[]; outDir?: string; prefix?: string; minify?: boolean; loader?: Record<string, AssetLoaderKind>; }; dev?: DevConfigShape; conventions?: { enabled?: boolean; paths?: Partial<ConventionsConfig['paths']>; };}) => AppConfigShape
2353
+
2354
+ function configLoader = (dir?: string) => ConfigLoader
2355
+
2356
+ function DeployConfig = (options?: Partial<DeployConfigShape>) => DeployConfigShape
2357
+
2358
+ interface AppAssetsConfig = {
2359
+ entrypoint: string | string[]
2360
+ loader?: Record<string, AssetLoaderKind>
2361
+ minify: boolean
2362
+ outDir: string
2363
+ prefix: string
2364
+ }
2365
+
2366
+ interface AppConfigShape = {
2367
+ allowedOrigins: string[]
2368
+ assets?: AppAssetsConfig
2369
+ conventions: ConventionsConfig
2370
+ cors: AppCorsConfig
2371
+ debug: boolean
2372
+ dev?: DevConfigShape
2373
+ env: string
2374
+ health: boolean | HealthConfigShape
2375
+ http3: boolean
2376
+ key: string
2377
+ locale: string
2378
+ maxRequestBodySize: number
2379
+ name: string
2380
+ port: number
2381
+ secureHeaders: AppSecureHeadersConfig
2382
+ throttle: AppThrottleConfig
2383
+ timezone: string
2384
+ tls?: AppTlsConfig
2385
+ url: string
2386
+ }
2387
+
2388
+ interface AppTlsConfig = {
2389
+ cert: string
2390
+ key: string
2391
+ }
2392
+
2393
+ interface ConfigIssue = {
2394
+ level: ConfigIssueLevel
2395
+ message: string
2396
+ }
2397
+
2398
+ interface ConfigRegistry = {
2399
+ app: AppConfigShape
2400
+ deploy: DeployConfigShape
2401
+ health: HealthConfigShape
2402
+ lock: LockConfigShape
2403
+ logging: LoggingConfigShape
2404
+ }
2405
+
2406
+ interface ConfigValidationContext = {
2407
+ config: ConfigManager
2408
+ isProduction: boolean
2409
+ namespace: string
2410
+ }
2411
+
2412
+ interface ConventionsConfig = {
2413
+ enabled: boolean
2414
+ paths: { providers: string; middleware: string; models: string; observers: string; policies: string; listeners: string; events: string; jobs: string; schedules: string; validators: string; commands: string;}
2415
+ }
2416
+
2417
+ interface DeployConfigShape = {
2418
+ targets: Record<string, DeployTarget>
2419
+ }
2420
+
2421
+ interface DeployTarget = {
2422
+ steps?: readonly string[]
2423
+ url?: string
2424
+ }
2425
+
2426
+ interface RegisteredConfigValidator = {
2427
+ namespace: string
2428
+ validate: ConfigValidator
2429
+ }
2430
+
2431
+ type AssetLoaderKind = 'text' | 'file' | 'json' | 'dataurl' | 'base64' | 'toml'
2432
+
2433
+ type ConfigIssueLevel = 'error' | 'warning'
2434
+
2435
+ type ConfigMap = { [x: string]: Record<string, unknown>;}
2436
+
2437
+ type ConfigPath = 'lock' | 'app' | 'deploy' | 'health' | 'logging' | 'lock.driver' | 'lock.sqlite' | 'lock.prefix' | 'lock.sqlite.path' | 'app.url' | 'app.name' | 'app.dev' | 'app.port' | 'app.health' | 'app.env' | 'app.key' | 'app.debug' | 'app.locale' | 'app.timezone' | 'app.http3' | 'app.tls' | 'app.maxRequestBodySize' | 'app.allowedOrigins' | 'app.cors' | 'app.throttle' | 'app.secureHeaders' | 'app.assets' | 'app.conventions' | 'app.cors.credentials' | 'app.cors.origin' | 'app.throttle.maxAttempts' | 'app.throttle.windowSeconds' | 'app.secureHeaders.referrerPolicy' | 'app.secureHeaders.frameOptions' | 'app.secureHeaders.secure' | 'app.secureHeaders.hstsMaxAge' | 'app.secureHeaders.hstsIncludeSubDomains' | 'app.secureHeaders.hstsPreload' | 'app.secureHeaders.contentSecurityPolicy' | 'app.conventions.paths' | 'app.conventions.enabled' | 'app.conventions.paths.events' | 'app.conventions.paths.commands' | 'app.conventions.paths.providers' | 'app.conventions.paths.middleware' | 'app.conventions.paths.models' | 'app.conventions.paths.observers' | 'app.conventions.paths.policies' | 'app.conventions.paths.listeners' | 'app.conventions.paths.jobs' | 'app.conventions.paths.schedules' | 'app.conventions.paths.validators' | 'deploy.targets' | `deploy.targets.${string}` | 'health.path' | 'health.enabled' | 'health.secret' | 'health.showDetails' | 'logging.default' | 'logging.file' | 'logging.console' | 'logging.channels' | 'logging.slowQueryMs' | 'logging.requests' | `logging.channels.${string}`
2438
+
2439
+ type ConfigValidator = (value: unknown, ctx: ConfigValidationContext) => ConfigIssue[] | void
2440
+
2441
+ type ConfigValue = P extends `${infer Head}.${infer Rest}` ? Head extends keyof ConfigRegistry ? ValueAt<ConfigRegistry[Head], Rest> : unknown : P extends keyof ConfigRegistry ? ConfigRegistry[P] : unknown
2442
+
2443
+ ## ./contracts `(./src/contracts/index.ts)`
2444
+
2445
+ interface AuthenticatableUser = {}
2446
+
2447
+ interface SessionContract = {
2448
+ flash: (key: string, value: unknown) => void
2449
+ flush: () => void
2450
+ forget: (key: string) => void
2451
+ get: { (key: string): unknown; <T>(key: string): T | undefined;}
2452
+ has: (key: string) => boolean
2453
+ id: () => string
2454
+ pull: { (key: string): unknown; <T>(key: string): T | undefined;}
2455
+ regenerate: () => void
2456
+ set: (key: string, value: unknown) => void
2457
+ }
2458
+
2459
+ interface TransactionContext = {
2460
+ <T = Record<string, unknown>>(strings: TemplateStringsArray, ...values: unknown[]): Promise<T[]>
2461
+ }
2462
+
2463
+ ## ./dev `(./src/dev/index.ts)`
2464
+
2465
+ class DevOrchestrator = {
2466
+ new (_port: number, _cwd: string, _build: BuildHookFn, _hooks?: DevOrchestratorHooks): DevOrchestrator
2467
+ restartServer: () => Promise<void>
2468
+ shutdown: (watcher?: { close(): void;}) => Promise<never>
2469
+ start: () => Promise<void>
2470
+ }
2471
+
2472
+ class DevReloadMiddleware = {
2473
+ new (): DevReloadMiddleware
2474
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
2475
+ afterResponse?: (ctx: HttpContext) => Promise<void>
2476
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
2477
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
2478
+ }
2479
+
2480
+ class DevSupervisor = {
2481
+ new (options: DevSupervisorOptions): DevSupervisor
2482
+ definitions: () => ResolvedDevProcess[]
2483
+ restart: (name: string) => Promise<void>
2484
+ start: (definitions: ResolvedDevProcess[]) => void
2485
+ statuses: () => DevProcessStatus[]
2486
+ stopAll: () => Promise<void>
2487
+ }
2488
+
2489
+ class StreamDeck = {
2490
+ new (_writer: OutputWriter, _color: boolean): StreamDeck
2491
+ line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
2492
+ notice: (text: string) => void
2493
+ start: (statuses: DevProcessStatus[]) => void
2494
+ state: (status: DevProcessStatus) => void
2495
+ stop: () => void
2496
+ }
2497
+
2498
+ class TabsDeck = {
2499
+ new (_options: DeckOptions, _stdout: DeckStdout, _stdin: DeckStdin): TabsDeck
2500
+ line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
2501
+ notice: (text: string) => void
2502
+ start: (statuses: DevProcessStatus[]) => void
2503
+ state: (status: DevProcessStatus) => void
2504
+ stop: () => void
2505
+ }
2506
+
2507
+ const DEV_RELOAD_CLIENT = string
2508
+
2509
+ const SERVER_PROCESS_NAME = 'server'
2510
+
2511
+ function bootBuildDecision = (outDirs: string[], env: string | undefined) => Promise<BootBuildDecision>
2512
+
2513
+ function browserEnvDefines = (isProduction: boolean) => Record<string, string>
2514
+
2515
+ function buildCssBundle = (input: string, outdir: string, minify?: boolean, loader?: Record<string, string>) => Promise<BundleResult>
2516
+
2517
+ function buildJsBundle = (input: string, outdir: string, minify?: boolean) => Promise<BundleResult>
2518
+
2519
+ function collectDevProcesses = (app: ProviderHost, config?: ConfigReader) => Promise<ResolvedDevProcess[]>
2520
+
2521
+ function createDeck = (options: DeckOptions) => Deck
2522
+
2523
+ function detectCssPlugins = (cwd: string) => Promise<BunPlugin[]>
2524
+
2525
+ function isDevOrchestrated = (env?: Record<string, string | undefined>, argv?: readonly string[]) => boolean
2526
+
2527
+ function isWritableDir = (dir: string) => Promise<boolean>
2528
+
2529
+ function pruneBuildOutput = (outdir: string, outputs: readonly { path: string;}[]) => Promise<string[]>
2530
+
2531
+ function registerDevBuildHook = (name: string, fn: BuildHookFn) => void
2532
+
2533
+ function registerDevHtmlSnippet = (name: string, fn: DevHtmlSnippet) => void
2534
+
2535
+ function startDevMode = (options: StartDevModeOptions) => Promise<void>
2536
+
2537
+ interface AssetBuildConfig = {
2538
+ entrypoint: string | string[]
2539
+ loader?: Record<string, string>
2540
+ minify: boolean
2541
+ outDir: string
2542
+ prefix: string
2543
+ }
2544
+
2545
+ interface BootBuildDecision = {
2546
+ build: boolean
2547
+ reason?: string
2548
+ }
2549
+
2550
+ interface BuildResult = {
2551
+ logs?: unknown[]
2552
+ skipped?: boolean
2553
+ success: boolean
2554
+ }
2555
+
2556
+ interface Deck = {
2557
+ line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
2558
+ notice: (text: string) => void
2559
+ start: (statuses: DevProcessStatus[]) => void
2560
+ state: (status: DevProcessStatus) => void
2561
+ stop: () => void
2562
+ }
2563
+
2564
+ interface DeckOptions = {
2565
+ mode?: 'tabs' | 'stream'
2566
+ onQuit: () => void
2567
+ onRestart: (name: string) => void
2568
+ stdin?: DeckStdin
2569
+ stdout?: DeckStdout
2570
+ writer: OutputWriter
2571
+ }
2572
+
2573
+ interface DevChild = {
2574
+ kill: (signal?: number | NodeJS.Signals) => void
2575
+ readonly exited: Promise<number>
2576
+ readonly stderr: ReadableStream<Uint8Array<ArrayBufferLike>> | null
2577
+ readonly stdout: ReadableStream<Uint8Array<ArrayBufferLike>> | null
2578
+ }
2579
+
2580
+ interface DevOrchestratorHooks = {
2581
+ onCleanup?: () => void | Promise<void>
2582
+ onNotice?: (text: string, level: 'info' | 'warn' | 'error') => void
2583
+ onServerLine?: (line: string, stream: 'stdout' | 'stderr') => void
2584
+ onServerReady?: () => void | Promise<void>
2585
+ onServerState?: (state: 'starting' | 'running' | 'restarting' | 'parked') => void
2586
+ }
2587
+
2588
+ interface DevProcessStatus = {
2589
+ attempts: number
2590
+ color: DevProcessColor
2591
+ exitCode?: number
2592
+ label: string
2593
+ name: string
2594
+ state: DevProcessState
2595
+ }
2596
+
2597
+ interface DevSupervisorOptions = {
2598
+ backoffMs?: number[]
2599
+ cwd: string
2600
+ env?: Record<string, string | undefined>
2601
+ healthyAfterMs?: number
2602
+ onLine?: (name: string, line: string, stream: 'stdout' | 'stderr') => void
2603
+ onState?: (status: DevProcessStatus) => void
2604
+ spawn?: DevSpawnFn
2605
+ }
2606
+
2607
+ type BuildHookFn = () => Promise<BuildResult>
2608
+
2609
+ type DevHtmlSnippet = (ctx: HttpContext) => string
2610
+
2611
+ type DevProcessState = 'starting' | 'running' | 'restarting' | 'exited' | 'parked'
2612
+
2613
+ type DevSpawnFn = (argv: string[], options: { cwd: string; env: Record<string, string | undefined>;}) => DevChild
2614
+
2615
+ ## ./env `(./src/env/index.ts)`
2616
+
2617
+ class Def = {
2618
+ new <T>(spec: FieldSpec): Def<T>
2619
+ _parse: (key: string, raw: string | undefined, allEnv: Record<string, string | undefined>) => T
2620
+ default: (value: NonNullable<T>) => Def<NonNullable<T>>
2621
+ readonly _output: T
2622
+ readonly _spec: FieldSpec
2623
+ required: () => Def<NonNullable<T>>
2624
+ when: (conditionField: string, conditionValue: string, rule?: RequiredMarker | Def<unknown>) => Def<T>
2625
+ }
2626
+
2627
+ class EnvFieldError = {
2628
+ new (key: string, message: string): EnvFieldError
2629
+ format: () => string
2630
+ readonly key: string
2631
+ readonly message: string
2632
+ }
2633
+
2634
+ class EnvSchemaError = {
2635
+ new (errors: EnvFieldError[]): EnvSchemaError
2636
+ readonly code: string
2637
+ readonly context?: Record<string, unknown> | undefined
2638
+ readonly errors: EnvFieldError[]
2639
+ readonly status: number
2640
+ }
2641
+
2642
+ const EnvSchema = { readonly define: <S extends Record<string, Def<unknown>>>(schema: S, source?: Record<string, string | undefined>) => EnvOutput<S>;}
2643
+
2644
+ const t = { readonly string: () => Def<string | undefined>; readonly number: () => Def<number | undefined>; readonly boolean: () => Def<boolean | undefined>; readonly enum: <const V extends readonly string[]>(values: V) => Def<V[number] | undefined>; readonly url: () => Def<string | undefined>; readonly port: () => Def<number | undefined>; readonly required: () => RequiredMarker;}
2645
+
2646
+ type EnvOutput = { readonly [K in keyof S]: InferDef<S[K]>; }
2647
+
2648
+ type FieldType = 'string' | 'number' | 'boolean' | 'url' | 'enum' | 'port'
2649
+
2650
+ type InferDef = D extends Def<infer T> ? T : never
2651
+
2652
+ ## ./facades `(./src/facade/facades/index.ts)`
2653
+
2654
+ const App = { readonly container: Container; readonly instance: () => Application; readonly environment: () => Application['environment']; readonly isProduction: () => boolean; readonly isLocal: () => boolean; readonly make: <T>(token: BindingToken<T>, consumer?: unknown) => Promise<T>; readonly makeSync: <T>(token: BindingToken<T>) => T; readonly build: <T>(ctor: new (...args: unknown[]) => T) => Promise<T>; readonly tryMake: <K extends keyof ContainerBindings>(token: K) => ContainerBindings[K] | undefined; readonly bound: (token: BindingToken) => boolean; readonly bind: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly singleton: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly scoped: <T>(token: BindingToken<T>, factory: Factory<T>) => Container; readonly value: <T>(token: BindingToken<T>, instance: T) => Container; readonly alias: (from: unknown, to: unknown) => Container; readonly forget: (token: BindingToken) => boolean;}
2655
+
2656
+ const Artisan = { call(commandName: string, parameters?: Record<string, string | boolean | number>): Promise<ArtisanResult>;}
2657
+
2658
+ const Config = ConfigManager
2659
+
2660
+ const Events = Emitter
2661
+
2662
+ interface ArtisanResult = {
2663
+ code: number
2664
+ output: string
2665
+ }
2666
+
2667
+ ## ./health `(./src/health/index.ts)`
2668
+
2669
+ const Health = HealthRegistry
2670
+
2671
+ interface HealthCheckReport = {
2672
+ critical: boolean
2673
+ durationMs: number
2674
+ message?: string
2675
+ meta?: Record<string, unknown>
2676
+ status: HealthStatus
2677
+ }
2678
+
2679
+ interface HealthConfigShape = {
2680
+ enabled?: boolean
2681
+ path?: string
2682
+ secret?: string
2683
+ showDetails?: boolean
2684
+ }
2685
+
2686
+ interface HealthReport = {
2687
+ app: { name: string; version: string; environment: string; bootMs?: number;}
2688
+ checks: Record<string, HealthCheckReport>
2689
+ status: HealthStatus
2690
+ timestamp: string
2691
+ uptime: number
2692
+ }
2693
+
2694
+ interface HealthResult = {
2695
+ message?: string
2696
+ meta?: Record<string, unknown>
2697
+ status?: HealthStatus
2698
+ }
2699
+
2700
+ interface ResolvedHealthConfig = {
2701
+ enabled: boolean
2702
+ path: string
2703
+ secret?: string
2704
+ showDetails: boolean
2705
+ }
2706
+
2707
+ type HealthCheckFn = () => Promise<HealthResult | void> | HealthResult | void
2708
+
2709
+ type HealthStatus = 'ok' | 'degraded' | 'down'
2710
+
2711
+ ## ./helpers `(./src/helpers/index.ts)`
2712
+
2713
+ const Str = { camelCase(value: string): string; snakeCase(value: string): string; slugify(value: string): string; titleCase(value: string): string; pascalCase(value: string): string; capitalize(value: string): string; lcfirst(value: string): string; truncate(value: string, maxLength: number, suffix?: string): string; isAlphanumeric(value: string): boolean; padLeft(value: string, length: number, char?: string): string; kebab(value: string): string; squish(value: string): string; finish(value: string, cap: string): string; start(value: string, prefix: string): string; after(value: string, needle: string): string; before(value: string, needle: string): string; afterLast(value: string, needle: string): string; beforeLast(value: string, needle: string): string; contains(value: string, substring: string): boolean; random(length?: number): string; replaceFirst(value: string, search: string, replace: string): string; replaceLast(value: string, search: string, replace: string): string; reverse(value: string): string; words(value: string, maxWords: number, suffix?: string): string; macro(name: string, fn: (...args: unknown[]) => unknown): void;}
2714
+
2715
+ function basePath = (...segments: string[]) => string
2716
+
2717
+ function data_get = (target: unknown, key: string, defaultValue?: unknown) => unknown
2718
+
2719
+ function deepMerge = <T extends object>(base: T, override: DeepPartial<T>) => T
2720
+
2721
+ function env = { (key: string): string | undefined; (key: string, fallback: string): string; (key: string, fallback: boolean): boolean; (key: string, fallback: number): number;}
2722
+
2723
+ function escapeHtml = (value: string) => string
2724
+
2725
+ function markdownPage = (title: string, body: string) => string
2726
+
2727
+ function parseCookieHeader = (header: string, name: string) => string | undefined
2728
+
2729
+ function pipe = <T, R>(value: T, fn: (val: T) => R) => R
2730
+
2731
+ function pipeAsync = <T, R>(value: T, fn: (val: T) => Promise<R>) => Promise<R>
2732
+
2733
+ function pluralize = (value: string) => string
2734
+
2735
+ function requireEnv = (key: string) => string
2736
+
2737
+ function rescue = <T>(callback: () => Promise<T> | T, fallback: T | ((error: unknown) => T | Promise<T>)) => Promise<T>
2738
+
2739
+ function rescueSync = <T>(callback: () => T, fallback: T | ((error: unknown) => T)) => T
2740
+
2741
+ function setAppEnv = (command?: string) => void
2742
+
2743
+ function singularize = (value: string) => string
2744
+
2745
+ function tableNameFor = (className: string) => string
2746
+
2747
+ function tap = <T>(value: T, callback: (val: T) => void) => T
2748
+
2749
+ function tapAsync = <T>(value: T, callback: (val: T) => Promise<void>) => Promise<T>
2750
+
2751
+ interface BunMarkdownOptions = {
2752
+ autolinks?: boolean | { url?: boolean; www?: boolean; email?: boolean;}
2753
+ collapseWhitespace?: boolean
2754
+ hardSoftBreaks?: boolean
2755
+ headings?: boolean | { ids?: boolean;}
2756
+ latexMath?: boolean
2757
+ noHtmlBlocks?: boolean
2758
+ noHtmlSpans?: boolean
2759
+ noIndentedCodeBlocks?: boolean
2760
+ permissiveAtxHeaders?: boolean
2761
+ strikethrough?: boolean
2762
+ tables?: boolean
2763
+ tagFilter?: boolean
2764
+ tasklists?: boolean
2765
+ underline?: boolean
2766
+ wikiLinks?: boolean
2767
+ }
2768
+
2769
+ ## ./http `(./src/http/index.ts)`
2770
+
2771
+ class Http = {
2772
+ new (): Http
2773
+ static assertNotSent: (predicate: (req: { method: string; url: string;}) => boolean) => void
2774
+ static assertNothingSent: () => void
2775
+ static assertSent: (predicate: (req: { method: string; url: string;}) => boolean) => void
2776
+ static assertSentCount: (count: number) => void
2777
+ static delete: (url: string) => PendingRequest
2778
+ static fake: (stubs?: FakeStub[]) => void
2779
+ static get: (url: string) => PendingRequest
2780
+ static head: (url: string) => PendingRequest
2781
+ static patch: (url: string, data?: unknown) => PendingRequest
2782
+ static post: (url: string, data?: unknown) => PendingRequest
2783
+ static put: (url: string, data?: unknown) => PendingRequest
2784
+ static recorded: () => Array<{ method: string; url: string; options: RequestInit;}>
2785
+ static resetFakes: () => void
2786
+ static retry: (times: number, delay?: number) => _Builder
2787
+ static timeout: (milliseconds: number) => _Builder
2788
+ static withBasicAuth: (username: string, password: string) => _Builder
2789
+ static withHeaders: (headers: Record<string, string>) => _Builder
2790
+ static withToken: (token: string) => _Builder
2791
+ }
2792
+
2793
+ class HttpClientError = {
2794
+ new (message: string, status: number, response: HttpClientResponse): HttpClientError
2795
+ readonly code: string
2796
+ readonly context?: Record<string, unknown> | undefined
2797
+ readonly response: HttpClientResponse
2798
+ readonly status: number
2799
+ }
2800
+
2801
+ class HttpClientResponse = {
2802
+ new (_res: Response): HttpClientResponse
2803
+ blob: () => Promise<Blob>
2804
+ headers: Headers
2805
+ json: <T = unknown>() => Promise<T>
2806
+ ok: boolean
2807
+ status: number
2808
+ text: () => Promise<string>
2809
+ throw: () => HttpClientResponse
2810
+ }
2811
+
2812
+ class PendingRequest = {
2813
+ new (_method: HttpMethod, _url: string): PendingRequest
2814
+ acceptJson: () => PendingRequest
2815
+ json: <T = unknown>() => Promise<T>
2816
+ retry: (times: number, delay?: number) => PendingRequest
2817
+ send: () => Promise<HttpClientResponse>
2818
+ text: () => Promise<string>
2819
+ then: <TResult1 = HttpClientResponse, TResult2 = never>(onfulfilled?: ((value: HttpClientResponse) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null) => PromiseLike<TResult1 | TResult2>
2820
+ timeout: (ms: number) => PendingRequest
2821
+ withBasicAuth: (username: string, password: string) => PendingRequest
2822
+ withFormData: (data: FormData) => PendingRequest
2823
+ withHeaders: (headers: Record<string, string>) => PendingRequest
2824
+ withJson: (data: unknown) => PendingRequest
2825
+ withToken: (token: string) => PendingRequest
2826
+ }
2827
+
2828
+ class Resource = {
2829
+ new <T>(resource: T): Resource<T>
2830
+ static collection: <T, R extends Resource<T>>(ResourceClass: new (item: T) => R, items: T[], meta?: Record<string, unknown>) => Record<string, unknown> | Record<string, unknown>[]
2831
+ static withWrapping: () => void
2832
+ static withoutWrapping: () => void
2833
+ static wrapping: () => boolean
2834
+ toArray: () => Record<string, unknown>
2835
+ toJson: () => Record<string, unknown>
2836
+ toResponse: (status?: number) => Response
2837
+ }
2838
+
2839
+ class ResourceCollection = {
2840
+ new (): ResourceCollection
2841
+ static of: <T, R extends Resource<T>>(ResourceClass: new (item: T) => R, paginated: PaginatedData<T>, baseUrl?: string, query?: Record<string, string>) => Record<string, unknown>
2842
+ }
2843
+
2844
+ class UploadedFile = {
2845
+ new (file: File): UploadedFile
2846
+ static fake: (name?: string, options?: { type?: string; size?: number; content?: string | Uint8Array<ArrayBuffer> | File;}) => UploadedFile
2847
+ bytes: () => Promise<Uint8Array>
2848
+ detectType: () => Promise<SniffedType>
2849
+ extension: () => string
2850
+ isValid: (options?: FileValidationOptions) => boolean
2851
+ mimeType: string
2852
+ originalName: string
2853
+ size: number
2854
+ store: (directory: string, disk: StorageDisk, filename?: string) => Promise<string>
2855
+ storeAndGetUrl: (directory: string, disk: StorageDisk, filename?: string) => Promise<string>
2856
+ text: () => Promise<string>
2857
+ }
2858
+
2859
+ class Uri = {
2860
+ new (parts: UriParts): Uri
2861
+ static current: () => Uri
2862
+ static of: (value: string | Uri) => Uri
2863
+ static route: <N extends RouteTarget>(name: N, params?: RouteParamValues | undefined, query?: RouteQuery | undefined) => Uri
2864
+ static to: (path: string) => Uri
2865
+ fragment: () => string | undefined
2866
+ host: () => string | undefined
2867
+ intended: (fallback?: string) => Uri
2868
+ password: () => string | undefined
2869
+ path: () => string
2870
+ port: () => number | undefined
2871
+ pushOntoQuery: (key: string, value: string | number) => Uri
2872
+ query: () => UriQueryString
2873
+ redirect: (status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
2874
+ replaceQuery: (query: QueryInput) => Uri
2875
+ scheme: () => string | undefined
2876
+ toJSON: () => string
2877
+ toString: () => string
2878
+ url: () => string
2879
+ user: () => string | undefined
2880
+ value: () => string
2881
+ withFragment: (fragment: string | undefined) => Uri
2882
+ withHost: (host: string) => Uri
2883
+ withPassword: (password: string | undefined) => Uri
2884
+ withPath: (path: string) => Uri
2885
+ withPort: (port: number | undefined) => Uri
2886
+ withQuery: (query: QueryInput) => Uri
2887
+ withQueryIfMissing: (query: QueryInput) => Uri
2888
+ withScheme: (scheme: string) => Uri
2889
+ withUser: (user: string | undefined, password?: string) => Uri
2890
+ withoutQuery: (keys: string[]) => Uri
2891
+ }
2892
+
2893
+ class UrlKeyMissingError = {
2894
+ new (): UrlKeyMissingError
2895
+ readonly code: string
2896
+ readonly context?: Record<string, unknown> | undefined
2897
+ readonly status: number
2898
+ }
2899
+
2900
+ const Url = UrlGenerator
2901
+
2902
+ function isAllowedOrigin = (request: Request, allowedOrigins?: string[]) => boolean
2903
+
2904
+ function negotiate = (ctx: HttpContext) => <TWeb = void, TJson = void, TCli = void>(map: NegotiateMap<TWeb, TJson, TCli>) => Promise<TWeb | TJson | TCli | void>
2905
+
2906
+ function sniffContentType = (bytes: Uint8Array) => SniffedType
2907
+
2908
+ function uri = (value?: string | Uri) => Uri
2909
+
2910
+ function url = { (): UrlGenerator; (path: string, extra?: (string | number)[], secure?: boolean): string;}
2911
+
2912
+ interface ApiContext = {
2913
+ bearerToken: () => string | null
2914
+ json: (data: unknown, status?: number) => void
2915
+ readonly ctx: HttpContext<Record<string, string>>
2916
+ }
2917
+
2918
+ interface CliContext = {
2919
+ error: (message: string) => void
2920
+ info: (message: string) => void
2921
+ line: (content: string, color?: AnsiColor) => void
2922
+ readonly ctx: HttpContext<Record<string, string>>
2923
+ success: (message: string) => void
2924
+ text: (content: string, status?: number) => void
2925
+ warn: (message: string) => void
2926
+ write: (content: string) => void
2927
+ writeln: (content: string) => void
2928
+ }
2929
+
2930
+ interface FakeStub = {
2931
+ body?: unknown
2932
+ headers?: Record<string, string>
2933
+ status?: number
2934
+ url: string
2935
+ }
2936
+
2937
+ interface FileValidationOptions = {
2938
+ maxSize?: number
2939
+ mimes?: string[]
2940
+ }
2941
+
2942
+ interface NegotiateMap = {
2943
+ cli?: (cli: CliContext) => TCli | Promise<TCli>
2944
+ json: (api: ApiContext) => TJson | Promise<TJson>
2945
+ web: (web: WebContext) => TWeb | Promise<TWeb>
2946
+ }
2947
+
2948
+ interface PaginatedData = {
2949
+ data: T[]
2950
+ lastPage: number
2951
+ nextPageUrl: (baseUrl?: string, query?: Record<string, string>) => string | null
2952
+ page: number
2953
+ perPage: number
2954
+ previousPageUrl: (baseUrl?: string, query?: Record<string, string>) => string | null
2955
+ total: number
2956
+ }
2957
+
2958
+ interface SniffedType = {
2959
+ contentType: string
2960
+ extension: string
2961
+ recognised: boolean
2962
+ }
2963
+
2964
+ interface UriQueryString = {
2965
+ all: () => Record<string, QueryValue>
2966
+ get: (key: string) => string | undefined
2967
+ getAll: (key: string) => string[]
2968
+ has: (key: string) => boolean
2969
+ toString: () => string
2970
+ }
2971
+
2972
+ interface UrlGenerator = {
2973
+ current: () => string
2974
+ full: () => string
2975
+ intended: (fallback?: string) => string
2976
+ is: (path: string) => boolean
2977
+ previous: (fallback?: string) => string
2978
+ query: (path: string, query: QueryInput, extra?: (string | number)[]) => string
2979
+ route: <N extends RouteTarget>(name: N, params?: RouteParamValues | undefined, query?: RouteQuery | undefined) => string
2980
+ secure: (path: string, extra?: (string | number)[]) => string
2981
+ setSecret: (secret: string) => void
2982
+ sign: (base: string, params?: Record<string, string>, expiresInMinutes?: number, secret?: string) => string
2983
+ to: (path: string, extra?: (string | number)[], secure?: boolean) => string
2984
+ verify: (signedUrl: string, secret?: string) => boolean
2985
+ }
2986
+
2987
+ interface WebContext = {
2988
+ back: (status?: 301 | 302 | 303 | 307 | 308) => void
2989
+ flash: (key: string, value: unknown) => void
2990
+ flashed: <T = unknown>(key: string) => T | undefined
2991
+ html: (markup: string | { toString(): string;}, status?: number) => void
2992
+ json: (data: unknown, status?: number) => void
2993
+ readonly ctx: HttpContext<Record<string, string>>
2994
+ redirect: (url: string, status?: 301 | 302 | 303 | 307 | 308) => void
2995
+ view: (markup: string | { toString(): string;}, status?: number) => void
2996
+ }
2997
+
2998
+ type AnsiColor = 'cyan' | 'yellow' | 'green' | 'blue' | 'red' | 'dim'
2999
+
3000
+ type Channel = 'web' | 'json' | 'cli'
3001
+
3002
+ type QueryInput = { [x: string]: string | number | boolean | string[];}
3003
+
3004
+ type StorageDisk = Pick<StorageDriver, 'url'> & { put(path: string, content: Uint8Array, options?: { contentType?: string; }): Promise<void>;}
3005
+
3006
+ ## ./lock `(./src/lock/index.ts)`
3007
+
3008
+ class Lock = {
3009
+ new (): Lock
3010
+ static block: <T>(key: string, ttlSeconds: number, callback: LockedCallback<T>, options?: BlockOptions) => Promise<T>
3011
+ static make: (key: string, ttlSeconds: number) => ManagedLock
3012
+ static readonly Lost: typeof LockLostError
3013
+ static readonly NotAcquired: typeof LockNotAcquiredError
3014
+ static try: <T>(key: string, ttlSeconds: number, callback: LockedCallback<T>, options?: TryOptions) => Promise<T>
3015
+ }
3016
+
3017
+ class LockLostError = {
3018
+ new (key: string): LockLostError
3019
+ readonly code: string
3020
+ readonly context?: Record<string, unknown> | undefined
3021
+ readonly key: string
3022
+ readonly status: number
3023
+ }
3024
+
3025
+ class LockManager = {
3026
+ new (_driver: LockDriver): LockManager
3027
+ block: <T>(key: string, ttlSeconds: number, callback: LockedCallback<T>, options?: BlockOptions) => Promise<T>
3028
+ dispose: () => void
3029
+ lock: (key: string, ttlSeconds: number) => ManagedLock
3030
+ try: <T>(key: string, ttlSeconds: number, callback: LockedCallback<T>, options?: TryOptions) => Promise<T>
3031
+ }
3032
+
3033
+ class LockNotAcquiredError = {
3034
+ new (key: string): LockNotAcquiredError
3035
+ readonly code: string
3036
+ readonly context?: Record<string, unknown> | undefined
3037
+ readonly key: string
3038
+ readonly status: number
3039
+ }
3040
+
3041
+ class LockProvider = {
3042
+ new (app: Application): LockProvider
3043
+ static dependsOn?: (new (app: Application) => ServiceProvider)[]
3044
+ static environments: AppEnvironment[]
3045
+ static priority?: number
3046
+ static provides: readonly ['lock']
3047
+ devProcesses: () => DevProcessDefinition[]
3048
+ doctorChecks: () => DoctorCheck[]
3049
+ onBooted: () => Promise<void>
3050
+ onBooting: () => Promise<void>
3051
+ onRegister: () => void
3052
+ onRequestProcessed: (_ctx: HttpContext) => Promise<void>
3053
+ onRequestReceived: (_ctx: HttpContext) => Promise<void>
3054
+ onResponseSent: (_ctx: HttpContext) => Promise<void>
3055
+ onStarted: () => Promise<void>
3056
+ onStarting: () => Promise<void>
3057
+ onStopped: () => Promise<void>
3058
+ onStopping: () => Promise<void>
3059
+ replContext: () => Record<string, unknown>
3060
+ }
3061
+
3062
+ class ManagedLock = {
3063
+ new (_key: string, _ttl: number, _driver: LockDriver): ManagedLock
3064
+ acquire: () => Promise<boolean>
3065
+ block: (timeoutSeconds: number, retryDelayMs?: number) => Promise<void>
3066
+ expiresAt: Date | undefined
3067
+ forceRelease: () => Promise<void>
3068
+ isAcquired: boolean
3069
+ key: string
3070
+ refresh: (ttlSeconds?: number) => Promise<boolean>
3071
+ release: () => Promise<void>
3072
+ ttl: number
3073
+ }
3074
+
3075
+ class MemoryLockDriver = {
3076
+ new (): MemoryLockDriver
3077
+ acquire: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3078
+ exists: (key: string) => Promise<boolean>
3079
+ extend: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3080
+ flush: () => void
3081
+ forceRelease: (key: string) => Promise<void>
3082
+ release: (key: string, owner: string) => Promise<boolean>
3083
+ }
3084
+
3085
+ class RedisLockDriver = {
3086
+ new (_prefix?: string, client?: RedisLockClient): RedisLockDriver
3087
+ acquire: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3088
+ exists: (key: string) => Promise<boolean>
3089
+ extend: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3090
+ forceRelease: (key: string) => Promise<void>
3091
+ release: (key: string, owner: string) => Promise<boolean>
3092
+ }
3093
+
3094
+ class SqliteLockDriver = {
3095
+ new (path?: string): SqliteLockDriver
3096
+ acquire: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3097
+ dispose: () => void
3098
+ exists: (key: string) => Promise<boolean>
3099
+ extend: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3100
+ forceRelease: (key: string) => Promise<void>
3101
+ release: (key: string, owner: string) => Promise<boolean>
3102
+ }
3103
+
3104
+ function LockConfig = (options?: Partial<LockConfigShape>) => LockConfigShape
3105
+
3106
+ interface BlockOptions = {
3107
+ refresh?: boolean
3108
+ refreshEvery?: number
3109
+ retryDelay?: number
3110
+ timeout?: number
3111
+ }
3112
+
3113
+ interface LockConfigShape = {
3114
+ driver: 'sqlite' | 'redis' | 'memory'
3115
+ prefix: string
3116
+ sqlite: { path: string;}
3117
+ }
3118
+
3119
+ interface LockDriver = {
3120
+ acquire: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3121
+ dispose?: () => void
3122
+ exists: (key: string) => Promise<boolean>
3123
+ extend?: (key: string, owner: string, ttlSeconds: number) => Promise<boolean>
3124
+ forceRelease: (key: string) => Promise<void>
3125
+ release: (key: string, owner: string) => Promise<boolean>
3126
+ }
3127
+
3128
+ interface RefreshOptions = {
3129
+ refresh?: boolean
3130
+ refreshEvery?: number
3131
+ }
3132
+
3133
+ type LockedCallback = (lock: ManagedLock, signal: AbortSignal) => Promise<T> | T
3134
+
3135
+ type TryOptions = RefreshOptions
3136
+
3137
+ ## ./logger `(./src/logger/index.ts)`
3138
+
3139
+ class ConsoleChannel = {
3140
+ new (_format?: 'json' | 'pretty'): ConsoleChannel
3141
+ write: (entry: LogEntry) => Promise<void>
3142
+ }
3143
+
3144
+ class DailyChannel = {
3145
+ new (_dir: string, _days?: number | undefined, disk?: StorageDriver): DailyChannel
3146
+ write: (entry: LogEntry) => Promise<void>
3147
+ }
3148
+
3149
+ class LoggerMiddleware = {
3150
+ new (): LoggerMiddleware
3151
+ static setManager: (mgr: LogManager) => void
3152
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
3153
+ afterResponse?: (ctx: HttpContext) => Promise<void>
3154
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
3155
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
3156
+ }
3157
+
3158
+ class LogManager = {
3159
+ new (config: LoggingConfigShape, enrich?: Partial<_Enrich>, override?: LogChannel): LogManager
3160
+ static tap: (fn: (entry: LogEntry) => void) => () => void
3161
+ channel: (name: string) => BoundLogger
3162
+ debug: (msg: string, ctx?: Record<string, unknown>, err?: unknown) => void
3163
+ error: (msg: string, ctx?: Record<string, unknown>, err?: unknown) => void
3164
+ fatal: (msg: string, ctx?: Record<string, unknown>, err?: unknown) => void
3165
+ info: (msg: string, ctx?: Record<string, unknown>, err?: unknown) => void
3166
+ scope: (name: string) => BoundLogger
3167
+ table: (msg: string, rows: TableData, level?: LogLevel) => void
3168
+ warn: (msg: string, ctx?: Record<string, unknown>, err?: unknown) => void
3169
+ withContext: (extra: Record<string, unknown>) => BoundLogger
3170
+ }
3171
+
3172
+ class LogProvider = {
3173
+ new (app: Application): LogProvider
3174
+ static dependsOn?: (new (app: Application) => ServiceProvider)[]
3175
+ static environments: AppEnvironment[]
3176
+ static priority?: number
3177
+ static provides: readonly ['log']
3178
+ devProcesses: () => DevProcessDefinition[]
3179
+ doctorChecks: () => DoctorCheck[]
3180
+ onBooted: () => Promise<void>
3181
+ onBooting: () => Promise<void>
3182
+ onRegister: () => void
3183
+ onRequestProcessed: (_ctx: HttpContext) => Promise<void>
3184
+ onRequestReceived: (_ctx: HttpContext) => Promise<void>
3185
+ onResponseSent: (_ctx: HttpContext) => Promise<void>
3186
+ onStarted: () => Promise<void>
3187
+ onStarting: () => Promise<void>
3188
+ onStopped: () => Promise<void>
3189
+ onStopping: () => Promise<void>
3190
+ replContext: () => Record<string, unknown>
3191
+ }
3192
+
3193
+ class NullChannel = {
3194
+ new (): NullChannel
3195
+ write: () => Promise<void>
3196
+ }
3197
+
3198
+ class SingleChannel = {
3199
+ new (_file: string): SingleChannel
3200
+ write: (entry: LogEntry) => Promise<void>
3201
+ }
3202
+
3203
+ class StackChannel = {
3204
+ new (_channels: LogChannel[]): StackChannel
3205
+ write: (entry: LogEntry) => Promise<void>
3206
+ }
3207
+
3208
+ const Log = LogManager
3209
+
3210
+ function frameworkLog = (scope: string) => BoundLogger
3211
+
3212
+ function LoggingConfig = (options?: Partial<LoggingConfigShape>) => LoggingConfigShape
3213
+
3214
+ function renderTable = (data: TableData, indent?: number) => string[]
3215
+
3216
+ interface BoundLogger = {
3217
+ debug: (message: string, context?: Record<string, unknown>, err?: unknown) => void
3218
+ error: (message: string, context?: Record<string, unknown>, err?: unknown) => void
3219
+ fatal: (message: string, context?: Record<string, unknown>, err?: unknown) => void
3220
+ info: (message: string, context?: Record<string, unknown>, err?: unknown) => void
3221
+ table: (message: string, rows: TableData, level?: LogLevel) => void
3222
+ warn: (message: string, context?: Record<string, unknown>, err?: unknown) => void
3223
+ }
3224
+
3225
+ interface LogChannel = {
3226
+ write: (entry: LogEntry) => Promise<void>
3227
+ }
3228
+
3229
+ interface LogEntry = {
3230
+ app?: string | undefined
3231
+ channel: string
3232
+ context?: Record<string, unknown> | undefined
3233
+ display?: 'table' | undefined
3234
+ env?: string | undefined
3235
+ error?: string | undefined
3236
+ hostname: string
3237
+ level: LogLevel
3238
+ message: string
3239
+ pid: number
3240
+ requestId?: string | undefined
3241
+ scope?: string | undefined
3242
+ stack?: string | undefined
3243
+ timestamp: string
3244
+ }
3245
+
3246
+ interface LoggerOptions = {
3247
+ format?: 'text' | 'json'
3248
+ }
3249
+
3250
+ interface LoggingConfigShape = {
3251
+ channels: Record<string, ChannelConfig>
3252
+ console?: ConsoleSinkConfig
3253
+ default: string
3254
+ file?: FileSinkConfig
3255
+ requests?: boolean
3256
+ slowQueryMs?: number
3257
+ }
3258
+
3259
+ type ChannelConfig = { driver: 'console'; level?: LogLevel; format?: 'json' | 'pretty';} | { driver: 'single'; level?: LogLevel; path: string;} | { driver: 'daily'; level?: LogLevel; path: string; days?: number;} | { driver: 'stack'; level?: LogLevel; channels: string[];} | { driver: 'null';}
3260
+
3261
+ type LogLevel = 'error' | 'info' | 'warn' | 'debug' | 'fatal'
3262
+
3263
+ type TableData = Record<string, unknown> | readonly Record<string, unknown>[]
3264
+
3265
+ ## ./macros/config `(./src/macros/config.macro.ts)`
3266
+
3267
+ function loadConfigsSync = (configDir: string) => Record<string, Record<string, unknown>>
3268
+
3269
+ ## ./metrics `(./src/metrics/index.ts)`
3270
+
3271
+ function beginHttp = () => void
3272
+
3273
+ function endHttp = () => void
3274
+
3275
+ function httpMetrics = () => HttpMetricsSnapshot
3276
+
3277
+ function recordHttp = (status: number, ms: number) => void
3278
+
3279
+ interface HttpMetricsSnapshot = {
3280
+ avgMs: number
3281
+ clientErrors: number
3282
+ inFlight: number
3283
+ last5m: { total: number; errors: number;}
3284
+ maxMs: number
3285
+ p95Ms: number
3286
+ perMinute: number
3287
+ serverErrors: number
3288
+ success: number
3289
+ successRate: number
3290
+ total: number
3291
+ }
3292
+
3293
+ ## ./routes `(./src/router/routes.ts)`
3294
+
3295
+ const route = RouteBuilder
3296
+
3297
+ function defineRoutes = (table: RouteTable) => void
3298
+
3299
+ function hasRoute = (name: string) => boolean
3300
+
3301
+ function resetRoutes = () => void
3302
+
3303
+ type RouteTable = Readonly<Record<string, string>> | ReadonlyMap<string, string>
3304
+
3305
+ ## ./security `(./src/security/index.ts)`
3306
+
3307
+ class CryptKeyMissingError = {
3308
+ new (): CryptKeyMissingError
3309
+ readonly code: string
3310
+ readonly context?: Record<string, unknown> | undefined
3311
+ readonly status: number
3312
+ }
3313
+
3314
+ class DecryptionError = {
3315
+ new (): DecryptionError
3316
+ readonly code: string
3317
+ readonly context?: Record<string, unknown> | undefined
3318
+ readonly status: number
3319
+ }
3320
+
3321
+ class URLSigner = {
3322
+ new (secret: string): URLSigner
3323
+ sign: (base: string, params?: Record<string, string>, expiresInMinutes?: number) => string
3324
+ verify: (signedUrl: string) => boolean
3325
+ }
3326
+
3327
+ const Crypt = CryptManager
3328
+
3329
+ const Hash = HashManager
3330
+
3331
+ function redactGraph = (value: unknown, options: RedactGraphOptions) => unknown
3332
+
3333
+ interface RedactGraphOptions = {
3334
+ circular: string
3335
+ flatten?: (value: unknown) => string | undefined
3336
+ mask: string
3337
+ maxDepth: number
3338
+ sensitive: (key: string) => boolean
3339
+ tooDeep: string
3340
+ }
3341
+
3342
+ type HashAlgorithm = 'bcrypt' | 'argon2id' | 'argon2i' | 'argon2d'
3343
+
3344
+ ## ./storage `(./src/storage/index.ts)`
3345
+
3346
+ class DiskNotConfiguredError = {
3347
+ new (disk: string): DiskNotConfiguredError
3348
+ readonly code: string
3349
+ readonly context?: Record<string, unknown> | undefined
3350
+ readonly status: number
3351
+ }
3352
+
3353
+ class DiskNotServedError = {
3354
+ new (disk: string): DiskNotServedError
3355
+ readonly code: string
3356
+ readonly context?: Record<string, unknown> | undefined
3357
+ readonly status: number
3358
+ }
3359
+
3360
+ class FakeDisk = {
3361
+ new (baseUrl?: string): FakeDisk
3362
+ append: (path: string, content: string | Uint8Array) => Promise<void>
3363
+ assertContentType: (path: string, contentType: string) => FakeDisk
3364
+ assertCount: (expected: number) => FakeDisk
3365
+ assertExists: (path: string, contents?: string | Uint8Array) => FakeDisk
3366
+ assertExistsMatching: (pattern: RegExp) => FakeDisk
3367
+ assertMissing: (path: string) => FakeDisk
3368
+ assertNothingStored: () => FakeDisk
3369
+ clear: () => void
3370
+ copy: (source: string, destination: string) => Promise<void>
3371
+ count: number
3372
+ delete: (path: string) => Promise<void>
3373
+ exists: (path: string) => Promise<boolean>
3374
+ file: (path: string) => FakeStoredFile | undefined
3375
+ get: (path: string) => Promise<string | null>
3376
+ getBuffer: (path: string) => Promise<Uint8Array | null>
3377
+ lastModified: (path: string) => Promise<number | null>
3378
+ move: (source: string, destination: string) => Promise<void>
3379
+ paths: () => string[]
3380
+ put: (path: string, content: string | Uint8Array | Blob, options?: PutOptions) => Promise<void>
3381
+ size: (path: string) => Promise<number | null>
3382
+ stream: (path: string) => Promise<Blob | null>
3383
+ temporaryUrl: (path: string, expiresInSeconds: number) => Promise<string>
3384
+ url: (path: string) => string
3385
+ }
3386
+
3387
+ class LocalDriver = {
3388
+ new (_root: string, _urlBase?: string | undefined): LocalDriver
3389
+ static verifyTemporaryUrl: (path: string, expiresAt: number, signature: string) => boolean
3390
+ append: (path: string, content: string | Uint8Array) => Promise<void>
3391
+ copy: (source: string, destination: string) => Promise<void>
3392
+ delete: (path: string) => Promise<void>
3393
+ exists: (path: string) => Promise<boolean>
3394
+ get: (path: string) => Promise<string | null>
3395
+ getBuffer: (path: string) => Promise<Uint8Array | null>
3396
+ lastModified: (path: string) => Promise<number | null>
3397
+ move: (source: string, destination: string) => Promise<void>
3398
+ put: (path: string, content: string | Uint8Array | Blob, _options?: PutOptions) => Promise<void>
3399
+ size: (path: string) => Promise<number | null>
3400
+ stream: (path: string) => Promise<Blob | null>
3401
+ temporaryUrl: (path: string, expiresInSeconds: number) => Promise<string>
3402
+ url: (path: string) => string
3403
+ }
3404
+
3405
+ class PathTraversalError = {
3406
+ new (path: string): PathTraversalError
3407
+ readonly code: string
3408
+ readonly context?: Record<string, unknown> | undefined
3409
+ readonly status: number
3410
+ }
3411
+
3412
+ class S3Driver = {
3413
+ new (key: string, secret: string, region: string, bucket: string, endpoint?: string, urlBase?: string): S3Driver
3414
+ append: (_path: string, _content: string | Uint8Array) => Promise<void>
3415
+ copy: (source: string, destination: string) => Promise<void>
3416
+ delete: (path: string) => Promise<void>
3417
+ exists: (path: string) => Promise<boolean>
3418
+ get: (path: string) => Promise<string | null>
3419
+ getBuffer: (path: string) => Promise<Uint8Array | null>
3420
+ lastModified: (path: string) => Promise<number | null>
3421
+ move: (source: string, destination: string) => Promise<void>
3422
+ put: (path: string, content: string | Uint8Array | Blob, options?: PutOptions) => Promise<void>
3423
+ size: (path: string) => Promise<number | null>
3424
+ temporaryUrl: (path: string, expiresInSeconds: number) => Promise<string>
3425
+ url: (path: string) => string
3426
+ }
3427
+
3428
+ class StorageError = {
3429
+ new (message: string, code?: string, status?: number, context?: Record<string, unknown>): StorageError
3430
+ readonly code: string
3431
+ readonly context?: Record<string, unknown> | undefined
3432
+ readonly status: number
3433
+ }
3434
+
3435
+ class StorageFilesMiddleware = {
3436
+ new (): StorageFilesMiddleware
3437
+ static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
3438
+ afterResponse?: (ctx: HttpContext) => Promise<void>
3439
+ handle: (http: HttpContext, next: NextFn) => Promise<Response | void>
3440
+ onError?: (ctx: HttpContext, error: Error) => Promise<void>
3441
+ }
3442
+
3443
+ class StorageKeyMissingError = {
3444
+ new (): StorageKeyMissingError
3445
+ readonly code: string
3446
+ readonly context?: Record<string, unknown> | undefined
3447
+ readonly status: number
3448
+ }
3449
+
3450
+ class StorageManager = {
3451
+ new (config: StorageConfigShape): StorageManager
3452
+ disk: (name?: string) => StorageDriver
3453
+ fake: (name?: string) => FakeDisk
3454
+ isServed: (disk?: string) => boolean
3455
+ publicUrl: (path: string, options?: { disk?: string; expiresIn?: number;}) => Promise<string>
3456
+ restoreFakes: () => void
3457
+ verifyTemporaryUrl: (path: string, expiresAt: number, signature: string) => boolean
3458
+ verifyTemporaryUrlFor: (path: string, url: URL | string) => boolean
3459
+ }
3460
+
3461
+ class StorageProvider = {
3462
+ new (app: Application): StorageProvider
3463
+ static dependsOn?: (new (app: Application) => ServiceProvider)[]
3464
+ static environments: AppEnvironment[]
3465
+ static priority?: number
3466
+ static provides: readonly ['storage']
3467
+ devProcesses: () => DevProcessDefinition[]
3468
+ doctorChecks: () => DoctorCheck[]
3469
+ onBooted: () => Promise<void>
3470
+ onBooting: () => Promise<void>
3471
+ onRegister: () => void
3472
+ onRequestProcessed: (_ctx: HttpContext) => Promise<void>
3473
+ onRequestReceived: (_ctx: HttpContext) => Promise<void>
3474
+ onResponseSent: (_ctx: HttpContext) => Promise<void>
3475
+ onStarted: () => Promise<void>
3476
+ onStarting: () => Promise<void>
3477
+ onStopped: () => Promise<void>
3478
+ onStopping: () => Promise<void>
3479
+ replContext: () => Record<string, unknown>
3480
+ }
3481
+
3482
+ class StorageRootEscapeError = {
3483
+ new (path: string, root: string, what: string): StorageRootEscapeError
3484
+ readonly code: string
3485
+ readonly context?: Record<string, unknown> | undefined
3486
+ readonly status: number
3487
+ }
3488
+
3489
+ class UnsafePublicMountError = {
3490
+ new (disk: string, root: string, publicRoot: string): UnsafePublicMountError
3491
+ readonly code: string
3492
+ readonly context?: Record<string, unknown> | undefined
3493
+ readonly status: number
3494
+ }
3495
+
3496
+ class UnsupportedOperationError = {
3497
+ new (operation: string, driver: string): UnsupportedOperationError
3498
+ readonly code: string
3499
+ readonly context?: Record<string, unknown> | undefined
3500
+ readonly status: number
3501
+ }
3502
+
3503
+ const Storage = StorageManager
3504
+
3505
+ function mountsFrom = (config: StorageConfigShape) => Mount[]
3506
+
3507
+ function StorageConfig = (options?: Partial<StorageConfigShape>) => StorageConfigShape
3508
+
3509
+ interface DiskServeConfig = {
3510
+ expiresIn?: number
3511
+ headers?: Record<string, string>
3512
+ path: string
3513
+ signed?: boolean
3514
+ }
3515
+
3516
+ interface FakeStoredFile = {
3517
+ contentType: string | undefined
3518
+ contents: Uint8Array<ArrayBufferLike>
3519
+ lastModified: number
3520
+ path: string
3521
+ visibility: 'public' | 'private' | undefined
3522
+ }
3523
+
3524
+ interface LocalDiskConfig = {
3525
+ driver: 'local'
3526
+ root: string
3527
+ serve?: DiskServeConfig
3528
+ url?: string
3529
+ }
3530
+
3531
+ interface PutOptions = {
3532
+ contentType?: string
3533
+ visibility?: 'public' | 'private'
3534
+ }
3535
+
3536
+ interface S3DiskConfig = {
3537
+ bucket: string
3538
+ driver: 's3'
3539
+ endpoint?: string
3540
+ key: string
3541
+ region: string
3542
+ secret: string
3543
+ serve?: DiskServeConfig
3544
+ url?: string
3545
+ }
3546
+
3547
+ interface StorageConfigShape = {
3548
+ default: string
3549
+ disks: Record<string, DiskConfig>
3550
+ }
3551
+
3552
+ interface StorageDriver = {
3553
+ append: (path: string, content: string | Uint8Array) => Promise<void>
3554
+ copy: (source: string, destination: string) => Promise<void>
3555
+ delete: (path: string) => Promise<void>
3556
+ exists: (path: string) => Promise<boolean>
3557
+ get: (path: string) => Promise<string | null>
3558
+ getBuffer: (path: string) => Promise<Uint8Array | null>
3559
+ lastModified: (path: string) => Promise<number | null>
3560
+ move: (source: string, destination: string) => Promise<void>
3561
+ put: (path: string, content: string | Uint8Array | Blob, options?: PutOptions) => Promise<void>
3562
+ size: (path: string) => Promise<number | null>
3563
+ stream?: (path: string) => Promise<Blob | null>
3564
+ temporaryUrl: (path: string, expiresInSeconds: number) => Promise<string>
3565
+ url: (path: string) => string
3566
+ }
3567
+
3568
+ interface StorageFilesOptions = {
3569
+ mounts?: Mount[]
3570
+ storage?: StorageManager
3571
+ }
3572
+
3573
+ type DiskConfig = LocalDiskConfig | S3DiskConfig
3574
+
3575
+ ## ./view `(./src/view/index.ts)`
3576
+
3577
+ class Html = {
3578
+ new (value: string): SafeHtml
3579
+ readonly value: string
3580
+ toString: () => string
3581
+ }
3582
+
3583
+ class SafeHtml = {
3584
+ new (value: string): SafeHtml
3585
+ readonly value: string
3586
+ toString: () => string
3587
+ }
3588
+
3589
+ const VIEW_COMPONENT_PROP = '__zerotalViewComponent'
3590
+
3591
+ const VIEW_COMPONENT_SYMBOL = typeof VIEW_COMPONENT_SYMBOL
3592
+
3593
+ function defineLayout = <LP extends Record<string, unknown>>(Layout: (props: LP & { children?: unknown;}) => SafeHtml) => <PP extends Record<string, unknown> = Record<string, never>>(Page: (props: PP & { children?: unknown;}) => SafeHtml) => (props: LP & PP) => SafeHtml
3594
+
3595
+ function definePage = <P extends Record<string, unknown> = Record<string, unknown>>(component: (ctx: HttpContext, params: P) => SafeHtml | string | Promise<SafeHtml | string>) => typeof component
3596
+
3597
+ function esc = (val: unknown) => string
3598
+
3599
+ function Fragment = ({ children }: { children?: unknown;}) => SafeHtml
3600
+
3601
+ function Raw = ({ html }: { html: string;}) => SafeHtml
3602
+
3603
+ function registerViewFileRouteResolver = () => void
3604
+
3605
+ function safe = (html: string) => SafeHtml
3606
+
3607
+ type Children = unknown
3608
+
3609
+ type FC = (props: P & { children?: unknown;}) => SafeHtml