zerotal 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/api-surface.md +47 -628
- package/package.json +13 -12
- package/src/shared.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,17 @@ follows the Zerotal monorepo's unified versioning.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.9.0] — 2026-08-29
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **`zerotal/shared`** — a browser-safe entry point re-exporting `@zerotal/core/shared`:
|
|
16
|
+
`pluralize`, `singularize`, `snakeCase`, `camelCase`, `tableNameFor`, `Str`, and the
|
|
17
|
+
`formatMoney` / `formatNumber` / `formatDate` formatters. Importing `zerotal` into a client
|
|
18
|
+
bundle drags the server in behind it; this is the subset that has no server in it, so one
|
|
19
|
+
definition of "how this app writes money" can be imported by both the controller and the
|
|
20
|
+
component instead of maintained twice.
|
|
21
|
+
|
|
11
22
|
## [1.4.0] — 2026-08-10
|
|
12
23
|
|
|
13
24
|
### Changed
|
package/api-surface.md
CHANGED
|
@@ -512,20 +512,6 @@ class ResponseBuilder = {
|
|
|
512
512
|
withWarning: (message: string) => ResponseBuilder
|
|
513
513
|
}
|
|
514
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
515
|
class ScopedResolver = {
|
|
530
516
|
new (_container?: Container | undefined): ScopedResolver
|
|
531
517
|
acquire: () => void
|
|
@@ -576,13 +562,6 @@ class ServiceUnavailableError = {
|
|
|
576
562
|
readonly status: number
|
|
577
563
|
}
|
|
578
564
|
|
|
579
|
-
class TerminalWriter = {
|
|
580
|
-
new (): TerminalWriter
|
|
581
|
-
write: (message: string) => void
|
|
582
|
-
writeError: (message: string) => void
|
|
583
|
-
writeLine: (message: string) => void
|
|
584
|
-
}
|
|
585
|
-
|
|
586
565
|
class ThrottleMiddleware = {
|
|
587
566
|
new (options?: Partial<ThrottleOptions>): ThrottleMiddleware
|
|
588
567
|
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>
|
|
@@ -648,8 +627,6 @@ const App = { readonly container: Container; readonly instance: () => Appl
|
|
|
648
627
|
|
|
649
628
|
const Artisan = { call(commandName: string, parameters?: Record<string, string | boolean | number>): Promise<ArtisanResult>;}
|
|
650
629
|
|
|
651
|
-
const builtinDoctorChecks = DoctorCheck[]
|
|
652
|
-
|
|
653
630
|
const Config = ConfigManager
|
|
654
631
|
|
|
655
632
|
const Events = Emitter
|
|
@@ -668,8 +645,6 @@ function app = { (): Application; <T>(token: BindingToken<T>): Promise<T>;
|
|
|
668
645
|
|
|
669
646
|
function basePath = (...segments: string[]) => string
|
|
670
647
|
|
|
671
|
-
function buildCookie = (options: CookieOptions) => string
|
|
672
|
-
|
|
673
648
|
function camelCase = (value: string) => string
|
|
674
649
|
|
|
675
650
|
function collect = <T>(items: T[]) => Collection<T>
|
|
@@ -708,10 +683,6 @@ function make = <T>(token: BindingToken<T>) => Promise<T>
|
|
|
708
683
|
|
|
709
684
|
function markdown = (content: string, options?: BunMarkdownOptions & { title?: string;}, status?: number) => MarkdownBuilder
|
|
710
685
|
|
|
711
|
-
function pageElements = (current: number, last: number, each?: number) => (number | '...')[]
|
|
712
|
-
|
|
713
|
-
function parseCookieHeader = (header: string, name: string) => string | undefined
|
|
714
|
-
|
|
715
686
|
function pipe = <T, R>(value: T, fn: (val: T) => R) => R
|
|
716
687
|
|
|
717
688
|
function pipeAsync = <T, R>(value: T, fn: (val: T) => Promise<R>) => Promise<R>
|
|
@@ -726,8 +697,6 @@ function redirectTo = <N extends RouteTarget>(name: N, params?: RouteParamsArg<N
|
|
|
726
697
|
|
|
727
698
|
function registerErrorDiagnoser = (diagnoser: ErrorDiagnoser) => void
|
|
728
699
|
|
|
729
|
-
function registerFileRouteResolver = (resolver: FileRouteResolver) => void
|
|
730
|
-
|
|
731
700
|
function request = { (): HttpContext; <T = string>(key: string, fallback?: T): T | undefined;}
|
|
732
701
|
|
|
733
702
|
function requireEnv = (key: string) => string
|
|
@@ -740,14 +709,8 @@ function runDoctor = (app: Application, extraChecks?: DoctorCheck[]) => Promise<
|
|
|
740
709
|
|
|
741
710
|
function safeEqual = (a: string, b: string) => boolean
|
|
742
711
|
|
|
743
|
-
function safeRedirectPath = (url: string | null | undefined, origin: string) => string | undefined
|
|
744
|
-
|
|
745
|
-
function scanFileRoutes = (baseDir: string, reloadId?: string) => Promise<number>
|
|
746
|
-
|
|
747
712
|
function setAppEnv = (command?: string) => void
|
|
748
713
|
|
|
749
|
-
function setCurrentPageResolver = (resolver: CurrentPageResolver) => void
|
|
750
|
-
|
|
751
714
|
function sha256Hex = (input: string | Uint8Array) => string
|
|
752
715
|
|
|
753
716
|
function singularize = (value: string) => string
|
|
@@ -762,12 +725,8 @@ function tap = <T>(value: T, callback: (val: T) => void) => T
|
|
|
762
725
|
|
|
763
726
|
function tapAsync = <T>(value: T, callback: (val: T) => Promise<void>) => Promise<T>
|
|
764
727
|
|
|
765
|
-
function tryCurrentApp = () => Application | undefined
|
|
766
|
-
|
|
767
728
|
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>;}
|
|
768
729
|
|
|
769
|
-
function withApp = <T>(app: Application, fn: () => T) => T
|
|
770
|
-
|
|
771
730
|
function withHeaders = (res: Response, headers: Record<string, string>) => Response
|
|
772
731
|
|
|
773
732
|
interface ArtisanResult = {
|
|
@@ -777,18 +736,6 @@ interface ArtisanResult = {
|
|
|
777
736
|
|
|
778
737
|
interface AuthenticatedUser = {}
|
|
779
738
|
|
|
780
|
-
interface CompiledDomain = {
|
|
781
|
-
params: string[]
|
|
782
|
-
regex: RegExp
|
|
783
|
-
source: string
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
interface ConcernContext = {
|
|
787
|
-
app: Application
|
|
788
|
-
env: AppEnvironment
|
|
789
|
-
resolve: <T = unknown>(token: string) => T | undefined
|
|
790
|
-
}
|
|
791
|
-
|
|
792
739
|
interface ConcernDescriptor = {
|
|
793
740
|
dir?: string
|
|
794
741
|
envs?: AppEnvironment[]
|
|
@@ -860,8 +807,6 @@ interface ContainerBindings = {
|
|
|
860
807
|
two_factor: TwoFactorService
|
|
861
808
|
}
|
|
862
809
|
|
|
863
|
-
interface ContextRegistry = {}
|
|
864
|
-
|
|
865
810
|
interface CookieOptions = {
|
|
866
811
|
domain?: string
|
|
867
812
|
httpOnly?: boolean
|
|
@@ -882,11 +827,6 @@ interface CorsOptions = {
|
|
|
882
827
|
origin?: string | string[] | ((origin: string) => boolean)
|
|
883
828
|
}
|
|
884
829
|
|
|
885
|
-
interface DevConfigShape = {
|
|
886
|
-
disable?: string[]
|
|
887
|
-
processes?: DevProcessDefinition[]
|
|
888
|
-
}
|
|
889
|
-
|
|
890
830
|
interface DevProcessDefinition = {
|
|
891
831
|
after?: 'server' | 'none'
|
|
892
832
|
color?: DevProcessColor
|
|
@@ -929,30 +869,12 @@ interface ErrorDiagnosis = {
|
|
|
929
869
|
title: string
|
|
930
870
|
}
|
|
931
871
|
|
|
932
|
-
interface FileRouteContext = {
|
|
933
|
-
filePath: string
|
|
934
|
-
isIndex: boolean
|
|
935
|
-
layout?: ViewComponent | undefined
|
|
936
|
-
middleware: MiddlewareClass[]
|
|
937
|
-
module: Record<string, unknown>
|
|
938
|
-
name: string
|
|
939
|
-
urlPath: string
|
|
940
|
-
}
|
|
941
|
-
|
|
942
872
|
interface GroupOptions = {
|
|
943
873
|
domain?: string
|
|
944
874
|
middleware?: string | string[] | MiddlewareClass | MiddlewareClass[]
|
|
945
875
|
prefix?: string
|
|
946
876
|
}
|
|
947
877
|
|
|
948
|
-
interface HasResponse = {
|
|
949
|
-
response: Response | undefined
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
interface MiddlewareModule = {
|
|
953
|
-
middleware: MiddlewareClass[]
|
|
954
|
-
}
|
|
955
|
-
|
|
956
878
|
interface ModelClass = {
|
|
957
879
|
findOrFail: (id: number | string) => Promise<unknown>
|
|
958
880
|
}
|
|
@@ -973,28 +895,6 @@ interface ProviderReport = {
|
|
|
973
895
|
name: string
|
|
974
896
|
}
|
|
975
897
|
|
|
976
|
-
interface QueuedListener = {
|
|
977
|
-
handle: (event: T) => Promise<void> | void
|
|
978
|
-
maxAttempts?: number
|
|
979
|
-
queue: string | boolean
|
|
980
|
-
retryDelay?: number
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
interface RequestIPProvider = {
|
|
984
|
-
requestIP: (req: Request) => { address: string; family: string; port: number;} | null
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
interface ResolvedDevProcess = {
|
|
988
|
-
after: 'server' | 'none'
|
|
989
|
-
argv?: string[]
|
|
990
|
-
color: DevProcessColor
|
|
991
|
-
label: string
|
|
992
|
-
name: string
|
|
993
|
-
registrant: string
|
|
994
|
-
restart: 'always' | 'on-failure' | 'never'
|
|
995
|
-
run?: (signal: AbortSignal) => Promise<void>
|
|
996
|
-
}
|
|
997
|
-
|
|
998
898
|
interface RouteBuilder = {
|
|
999
899
|
<N extends RouteTarget>(name: N, params?: RouteParamValues | undefined, query?: RouteQuery | undefined): string
|
|
1000
900
|
dynamic: (name: string, params?: RouteParamValues, query?: RouteQuery) => string
|
|
@@ -1011,34 +911,6 @@ interface RouteDefinition = {
|
|
|
1011
911
|
path: string
|
|
1012
912
|
}
|
|
1013
913
|
|
|
1014
|
-
interface RouteFileMeta = {
|
|
1015
|
-
DELETE?: { name?: string;}
|
|
1016
|
-
GET?: { name?: string;}
|
|
1017
|
-
PATCH?: { name?: string;}
|
|
1018
|
-
POST?: { name?: string;}
|
|
1019
|
-
PUT?: { name?: string;}
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
interface RouteMethodMiddleware = {
|
|
1023
|
-
ALL?: MiddlewareClass[]
|
|
1024
|
-
DELETE?: MiddlewareClass[]
|
|
1025
|
-
GET?: MiddlewareClass[]
|
|
1026
|
-
PATCH?: MiddlewareClass[]
|
|
1027
|
-
POST?: MiddlewareClass[]
|
|
1028
|
-
PUT?: MiddlewareClass[]
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
interface RouteModule = {
|
|
1032
|
-
DELETE?: FileHandler
|
|
1033
|
-
GET?: FileHandler
|
|
1034
|
-
PATCH?: FileHandler
|
|
1035
|
-
POST?: FileHandler
|
|
1036
|
-
PUT?: FileHandler
|
|
1037
|
-
default?: ViewComponent | FileHandler
|
|
1038
|
-
layout?: ViewComponent | null
|
|
1039
|
-
middleware?: RouteMiddleware
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
914
|
interface RouteRegistration = {
|
|
1043
915
|
bind: (paramName: string, model: ModelClass | ModelBindingResolver) => RouteRegistration
|
|
1044
916
|
name: (routeName: string) => RouteRegistration
|
|
@@ -1100,38 +972,20 @@ interface WebSocketHandlers = {
|
|
|
1100
972
|
|
|
1101
973
|
type AppEnvironment = 'web' | 'console' | 'worker' | 'test' | 'repl'
|
|
1102
974
|
|
|
1103
|
-
type AppScopeInstaller = () => () => void
|
|
1104
|
-
|
|
1105
975
|
type ArgDef = { name: string; required?: boolean; default?: string;}
|
|
1106
976
|
|
|
1107
977
|
type BindingToken = ClassToken<T> | AbstractToken<T> | keyof ContainerBindings
|
|
1108
978
|
|
|
1109
|
-
type ContextKey = never
|
|
1110
|
-
|
|
1111
|
-
type ContextValue = ContextRegistry[K]
|
|
1112
|
-
|
|
1113
979
|
type ControllerResponse = void | ResponseBuilder | MarkdownBuilder
|
|
1114
980
|
|
|
1115
|
-
type CurrentPageResolver = (pageName: string) => number | undefined
|
|
1116
|
-
|
|
1117
981
|
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; }
|
|
1118
982
|
|
|
1119
|
-
type DevProcessColor = 'cyan' | 'magenta' | 'yellow' | 'green' | 'blue' | 'red'
|
|
1120
|
-
|
|
1121
983
|
type ErrorDiagnoser = (error: Error, ctx?: HttpContext) => ErrorDiagnosis | null | Promise<ErrorDiagnosis | null>
|
|
1122
984
|
|
|
1123
985
|
type Factory = (container: Container) => T | Promise<T>
|
|
1124
986
|
|
|
1125
|
-
type FileHandler = (ctx: HttpContext) => void | Response | Promise<void | Response>
|
|
1126
|
-
|
|
1127
|
-
type FileRouteHandler = (ctx: HttpContext) => void | Response | Promise<void | Response>
|
|
1128
|
-
|
|
1129
|
-
type FileRouteResolver = (ctx: FileRouteContext) => boolean
|
|
1130
|
-
|
|
1131
987
|
type FileRoutingConfig = { [x: string]: FileRoutingEntry;}
|
|
1132
988
|
|
|
1133
|
-
type FileRoutingEntry = string | { dir: string; prefix?: string; middleware?: MiddlewareInput }
|
|
1134
|
-
|
|
1135
989
|
type FlagDef = { name: string; short?: string; type: 'string' | 'boolean' | 'number'; description?: string; default?: unknown;}
|
|
1136
990
|
|
|
1137
991
|
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
|
|
@@ -1140,8 +994,6 @@ type HttpResponse = Promise<void>
|
|
|
1140
994
|
|
|
1141
995
|
type MiddlewareClass = new (...args: any[]) => Pipe<HttpContext>
|
|
1142
996
|
|
|
1143
|
-
type ModelBindingResolver = (value: string, ctx: HttpContext) => Promise<unknown>
|
|
1144
|
-
|
|
1145
997
|
type NextFn = () => Promise<Response | void>
|
|
1146
998
|
|
|
1147
999
|
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>
|
|
@@ -1154,22 +1006,14 @@ type RouteName = never
|
|
|
1154
1006
|
|
|
1155
1007
|
type RouteParams = { [K in keyof ParamsOf<RoutePattern<N>>]: ParamsOf<RoutePattern<N>>[K]; }
|
|
1156
1008
|
|
|
1157
|
-
type RouteParamsArg = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
|
|
1158
|
-
|
|
1159
|
-
type RouteParamValue = string | number
|
|
1160
|
-
|
|
1161
1009
|
type RouteParamValues = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
|
|
1162
1010
|
|
|
1163
|
-
type RoutePattern = N extends never ? RouteRegistry[N] extends string ? RouteRegistry[N] : string : string
|
|
1164
|
-
|
|
1165
1011
|
type RouteQuery = { [x: string]: string | number | boolean | readonly (string | number | boolean)[] | null | undefined;}
|
|
1166
1012
|
|
|
1167
1013
|
type RouteTarget = string
|
|
1168
1014
|
|
|
1169
1015
|
type RoutingConfig = { [x: string]: RoutingEntry;}
|
|
1170
1016
|
|
|
1171
|
-
type RoutingEntry = string | { file: string; prefix?: string; middleware?: MiddlewareInput }
|
|
1172
|
-
|
|
1173
1017
|
type SameSite = 'Strict' | 'Lax' | 'None'
|
|
1174
1018
|
|
|
1175
1019
|
type ViewComponent = (ctx: HttpContext, props: P) => unknown
|
|
@@ -1802,15 +1646,6 @@ class RememberMeMiddleware = {
|
|
|
1802
1646
|
onError?: (ctx: HttpContext, error: Error) => Promise<void>
|
|
1803
1647
|
}
|
|
1804
1648
|
|
|
1805
|
-
class RequestGuard = {
|
|
1806
|
-
new (_name: string, _resolver: RequestGuardResolver): RequestGuard
|
|
1807
|
-
check: () => Promise<boolean>
|
|
1808
|
-
guest: () => Promise<boolean>
|
|
1809
|
-
id: () => Promise<number | string | undefined>
|
|
1810
|
-
user: () => Promise<unknown>
|
|
1811
|
-
userOrNull: () => Promise<unknown>
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
1649
|
class RequirePermissionMiddleware = {
|
|
1815
1650
|
new (...abilities: string[]): RequirePermissionMiddleware
|
|
1816
1651
|
static for: (...abilities: string[]) => RequirePermissionMiddleware
|
|
@@ -2038,14 +1873,6 @@ class ValidateSignatureMiddleware = {
|
|
|
2038
1873
|
|
|
2039
1874
|
const Auth = { user(): UserModel; userOrNull(): UserModel | undefined; id(): number; check(): boolean; guest(): boolean; viaRemember(): boolean; confirmPassword(password: string): Promise<boolean>; markPasswordConfirmed(): void; hasRecentlyConfirmedPassword(timeoutSeconds?: number): boolean; hasRole(role: string): boolean; hasAnyRole(roles: string[]): boolean; hasAllRoles(roles: string[]): boolean; can(ability: string): boolean; hasPermission(ability: string): boolean; authorize(ability: string): void; roles(): string[]; attempt(credentials: Credentials, remember?: boolean): Promise<boolean>; attemptWhen(credentials: Credentials, callback: (user: UserModel) => boolean | Promise<boolean>, remember?: boolean): Promise<boolean>; validate(credentials: Credentials): Promise<boolean>; once(credentials: Credentials): Promise<boolean>; loginUsingId(id: number, remember?: boolean): Promise<UserModel | null>; login(user: UserModel, options?: LoginOptions): Promise<void>; twoFactorPending(): boolean; pendingTwoFactorUser(): UserModel | undefined; completeTwoFactor(): Promise<UserModel | null>; logout(): Promise<void>; logoutOtherDevices(password: string): Promise<boolean>; viaRequest(name: string, resolver: RequestGuardResolver): void; guard(name?: string): Guard;}
|
|
2040
1875
|
|
|
2041
|
-
const AUTH_PASSWORD_HASH_KEY = 'auth_password_hash'
|
|
2042
|
-
|
|
2043
|
-
const AUTHENTICATABLE = typeof AUTHENTICATABLE
|
|
2044
|
-
|
|
2045
|
-
const DEFAULT_PASSWORD_TIMEOUT = number
|
|
2046
|
-
|
|
2047
|
-
const EMAIL_VERIFICATION = typeof EMAIL_VERIFICATION
|
|
2048
|
-
|
|
2049
1876
|
const Gate = GateService
|
|
2050
1877
|
|
|
2051
1878
|
const Hash = HashService
|
|
@@ -2056,30 +1883,10 @@ const loginThrottle = LoginRateLimiter
|
|
|
2056
1883
|
|
|
2057
1884
|
const MAGIC = { readonly SENT: 'magic.sent'; readonly USER_NOT_FOUND: 'magic.user_not_found'; readonly OK: 'magic.ok'; readonly INVALID: 'magic.invalid';}
|
|
2058
1885
|
|
|
2059
|
-
const PASSWORD_CONFIRMED_AT_KEY = 'auth_password_confirmed_at'
|
|
2060
|
-
|
|
2061
|
-
const PASSWORD_RESET = typeof PASSWORD_RESET
|
|
2062
|
-
|
|
2063
1886
|
const PASSWORDS = { readonly SENT: 'passwords.sent'; readonly TOKEN: 'passwords.token'; readonly RESET: 'passwords.reset';}
|
|
2064
1887
|
|
|
2065
|
-
const PermissionRegistry = { define: (...names: (string | string[])[]) => void; all: () => string[];}
|
|
2066
|
-
|
|
2067
|
-
const PERMISSIONS_MIXIN = typeof PERMISSIONS_MIXIN
|
|
2068
|
-
|
|
2069
|
-
const RECOVERY_CODE_BITS = 160
|
|
2070
|
-
|
|
2071
|
-
const REMEMBER_COOKIE = 'remember_web'
|
|
2072
|
-
|
|
2073
|
-
const REMEMBER_MAX_AGE = number
|
|
2074
|
-
|
|
2075
|
-
const ROLES_MIXIN = typeof ROLES_MIXIN
|
|
2076
|
-
|
|
2077
1888
|
const Social = SocialManager
|
|
2078
1889
|
|
|
2079
|
-
const TWO_FACTOR_PENDING_KEY = 'two_factor_pending'
|
|
2080
|
-
|
|
2081
|
-
const TWO_FACTOR_REMEMBER_KEY = 'two_factor_pending_remember'
|
|
2082
|
-
|
|
2083
1890
|
const TWO_FACTOR_SESSION_KEY = 'two_factor_confirmed'
|
|
2084
1891
|
|
|
2085
1892
|
const TwoFactor = TwoFactorService
|
|
@@ -2098,36 +1905,18 @@ function encodeQr = (text: string) => QrMatrix
|
|
|
2098
1905
|
|
|
2099
1906
|
function fakeSocialUser = (overrides?: Partial<SocialUser>) => SocialUser
|
|
2100
1907
|
|
|
2101
|
-
function hasEmailVerification = (model: unknown) => boolean
|
|
2102
|
-
|
|
2103
|
-
function hashRememberToken = (raw: string) => string
|
|
2104
|
-
|
|
2105
1908
|
function hashToken = (plaintext: string) => Promise<string>
|
|
2106
1909
|
|
|
2107
|
-
function hasPasswordReset = (model: unknown) => boolean
|
|
2108
|
-
|
|
2109
|
-
function hasPermissionsMixin = (model: unknown) => boolean
|
|
2110
|
-
|
|
2111
|
-
function hasRolesMixin = (model: unknown) => boolean
|
|
2112
|
-
|
|
2113
|
-
function isAuthenticatable = (model: unknown) => boolean
|
|
2114
|
-
|
|
2115
1910
|
function isPasswordCompromised = (password: string, opts?: CompromisedCheckOptions) => Promise<boolean>
|
|
2116
1911
|
|
|
2117
1912
|
function maxPayloadBytes = (version?: number) => number
|
|
2118
1913
|
|
|
2119
|
-
function mintRememberToken = () => string
|
|
2120
|
-
|
|
2121
1914
|
function PasswordReset = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): PasswordReset; prototype: PasswordReset<any>.PasswordReset; passwordResetExpireMinutes: number; resetPassword(token: string, newPassword: string): Promise<PasswordReset | null>;} & TBase
|
|
2122
1915
|
|
|
2123
1916
|
function Permissions = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Permissions<any>.(Anonymous class); withPermissions: boolean;} & TBase
|
|
2124
1917
|
|
|
2125
1918
|
function qrSvg = (matrix: QrMatrix, options?: QrSvgOptions) => string
|
|
2126
1919
|
|
|
2127
|
-
function registeredPermissions = () => string[]
|
|
2128
|
-
|
|
2129
|
-
function rememberTokenMatches = (rawFromCookie: string, storedHash: string) => boolean
|
|
2130
|
-
|
|
2131
1920
|
function Roles = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Roles<any>.(Anonymous class); withRoles: boolean;} & TBase
|
|
2132
1921
|
|
|
2133
1922
|
function SocialConfig = (config?: DeepPartial<SocialConfigShape>) => SocialConfigShape
|
|
@@ -2403,8 +2192,6 @@ type MagicLinkBrokerResult = 'magic.sent' | 'magic.user_not_found' | 'magic.ok'
|
|
|
2403
2192
|
|
|
2404
2193
|
type PasswordBrokerResult = 'passwords.sent' | 'passwords.token' | 'passwords.reset'
|
|
2405
2194
|
|
|
2406
|
-
type RequestGuardResolver = (request: Request) => unknown | Promise<unknown>
|
|
2407
|
-
|
|
2408
2195
|
type SocialConfigShape = { [driver: string]: (OAuth2Config & Record<string, unknown>) | undefined; github?: OAuth2Config & Record<string, unknown>; google?: OAuth2Config & Record<string, unknown>; apple?: AppleOAuth2Config & Record<string, unknown>; discord?: (OAuth2Config & Record<string, unknown>) | undefined; microsoft?: (OAuth2Config & Record<string, unknown>) | undefined; facebook?: (OAuth2Config & Record<string, unknown>) | undefined; twitter?: (OAuth2Config & Record<string, unknown>) | undefined; linkedin?: (OAuth2Config & Record<string, unknown>) | undefined; gitlab?: (OAuth2Config & Record<string, unknown>) | undefined;}
|
|
2409
2196
|
|
|
2410
2197
|
## ./build `(./src/build.ts)`
|
|
@@ -3996,6 +3783,8 @@ class ConfigValidationError = {
|
|
|
3996
3783
|
readonly status: number
|
|
3997
3784
|
}
|
|
3998
3785
|
|
|
3786
|
+
const CONVENTIONAL_PREFLIGHT_COMMAND = 'release:check'
|
|
3787
|
+
|
|
3999
3788
|
const DEFAULT_DEPLOY_STEPS = readonly string[]
|
|
4000
3789
|
|
|
4001
3790
|
const DEFAULT_DEPLOY_TARGETS = Record<string, DeployTarget>
|
|
@@ -4054,12 +3843,6 @@ interface ConfigRegistry = {
|
|
|
4054
3843
|
logging: LoggingConfigShape
|
|
4055
3844
|
}
|
|
4056
3845
|
|
|
4057
|
-
interface ConfigValidationContext = {
|
|
4058
|
-
config: ConfigManager
|
|
4059
|
-
isProduction: boolean
|
|
4060
|
-
namespace: string
|
|
4061
|
-
}
|
|
4062
|
-
|
|
4063
3846
|
interface ConventionsConfig = {
|
|
4064
3847
|
enabled: boolean
|
|
4065
3848
|
paths: { providers: string; middleware: string; models: string; observers: string; policies: string; listeners: string; events: string; jobs: string; schedules: string; validators: string; commands: string;}
|
|
@@ -4070,23 +3853,15 @@ interface DeployConfigShape = {
|
|
|
4070
3853
|
}
|
|
4071
3854
|
|
|
4072
3855
|
interface DeployTarget = {
|
|
3856
|
+
preflight?: readonly string[]
|
|
4073
3857
|
steps?: readonly string[]
|
|
4074
3858
|
url?: string
|
|
4075
3859
|
}
|
|
4076
3860
|
|
|
4077
|
-
interface RegisteredConfigValidator = {
|
|
4078
|
-
namespace: string
|
|
4079
|
-
validate: ConfigValidator
|
|
4080
|
-
}
|
|
4081
|
-
|
|
4082
3861
|
type AssetLoaderKind = 'file' | 'dataurl' | 'base64' | 'text' | 'json' | 'toml'
|
|
4083
3862
|
|
|
4084
3863
|
type ConfigIssueLevel = 'error' | 'warning'
|
|
4085
3864
|
|
|
4086
|
-
type ConfigMap = { [x: string]: Record<string, unknown>;}
|
|
4087
|
-
|
|
4088
|
-
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}`
|
|
4089
|
-
|
|
4090
3865
|
type ConfigValidator = (value: unknown, ctx: ConfigValidationContext) => ConfigIssue[] | void
|
|
4091
3866
|
|
|
4092
3867
|
type ConfigValue = P extends `${infer Head}.${infer Rest}` ? Head extends keyof ConfigRegistry ? ValueAt<ConfigRegistry[Head], Rest> : unknown : P extends keyof ConfigRegistry ? ConfigRegistry[P] : unknown
|
|
@@ -4128,75 +3903,6 @@ class DevReloadMiddleware = {
|
|
|
4128
3903
|
onError?: (ctx: HttpContext, error: Error) => Promise<void>
|
|
4129
3904
|
}
|
|
4130
3905
|
|
|
4131
|
-
class DevSupervisor = {
|
|
4132
|
-
new (options: DevSupervisorOptions): DevSupervisor
|
|
4133
|
-
definitions: () => ResolvedDevProcess[]
|
|
4134
|
-
restart: (name: string) => Promise<void>
|
|
4135
|
-
start: (definitions: ResolvedDevProcess[]) => void
|
|
4136
|
-
statuses: () => DevProcessStatus[]
|
|
4137
|
-
stopAll: () => Promise<void>
|
|
4138
|
-
}
|
|
4139
|
-
|
|
4140
|
-
class StreamDeck = {
|
|
4141
|
-
new (_writer: OutputWriter, _color: boolean): StreamDeck
|
|
4142
|
-
line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
|
|
4143
|
-
notice: (text: string) => void
|
|
4144
|
-
start: (statuses: DevProcessStatus[]) => void
|
|
4145
|
-
state: (status: DevProcessStatus) => void
|
|
4146
|
-
stop: () => void
|
|
4147
|
-
}
|
|
4148
|
-
|
|
4149
|
-
class TabsDeck = {
|
|
4150
|
-
new (_options: DeckOptions, _stdout: DeckStdout, _stdin: DeckStdin): TabsDeck
|
|
4151
|
-
line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
|
|
4152
|
-
notice: (text: string) => void
|
|
4153
|
-
start: (statuses: DevProcessStatus[]) => void
|
|
4154
|
-
state: (status: DevProcessStatus) => void
|
|
4155
|
-
stop: () => void
|
|
4156
|
-
}
|
|
4157
|
-
|
|
4158
|
-
const DEV_RELOAD_CLIENT = string
|
|
4159
|
-
|
|
4160
|
-
const SERVER_PROCESS_NAME = 'server'
|
|
4161
|
-
|
|
4162
|
-
function bootBuildDecision = (outDirs: string[], env: string | undefined) => Promise<BootBuildDecision>
|
|
4163
|
-
|
|
4164
|
-
function buildCssBundle = (input: string, outdir: string, minify?: boolean, loader?: Record<string, string>) => Promise<BundleResult>
|
|
4165
|
-
|
|
4166
|
-
function buildJsBundle = (input: string, outdir: string, minify?: boolean) => Promise<BundleResult>
|
|
4167
|
-
|
|
4168
|
-
function collectDevProcesses = (app: ProviderHost, config?: ConfigReader) => Promise<ResolvedDevProcess[]>
|
|
4169
|
-
|
|
4170
|
-
function createDeck = (options: DeckOptions) => Deck
|
|
4171
|
-
|
|
4172
|
-
function detectCssPlugins = (cwd: string) => Promise<BunPlugin[]>
|
|
4173
|
-
|
|
4174
|
-
function isWritableDir = (dir: string) => Promise<boolean>
|
|
4175
|
-
|
|
4176
|
-
function registerDevHtmlSnippet = (name: string, fn: DevHtmlSnippet) => void
|
|
4177
|
-
|
|
4178
|
-
function startDevMode = (options: StartDevModeOptions) => Promise<void>
|
|
4179
|
-
|
|
4180
|
-
interface AssetBuildConfig = {
|
|
4181
|
-
clean?: boolean
|
|
4182
|
-
entrypoint: string | string[]
|
|
4183
|
-
loader?: Record<string, string>
|
|
4184
|
-
minify: boolean
|
|
4185
|
-
outDir: string
|
|
4186
|
-
prefix: string
|
|
4187
|
-
}
|
|
4188
|
-
|
|
4189
|
-
interface BootBuildDecision = {
|
|
4190
|
-
build: boolean
|
|
4191
|
-
reason?: string
|
|
4192
|
-
}
|
|
4193
|
-
|
|
4194
|
-
interface BuildResult = {
|
|
4195
|
-
logs?: unknown[]
|
|
4196
|
-
skipped?: boolean
|
|
4197
|
-
success: boolean
|
|
4198
|
-
}
|
|
4199
|
-
|
|
4200
3906
|
interface Deck = {
|
|
4201
3907
|
line: (name: string, text: string, stream: 'stdout' | 'stderr') => void
|
|
4202
3908
|
notice: (text: string) => void
|
|
@@ -4205,57 +3911,6 @@ interface Deck = {
|
|
|
4205
3911
|
stop: () => void
|
|
4206
3912
|
}
|
|
4207
3913
|
|
|
4208
|
-
interface DeckOptions = {
|
|
4209
|
-
mode?: 'tabs' | 'stream'
|
|
4210
|
-
onQuit: () => void
|
|
4211
|
-
onRestart: (name: string) => void
|
|
4212
|
-
stdin?: DeckStdin
|
|
4213
|
-
stdout?: DeckStdout
|
|
4214
|
-
writer: OutputWriter
|
|
4215
|
-
}
|
|
4216
|
-
|
|
4217
|
-
interface DevChild = {
|
|
4218
|
-
kill: (signal?: number | NodeJS.Signals) => void
|
|
4219
|
-
readonly exited: Promise<number>
|
|
4220
|
-
readonly stderr: ReadableStream<Uint8Array<ArrayBufferLike>> | null
|
|
4221
|
-
readonly stdout: ReadableStream<Uint8Array<ArrayBufferLike>> | null
|
|
4222
|
-
}
|
|
4223
|
-
|
|
4224
|
-
interface DevOrchestratorHooks = {
|
|
4225
|
-
onCleanup?: () => void | Promise<void>
|
|
4226
|
-
onNotice?: (text: string, level: 'info' | 'warn' | 'error') => void
|
|
4227
|
-
onServerLine?: (line: string, stream: 'stdout' | 'stderr') => void
|
|
4228
|
-
onServerReady?: () => void | Promise<void>
|
|
4229
|
-
onServerState?: (state: 'starting' | 'running' | 'restarting' | 'parked') => void
|
|
4230
|
-
}
|
|
4231
|
-
|
|
4232
|
-
interface DevProcessStatus = {
|
|
4233
|
-
attempts: number
|
|
4234
|
-
color: DevProcessColor
|
|
4235
|
-
exitCode?: number
|
|
4236
|
-
label: string
|
|
4237
|
-
name: string
|
|
4238
|
-
state: DevProcessState
|
|
4239
|
-
}
|
|
4240
|
-
|
|
4241
|
-
interface DevSupervisorOptions = {
|
|
4242
|
-
backoffMs?: number[]
|
|
4243
|
-
cwd: string
|
|
4244
|
-
env?: Record<string, string | undefined>
|
|
4245
|
-
healthyAfterMs?: number
|
|
4246
|
-
onLine?: (name: string, line: string, stream: 'stdout' | 'stderr') => void
|
|
4247
|
-
onState?: (status: DevProcessStatus) => void
|
|
4248
|
-
spawn?: DevSpawnFn
|
|
4249
|
-
}
|
|
4250
|
-
|
|
4251
|
-
type BuildHookFn = () => Promise<BuildResult>
|
|
4252
|
-
|
|
4253
|
-
type DevHtmlSnippet = (ctx: HttpContext) => string
|
|
4254
|
-
|
|
4255
|
-
type DevProcessState = 'starting' | 'running' | 'restarting' | 'exited' | 'parked'
|
|
4256
|
-
|
|
4257
|
-
type DevSpawnFn = (argv: string[], options: { cwd: string; env: Record<string, string | undefined>;}) => DevChild
|
|
4258
|
-
|
|
4259
3914
|
## ./env `(./src/env.ts)`
|
|
4260
3915
|
|
|
4261
3916
|
class Def = {
|
|
@@ -4364,12 +4019,6 @@ function deepMerge = <T extends object>(base: T, override: DeepPartial<T>) => T
|
|
|
4364
4019
|
|
|
4365
4020
|
function env = { (key: string): string | undefined; (key: string, fallback: string): string; (key: string, fallback: boolean): boolean; (key: string, fallback: number): number;}
|
|
4366
4021
|
|
|
4367
|
-
function escapeHtml = (value: string) => string
|
|
4368
|
-
|
|
4369
|
-
function markdownPage = (title: string, body: string) => string
|
|
4370
|
-
|
|
4371
|
-
function parseCookieHeader = (header: string, name: string) => string | undefined
|
|
4372
|
-
|
|
4373
4022
|
function pipe = <T, R>(value: T, fn: (val: T) => R) => R
|
|
4374
4023
|
|
|
4375
4024
|
function pipeAsync = <T, R>(value: T, fn: (val: T) => Promise<R>) => Promise<R>
|
|
@@ -4392,24 +4041,6 @@ function tap = <T>(value: T, callback: (val: T) => void) => T
|
|
|
4392
4041
|
|
|
4393
4042
|
function tapAsync = <T>(value: T, callback: (val: T) => Promise<void>) => Promise<T>
|
|
4394
4043
|
|
|
4395
|
-
interface BunMarkdownOptions = {
|
|
4396
|
-
autolinks?: boolean | { url?: boolean; www?: boolean; email?: boolean;}
|
|
4397
|
-
collapseWhitespace?: boolean
|
|
4398
|
-
hardSoftBreaks?: boolean
|
|
4399
|
-
headings?: boolean | { ids?: boolean;}
|
|
4400
|
-
latexMath?: boolean
|
|
4401
|
-
noHtmlBlocks?: boolean
|
|
4402
|
-
noHtmlSpans?: boolean
|
|
4403
|
-
noIndentedCodeBlocks?: boolean
|
|
4404
|
-
permissiveAtxHeaders?: boolean
|
|
4405
|
-
strikethrough?: boolean
|
|
4406
|
-
tables?: boolean
|
|
4407
|
-
tagFilter?: boolean
|
|
4408
|
-
tasklists?: boolean
|
|
4409
|
-
underline?: boolean
|
|
4410
|
-
wikiLinks?: boolean
|
|
4411
|
-
}
|
|
4412
|
-
|
|
4413
4044
|
## ./http `(./src/http.ts)`
|
|
4414
4045
|
|
|
4415
4046
|
class Http = {
|
|
@@ -4543,12 +4174,8 @@ class UrlKeyMissingError = {
|
|
|
4543
4174
|
|
|
4544
4175
|
const Url = UrlGenerator
|
|
4545
4176
|
|
|
4546
|
-
function isAllowedOrigin = (request: Request, allowedOrigins?: string[]) => boolean
|
|
4547
|
-
|
|
4548
4177
|
function negotiate = (ctx: HttpContext) => <TWeb = void, TJson = void, TCli = void>(map: NegotiateMap<TWeb, TJson, TCli>) => Promise<TWeb | TJson | TCli | void>
|
|
4549
4178
|
|
|
4550
|
-
function sniffContentType = (bytes: Uint8Array) => SniffedType
|
|
4551
|
-
|
|
4552
4179
|
function uri = (value?: string | Uri) => Uri
|
|
4553
4180
|
|
|
4554
4181
|
function url = { (): UrlGenerator; (path: string, extra?: (string | number)[], secure?: boolean): string;}
|
|
@@ -4571,13 +4198,6 @@ interface CliContext = {
|
|
|
4571
4198
|
writeln: (content: string) => void
|
|
4572
4199
|
}
|
|
4573
4200
|
|
|
4574
|
-
interface FakeStub = {
|
|
4575
|
-
body?: unknown
|
|
4576
|
-
headers?: Record<string, string>
|
|
4577
|
-
status?: number
|
|
4578
|
-
url: string
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
4201
|
interface FileValidationOptions = {
|
|
4582
4202
|
maxSize?: number
|
|
4583
4203
|
mimes?: string[]
|
|
@@ -4599,20 +4219,6 @@ interface PaginatedData = {
|
|
|
4599
4219
|
total: number
|
|
4600
4220
|
}
|
|
4601
4221
|
|
|
4602
|
-
interface SniffedType = {
|
|
4603
|
-
contentType: string
|
|
4604
|
-
extension: string
|
|
4605
|
-
recognised: boolean
|
|
4606
|
-
}
|
|
4607
|
-
|
|
4608
|
-
interface UriQueryString = {
|
|
4609
|
-
all: () => Record<string, QueryValue>
|
|
4610
|
-
get: (key: string) => string | undefined
|
|
4611
|
-
getAll: (key: string) => string[]
|
|
4612
|
-
has: (key: string) => boolean
|
|
4613
|
-
toString: () => string
|
|
4614
|
-
}
|
|
4615
|
-
|
|
4616
4222
|
interface UrlGenerator = {
|
|
4617
4223
|
current: () => string
|
|
4618
4224
|
full: () => string
|
|
@@ -4639,8 +4245,6 @@ interface WebContext = {
|
|
|
4639
4245
|
view: (markup: string | { toString(): string;}, status?: number) => void
|
|
4640
4246
|
}
|
|
4641
4247
|
|
|
4642
|
-
type AnsiColor = 'red' | 'green' | 'yellow' | 'blue' | 'cyan' | 'dim'
|
|
4643
|
-
|
|
4644
4248
|
type Channel = 'web' | 'json' | 'cli'
|
|
4645
4249
|
|
|
4646
4250
|
type QueryInput = { [x: string]: string | number | boolean | string[];}
|
|
@@ -5318,10 +4922,6 @@ type SafeConversionFormat = 'jpeg' | 'png' | 'webp'
|
|
|
5318
4922
|
|
|
5319
4923
|
## ./metrics `(./src/metrics.ts)`
|
|
5320
4924
|
|
|
5321
|
-
function beginHttp = () => void
|
|
5322
|
-
|
|
5323
|
-
function endHttp = () => void
|
|
5324
|
-
|
|
5325
4925
|
function httpMetrics = () => HttpMetricsSnapshot
|
|
5326
4926
|
|
|
5327
4927
|
function recordHttp = (status: number, ms: number) => void
|
|
@@ -5891,22 +5491,6 @@ class ModelQueryBuilder = {
|
|
|
5891
5491
|
withoutTenancy: () => ModelQueryBuilder<M>
|
|
5892
5492
|
}
|
|
5893
5493
|
|
|
5894
|
-
class MysqlDialect = {
|
|
5895
|
-
new (): MysqlDialect
|
|
5896
|
-
advisoryLockSql: (key: number) => DialectQuery
|
|
5897
|
-
advisoryUnlockSql: (key: number) => DialectQuery
|
|
5898
|
-
autoIncrementColumn: (column: string) => string
|
|
5899
|
-
booleanLiteral: (value: boolean) => string
|
|
5900
|
-
dateExpr: (part: DatePart, column: string) => string
|
|
5901
|
-
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
5902
|
-
hasTableSql: (table: string) => DialectQuery
|
|
5903
|
-
readonly booleanType: 'INTEGER'
|
|
5904
|
-
readonly name: 'mysql'
|
|
5905
|
-
readonly supportsAdvisoryLocks: true
|
|
5906
|
-
readonly supportsTransactionalDdl: false
|
|
5907
|
-
stringType: (length: number) => string
|
|
5908
|
-
}
|
|
5909
|
-
|
|
5910
5494
|
class NPlusOneDetected = {
|
|
5911
5495
|
new (fingerprint: string, count: number, ctx: object | undefined): NPlusOneDetected
|
|
5912
5496
|
readonly count: number
|
|
@@ -5924,31 +5508,6 @@ class NPlusOneError = {
|
|
|
5924
5508
|
readonly status: number
|
|
5925
5509
|
}
|
|
5926
5510
|
|
|
5927
|
-
class OrmContext = {
|
|
5928
|
-
new (): OrmContext
|
|
5929
|
-
globalScopes: Map<ClassRef, Map<string, unknown>>
|
|
5930
|
-
hooks: Map<ClassRef, Map<string, unknown[]>>
|
|
5931
|
-
namedConnections: Map<string, SQLInstance>
|
|
5932
|
-
overrideConnection: SQLInstance | null
|
|
5933
|
-
transitionCallbacks: Map<ClassRef, Map<string, unknown[]>>
|
|
5934
|
-
}
|
|
5935
|
-
|
|
5936
|
-
class PostgresDialect = {
|
|
5937
|
-
new (): PostgresDialect
|
|
5938
|
-
advisoryLockSql: (key: number) => DialectQuery
|
|
5939
|
-
advisoryUnlockSql: (key: number) => DialectQuery
|
|
5940
|
-
autoIncrementColumn: (column: string) => string
|
|
5941
|
-
booleanLiteral: (value: boolean) => string
|
|
5942
|
-
dateExpr: (part: DatePart, column: string) => string
|
|
5943
|
-
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
5944
|
-
hasTableSql: (table: string) => DialectQuery
|
|
5945
|
-
readonly booleanType: 'BOOLEAN'
|
|
5946
|
-
readonly name: 'postgres'
|
|
5947
|
-
readonly supportsAdvisoryLocks: true
|
|
5948
|
-
readonly supportsTransactionalDdl: true
|
|
5949
|
-
stringType: () => string
|
|
5950
|
-
}
|
|
5951
|
-
|
|
5952
5511
|
class QueryBuilder = {
|
|
5953
5512
|
new (table: string, sql: SQLInstance): QueryBuilder
|
|
5954
5513
|
_markUserWhereStart: () => void
|
|
@@ -6073,22 +5632,6 @@ class Seeder = {
|
|
|
6073
5632
|
run: () => Promise<void>
|
|
6074
5633
|
}
|
|
6075
5634
|
|
|
6076
|
-
class SqliteDialect = {
|
|
6077
|
-
new (): SqliteDialect
|
|
6078
|
-
advisoryLockSql: () => DialectQuery | null
|
|
6079
|
-
advisoryUnlockSql: () => DialectQuery | null
|
|
6080
|
-
autoIncrementColumn: (column: string) => string
|
|
6081
|
-
booleanLiteral: (value: boolean) => string
|
|
6082
|
-
dateExpr: (part: DatePart, column: string) => string
|
|
6083
|
-
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
6084
|
-
hasTableSql: (table: string) => DialectQuery
|
|
6085
|
-
readonly booleanType: 'INTEGER'
|
|
6086
|
-
readonly name: 'sqlite'
|
|
6087
|
-
readonly supportsAdvisoryLocks: false
|
|
6088
|
-
readonly supportsTransactionalDdl: true
|
|
6089
|
-
stringType: () => string
|
|
6090
|
-
}
|
|
6091
|
-
|
|
6092
5635
|
class StateError = {
|
|
6093
5636
|
new (model: string, from: string, to: string, detail?: string): StateError
|
|
6094
5637
|
readonly code: string
|
|
@@ -6133,30 +5676,12 @@ class UnsupportedDialectError = {
|
|
|
6133
5676
|
|
|
6134
5677
|
const DB = { table(tableName: string): QueryBuilder; raw<T = Record<string, unknown>>(sql: TemplateStringsArray | string, ...rest: unknown[]): Promise<T[]>; transaction<T>(callback: (tx?: SQLInstance) => Promise<T>, attempts?: number): Promise<T>; beginTransaction(): Promise<ManualTransaction>; onPrimary(): { table(name: string): QueryBuilder; }; currentTx(): unknown | undefined; advisoryLock<T>(key: number, callback: () => Promise<T>): Promise<T>; preventNPlusOne(options?: NPlusOneOptions): void; allowNPlusOne(pattern: string, options?: { once?: boolean; }): void;}
|
|
6135
5678
|
|
|
6136
|
-
const ModelInspector = { load(pattern: string, cwd?: string): Promise<void>; all(): ModelSchema[]; fromClass(ctor: ClassRef): ModelSchema | null;}
|
|
6137
|
-
|
|
6138
5679
|
const relationRegistry = Map<ClassRef, Map<string, RelationMetadata>>
|
|
6139
5680
|
|
|
6140
5681
|
const Schema = { create(table: string, callback: (bp: Blueprint) => void): Promise<void>; createIfNotExists(table: string, callback: (bp: Blueprint) => void): Promise<void>; table(name: string, callback: (bp: Blueprint) => void): Promise<void>; alter(name: string, callback: (bp: Blueprint) => void): Promise<void>; drop(table: string): Promise<void>; dropIfExists(table: string): Promise<void>; rename(from: string, to: string): Promise<void>; hasTable(table: string): Promise<boolean>; hasColumn(table: string, column: string): Promise<boolean>;}
|
|
6141
5682
|
|
|
6142
|
-
const SchemaDiffer = { diff(schemas: ModelSchema[]): Promise<DiffResult>; isEmpty(diff: DiffResult): boolean;}
|
|
6143
|
-
|
|
6144
|
-
const SchemaInspector = { tables(): Promise<string[]>; columns(table: string): Promise<LiveColumn[] | null>; describe(table: string): Promise<LiveTable | null>;}
|
|
6145
|
-
|
|
6146
5683
|
const TransactionContext = AsyncLocalStorage<SQLInstance>
|
|
6147
5684
|
|
|
6148
|
-
function _getConnection = () => SQLInstance
|
|
6149
|
-
|
|
6150
|
-
function _getDbConnectionOverride = () => SQLInstance | null
|
|
6151
|
-
|
|
6152
|
-
function _globalScopeRegistry = () => Map<ClassRef, Map<string, GlobalScopeCallback>>
|
|
6153
|
-
|
|
6154
|
-
function _setDbConnection = (conn: SQLInstance | null) => void
|
|
6155
|
-
|
|
6156
|
-
function _setReadReplicas = (primary: SQLInstance, replicas: SQLInstance[]) => void
|
|
6157
|
-
|
|
6158
|
-
function _suppressHooks = <T>(fn: () => Promise<T>) => Promise<T>
|
|
6159
|
-
|
|
6160
5685
|
function allowNPlusOne = (pattern: string, options?: { once?: boolean;}, ctx?: object | null) => void
|
|
6161
5686
|
|
|
6162
5687
|
function arrayOf = <T = unknown>(mapper?: CastMapper<T>) => ArrayCast<T>
|
|
@@ -6165,16 +5690,8 @@ function belongsTo = (related: () => unknown, options: BelongsToOptions) => (_va
|
|
|
6165
5690
|
|
|
6166
5691
|
function column = { (): ColumnDecorator; (type: ColumnShorthand): ColumnDecorator; (options: ColumnOptions): ColumnDecorator; (type: ColumnShorthand, options: Omit<ColumnOptions, 'type'>): ColumnDecorator;}
|
|
6167
5692
|
|
|
6168
|
-
function createReadWriteRouter = (primary: SQLInstance, replicas: SQLInstance[]) => SQLInstance
|
|
6169
|
-
|
|
6170
|
-
function currentOrmContext = () => OrmContext
|
|
6171
|
-
|
|
6172
5693
|
function DatabaseConfig = (options?: Partial<DatabaseConfigShape>) => DatabaseConfigShape
|
|
6173
5694
|
|
|
6174
|
-
function generateMigrationContent = (className: string, diff: DiffResult) => string
|
|
6175
|
-
|
|
6176
|
-
function getDialect = (name: DialectName) => SqlDialect
|
|
6177
|
-
|
|
6178
5695
|
function hasMany = (related: () => unknown, options: HasManyOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
6179
5696
|
|
|
6180
5697
|
function hasManyThrough = (related: () => unknown, through: () => unknown, options: HasManyThroughOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
@@ -6183,8 +5700,6 @@ function hasOne = (related: () => unknown, options: HasOneOptions) => (_value: u
|
|
|
6183
5700
|
|
|
6184
5701
|
function hasOneThrough = (related: () => unknown, through: () => unknown, options: HasManyThroughOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
6185
5702
|
|
|
6186
|
-
function installOrmObservability = (app: Application) => () => void
|
|
6187
|
-
|
|
6188
5703
|
function isEncryptedCast = (cast: unknown) => cast is EncryptedCastName
|
|
6189
5704
|
|
|
6190
5705
|
function json = <T = unknown>(mapper?: CastMapper<T>) => JsonCast<T>
|
|
@@ -6205,30 +5720,12 @@ function objectOf = <T = unknown>(mapper?: CastMapper<T>) => JsonCast<T>
|
|
|
6205
5720
|
|
|
6206
5721
|
function preventNPlusOne = (options?: NPlusOneOptions) => void
|
|
6207
5722
|
|
|
6208
|
-
function registerConnectionResolver = (fn: ContextConnectionResolver | null) => void
|
|
6209
|
-
|
|
6210
|
-
function registerImplicitBinding = () => void
|
|
6211
|
-
|
|
6212
|
-
function registerModelConnection = (name: string, conn: SQLInstance, dialect?: Dialect) => void
|
|
6213
|
-
|
|
6214
|
-
function resetOrmContext = () => void
|
|
6215
|
-
|
|
6216
|
-
function resolveContainerConnection = () => SQLInstance | undefined
|
|
6217
|
-
|
|
6218
|
-
function resolveSyncOptions = (raw: unknown) => ResolvedSyncOptions
|
|
6219
|
-
|
|
6220
|
-
function setConnectionResolver = (fn: ConnectionResolver | null) => void
|
|
6221
|
-
|
|
6222
5723
|
function SoftDeletes = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): SoftDeletes; prototype: SoftDeletes<any>.SoftDeletes; softDeletes: boolean; withTrashed<T extends BaseModel>(this: SoftDeleteModelClass<T>): ModelQueryBuilder<T>; onlyTrashed<T extends BaseModel>(this: SoftDeleteModelClass<T>): ModelQueryBuilder<T>;} & TBase
|
|
6223
5724
|
|
|
6224
5725
|
function State = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): State; prototype: State<any>.State; stateField: string; states?: Record<string, StateDefinition<string, any>>; onTransition<T>(this: { new (...args: any[]): T; }, toState: string, callback: TransitionCallback<T>): void;} & TBase
|
|
6225
5726
|
|
|
6226
|
-
function synchronizeSchema = (options?: SynchronizeOptions) => Promise<DiffResult>
|
|
6227
|
-
|
|
6228
5727
|
function table = (tableName: string, options?: TableOptions) => TableDecoratorBuilder
|
|
6229
5728
|
|
|
6230
|
-
function useOrmContext = (ctx?: OrmContext) => OrmContext
|
|
6231
|
-
|
|
6232
5729
|
interface BelongsTo = {
|
|
6233
5730
|
__@___relation__: 'belongsTo'
|
|
6234
5731
|
__type__: T
|
|
@@ -6283,22 +5780,6 @@ interface DatabaseConfigShape = {
|
|
|
6283
5780
|
url: string
|
|
6284
5781
|
}
|
|
6285
5782
|
|
|
6286
|
-
interface DialectQuery = {
|
|
6287
|
-
params: unknown[]
|
|
6288
|
-
sql: string
|
|
6289
|
-
}
|
|
6290
|
-
|
|
6291
|
-
interface DiffResult = {
|
|
6292
|
-
droppedColumns: DroppedColumn[]
|
|
6293
|
-
newColumns: NewColumn[]
|
|
6294
|
-
newTables: NewTable[]
|
|
6295
|
-
}
|
|
6296
|
-
|
|
6297
|
-
interface DroppedColumn = {
|
|
6298
|
-
column: string
|
|
6299
|
-
table: string
|
|
6300
|
-
}
|
|
6301
|
-
|
|
6302
5783
|
interface HasMany = {
|
|
6303
5784
|
__@___relation__: 'hasMany'
|
|
6304
5785
|
__type__: T
|
|
@@ -6328,18 +5809,6 @@ interface KeysetPaginateResult = {
|
|
|
6328
5809
|
nextCursor: string | null
|
|
6329
5810
|
}
|
|
6330
5811
|
|
|
6331
|
-
interface LiveColumn = {
|
|
6332
|
-
name: string
|
|
6333
|
-
nullable: boolean
|
|
6334
|
-
primary: boolean
|
|
6335
|
-
rawType: string
|
|
6336
|
-
}
|
|
6337
|
-
|
|
6338
|
-
interface LiveTable = {
|
|
6339
|
-
columns: LiveColumn[]
|
|
6340
|
-
name: string
|
|
6341
|
-
}
|
|
6342
|
-
|
|
6343
5812
|
interface ManualTransaction = {
|
|
6344
5813
|
commit: () => Promise<void>
|
|
6345
5814
|
readonly sql: SQLInstance
|
|
@@ -6384,16 +5853,6 @@ interface MigrationStatus = {
|
|
|
6384
5853
|
ranAt?: Date
|
|
6385
5854
|
}
|
|
6386
5855
|
|
|
6387
|
-
interface ModelColumn = {
|
|
6388
|
-
default: unknown
|
|
6389
|
-
index?: boolean
|
|
6390
|
-
name: string
|
|
6391
|
-
nullable: boolean
|
|
6392
|
-
primary: boolean
|
|
6393
|
-
type: 'string' | 'number' | 'boolean' | 'text' | 'datetime' | 'json' | undefined
|
|
6394
|
-
unique?: boolean
|
|
6395
|
-
}
|
|
6396
|
-
|
|
6397
5856
|
interface ModelObserver = {
|
|
6398
5857
|
created?: (model: T) => Promise<void> | void
|
|
6399
5858
|
creating?: (model: T) => Promise<void> | void
|
|
@@ -6406,14 +5865,6 @@ interface ModelObserver = {
|
|
|
6406
5865
|
updating?: (model: T) => Promise<void> | void
|
|
6407
5866
|
}
|
|
6408
5867
|
|
|
6409
|
-
interface ModelSchema = {
|
|
6410
|
-
columns: ModelColumn[]
|
|
6411
|
-
primaryKey: string
|
|
6412
|
-
softDeletes: boolean
|
|
6413
|
-
table: string
|
|
6414
|
-
timestamps: boolean
|
|
6415
|
-
}
|
|
6416
|
-
|
|
6417
5868
|
interface MorphedByManyOptions = {
|
|
6418
5869
|
morphName: string
|
|
6419
5870
|
parentPivotKey: string
|
|
@@ -6461,15 +5912,6 @@ interface MorphToOptions = {
|
|
|
6461
5912
|
morphTypeColumn?: string
|
|
6462
5913
|
}
|
|
6463
5914
|
|
|
6464
|
-
interface NewColumn = {
|
|
6465
|
-
column: ModelColumn
|
|
6466
|
-
table: string
|
|
6467
|
-
}
|
|
6468
|
-
|
|
6469
|
-
interface NewTable = {
|
|
6470
|
-
schema: ModelSchema
|
|
6471
|
-
}
|
|
6472
|
-
|
|
6473
5915
|
interface NPlusOneOptions = {
|
|
6474
5916
|
mode?: 'warn' | 'throw'
|
|
6475
5917
|
threshold?: number
|
|
@@ -6526,11 +5968,6 @@ interface RelationMetadata = {
|
|
|
6526
5968
|
withDefault?: boolean | Record<string, unknown> | ((model: unknown) => void)
|
|
6527
5969
|
}
|
|
6528
5970
|
|
|
6529
|
-
interface ResolvedSyncOptions = {
|
|
6530
|
-
disruptive: boolean
|
|
6531
|
-
enabled: boolean
|
|
6532
|
-
}
|
|
6533
|
-
|
|
6534
5971
|
interface ScopeApplicator = {
|
|
6535
5972
|
apply: (query: QueryBuilder) => void
|
|
6536
5973
|
}
|
|
@@ -6548,21 +5985,6 @@ interface SimplePaginateResult = {
|
|
|
6548
5985
|
url: (page: number, baseUrl?: string, query?: Record<string, string>) => string
|
|
6549
5986
|
}
|
|
6550
5987
|
|
|
6551
|
-
interface SqlDialect = {
|
|
6552
|
-
advisoryLockSql: (key: number) => DialectQuery | null
|
|
6553
|
-
advisoryUnlockSql: (key: number) => DialectQuery | null
|
|
6554
|
-
autoIncrementColumn: (column: string) => string
|
|
6555
|
-
booleanLiteral: (value: boolean) => string
|
|
6556
|
-
dateExpr: (part: DatePart, column: string) => string
|
|
6557
|
-
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
6558
|
-
hasTableSql: (table: string) => DialectQuery
|
|
6559
|
-
readonly booleanType: string
|
|
6560
|
-
readonly name: DialectName
|
|
6561
|
-
readonly supportsAdvisoryLocks: boolean
|
|
6562
|
-
readonly supportsTransactionalDdl: boolean
|
|
6563
|
-
stringType: (length: number) => string
|
|
6564
|
-
}
|
|
6565
|
-
|
|
6566
5988
|
interface SQLInstance = {
|
|
6567
5989
|
<T = Record<string, unknown>>(strings: TemplateStringsArray, ...values: unknown[]): Promise<T[]>
|
|
6568
5990
|
begin: <T>(fn: (tx: SQLInstance) => Promise<T>) => Promise<T>
|
|
@@ -6574,10 +5996,6 @@ interface StateDefinition = {
|
|
|
6574
5996
|
guard?: StateGuard<T>
|
|
6575
5997
|
}
|
|
6576
5998
|
|
|
6577
|
-
interface SynchronizeOptions = {
|
|
6578
|
-
disruptive?: boolean
|
|
6579
|
-
}
|
|
6580
|
-
|
|
6581
5999
|
interface TableDecoratorBuilder = {
|
|
6582
6000
|
(target: ClassRef, context?: unknown): void
|
|
6583
6001
|
primaryKey: (key: string) => TableDecoratorBuilder
|
|
@@ -6604,12 +6022,8 @@ type ColumnShorthand = 'string' | 'text' | 'integer' | 'number' | 'float' | 'boo
|
|
|
6604
6022
|
|
|
6605
6023
|
type Constructor = new (...args: any[]) => T
|
|
6606
6024
|
|
|
6607
|
-
type ContextConnectionResolver = (ModelClass?: typeof BaseModel) => SQLInstance | null
|
|
6608
|
-
|
|
6609
6025
|
type DatePart = 'date' | 'time' | 'day' | 'month' | 'year'
|
|
6610
6026
|
|
|
6611
|
-
type DialectName = 'sqlite' | 'postgres' | 'mysql'
|
|
6612
|
-
|
|
6613
6027
|
type EncryptedCastName = 'encrypted' | 'encrypted:json'
|
|
6614
6028
|
|
|
6615
6029
|
type FKAction = 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION'
|
|
@@ -6996,13 +6410,6 @@ class CronExpression = {
|
|
|
6996
6410
|
weekday: (v: number | string) => CronExpression
|
|
6997
6411
|
}
|
|
6998
6412
|
|
|
6999
|
-
class FileScheduleRunStore = {
|
|
7000
|
-
new (_path: string, _keep?: number): FileScheduleRunStore
|
|
7001
|
-
lastFor: (name: string) => ScheduleRunRecord | undefined
|
|
7002
|
-
recent: (limit?: number, name?: string) => ScheduleRunRecord[]
|
|
7003
|
-
record: (run: ScheduleRunRecord) => void
|
|
7004
|
-
}
|
|
7005
|
-
|
|
7006
6413
|
class Schedule = {
|
|
7007
6414
|
new (): Schedule
|
|
7008
6415
|
appendOutputTo?: string
|
|
@@ -7154,20 +6561,8 @@ class TaskSkipped = {
|
|
|
7154
6561
|
readonly reason: 'lock' | 'window' | 'env' | 'when' | 'skip' | 'overlap'
|
|
7155
6562
|
}
|
|
7156
6563
|
|
|
7157
|
-
const DEFAULT_RUN_LOG_KEEP = 500
|
|
7158
|
-
|
|
7159
|
-
const DEFAULT_RUN_LOG_PATH = 'storage/framework/schedule-runs.jsonl'
|
|
7160
|
-
|
|
7161
6564
|
const Scheduler = SchedulerManager
|
|
7162
6565
|
|
|
7163
|
-
const schedulesConcern = ConcernDescriptor
|
|
7164
|
-
|
|
7165
|
-
function installScheduleRunLog = (app: Application) => (() => void) | undefined
|
|
7166
|
-
|
|
7167
|
-
function registerSchedule = (manager: SchedulerManager, schedule: Schedule, fallbackName: string) => ScheduledTask | undefined
|
|
7168
|
-
|
|
7169
|
-
function resolveRunLogConfig = (app: Application) => RunLogConfig
|
|
7170
|
-
|
|
7171
6566
|
function SchedulerConfig = (options?: Partial<SchedulerConfigShape>) => SchedulerConfigShape
|
|
7172
6567
|
|
|
7173
6568
|
interface OverlapLockOptions = {
|
|
@@ -7376,8 +6771,6 @@ class SessionSecretMissingError = {
|
|
|
7376
6771
|
|
|
7377
6772
|
const Session = SessionAccessor
|
|
7378
6773
|
|
|
7379
|
-
const SESSION_ISSUED_AT_KEY = '_iat'
|
|
7380
|
-
|
|
7381
6774
|
function SessionConfig = (options?: Partial<SessionConfigShape>) => SessionConfigShape
|
|
7382
6775
|
|
|
7383
6776
|
interface CsrfOptions = {
|
|
@@ -7409,6 +6802,50 @@ interface SessionPayload = {
|
|
|
7409
6802
|
id: string
|
|
7410
6803
|
}
|
|
7411
6804
|
|
|
6805
|
+
## ./shared `(./src/shared.ts)`
|
|
6806
|
+
|
|
6807
|
+
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;}
|
|
6808
|
+
|
|
6809
|
+
function camelCase = (value: string) => string
|
|
6810
|
+
|
|
6811
|
+
function formatDate = (value: Date | number | string, options?: DateOptions) => string
|
|
6812
|
+
|
|
6813
|
+
function formatMoney = (amount: number, options: MoneyOptions) => string
|
|
6814
|
+
|
|
6815
|
+
function formatNumber = (value: number, options?: NumberOptions) => string
|
|
6816
|
+
|
|
6817
|
+
function pluralize = (value: string) => string
|
|
6818
|
+
|
|
6819
|
+
function singularize = (value: string) => string
|
|
6820
|
+
|
|
6821
|
+
function snakeCase = (value: string) => string
|
|
6822
|
+
|
|
6823
|
+
function tableNameFor = (className: string) => string
|
|
6824
|
+
|
|
6825
|
+
interface DateOptions = {
|
|
6826
|
+
dateStyle?: 'medium' | 'short' | 'full' | 'long'
|
|
6827
|
+
locale?: string
|
|
6828
|
+
timeStyle?: 'medium' | 'short' | 'full' | 'long'
|
|
6829
|
+
timeZone?: string
|
|
6830
|
+
}
|
|
6831
|
+
|
|
6832
|
+
interface FormatOptions = {
|
|
6833
|
+
locale?: string
|
|
6834
|
+
}
|
|
6835
|
+
|
|
6836
|
+
interface MoneyOptions = {
|
|
6837
|
+
currency: string
|
|
6838
|
+
fractionDigits?: number
|
|
6839
|
+
locale?: string
|
|
6840
|
+
minorUnits?: boolean
|
|
6841
|
+
}
|
|
6842
|
+
|
|
6843
|
+
interface NumberOptions = {
|
|
6844
|
+
locale?: string
|
|
6845
|
+
maximumFractionDigits?: number
|
|
6846
|
+
minimumFractionDigits?: number
|
|
6847
|
+
}
|
|
6848
|
+
|
|
7412
6849
|
## ./storage `(./src/storage.ts)`
|
|
7413
6850
|
|
|
7414
6851
|
class DiskNotConfiguredError = {
|
|
@@ -7570,8 +7007,6 @@ class UnsupportedOperationError = {
|
|
|
7570
7007
|
|
|
7571
7008
|
const Storage = StorageManager
|
|
7572
7009
|
|
|
7573
|
-
function mountsFrom = (config: StorageConfigShape) => Mount[]
|
|
7574
|
-
|
|
7575
7010
|
function StorageConfig = (options?: Partial<StorageConfigShape>) => StorageConfigShape
|
|
7576
7011
|
|
|
7577
7012
|
interface DiskServeConfig = {
|
|
@@ -8241,14 +7676,6 @@ const Validator = { check<S extends Record<string, FieldRule>>(data: Record<s
|
|
|
8241
7676
|
|
|
8242
7677
|
function registerDbRuleRunner = (runner: DbRuleRunner) => void
|
|
8243
7678
|
|
|
8244
|
-
function runStringRules = (data: Record<string, unknown>, rules: StringRules) => Record<string, string[]>
|
|
8245
|
-
|
|
8246
|
-
function runStringRulesAsync = (data: Record<string, unknown>, rules: StringRules) => Promise<Record<string, string[]>>
|
|
8247
|
-
|
|
8248
|
-
function runValidation = <S extends Schema>(schema: S, input: Record<string, unknown>) => ValidationOutcome<unknown>
|
|
8249
|
-
|
|
8250
|
-
function runValidationAsync = <S extends Schema>(schema: S, input: Record<string, unknown>) => Promise<ValidationOutcome<unknown>>
|
|
8251
|
-
|
|
8252
7679
|
function validate = <S extends Record<string, FieldRule>>(ctx: HttpContext, factory: (rules: RuleBuilder) => S) => Promise<Infer<ExtractDefs<S>>>
|
|
8253
7680
|
|
|
8254
7681
|
function ValidatorConfig = (options?: Partial<ValidatorConfigShape>) => ValidatorConfigShape
|
|
@@ -8289,8 +7716,6 @@ type InferFieldType = F['type'] extends 'string' ? string : F['type'] extends 'n
|
|
|
8289
7716
|
|
|
8290
7717
|
type Schema = { [x: string]: FieldRuleDefinition;}
|
|
8291
7718
|
|
|
8292
|
-
type StringRules = { [x: string]: string | string[];}
|
|
8293
|
-
|
|
8294
7719
|
type ValidationErrors = { [x: string]: string;}
|
|
8295
7720
|
|
|
8296
7721
|
type ValidationOutcome = ValidationResult<T> | ValidationFailure
|
|
@@ -8309,10 +7734,6 @@ class SafeHtml = {
|
|
|
8309
7734
|
toString: () => string
|
|
8310
7735
|
}
|
|
8311
7736
|
|
|
8312
|
-
const VIEW_COMPONENT_PROP = '__zerotalViewComponent'
|
|
8313
|
-
|
|
8314
|
-
const VIEW_COMPONENT_SYMBOL = typeof VIEW_COMPONENT_SYMBOL
|
|
8315
|
-
|
|
8316
7737
|
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
|
|
8317
7738
|
|
|
8318
7739
|
function definePage = <P extends Record<string, unknown> = Record<string, unknown>>(component: (ctx: HttpContext, params: P) => SafeHtml | string | Promise<SafeHtml | string>) => typeof component
|
|
@@ -8323,8 +7744,6 @@ function Fragment = ({ children }: { children?: unknown;}) => SafeHtml
|
|
|
8323
7744
|
|
|
8324
7745
|
function Raw = ({ html }: { html: string;}) => SafeHtml
|
|
8325
7746
|
|
|
8326
|
-
function registerViewFileRouteResolver = () => void
|
|
8327
|
-
|
|
8328
7747
|
function safe = (html: string) => SafeHtml
|
|
8329
7748
|
|
|
8330
7749
|
type Children = unknown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zerotal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"./scheduler": "./src/scheduler.ts",
|
|
37
37
|
"./security": "./src/security.ts",
|
|
38
38
|
"./session": "./src/session.ts",
|
|
39
|
+
"./shared": "./src/shared.ts",
|
|
39
40
|
"./storage": "./src/storage.ts",
|
|
40
41
|
"./testing": "./src/testing.ts",
|
|
41
42
|
"./validator": "./src/validator.ts",
|
|
@@ -61,17 +62,17 @@
|
|
|
61
62
|
"typecheck": "tsc --noEmit"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@zerotal/auth": "1.
|
|
65
|
-
"@zerotal/cache": "1.
|
|
66
|
-
"@zerotal/client": "1.
|
|
67
|
-
"@zerotal/core": "1.
|
|
68
|
-
"@zerotal/media": "1.
|
|
69
|
-
"@zerotal/orm": "1.
|
|
70
|
-
"@zerotal/queue": "1.
|
|
71
|
-
"@zerotal/scheduler": "1.
|
|
72
|
-
"@zerotal/session": "1.
|
|
73
|
-
"@zerotal/testing": "1.
|
|
74
|
-
"@zerotal/validator": "1.
|
|
65
|
+
"@zerotal/auth": "1.9.0",
|
|
66
|
+
"@zerotal/cache": "1.9.0",
|
|
67
|
+
"@zerotal/client": "1.9.0",
|
|
68
|
+
"@zerotal/core": "1.9.0",
|
|
69
|
+
"@zerotal/media": "1.9.0",
|
|
70
|
+
"@zerotal/orm": "1.9.0",
|
|
71
|
+
"@zerotal/queue": "1.9.0",
|
|
72
|
+
"@zerotal/scheduler": "1.9.0",
|
|
73
|
+
"@zerotal/session": "1.9.0",
|
|
74
|
+
"@zerotal/testing": "1.9.0",
|
|
75
|
+
"@zerotal/validator": "1.9.0"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"typescript": "^5.8.0"
|
package/src/shared.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@zerotal/core/shared";
|