zerotal 1.9.0 → 1.10.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/README.md +1 -1
- package/api-surface.md +342 -254
- package/package.json +13 -12
- package/src/runtime.ts +1 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ import { Auth } from "zerotal/auth";
|
|
|
27
27
|
| `zerotal/testing` | `@zerotal/testing` |
|
|
28
28
|
| `zerotal/validator` | `@zerotal/validator` |
|
|
29
29
|
|
|
30
|
-
Core's own subpaths are mirrored 1:1, so `zerotal` is a full drop-in for `@zerotal/core`: `zerotal/logger`, `zerotal/lock`, `zerotal/storage`, `zerotal/config`, `zerotal/view`, `zerotal/helpers`, `zerotal/facades`, `zerotal/http`, `zerotal/env`, `zerotal/carbon`, `zerotal/contracts`, `zerotal/commands`, `zerotal/assets`, `zerotal/security`, `zerotal/health`, `zerotal/metrics`, `zerotal/dev`, `zerotal/build` — and `jsx-runtime`, so `"jsxImportSource": "zerotal"` works for server JSX views. The one exception is `@zerotal/core/macros/config` (a Bun macro): import it from core directly.
|
|
30
|
+
Core's own subpaths are mirrored 1:1, so `zerotal` is a full drop-in for `@zerotal/core`: `zerotal/logger`, `zerotal/lock`, `zerotal/storage`, `zerotal/config`, `zerotal/view`, `zerotal/helpers`, `zerotal/facades`, `zerotal/http`, `zerotal/env`, `zerotal/carbon`, `zerotal/contracts`, `zerotal/commands`, `zerotal/assets`, `zerotal/security`, `zerotal/health`, `zerotal/metrics`, `zerotal/dev`, `zerotal/build`, `zerotal/runtime` — and `jsx-runtime`, so `"jsxImportSource": "zerotal"` works for server JSX views. The one exception is `@zerotal/core/macros/config` (a Bun macro): import it from core directly.
|
|
31
31
|
|
|
32
32
|
There is no behaviour here and no version skew: the meta package pins the same monorepo version as every `@zerotal/*` package it re-exports. Installing a scoped package directly is always equivalent — this package exists so a new app needs exactly one dependency to start.
|
|
33
33
|
|
package/api-surface.md
CHANGED
|
@@ -394,6 +394,7 @@ class LimiterDefinition = {
|
|
|
394
394
|
register: () => LimiterDefinition
|
|
395
395
|
toMiddleware: () => ThrottleMiddleware
|
|
396
396
|
toMiddlewareClass: () => new () => ThrottleMiddleware
|
|
397
|
+
trustedProxies: (count: number) => LimiterDefinition
|
|
397
398
|
}
|
|
398
399
|
|
|
399
400
|
class MarkdownBuilder = {
|
|
@@ -808,23 +809,23 @@ interface ContainerBindings = {
|
|
|
808
809
|
}
|
|
809
810
|
|
|
810
811
|
interface CookieOptions = {
|
|
811
|
-
domain?: string
|
|
812
|
-
httpOnly?: boolean
|
|
813
|
-
maxAge?: number
|
|
812
|
+
domain?: string | undefined
|
|
813
|
+
httpOnly?: boolean | undefined
|
|
814
|
+
maxAge?: number | undefined
|
|
814
815
|
name: string
|
|
815
|
-
path?: string
|
|
816
|
-
sameSite?: SameSite
|
|
817
|
-
secure?: boolean
|
|
816
|
+
path?: string | undefined
|
|
817
|
+
sameSite?: SameSite | undefined
|
|
818
|
+
secure?: boolean | undefined
|
|
818
819
|
value: string
|
|
819
820
|
}
|
|
820
821
|
|
|
821
822
|
interface CorsOptions = {
|
|
822
|
-
allowedHeaders?: string[]
|
|
823
|
-
credentials?: boolean
|
|
824
|
-
exposedHeaders?: string[]
|
|
825
|
-
maxAge?: number
|
|
826
|
-
methods?: string[]
|
|
827
|
-
origin?: string | string[] | ((origin: string) => boolean)
|
|
823
|
+
allowedHeaders?: string[] | undefined
|
|
824
|
+
credentials?: boolean | undefined
|
|
825
|
+
exposedHeaders?: string[] | undefined
|
|
826
|
+
maxAge?: number | undefined
|
|
827
|
+
methods?: string[] | undefined
|
|
828
|
+
origin?: string | string[] | ((origin: string) => boolean) | undefined
|
|
828
829
|
}
|
|
829
830
|
|
|
830
831
|
interface DevProcessDefinition = {
|
|
@@ -870,9 +871,9 @@ interface ErrorDiagnosis = {
|
|
|
870
871
|
}
|
|
871
872
|
|
|
872
873
|
interface GroupOptions = {
|
|
873
|
-
domain?: string
|
|
874
|
-
middleware?: string | string[] | MiddlewareClass | MiddlewareClass[]
|
|
875
|
-
prefix?: string
|
|
874
|
+
domain?: string | undefined
|
|
875
|
+
middleware?: string | string[] | MiddlewareClass | MiddlewareClass[] | undefined
|
|
876
|
+
prefix?: string | undefined
|
|
876
877
|
}
|
|
877
878
|
|
|
878
879
|
interface ModelClass = {
|
|
@@ -925,25 +926,25 @@ interface RouterMacros = {
|
|
|
925
926
|
}
|
|
926
927
|
|
|
927
928
|
interface SecureHeadersOptions = {
|
|
928
|
-
contentSecurityPolicy?: string
|
|
929
|
-
frameOptions?: false | 'DENY' | 'SAMEORIGIN'
|
|
930
|
-
hstsIncludeSubDomains?: boolean
|
|
931
|
-
hstsMaxAge?: number
|
|
932
|
-
hstsPreload?: boolean
|
|
933
|
-
permissionsPolicy?: string | false
|
|
934
|
-
referrerPolicy?: string
|
|
935
|
-
secure?: boolean
|
|
929
|
+
contentSecurityPolicy?: string | undefined
|
|
930
|
+
frameOptions?: false | 'DENY' | 'SAMEORIGIN' | undefined
|
|
931
|
+
hstsIncludeSubDomains?: boolean | undefined
|
|
932
|
+
hstsMaxAge?: number | undefined
|
|
933
|
+
hstsPreload?: boolean | undefined
|
|
934
|
+
permissionsPolicy?: string | false | undefined
|
|
935
|
+
referrerPolicy?: string | undefined
|
|
936
|
+
secure?: boolean | undefined
|
|
936
937
|
}
|
|
937
938
|
|
|
938
939
|
interface StartZerotalOptions = {
|
|
939
|
-
configDir?: string
|
|
940
|
+
configDir?: string | undefined
|
|
940
941
|
}
|
|
941
942
|
|
|
942
943
|
interface ThrottleOptions = {
|
|
943
|
-
keyResolver?: (ctx: HttpContext) => string
|
|
944
|
+
keyResolver?: ((ctx: HttpContext) => string) | undefined
|
|
944
945
|
maxAttempts: number
|
|
945
|
-
trustedProxies?: number
|
|
946
|
-
windowSeconds?: number
|
|
946
|
+
trustedProxies?: number | undefined
|
|
947
|
+
windowSeconds?: number | undefined
|
|
947
948
|
}
|
|
948
949
|
|
|
949
950
|
interface ViewRegistration = {
|
|
@@ -952,14 +953,14 @@ interface ViewRegistration = {
|
|
|
952
953
|
}
|
|
953
954
|
|
|
954
955
|
interface WebhookOptions = {
|
|
955
|
-
algorithm?: 'sha256' | 'sha1' | 'sha512'
|
|
956
|
-
format?: 'raw' | 'stripe'
|
|
957
|
-
header?: string
|
|
958
|
-
prefix?: string
|
|
956
|
+
algorithm?: 'sha256' | 'sha1' | 'sha512' | undefined
|
|
957
|
+
format?: 'raw' | 'stripe' | undefined
|
|
958
|
+
header?: string | undefined
|
|
959
|
+
prefix?: string | undefined
|
|
959
960
|
secret: string
|
|
960
|
-
timestampHeader?: string
|
|
961
|
-
timestampSeparator?: string
|
|
962
|
-
tolerance?: number
|
|
961
|
+
timestampHeader?: string | undefined
|
|
962
|
+
timestampSeparator?: string | undefined
|
|
963
|
+
tolerance?: number | undefined
|
|
963
964
|
}
|
|
964
965
|
|
|
965
966
|
interface WebSocketHandlers = {
|
|
@@ -998,6 +999,8 @@ type NextFn = () => Promise<Response | void>
|
|
|
998
999
|
|
|
999
1000
|
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>
|
|
1000
1001
|
|
|
1002
|
+
type Resolved = { [K in keyof T]-?: Exclude<T[K], undefined>; }
|
|
1003
|
+
|
|
1001
1004
|
type RouteArgs = [params?: RouteParamValues, query?: RouteQuery]
|
|
1002
1005
|
|
|
1003
1006
|
type RouteMiddleware = MiddlewareClass[] | RouteMethodMiddleware
|
|
@@ -1925,50 +1928,50 @@ function tokenCan = (row: TokenRow, ability: string) => boolean
|
|
|
1925
1928
|
|
|
1926
1929
|
interface AppleOAuth2Config = {
|
|
1927
1930
|
clientId: string
|
|
1928
|
-
clientSecret?: string
|
|
1929
|
-
keyId?: string
|
|
1930
|
-
privateKey?: string
|
|
1931
|
+
clientSecret?: string | undefined
|
|
1932
|
+
keyId?: string | undefined
|
|
1933
|
+
privateKey?: string | undefined
|
|
1931
1934
|
redirectUrl: string
|
|
1932
|
-
scopes?: string[]
|
|
1933
|
-
teamId?: string
|
|
1935
|
+
scopes?: string[] | undefined
|
|
1936
|
+
teamId?: string | undefined
|
|
1934
1937
|
}
|
|
1935
1938
|
|
|
1936
1939
|
interface AuthConfigShape = {
|
|
1937
1940
|
algorithm: 'bcrypt' | 'argon2id'
|
|
1938
|
-
twoFactor?: TwoFactorOptions
|
|
1941
|
+
twoFactor?: TwoFactorOptions | undefined
|
|
1939
1942
|
}
|
|
1940
1943
|
|
|
1941
1944
|
interface AuthenticateSessionOptions = {
|
|
1942
|
-
redirectTo?: string
|
|
1945
|
+
redirectTo?: string | undefined
|
|
1943
1946
|
}
|
|
1944
1947
|
|
|
1945
1948
|
interface AuthOptions = {
|
|
1946
|
-
mustVerifyEmail?: boolean
|
|
1947
|
-
redirectTo?: string
|
|
1948
|
-
verifyRedirectTo?: string
|
|
1949
|
+
mustVerifyEmail?: boolean | undefined
|
|
1950
|
+
redirectTo?: string | undefined
|
|
1951
|
+
verifyRedirectTo?: string | undefined
|
|
1949
1952
|
}
|
|
1950
1953
|
|
|
1951
1954
|
interface BasicAuthOptions = {
|
|
1952
|
-
field?: string
|
|
1953
|
-
realm?: string
|
|
1955
|
+
field?: string | undefined
|
|
1956
|
+
realm?: string | undefined
|
|
1954
1957
|
}
|
|
1955
1958
|
|
|
1956
1959
|
interface CompromisedCheckOptions = {
|
|
1957
|
-
endpoint?: string
|
|
1958
|
-
threshold?: number
|
|
1960
|
+
endpoint?: string | undefined
|
|
1961
|
+
threshold?: number | undefined
|
|
1959
1962
|
}
|
|
1960
1963
|
|
|
1961
1964
|
interface ConfirmPasswordOptions = {
|
|
1962
|
-
redirectTo?: string
|
|
1963
|
-
timeoutSeconds?: number
|
|
1965
|
+
redirectTo?: string | undefined
|
|
1966
|
+
timeoutSeconds?: number | undefined
|
|
1964
1967
|
}
|
|
1965
1968
|
|
|
1966
1969
|
interface EmailOtpOptions = {
|
|
1967
1970
|
deleteCode: (email: string) => Promise<void>
|
|
1968
|
-
expireMinutes?: number
|
|
1971
|
+
expireMinutes?: number | undefined
|
|
1969
1972
|
findCode: (email: string) => Promise<{ code: string; createdAt: Date;} | null>
|
|
1970
|
-
length?: number
|
|
1971
|
-
maxAttempts?: number
|
|
1973
|
+
length?: number | undefined
|
|
1974
|
+
maxAttempts?: number | undefined
|
|
1972
1975
|
sendCode: (email: string, code: string) => Promise<void>
|
|
1973
1976
|
storeCode: (email: string, hash: string, expiresAt: Date) => Promise<void>
|
|
1974
1977
|
}
|
|
@@ -1982,31 +1985,31 @@ interface Guard = {
|
|
|
1982
1985
|
}
|
|
1983
1986
|
|
|
1984
1987
|
interface GuestOptions = {
|
|
1985
|
-
redirectTo?: string
|
|
1988
|
+
redirectTo?: string | undefined
|
|
1986
1989
|
}
|
|
1987
1990
|
|
|
1988
1991
|
interface JwtGuardOptions = {
|
|
1989
|
-
header?: string
|
|
1990
|
-
resolve?: (claims: JwtPayload) => Promise<unknown> | unknown
|
|
1991
|
-
secret?: string
|
|
1992
|
+
header?: string | undefined
|
|
1993
|
+
resolve?: ((claims: JwtPayload) => Promise<unknown> | unknown) | undefined
|
|
1994
|
+
secret?: string | undefined
|
|
1992
1995
|
}
|
|
1993
1996
|
|
|
1994
1997
|
interface JwtSignOptions = {
|
|
1995
|
-
expiresIn?: number
|
|
1996
|
-
issuedAt?: number
|
|
1998
|
+
expiresIn?: number | undefined
|
|
1999
|
+
issuedAt?: number | undefined
|
|
1997
2000
|
}
|
|
1998
2001
|
|
|
1999
2002
|
interface LoginOptions = {
|
|
2000
|
-
remember?: boolean
|
|
2003
|
+
remember?: boolean | undefined
|
|
2001
2004
|
}
|
|
2002
2005
|
|
|
2003
2006
|
interface LoginThrottleOptions = {
|
|
2004
|
-
decaySeconds?: number
|
|
2005
|
-
maxAttempts?: number
|
|
2007
|
+
decaySeconds?: number | undefined
|
|
2008
|
+
maxAttempts?: number | undefined
|
|
2006
2009
|
}
|
|
2007
2010
|
|
|
2008
2011
|
interface MagicLinkBrokerOptions = {
|
|
2009
|
-
expiresInMinutes?: number
|
|
2012
|
+
expiresInMinutes?: number | undefined
|
|
2010
2013
|
findUser: (email: string) => Promise<U | null | undefined>
|
|
2011
2014
|
secret: string
|
|
2012
2015
|
sendLink: (email: string, signedUrl: string) => Promise<void>
|
|
@@ -2024,9 +2027,9 @@ interface NewToken = {
|
|
|
2024
2027
|
|
|
2025
2028
|
interface OAuth2Config = {
|
|
2026
2029
|
clientId: string
|
|
2027
|
-
clientSecret?: string
|
|
2030
|
+
clientSecret?: string | undefined
|
|
2028
2031
|
redirectUrl: string
|
|
2029
|
-
scopes?: string[]
|
|
2032
|
+
scopes?: string[] | undefined
|
|
2030
2033
|
}
|
|
2031
2034
|
|
|
2032
2035
|
interface PasskeyCredential = {
|
|
@@ -2045,11 +2048,11 @@ interface PasskeysOptions = {
|
|
|
2045
2048
|
findCredential: (credentialId: string) => Promise<PasskeyCredential | null | undefined>
|
|
2046
2049
|
findUserCredentials: (userId: number) => Promise<PasskeyCredential[]>
|
|
2047
2050
|
origin: string | string[]
|
|
2048
|
-
requireUserVerification?: boolean
|
|
2051
|
+
requireUserVerification?: boolean | undefined
|
|
2049
2052
|
rpId: string
|
|
2050
2053
|
rpName: string
|
|
2051
2054
|
saveCredential: (credential: Omit<PasskeyCredential, 'id'>) => Promise<void>
|
|
2052
|
-
timeoutSeconds?: number
|
|
2055
|
+
timeoutSeconds?: number | undefined
|
|
2053
2056
|
updateCounter: (id: number, newCounter: number) => Promise<void>
|
|
2054
2057
|
}
|
|
2055
2058
|
|
|
@@ -2061,7 +2064,7 @@ interface PasskeyUser = {
|
|
|
2061
2064
|
|
|
2062
2065
|
interface PasswordBrokerOptions = {
|
|
2063
2066
|
deleteToken: (email: string) => Promise<void>
|
|
2064
|
-
expireMinutes?: number
|
|
2067
|
+
expireMinutes?: number | undefined
|
|
2065
2068
|
findToken: (email: string) => Promise<{ token: string; createdAt: Date;} | null>
|
|
2066
2069
|
pruneTokens: (cutoff: Date) => Promise<void>
|
|
2067
2070
|
resetPassword: (email: string, newPassword: string) => Promise<void>
|
|
@@ -2078,16 +2081,16 @@ interface QrMatrix = {
|
|
|
2078
2081
|
}
|
|
2079
2082
|
|
|
2080
2083
|
interface QrSvgOptions = {
|
|
2081
|
-
alt?: string
|
|
2082
|
-
class?: string
|
|
2083
|
-
dark?: string
|
|
2084
|
-
light?: string | null
|
|
2085
|
-
quietZone?: number
|
|
2086
|
-
size?: number
|
|
2084
|
+
alt?: string | undefined
|
|
2085
|
+
class?: string | undefined
|
|
2086
|
+
dark?: string | undefined
|
|
2087
|
+
light?: string | null | undefined
|
|
2088
|
+
quietZone?: number | undefined
|
|
2089
|
+
size?: number | undefined
|
|
2087
2090
|
}
|
|
2088
2091
|
|
|
2089
2092
|
interface RememberMeOptions = {
|
|
2090
|
-
secure?: boolean
|
|
2093
|
+
secure?: boolean | undefined
|
|
2091
2094
|
}
|
|
2092
2095
|
|
|
2093
2096
|
interface SocialSession = {
|
|
@@ -2129,19 +2132,19 @@ interface TokenRow = {
|
|
|
2129
2132
|
}
|
|
2130
2133
|
|
|
2131
2134
|
interface TwoFactorOptions = {
|
|
2132
|
-
issuer?: string
|
|
2133
|
-
recoveryCodeCount?: number
|
|
2134
|
-
window?: number
|
|
2135
|
+
issuer?: string | undefined
|
|
2136
|
+
recoveryCodeCount?: number | undefined
|
|
2137
|
+
window?: number | undefined
|
|
2135
2138
|
}
|
|
2136
2139
|
|
|
2137
2140
|
interface TwoFactorQrOptions = {
|
|
2138
|
-
alt?: string
|
|
2139
|
-
class?: string
|
|
2140
|
-
dark?: string
|
|
2141
|
-
issuer?: string
|
|
2142
|
-
light?: string | null
|
|
2143
|
-
quietZone?: number
|
|
2144
|
-
size?: number
|
|
2141
|
+
alt?: string | undefined
|
|
2142
|
+
class?: string | undefined
|
|
2143
|
+
dark?: string | undefined
|
|
2144
|
+
issuer?: string | undefined
|
|
2145
|
+
light?: string | null | undefined
|
|
2146
|
+
quietZone?: number | undefined
|
|
2147
|
+
size?: number | undefined
|
|
2145
2148
|
}
|
|
2146
2149
|
|
|
2147
2150
|
interface UserModel = {
|
|
@@ -2192,7 +2195,7 @@ type MagicLinkBrokerResult = 'magic.sent' | 'magic.user_not_found' | 'magic.ok'
|
|
|
2192
2195
|
|
|
2193
2196
|
type PasswordBrokerResult = 'passwords.sent' | 'passwords.token' | 'passwords.reset'
|
|
2194
2197
|
|
|
2195
|
-
type SocialConfigShape = { [driver: string]: (OAuth2Config & Record<string, unknown>) | undefined; github?: OAuth2Config & Record<string, unknown
|
|
2198
|
+
type SocialConfigShape = { [driver: string]: (OAuth2Config & Record<string, unknown>) | undefined; github?: (OAuth2Config & Record<string, unknown>) | undefined; google?: (OAuth2Config & Record<string, unknown>) | undefined; apple?: (AppleOAuth2Config & Record<string, unknown>) | undefined; 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;}
|
|
2196
2199
|
|
|
2197
2200
|
## ./build `(./src/build.ts)`
|
|
2198
2201
|
|
|
@@ -2203,7 +2206,7 @@ function addToDefaultArrayExport = (source: string, identifier: string) => strin
|
|
|
2203
2206
|
function registerProvider = (options: RegisterProviderOptions) => Promise<RegisterResult>
|
|
2204
2207
|
|
|
2205
2208
|
interface RegisterProviderOptions = {
|
|
2206
|
-
bootstrapPath?: string
|
|
2209
|
+
bootstrapPath?: string | undefined
|
|
2207
2210
|
className: string
|
|
2208
2211
|
importPath: string
|
|
2209
2212
|
}
|
|
@@ -2357,7 +2360,7 @@ interface CacheDriver = {
|
|
|
2357
2360
|
interface IdempotencyOptions = {
|
|
2358
2361
|
cache: CacheManager | undefined
|
|
2359
2362
|
header: string
|
|
2360
|
-
lock?: LockManager
|
|
2363
|
+
lock?: LockManager | undefined
|
|
2361
2364
|
methods: string[]
|
|
2362
2365
|
ttl: number
|
|
2363
2366
|
useLock: boolean
|
|
@@ -2718,64 +2721,64 @@ function ClientConfig = (options?: Partial<ClientConfigShape>) => Partial<Client
|
|
|
2718
2721
|
function createApiClient = <Routes extends ApiRouteMap>(config?: ApiClientConfig) => ApiClient<Routes>
|
|
2719
2722
|
|
|
2720
2723
|
interface ApiClientConfig = {
|
|
2721
|
-
baseUrl?: string
|
|
2722
|
-
circuitBreaker?: CircuitBreaker | CircuitBreakerOptions
|
|
2723
|
-
csrf?: boolean | { cookie?: string; header?: string;}
|
|
2724
|
-
headers?: Record<string, string>
|
|
2725
|
-
onError?: (error: ApiClientError) => void | Promise<void>
|
|
2726
|
-
onForbidden?: (error: ApiClientError) => void | Promise<void>
|
|
2727
|
-
onRequest?: RequestInterceptor | RequestInterceptor[]
|
|
2728
|
-
onResponse?: ResponseInterceptor | ResponseInterceptor[]
|
|
2729
|
-
onUnauthorized?: (error: ApiClientError, retry: (headerOverrides?: Record<string, string>) => Promise<unknown>) => Promise<unknown> | void
|
|
2730
|
-
retry?: number | RetryOptions
|
|
2731
|
-
timeout?: number
|
|
2732
|
-
token?: TokenSource
|
|
2733
|
-
withCredentials?: boolean
|
|
2724
|
+
baseUrl?: string | undefined
|
|
2725
|
+
circuitBreaker?: CircuitBreaker | CircuitBreakerOptions | undefined
|
|
2726
|
+
csrf?: boolean | { cookie?: string; header?: string;} | undefined
|
|
2727
|
+
headers?: Record<string, string> | undefined
|
|
2728
|
+
onError?: ((error: ApiClientError) => void | Promise<void>) | undefined
|
|
2729
|
+
onForbidden?: ((error: ApiClientError) => void | Promise<void>) | undefined
|
|
2730
|
+
onRequest?: RequestInterceptor | RequestInterceptor[] | undefined
|
|
2731
|
+
onResponse?: ResponseInterceptor | ResponseInterceptor[] | undefined
|
|
2732
|
+
onUnauthorized?: ((error: ApiClientError, retry: (headerOverrides?: Record<string, string>) => Promise<unknown>) => Promise<unknown> | void) | undefined
|
|
2733
|
+
retry?: number | RetryOptions | undefined
|
|
2734
|
+
timeout?: number | undefined
|
|
2735
|
+
token?: TokenSource | undefined
|
|
2736
|
+
withCredentials?: boolean | undefined
|
|
2734
2737
|
}
|
|
2735
2738
|
|
|
2736
2739
|
interface CircuitBreakerOptions = {
|
|
2737
|
-
isFailure?: (error: unknown) => boolean
|
|
2738
|
-
resetTimeout?: number
|
|
2739
|
-
threshold?: number
|
|
2740
|
+
isFailure?: ((error: unknown) => boolean) | undefined
|
|
2741
|
+
resetTimeout?: number | undefined
|
|
2742
|
+
threshold?: number | undefined
|
|
2740
2743
|
}
|
|
2741
2744
|
|
|
2742
2745
|
interface ClientConfigShape = {
|
|
2743
|
-
baseUrl?: string
|
|
2744
|
-
circuitBreaker?: CircuitBreaker | CircuitBreakerOptions
|
|
2745
|
-
csrf?: boolean | { cookie?: string; header?: string;}
|
|
2746
|
-
headers?: Record<string, string>
|
|
2747
|
-
onError?: (error: ApiClientError) => void | Promise<void>
|
|
2748
|
-
onForbidden?: (error: ApiClientError) => void | Promise<void>
|
|
2749
|
-
onRequest?: RequestInterceptor | RequestInterceptor[]
|
|
2750
|
-
onResponse?: ResponseInterceptor | ResponseInterceptor[]
|
|
2751
|
-
onUnauthorized?: (error: ApiClientError, retry: (headerOverrides?: Record<string, string>) => Promise<unknown>) => Promise<unknown> | void
|
|
2752
|
-
retry?: number | RetryOptions
|
|
2753
|
-
timeout?: number
|
|
2754
|
-
token?: TokenSource
|
|
2755
|
-
withCredentials?: boolean
|
|
2746
|
+
baseUrl?: string | undefined
|
|
2747
|
+
circuitBreaker?: CircuitBreaker | CircuitBreakerOptions | undefined
|
|
2748
|
+
csrf?: boolean | { cookie?: string; header?: string;} | undefined
|
|
2749
|
+
headers?: Record<string, string> | undefined
|
|
2750
|
+
onError?: ((error: ApiClientError) => void | Promise<void>) | undefined
|
|
2751
|
+
onForbidden?: ((error: ApiClientError) => void | Promise<void>) | undefined
|
|
2752
|
+
onRequest?: RequestInterceptor | RequestInterceptor[] | undefined
|
|
2753
|
+
onResponse?: ResponseInterceptor | ResponseInterceptor[] | undefined
|
|
2754
|
+
onUnauthorized?: ((error: ApiClientError, retry: (headerOverrides?: Record<string, string>) => Promise<unknown>) => Promise<unknown> | void) | undefined
|
|
2755
|
+
retry?: number | RetryOptions | undefined
|
|
2756
|
+
timeout?: number | undefined
|
|
2757
|
+
token?: TokenSource | undefined
|
|
2758
|
+
withCredentials?: boolean | undefined
|
|
2756
2759
|
}
|
|
2757
2760
|
|
|
2758
2761
|
interface GetOptions = {
|
|
2759
|
-
headers?: Record<string, string>
|
|
2760
|
-
init?: Omit<RequestInit, 'method' | 'headers' | 'body'>
|
|
2761
|
-
meta?: (meta: ResponseMeta) => void
|
|
2762
|
-
query?: Q
|
|
2763
|
-
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer'
|
|
2764
|
-
retry?: number | false | RetryOptions
|
|
2765
|
-
signal?: AbortSignal
|
|
2766
|
-
timeout?: number
|
|
2762
|
+
headers?: Record<string, string> | undefined
|
|
2763
|
+
init?: Omit<RequestInit, 'method' | 'headers' | 'body'> | undefined
|
|
2764
|
+
meta?: ((meta: ResponseMeta) => void) | undefined
|
|
2765
|
+
query?: Q | undefined
|
|
2766
|
+
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer' | undefined
|
|
2767
|
+
retry?: number | false | RetryOptions | undefined
|
|
2768
|
+
signal?: AbortSignal | undefined
|
|
2769
|
+
timeout?: number | undefined
|
|
2767
2770
|
}
|
|
2768
2771
|
|
|
2769
2772
|
interface MutationOptions = {
|
|
2770
|
-
headers?: Record<string, string>
|
|
2771
|
-
init?: Omit<RequestInit, 'method' | 'headers' | 'body'>
|
|
2772
|
-
meta?: (meta: ResponseMeta) => void
|
|
2773
|
-
params?: Record<string, string | number>
|
|
2774
|
-
query?: Q
|
|
2775
|
-
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer'
|
|
2776
|
-
retry?: number | false | RetryOptions
|
|
2777
|
-
signal?: AbortSignal
|
|
2778
|
-
timeout?: number
|
|
2773
|
+
headers?: Record<string, string> | undefined
|
|
2774
|
+
init?: Omit<RequestInit, 'method' | 'headers' | 'body'> | undefined
|
|
2775
|
+
meta?: ((meta: ResponseMeta) => void) | undefined
|
|
2776
|
+
params?: Record<string, string | number> | undefined
|
|
2777
|
+
query?: Q | undefined
|
|
2778
|
+
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer' | undefined
|
|
2779
|
+
retry?: number | false | RetryOptions | undefined
|
|
2780
|
+
signal?: AbortSignal | undefined
|
|
2781
|
+
timeout?: number | undefined
|
|
2779
2782
|
}
|
|
2780
2783
|
|
|
2781
2784
|
interface PresenceMember = {
|
|
@@ -2791,13 +2794,13 @@ interface RequestConfig = {
|
|
|
2791
2794
|
}
|
|
2792
2795
|
|
|
2793
2796
|
interface RequestOptions = {
|
|
2794
|
-
headers?: Record<string, string>
|
|
2795
|
-
init?: Omit<RequestInit, 'method' | 'headers' | 'body'>
|
|
2796
|
-
meta?: (meta: ResponseMeta) => void
|
|
2797
|
-
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer'
|
|
2798
|
-
retry?: number | false | RetryOptions
|
|
2799
|
-
signal?: AbortSignal
|
|
2800
|
-
timeout?: number
|
|
2797
|
+
headers?: Record<string, string> | undefined
|
|
2798
|
+
init?: Omit<RequestInit, 'method' | 'headers' | 'body'> | undefined
|
|
2799
|
+
meta?: ((meta: ResponseMeta) => void) | undefined
|
|
2800
|
+
responseType?: 'text' | 'json' | 'auto' | 'blob' | 'arrayBuffer' | undefined
|
|
2801
|
+
retry?: number | false | RetryOptions | undefined
|
|
2802
|
+
signal?: AbortSignal | undefined
|
|
2803
|
+
timeout?: number | undefined
|
|
2801
2804
|
}
|
|
2802
2805
|
|
|
2803
2806
|
interface ResponseContext = {
|
|
@@ -2813,11 +2816,11 @@ interface ResponseMeta = {
|
|
|
2813
2816
|
}
|
|
2814
2817
|
|
|
2815
2818
|
interface RetryOptions = {
|
|
2816
|
-
attempts?: number
|
|
2817
|
-
backoff?: (attempt: number, retryAfterMs: number | null) => number
|
|
2818
|
-
methods?: string[]
|
|
2819
|
-
respectRetryAfter?: boolean
|
|
2820
|
-
statuses?: number[]
|
|
2819
|
+
attempts?: number | undefined
|
|
2820
|
+
backoff?: ((attempt: number, retryAfterMs: number | null) => number) | undefined
|
|
2821
|
+
methods?: string[] | undefined
|
|
2822
|
+
respectRetryAfter?: boolean | undefined
|
|
2823
|
+
statuses?: number[] | undefined
|
|
2821
2824
|
}
|
|
2822
2825
|
|
|
2823
2826
|
interface RouteShape = {
|
|
@@ -2838,20 +2841,20 @@ interface SocketLike = {
|
|
|
2838
2841
|
}
|
|
2839
2842
|
|
|
2840
2843
|
interface SocketOptions = {
|
|
2841
|
-
WebSocket?: new (url: string) => SocketLike
|
|
2842
|
-
auth?: { params?: Record<string, string>; headers?: Record<string, string>;}
|
|
2843
|
-
authEndpoint?: string | false
|
|
2844
|
-
autoConnect?: boolean
|
|
2845
|
-
fetch?: typeof fetch
|
|
2846
|
-
host?: string
|
|
2847
|
-
maxReconnectDelay?: number
|
|
2848
|
-
path?: string
|
|
2849
|
-
pingInterval?: number
|
|
2850
|
-
port?: string | number
|
|
2851
|
-
reconnect?: boolean
|
|
2852
|
-
reconnectDelay?: number
|
|
2853
|
-
scheme?: 'ws' | 'wss'
|
|
2854
|
-
url?: string
|
|
2844
|
+
WebSocket?: (new (url: string) => SocketLike) | undefined
|
|
2845
|
+
auth?: { params?: Record<string, string>; headers?: Record<string, string>;} | undefined
|
|
2846
|
+
authEndpoint?: string | false | undefined
|
|
2847
|
+
autoConnect?: boolean | undefined
|
|
2848
|
+
fetch?: typeof fetch | undefined
|
|
2849
|
+
host?: string | undefined
|
|
2850
|
+
maxReconnectDelay?: number | undefined
|
|
2851
|
+
path?: string | undefined
|
|
2852
|
+
pingInterval?: number | undefined
|
|
2853
|
+
port?: string | number | undefined
|
|
2854
|
+
reconnect?: boolean | undefined
|
|
2855
|
+
reconnectDelay?: number | undefined
|
|
2856
|
+
scheme?: 'ws' | 'wss' | undefined
|
|
2857
|
+
url?: string | undefined
|
|
2855
2858
|
}
|
|
2856
2859
|
|
|
2857
2860
|
type ApiRouteMap = { [x: `GET ${string}`]: RouteShape | undefined; [x: `POST ${string}`]: RouteShape | undefined; [x: `PUT ${string}`]: RouteShape | undefined; [x: `PATCH ${string}`]: RouteShape | undefined; [x: `DELETE ${string}`]: RouteShape | undefined;}
|
|
@@ -2910,6 +2913,34 @@ class AssetsBuildCommand = {
|
|
|
2910
2913
|
write: (msg: string) => void
|
|
2911
2914
|
}
|
|
2912
2915
|
|
|
2916
|
+
class AssetsPruneCommand = {
|
|
2917
|
+
new (): AssetsPruneCommand
|
|
2918
|
+
static args: ArgDef[]
|
|
2919
|
+
static commandName: string
|
|
2920
|
+
static description: string
|
|
2921
|
+
static flags: ({ name: string; type: 'string'; description: string; default?: never;} | { name: string; type: 'boolean'; description: string; default: boolean;})[]
|
|
2922
|
+
static needsApp: boolean
|
|
2923
|
+
_readLine: () => Promise<string>
|
|
2924
|
+
_writer: OutputWriter
|
|
2925
|
+
app: unknown
|
|
2926
|
+
args: Record<string, string>
|
|
2927
|
+
ask: (question: string, defaultValue?: string) => Promise<string>
|
|
2928
|
+
choice: (question: string, options: string[]) => Promise<string>
|
|
2929
|
+
confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
|
|
2930
|
+
dim: (msg: string) => void
|
|
2931
|
+
error: (msg: string) => void
|
|
2932
|
+
flags: Record<string, string | number | boolean>
|
|
2933
|
+
info: (msg: string) => void
|
|
2934
|
+
line: (msg: string) => void
|
|
2935
|
+
newLine: () => void
|
|
2936
|
+
run: () => Promise<void>
|
|
2937
|
+
secret: (question: string) => Promise<string>
|
|
2938
|
+
section: (title: string) => void
|
|
2939
|
+
table: (rows: [string, string][], indent?: number) => void
|
|
2940
|
+
warn: (msg: string) => void
|
|
2941
|
+
write: (msg: string) => void
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2913
2944
|
class CompileCommand = {
|
|
2914
2945
|
new (): CompileCommand
|
|
2915
2946
|
static args: ArgDef[]
|
|
@@ -3797,7 +3828,7 @@ function DeployConfig = (options?: Partial<DeployConfigShape>) => DeployConfigSh
|
|
|
3797
3828
|
|
|
3798
3829
|
interface AppAssetsConfig = {
|
|
3799
3830
|
entrypoint: string | string[]
|
|
3800
|
-
loader?: Record<string, AssetLoaderKind>
|
|
3831
|
+
loader?: Record<string, AssetLoaderKind> | undefined
|
|
3801
3832
|
minify: boolean
|
|
3802
3833
|
outDir: string
|
|
3803
3834
|
prefix: string
|
|
@@ -3805,11 +3836,11 @@ interface AppAssetsConfig = {
|
|
|
3805
3836
|
|
|
3806
3837
|
interface AppConfigShape = {
|
|
3807
3838
|
allowedOrigins: string[]
|
|
3808
|
-
assets?: AppAssetsConfig
|
|
3839
|
+
assets?: AppAssetsConfig | undefined
|
|
3809
3840
|
conventions: ConventionsConfig
|
|
3810
3841
|
cors: AppCorsConfig
|
|
3811
3842
|
debug: boolean
|
|
3812
|
-
dev?: DevConfigShape
|
|
3843
|
+
dev?: DevConfigShape | undefined
|
|
3813
3844
|
env: string
|
|
3814
3845
|
health: boolean | HealthConfigShape
|
|
3815
3846
|
http3: boolean
|
|
@@ -3821,7 +3852,7 @@ interface AppConfigShape = {
|
|
|
3821
3852
|
secureHeaders: AppSecureHeadersConfig
|
|
3822
3853
|
throttle: AppThrottleConfig
|
|
3823
3854
|
timezone: string
|
|
3824
|
-
tls?: AppTlsConfig
|
|
3855
|
+
tls?: AppTlsConfig | undefined
|
|
3825
3856
|
url: string
|
|
3826
3857
|
}
|
|
3827
3858
|
|
|
@@ -3976,10 +4007,10 @@ interface HealthCheckReport = {
|
|
|
3976
4007
|
}
|
|
3977
4008
|
|
|
3978
4009
|
interface HealthConfigShape = {
|
|
3979
|
-
enabled?: boolean
|
|
3980
|
-
path?: string
|
|
3981
|
-
secret?: string
|
|
3982
|
-
showDetails?: boolean
|
|
4010
|
+
enabled?: boolean | undefined
|
|
4011
|
+
path?: string | undefined
|
|
4012
|
+
secret?: string | undefined
|
|
4013
|
+
showDetails?: boolean | undefined
|
|
3983
4014
|
}
|
|
3984
4015
|
|
|
3985
4016
|
interface HealthReport = {
|
|
@@ -3999,7 +4030,7 @@ interface HealthResult = {
|
|
|
3999
4030
|
interface ResolvedHealthConfig = {
|
|
4000
4031
|
enabled: boolean
|
|
4001
4032
|
path: string
|
|
4002
|
-
secret?: string
|
|
4033
|
+
secret?: string | undefined
|
|
4003
4034
|
showDetails: boolean
|
|
4004
4035
|
}
|
|
4005
4036
|
|
|
@@ -4017,6 +4048,8 @@ function data_get = (target: unknown, key: string, defaultValue?: unknown) => un
|
|
|
4017
4048
|
|
|
4018
4049
|
function deepMerge = <T extends object>(base: T, override: DeepPartial<T>) => T
|
|
4019
4050
|
|
|
4051
|
+
function definedOnly = <T extends object>(value: T) => { [K in keyof T]?: Exclude<T[K], undefined>; }
|
|
4052
|
+
|
|
4020
4053
|
function env = { (key: string): string | undefined; (key: string, fallback: string): string; (key: string, fallback: boolean): boolean; (key: string, fallback: number): number;}
|
|
4021
4054
|
|
|
4022
4055
|
function pipe = <T, R>(value: T, fn: (val: T) => R) => R
|
|
@@ -4041,6 +4074,8 @@ function tap = <T>(value: T, callback: (val: T) => void) => T
|
|
|
4041
4074
|
|
|
4042
4075
|
function tapAsync = <T>(value: T, callback: (val: T) => Promise<void>) => Promise<T>
|
|
4043
4076
|
|
|
4077
|
+
type Resolved = { [K in keyof T]-?: Exclude<T[K], undefined>; }
|
|
4078
|
+
|
|
4044
4079
|
## ./http `(./src/http.ts)`
|
|
4045
4080
|
|
|
4046
4081
|
class Http = {
|
|
@@ -4199,8 +4234,8 @@ interface CliContext = {
|
|
|
4199
4234
|
}
|
|
4200
4235
|
|
|
4201
4236
|
interface FileValidationOptions = {
|
|
4202
|
-
maxSize?: number
|
|
4203
|
-
mimes?: string[]
|
|
4237
|
+
maxSize?: number | undefined
|
|
4238
|
+
mimes?: string[] | undefined
|
|
4204
4239
|
}
|
|
4205
4240
|
|
|
4206
4241
|
interface NegotiateMap = {
|
|
@@ -4352,10 +4387,10 @@ class SqliteLockDriver = {
|
|
|
4352
4387
|
function LockConfig = (options?: Partial<LockConfigShape>) => LockConfigShape
|
|
4353
4388
|
|
|
4354
4389
|
interface BlockOptions = {
|
|
4355
|
-
refresh?: boolean
|
|
4356
|
-
refreshEvery?: number
|
|
4357
|
-
retryDelay?: number
|
|
4358
|
-
timeout?: number
|
|
4390
|
+
refresh?: boolean | undefined
|
|
4391
|
+
refreshEvery?: number | undefined
|
|
4392
|
+
retryDelay?: number | undefined
|
|
4393
|
+
timeout?: number | undefined
|
|
4359
4394
|
}
|
|
4360
4395
|
|
|
4361
4396
|
interface LockConfigShape = {
|
|
@@ -4374,8 +4409,8 @@ interface LockDriver = {
|
|
|
4374
4409
|
}
|
|
4375
4410
|
|
|
4376
4411
|
interface RefreshOptions = {
|
|
4377
|
-
refresh?: boolean
|
|
4378
|
-
refreshEvery?: number
|
|
4412
|
+
refresh?: boolean | undefined
|
|
4413
|
+
refreshEvery?: number | undefined
|
|
4379
4414
|
}
|
|
4380
4415
|
|
|
4381
4416
|
type LockedCallback = (lock: ManagedLock, signal: AbortSignal) => Promise<T> | T
|
|
@@ -4490,16 +4525,16 @@ interface LogEntry = {
|
|
|
4490
4525
|
}
|
|
4491
4526
|
|
|
4492
4527
|
interface LoggerOptions = {
|
|
4493
|
-
format?: 'text' | 'json'
|
|
4528
|
+
format?: 'text' | 'json' | undefined
|
|
4494
4529
|
}
|
|
4495
4530
|
|
|
4496
4531
|
interface LoggingConfigShape = {
|
|
4497
4532
|
channels: Record<string, ChannelConfig>
|
|
4498
|
-
console?: ConsoleSinkConfig
|
|
4533
|
+
console?: ConsoleSinkConfig | undefined
|
|
4499
4534
|
default: string
|
|
4500
|
-
file?: FileSinkConfig
|
|
4501
|
-
requests?: boolean
|
|
4502
|
-
slowQueryMs?: number
|
|
4535
|
+
file?: FileSinkConfig | undefined
|
|
4536
|
+
requests?: boolean | undefined
|
|
4537
|
+
slowQueryMs?: number | undefined
|
|
4503
4538
|
}
|
|
4504
4539
|
|
|
4505
4540
|
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' }
|
|
@@ -5743,14 +5778,14 @@ interface CastField = {
|
|
|
5743
5778
|
}
|
|
5744
5779
|
|
|
5745
5780
|
interface ColumnOptions = {
|
|
5746
|
-
cast?: 'boolean' | 'date' | 'datetime' | 'array' | 'integer' | 'json' | 'float' | 'enum' | 'immutable_datetime' | 'encrypted' | 'encrypted:json' | `decimal:${number}` | { get?: (dbValue: unknown) => unknown; set?: (jsValue: unknown) => unknown;} | CastContract<unknown>
|
|
5781
|
+
cast?: 'boolean' | 'date' | 'datetime' | 'array' | 'integer' | 'json' | 'float' | 'enum' | 'immutable_datetime' | 'encrypted' | 'encrypted:json' | `decimal:${number}` | { get?: (dbValue: unknown) => unknown; set?: (jsValue: unknown) => unknown;} | CastContract<unknown> | undefined
|
|
5747
5782
|
default?: unknown
|
|
5748
|
-
enumValues?: Record<string, string | number>
|
|
5749
|
-
index?: boolean
|
|
5750
|
-
nullable?: boolean
|
|
5751
|
-
primary?: boolean
|
|
5752
|
-
type?: 'string' | 'number' | 'boolean' | 'text' | 'datetime' | 'json'
|
|
5753
|
-
unique?: boolean
|
|
5783
|
+
enumValues?: Record<string, string | number> | undefined
|
|
5784
|
+
index?: boolean | undefined
|
|
5785
|
+
nullable?: boolean | undefined
|
|
5786
|
+
primary?: boolean | undefined
|
|
5787
|
+
type?: 'string' | 'number' | 'boolean' | 'text' | 'datetime' | 'json' | undefined
|
|
5788
|
+
unique?: boolean | undefined
|
|
5754
5789
|
}
|
|
5755
5790
|
|
|
5756
5791
|
interface Compose = {
|
|
@@ -5773,10 +5808,10 @@ interface CursorPaginateResult = {
|
|
|
5773
5808
|
|
|
5774
5809
|
interface DatabaseConfigShape = {
|
|
5775
5810
|
driver: 'sqlite' | 'postgres' | 'mysql'
|
|
5776
|
-
pool?: { max?: number; idleTimeout?: number;}
|
|
5777
|
-
replicas?: string[]
|
|
5811
|
+
pool?: { max?: number; idleTimeout?: number;} | undefined
|
|
5812
|
+
replicas?: string[] | undefined
|
|
5778
5813
|
sqlite: { path: string;}
|
|
5779
|
-
synchronize?: boolean | { enabled: boolean; disruptive?: boolean;}
|
|
5814
|
+
synchronize?: boolean | { enabled: boolean; disruptive?: boolean;} | undefined
|
|
5780
5815
|
url: string
|
|
5781
5816
|
}
|
|
5782
5817
|
|
|
@@ -5787,9 +5822,9 @@ interface HasMany = {
|
|
|
5787
5822
|
|
|
5788
5823
|
interface HasManyThroughOptions = {
|
|
5789
5824
|
firstKey: string
|
|
5790
|
-
localKey?: string
|
|
5825
|
+
localKey?: string | undefined
|
|
5791
5826
|
secondKey: string
|
|
5792
|
-
throughLocalKey?: string
|
|
5827
|
+
throughLocalKey?: string | undefined
|
|
5793
5828
|
}
|
|
5794
5829
|
|
|
5795
5830
|
interface HasOne = {
|
|
@@ -5798,10 +5833,10 @@ interface HasOne = {
|
|
|
5798
5833
|
}
|
|
5799
5834
|
|
|
5800
5835
|
interface KeysetOptions = {
|
|
5801
|
-
column?: string
|
|
5802
|
-
cursor?: string | null
|
|
5803
|
-
direction?: 'asc' | 'desc'
|
|
5804
|
-
limit?: number
|
|
5836
|
+
column?: string | undefined
|
|
5837
|
+
cursor?: string | null | undefined
|
|
5838
|
+
direction?: 'asc' | 'desc' | undefined
|
|
5839
|
+
limit?: number | undefined
|
|
5805
5840
|
}
|
|
5806
5841
|
|
|
5807
5842
|
interface KeysetPaginateResult = {
|
|
@@ -5827,13 +5862,13 @@ interface ManyToMany = {
|
|
|
5827
5862
|
}
|
|
5828
5863
|
|
|
5829
5864
|
interface ManyToManyOptions = {
|
|
5830
|
-
localKey?: string
|
|
5865
|
+
localKey?: string | undefined
|
|
5831
5866
|
pivotForeignKey: string
|
|
5832
5867
|
pivotRelatedKey: string
|
|
5833
5868
|
pivotTable: string
|
|
5834
|
-
relatedKey?: string
|
|
5835
|
-
withPivot?: string[]
|
|
5836
|
-
withTimestamps?: boolean
|
|
5869
|
+
relatedKey?: string | undefined
|
|
5870
|
+
withPivot?: string[] | undefined
|
|
5871
|
+
withTimestamps?: boolean | undefined
|
|
5837
5872
|
}
|
|
5838
5873
|
|
|
5839
5874
|
interface MigrationEntry = {
|
|
@@ -5868,9 +5903,9 @@ interface ModelObserver = {
|
|
|
5868
5903
|
interface MorphedByManyOptions = {
|
|
5869
5904
|
morphName: string
|
|
5870
5905
|
parentPivotKey: string
|
|
5871
|
-
pivotTable?: string
|
|
5872
|
-
withPivot?: string[]
|
|
5873
|
-
withTimestamps?: boolean
|
|
5906
|
+
pivotTable?: string | undefined
|
|
5907
|
+
withPivot?: string[] | undefined
|
|
5908
|
+
withTimestamps?: boolean | undefined
|
|
5874
5909
|
}
|
|
5875
5910
|
|
|
5876
5911
|
interface MorphMany = {
|
|
@@ -5879,7 +5914,7 @@ interface MorphMany = {
|
|
|
5879
5914
|
}
|
|
5880
5915
|
|
|
5881
5916
|
interface MorphManyOptions = {
|
|
5882
|
-
localKey?: string
|
|
5917
|
+
localKey?: string | undefined
|
|
5883
5918
|
morphName: string
|
|
5884
5919
|
}
|
|
5885
5920
|
|
|
@@ -5889,7 +5924,7 @@ interface MorphOne = {
|
|
|
5889
5924
|
}
|
|
5890
5925
|
|
|
5891
5926
|
interface MorphOneOptions = {
|
|
5892
|
-
localKey?: string
|
|
5927
|
+
localKey?: string | undefined
|
|
5893
5928
|
morphName: string
|
|
5894
5929
|
}
|
|
5895
5930
|
|
|
@@ -5900,21 +5935,21 @@ interface MorphTo = {
|
|
|
5900
5935
|
|
|
5901
5936
|
interface MorphToManyOptions = {
|
|
5902
5937
|
morphName: string
|
|
5903
|
-
pivotTable?: string
|
|
5938
|
+
pivotTable?: string | undefined
|
|
5904
5939
|
relatedPivotKey: string
|
|
5905
|
-
withPivot?: string[]
|
|
5906
|
-
withTimestamps?: boolean
|
|
5940
|
+
withPivot?: string[] | undefined
|
|
5941
|
+
withTimestamps?: boolean | undefined
|
|
5907
5942
|
}
|
|
5908
5943
|
|
|
5909
5944
|
interface MorphToOptions = {
|
|
5910
|
-
morphForeignKey?: string
|
|
5945
|
+
morphForeignKey?: string | undefined
|
|
5911
5946
|
morphMap: Record<string, () => unknown>
|
|
5912
|
-
morphTypeColumn?: string
|
|
5947
|
+
morphTypeColumn?: string | undefined
|
|
5913
5948
|
}
|
|
5914
5949
|
|
|
5915
5950
|
interface NPlusOneOptions = {
|
|
5916
|
-
mode?: 'warn' | 'throw'
|
|
5917
|
-
threshold?: number
|
|
5951
|
+
mode?: 'warn' | 'throw' | undefined
|
|
5952
|
+
threshold?: number | undefined
|
|
5918
5953
|
}
|
|
5919
5954
|
|
|
5920
5955
|
interface PaginateMeta = {
|
|
@@ -6004,8 +6039,8 @@ interface TableDecoratorBuilder = {
|
|
|
6004
6039
|
}
|
|
6005
6040
|
|
|
6006
6041
|
interface TableOptions = {
|
|
6007
|
-
primaryKey?: string
|
|
6008
|
-
timestamps?: boolean
|
|
6042
|
+
primaryKey?: string | undefined
|
|
6043
|
+
timestamps?: boolean | undefined
|
|
6009
6044
|
}
|
|
6010
6045
|
|
|
6011
6046
|
interface TransitionContext = {
|
|
@@ -6317,7 +6352,7 @@ interface QueueConfigShape = {
|
|
|
6317
6352
|
driver: 'sqlite' | 'redis' | 'sync'
|
|
6318
6353
|
pollInterval: number
|
|
6319
6354
|
queues: string[]
|
|
6320
|
-
workerBootstrap?: string
|
|
6355
|
+
workerBootstrap?: string | undefined
|
|
6321
6356
|
workers: number
|
|
6322
6357
|
}
|
|
6323
6358
|
|
|
@@ -6392,6 +6427,38 @@ type RouteTable = Readonly<Record<string, string>> | ReadonlyMap<string, string>
|
|
|
6392
6427
|
|
|
6393
6428
|
type RouteTarget = string
|
|
6394
6429
|
|
|
6430
|
+
## ./runtime `(./src/runtime.ts)`
|
|
6431
|
+
|
|
6432
|
+
const RUNTIME_MISMATCH_ESCAPE = 'ZT_ALLOW_RUNTIME_MISMATCH'
|
|
6433
|
+
|
|
6434
|
+
function bunBinary = () => string
|
|
6435
|
+
|
|
6436
|
+
function declaredBunFloor = (cwd: string) => { range: string; manifest: string;} | null
|
|
6437
|
+
|
|
6438
|
+
function installedBunVersion = (cwd: string) => { version: string; manifest: string;} | null
|
|
6439
|
+
|
|
6440
|
+
function runtimeBelowFloor = (cwd?: string) => RuntimeFloor | null
|
|
6441
|
+
|
|
6442
|
+
function runtimeBelowFloorMessage = (floor: RuntimeFloor) => string
|
|
6443
|
+
|
|
6444
|
+
function runtimeMismatch = (cwd?: string) => RuntimeMismatch | null
|
|
6445
|
+
|
|
6446
|
+
function runtimeMismatchAllowed = () => boolean
|
|
6447
|
+
|
|
6448
|
+
function runtimeMismatchMessage = (mismatch: RuntimeMismatch) => string
|
|
6449
|
+
|
|
6450
|
+
interface RuntimeFloor = {
|
|
6451
|
+
manifest: string
|
|
6452
|
+
required: string
|
|
6453
|
+
running: string
|
|
6454
|
+
}
|
|
6455
|
+
|
|
6456
|
+
interface RuntimeMismatch = {
|
|
6457
|
+
installed: string
|
|
6458
|
+
manifest: string
|
|
6459
|
+
running: string
|
|
6460
|
+
}
|
|
6461
|
+
|
|
6395
6462
|
## ./scheduler `(./src/scheduler.ts)`
|
|
6396
6463
|
|
|
6397
6464
|
class CronExpression = {
|
|
@@ -6399,10 +6466,12 @@ class CronExpression = {
|
|
|
6399
6466
|
static describe: (expression: string) => string
|
|
6400
6467
|
static isValid: (expression: string) => boolean
|
|
6401
6468
|
static nextRunAfter: (expression: string, from?: Date) => Date | null
|
|
6469
|
+
static nextRunAfterIn: (expression: string, from: Date, timeZone: string) => Date | null
|
|
6402
6470
|
static readonly SEARCH_HORIZON_DAYS: number
|
|
6403
6471
|
dayOfMonth: (v: number | string) => CronExpression
|
|
6404
6472
|
hour: (v: number | string) => CronExpression
|
|
6405
6473
|
matches: (date?: Date) => boolean
|
|
6474
|
+
matchesIn: (date: Date, timeZone: string) => boolean
|
|
6406
6475
|
minute: (v: number | string) => CronExpression
|
|
6407
6476
|
month: (v: number | string) => CronExpression
|
|
6408
6477
|
nextRun: (from?: Date) => Date | null
|
|
@@ -6510,6 +6579,13 @@ class SchedulerBuilder = {
|
|
|
6510
6579
|
yearlyOn: (month?: number, dayOfMonth?: number, time?: string) => ScheduledTask
|
|
6511
6580
|
}
|
|
6512
6581
|
|
|
6582
|
+
class SchedulerError = {
|
|
6583
|
+
new (message: string, code?: string, status?: number, context?: Record<string, unknown>): SchedulerError
|
|
6584
|
+
readonly code: string
|
|
6585
|
+
readonly context?: Record<string, unknown> | undefined
|
|
6586
|
+
readonly status: number
|
|
6587
|
+
}
|
|
6588
|
+
|
|
6513
6589
|
class SchedulerManager = {
|
|
6514
6590
|
new (): SchedulerManager
|
|
6515
6591
|
add: (name: string, cronExpression: string, callback: TaskCallback) => ScheduledTask
|
|
@@ -6561,14 +6637,25 @@ class TaskSkipped = {
|
|
|
6561
6637
|
readonly reason: 'lock' | 'window' | 'env' | 'when' | 'skip' | 'overlap'
|
|
6562
6638
|
}
|
|
6563
6639
|
|
|
6640
|
+
class UnknownTimeZoneError = {
|
|
6641
|
+
new (task: string, timezone: string): UnknownTimeZoneError
|
|
6642
|
+
readonly code: string
|
|
6643
|
+
readonly context?: Record<string, unknown> | undefined
|
|
6644
|
+
readonly status: number
|
|
6645
|
+
}
|
|
6646
|
+
|
|
6564
6647
|
const Scheduler = SchedulerManager
|
|
6565
6648
|
|
|
6649
|
+
function isValidTimeZone = (timeZone: string) => boolean
|
|
6650
|
+
|
|
6566
6651
|
function SchedulerConfig = (options?: Partial<SchedulerConfigShape>) => SchedulerConfigShape
|
|
6567
6652
|
|
|
6653
|
+
function wallClockIn = (date: Date, timeZone: string) => Date
|
|
6654
|
+
|
|
6568
6655
|
interface OverlapLockOptions = {
|
|
6569
|
-
crossProcess?: boolean
|
|
6570
|
-
expiresAfterMinutes?: number
|
|
6571
|
-
refresh?: boolean
|
|
6656
|
+
crossProcess?: boolean | undefined
|
|
6657
|
+
expiresAfterMinutes?: number | undefined
|
|
6658
|
+
refresh?: boolean | undefined
|
|
6572
6659
|
}
|
|
6573
6660
|
|
|
6574
6661
|
interface RunLogConfig = {
|
|
@@ -6635,7 +6722,7 @@ function redactGraph = (value: unknown, options: RedactGraphOptions) => unknown
|
|
|
6635
6722
|
|
|
6636
6723
|
interface RedactGraphOptions = {
|
|
6637
6724
|
circular: string
|
|
6638
|
-
flatten?: (value: unknown) => string | undefined
|
|
6725
|
+
flatten?: ((value: unknown) => string | undefined) | undefined
|
|
6639
6726
|
mask: string
|
|
6640
6727
|
maxDepth: number
|
|
6641
6728
|
sensitive: (key: string) => boolean
|
|
@@ -6774,7 +6861,7 @@ const Session = SessionAccessor
|
|
|
6774
6861
|
function SessionConfig = (options?: Partial<SessionConfigShape>) => SessionConfigShape
|
|
6775
6862
|
|
|
6776
6863
|
interface CsrfOptions = {
|
|
6777
|
-
secure?: boolean
|
|
6864
|
+
secure?: boolean | undefined
|
|
6778
6865
|
}
|
|
6779
6866
|
|
|
6780
6867
|
interface SessionConfigShape = {
|
|
@@ -6794,7 +6881,7 @@ interface SessionDriver = {
|
|
|
6794
6881
|
}
|
|
6795
6882
|
|
|
6796
6883
|
interface SessionOptions = {
|
|
6797
|
-
driver?: SessionDriver
|
|
6884
|
+
driver?: SessionDriver | undefined
|
|
6798
6885
|
}
|
|
6799
6886
|
|
|
6800
6887
|
interface SessionPayload = {
|
|
@@ -6823,27 +6910,27 @@ function snakeCase = (value: string) => string
|
|
|
6823
6910
|
function tableNameFor = (className: string) => string
|
|
6824
6911
|
|
|
6825
6912
|
interface DateOptions = {
|
|
6826
|
-
dateStyle?: 'medium' | 'short' | 'full' | 'long'
|
|
6827
|
-
locale?: string
|
|
6828
|
-
timeStyle?: 'medium' | 'short' | 'full' | 'long'
|
|
6829
|
-
timeZone?: string
|
|
6913
|
+
dateStyle?: 'medium' | 'short' | 'full' | 'long' | undefined
|
|
6914
|
+
locale?: string | undefined
|
|
6915
|
+
timeStyle?: 'medium' | 'short' | 'full' | 'long' | undefined
|
|
6916
|
+
timeZone?: string | undefined
|
|
6830
6917
|
}
|
|
6831
6918
|
|
|
6832
6919
|
interface FormatOptions = {
|
|
6833
|
-
locale?: string
|
|
6920
|
+
locale?: string | undefined
|
|
6834
6921
|
}
|
|
6835
6922
|
|
|
6836
6923
|
interface MoneyOptions = {
|
|
6837
6924
|
currency: string
|
|
6838
|
-
fractionDigits?: number
|
|
6839
|
-
locale?: string
|
|
6840
|
-
minorUnits?: boolean
|
|
6925
|
+
fractionDigits?: number | undefined
|
|
6926
|
+
locale?: string | undefined
|
|
6927
|
+
minorUnits?: boolean | undefined
|
|
6841
6928
|
}
|
|
6842
6929
|
|
|
6843
6930
|
interface NumberOptions = {
|
|
6844
|
-
locale?: string
|
|
6845
|
-
maximumFractionDigits?: number
|
|
6846
|
-
minimumFractionDigits?: number
|
|
6931
|
+
locale?: string | undefined
|
|
6932
|
+
maximumFractionDigits?: number | undefined
|
|
6933
|
+
minimumFractionDigits?: number | undefined
|
|
6847
6934
|
}
|
|
6848
6935
|
|
|
6849
6936
|
## ./storage `(./src/storage.ts)`
|
|
@@ -7010,10 +7097,10 @@ const Storage = StorageManager
|
|
|
7010
7097
|
function StorageConfig = (options?: Partial<StorageConfigShape>) => StorageConfigShape
|
|
7011
7098
|
|
|
7012
7099
|
interface DiskServeConfig = {
|
|
7013
|
-
expiresIn?: number
|
|
7014
|
-
headers?: Record<string, string>
|
|
7100
|
+
expiresIn?: number | undefined
|
|
7101
|
+
headers?: Record<string, string> | undefined
|
|
7015
7102
|
path: string
|
|
7016
|
-
signed?: boolean
|
|
7103
|
+
signed?: boolean | undefined
|
|
7017
7104
|
}
|
|
7018
7105
|
|
|
7019
7106
|
interface FakeStoredFile = {
|
|
@@ -7027,24 +7114,24 @@ interface FakeStoredFile = {
|
|
|
7027
7114
|
interface LocalDiskConfig = {
|
|
7028
7115
|
driver: 'local'
|
|
7029
7116
|
root: string
|
|
7030
|
-
serve?: DiskServeConfig
|
|
7031
|
-
url?: string
|
|
7117
|
+
serve?: DiskServeConfig | undefined
|
|
7118
|
+
url?: string | undefined
|
|
7032
7119
|
}
|
|
7033
7120
|
|
|
7034
7121
|
interface PutOptions = {
|
|
7035
|
-
contentType?: string
|
|
7036
|
-
visibility?: 'public' | 'private'
|
|
7122
|
+
contentType?: string | undefined
|
|
7123
|
+
visibility?: 'public' | 'private' | undefined
|
|
7037
7124
|
}
|
|
7038
7125
|
|
|
7039
7126
|
interface S3DiskConfig = {
|
|
7040
7127
|
bucket: string
|
|
7041
7128
|
driver: 's3'
|
|
7042
|
-
endpoint?: string
|
|
7129
|
+
endpoint?: string | undefined
|
|
7043
7130
|
key: string
|
|
7044
7131
|
region: string
|
|
7045
7132
|
secret: string
|
|
7046
|
-
serve?: DiskServeConfig
|
|
7047
|
-
url?: string
|
|
7133
|
+
serve?: DiskServeConfig | undefined
|
|
7134
|
+
url?: string | undefined
|
|
7048
7135
|
}
|
|
7049
7136
|
|
|
7050
7137
|
interface StorageConfigShape = {
|
|
@@ -7069,8 +7156,8 @@ interface StorageDriver = {
|
|
|
7069
7156
|
}
|
|
7070
7157
|
|
|
7071
7158
|
interface StorageFilesOptions = {
|
|
7072
|
-
mounts?: Mount[]
|
|
7073
|
-
storage?: StorageManager
|
|
7159
|
+
mounts?: Mount[] | undefined
|
|
7160
|
+
storage?: StorageManager | undefined
|
|
7074
7161
|
}
|
|
7075
7162
|
|
|
7076
7163
|
type DiskConfig = LocalDiskConfig | S3DiskConfig
|
|
@@ -7259,6 +7346,7 @@ class TestResponse = {
|
|
|
7259
7346
|
assertHeaderMissing: (name: string) => TestResponse
|
|
7260
7347
|
assertInertia: (component?: string, props?: Record<string, unknown>) => TestResponse
|
|
7261
7348
|
assertInertiaProp: (key: string, value?: unknown) => TestResponse
|
|
7349
|
+
assertInertiaRedirect: (url: string, status?: number) => TestResponse
|
|
7262
7350
|
assertInvalid: (fields?: string | string[] | Record<string, string>) => TestResponse
|
|
7263
7351
|
assertJson: (expected: Record<string, unknown>) => TestResponse
|
|
7264
7352
|
assertJsonCount: (count: number, key?: string) => TestResponse
|
|
@@ -7333,16 +7421,16 @@ interface InertiaPage = {
|
|
|
7333
7421
|
}
|
|
7334
7422
|
|
|
7335
7423
|
interface MigrateDatabaseOptions = {
|
|
7336
|
-
connection?: SQLInstance
|
|
7337
|
-
path?: string
|
|
7338
|
-
table?: string
|
|
7424
|
+
connection?: SQLInstance | undefined
|
|
7425
|
+
path?: string | undefined
|
|
7426
|
+
table?: string | undefined
|
|
7339
7427
|
}
|
|
7340
7428
|
|
|
7341
7429
|
interface RefreshDatabaseOptions = {
|
|
7342
|
-
connection?: SQLInstance
|
|
7343
|
-
migrate?: string | boolean
|
|
7344
|
-
setup?: (db: SQLInstance) => void | Promise<void>
|
|
7345
|
-
teardown?: (db: SQLInstance) => void | Promise<void>
|
|
7430
|
+
connection?: SQLInstance | undefined
|
|
7431
|
+
migrate?: string | boolean | undefined
|
|
7432
|
+
setup?: ((db: SQLInstance) => void | Promise<void>) | undefined
|
|
7433
|
+
teardown?: ((db: SQLInstance) => void | Promise<void>) | undefined
|
|
7346
7434
|
}
|
|
7347
7435
|
|
|
7348
7436
|
interface TestFileInput = {
|
|
@@ -7702,7 +7790,7 @@ interface FieldRuleDefinition = {
|
|
|
7702
7790
|
}
|
|
7703
7791
|
|
|
7704
7792
|
interface UniqueOptions = {
|
|
7705
|
-
ignoreId?: string | number
|
|
7793
|
+
ignoreId?: string | number | undefined
|
|
7706
7794
|
}
|
|
7707
7795
|
|
|
7708
7796
|
interface ValidatorConfigShape = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zerotal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"./orm": "./src/orm.ts",
|
|
34
34
|
"./queue": "./src/queue.ts",
|
|
35
35
|
"./routes": "./src/routes.ts",
|
|
36
|
+
"./runtime": "./src/runtime.ts",
|
|
36
37
|
"./scheduler": "./src/scheduler.ts",
|
|
37
38
|
"./security": "./src/security.ts",
|
|
38
39
|
"./session": "./src/session.ts",
|
|
@@ -62,17 +63,17 @@
|
|
|
62
63
|
"typecheck": "tsc --noEmit"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@zerotal/auth": "1.
|
|
66
|
-
"@zerotal/cache": "1.
|
|
67
|
-
"@zerotal/client": "1.
|
|
68
|
-
"@zerotal/core": "1.
|
|
69
|
-
"@zerotal/media": "1.
|
|
70
|
-
"@zerotal/orm": "1.
|
|
71
|
-
"@zerotal/queue": "1.
|
|
72
|
-
"@zerotal/scheduler": "1.
|
|
73
|
-
"@zerotal/session": "1.
|
|
74
|
-
"@zerotal/testing": "1.
|
|
75
|
-
"@zerotal/validator": "1.
|
|
66
|
+
"@zerotal/auth": "1.10.0",
|
|
67
|
+
"@zerotal/cache": "1.10.0",
|
|
68
|
+
"@zerotal/client": "1.10.0",
|
|
69
|
+
"@zerotal/core": "1.10.0",
|
|
70
|
+
"@zerotal/media": "1.10.0",
|
|
71
|
+
"@zerotal/orm": "1.10.0",
|
|
72
|
+
"@zerotal/queue": "1.10.0",
|
|
73
|
+
"@zerotal/scheduler": "1.10.0",
|
|
74
|
+
"@zerotal/session": "1.10.0",
|
|
75
|
+
"@zerotal/testing": "1.10.0",
|
|
76
|
+
"@zerotal/validator": "1.10.0"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"typescript": "^5.8.0"
|
package/src/runtime.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@zerotal/core/runtime";
|