zerotal 1.9.0 → 1.11.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 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>; 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;}
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' }
@@ -5224,6 +5259,7 @@ class JsonCast = {
5224
5259
 
5225
5260
  class Migration = {
5226
5261
  new (): Migration
5262
+ static id?: string
5227
5263
  down: () => Promise<void>
5228
5264
  up: () => Promise<void>
5229
5265
  }
@@ -5743,14 +5779,14 @@ interface CastField = {
5743
5779
  }
5744
5780
 
5745
5781
  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>
5782
+ 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
5783
  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
5784
+ enumValues?: Record<string, string | number> | undefined
5785
+ index?: boolean | undefined
5786
+ nullable?: boolean | undefined
5787
+ primary?: boolean | undefined
5788
+ type?: 'string' | 'number' | 'boolean' | 'text' | 'datetime' | 'json' | undefined
5789
+ unique?: boolean | undefined
5754
5790
  }
5755
5791
 
5756
5792
  interface Compose = {
@@ -5773,10 +5809,10 @@ interface CursorPaginateResult = {
5773
5809
 
5774
5810
  interface DatabaseConfigShape = {
5775
5811
  driver: 'sqlite' | 'postgres' | 'mysql'
5776
- pool?: { max?: number; idleTimeout?: number;}
5777
- replicas?: string[]
5778
- sqlite: { path: string;}
5779
- synchronize?: boolean | { enabled: boolean; disruptive?: boolean;}
5812
+ pool?: { max?: number; idleTimeout?: number;} | undefined
5813
+ replicas?: string[] | undefined
5814
+ sqlite: { path: string; foreignKeys?: boolean | undefined;}
5815
+ synchronize?: boolean | { enabled: boolean; disruptive?: boolean;} | undefined
5780
5816
  url: string
5781
5817
  }
5782
5818
 
@@ -5787,9 +5823,9 @@ interface HasMany = {
5787
5823
 
5788
5824
  interface HasManyThroughOptions = {
5789
5825
  firstKey: string
5790
- localKey?: string
5826
+ localKey?: string | undefined
5791
5827
  secondKey: string
5792
- throughLocalKey?: string
5828
+ throughLocalKey?: string | undefined
5793
5829
  }
5794
5830
 
5795
5831
  interface HasOne = {
@@ -5798,10 +5834,10 @@ interface HasOne = {
5798
5834
  }
5799
5835
 
5800
5836
  interface KeysetOptions = {
5801
- column?: string
5802
- cursor?: string | null
5803
- direction?: 'asc' | 'desc'
5804
- limit?: number
5837
+ column?: string | undefined
5838
+ cursor?: string | null | undefined
5839
+ direction?: 'asc' | 'desc' | undefined
5840
+ limit?: number | undefined
5805
5841
  }
5806
5842
 
5807
5843
  interface KeysetPaginateResult = {
@@ -5827,13 +5863,13 @@ interface ManyToMany = {
5827
5863
  }
5828
5864
 
5829
5865
  interface ManyToManyOptions = {
5830
- localKey?: string
5866
+ localKey?: string | undefined
5831
5867
  pivotForeignKey: string
5832
5868
  pivotRelatedKey: string
5833
5869
  pivotTable: string
5834
- relatedKey?: string
5835
- withPivot?: string[]
5836
- withTimestamps?: boolean
5870
+ relatedKey?: string | undefined
5871
+ withPivot?: string[] | undefined
5872
+ withTimestamps?: boolean | undefined
5837
5873
  }
5838
5874
 
5839
5875
  interface MigrationEntry = {
@@ -5868,9 +5904,9 @@ interface ModelObserver = {
5868
5904
  interface MorphedByManyOptions = {
5869
5905
  morphName: string
5870
5906
  parentPivotKey: string
5871
- pivotTable?: string
5872
- withPivot?: string[]
5873
- withTimestamps?: boolean
5907
+ pivotTable?: string | undefined
5908
+ withPivot?: string[] | undefined
5909
+ withTimestamps?: boolean | undefined
5874
5910
  }
5875
5911
 
5876
5912
  interface MorphMany = {
@@ -5879,7 +5915,7 @@ interface MorphMany = {
5879
5915
  }
5880
5916
 
5881
5917
  interface MorphManyOptions = {
5882
- localKey?: string
5918
+ localKey?: string | undefined
5883
5919
  morphName: string
5884
5920
  }
5885
5921
 
@@ -5889,7 +5925,7 @@ interface MorphOne = {
5889
5925
  }
5890
5926
 
5891
5927
  interface MorphOneOptions = {
5892
- localKey?: string
5928
+ localKey?: string | undefined
5893
5929
  morphName: string
5894
5930
  }
5895
5931
 
@@ -5900,21 +5936,21 @@ interface MorphTo = {
5900
5936
 
5901
5937
  interface MorphToManyOptions = {
5902
5938
  morphName: string
5903
- pivotTable?: string
5939
+ pivotTable?: string | undefined
5904
5940
  relatedPivotKey: string
5905
- withPivot?: string[]
5906
- withTimestamps?: boolean
5941
+ withPivot?: string[] | undefined
5942
+ withTimestamps?: boolean | undefined
5907
5943
  }
5908
5944
 
5909
5945
  interface MorphToOptions = {
5910
- morphForeignKey?: string
5946
+ morphForeignKey?: string | undefined
5911
5947
  morphMap: Record<string, () => unknown>
5912
- morphTypeColumn?: string
5948
+ morphTypeColumn?: string | undefined
5913
5949
  }
5914
5950
 
5915
5951
  interface NPlusOneOptions = {
5916
- mode?: 'warn' | 'throw'
5917
- threshold?: number
5952
+ mode?: 'warn' | 'throw' | undefined
5953
+ threshold?: number | undefined
5918
5954
  }
5919
5955
 
5920
5956
  interface PaginateMeta = {
@@ -6004,8 +6040,8 @@ interface TableDecoratorBuilder = {
6004
6040
  }
6005
6041
 
6006
6042
  interface TableOptions = {
6007
- primaryKey?: string
6008
- timestamps?: boolean
6043
+ primaryKey?: string | undefined
6044
+ timestamps?: boolean | undefined
6009
6045
  }
6010
6046
 
6011
6047
  interface TransitionContext = {
@@ -6317,7 +6353,7 @@ interface QueueConfigShape = {
6317
6353
  driver: 'sqlite' | 'redis' | 'sync'
6318
6354
  pollInterval: number
6319
6355
  queues: string[]
6320
- workerBootstrap?: string
6356
+ workerBootstrap?: string | undefined
6321
6357
  workers: number
6322
6358
  }
6323
6359
 
@@ -6392,6 +6428,41 @@ type RouteTable = Readonly<Record<string, string>> | ReadonlyMap<string, string>
6392
6428
 
6393
6429
  type RouteTarget = string
6394
6430
 
6431
+ ## ./runtime `(./src/runtime.ts)`
6432
+
6433
+ const RUNTIME_MISMATCH_ESCAPE = 'ZT_ALLOW_RUNTIME_MISMATCH'
6434
+
6435
+ function bunBinary = () => string
6436
+
6437
+ function declaredBunFloor = (cwd: string) => { range: string; manifest: string;} | null
6438
+
6439
+ function declaresBunDependency = (cwd: string) => boolean
6440
+
6441
+ function installedBunVersion = (cwd: string) => { version: string; manifest: string;} | null
6442
+
6443
+ function runtimeBelowFloor = (cwd?: string) => RuntimeFloor | null
6444
+
6445
+ function runtimeBelowFloorMessage = (floor: RuntimeFloor) => string
6446
+
6447
+ function runtimeMismatch = (cwd?: string) => RuntimeMismatch | null
6448
+
6449
+ function runtimeMismatchAllowed = () => boolean
6450
+
6451
+ function runtimeMismatchMessage = (mismatch: RuntimeMismatch) => string
6452
+
6453
+ interface RuntimeFloor = {
6454
+ manifest: string
6455
+ required: string
6456
+ running: string
6457
+ }
6458
+
6459
+ interface RuntimeMismatch = {
6460
+ chosen?: boolean | undefined
6461
+ installed: string
6462
+ manifest: string
6463
+ running: string
6464
+ }
6465
+
6395
6466
  ## ./scheduler `(./src/scheduler.ts)`
6396
6467
 
6397
6468
  class CronExpression = {
@@ -6399,10 +6470,12 @@ class CronExpression = {
6399
6470
  static describe: (expression: string) => string
6400
6471
  static isValid: (expression: string) => boolean
6401
6472
  static nextRunAfter: (expression: string, from?: Date) => Date | null
6473
+ static nextRunAfterIn: (expression: string, from: Date, timeZone: string) => Date | null
6402
6474
  static readonly SEARCH_HORIZON_DAYS: number
6403
6475
  dayOfMonth: (v: number | string) => CronExpression
6404
6476
  hour: (v: number | string) => CronExpression
6405
6477
  matches: (date?: Date) => boolean
6478
+ matchesIn: (date: Date, timeZone: string) => boolean
6406
6479
  minute: (v: number | string) => CronExpression
6407
6480
  month: (v: number | string) => CronExpression
6408
6481
  nextRun: (from?: Date) => Date | null
@@ -6510,6 +6583,13 @@ class SchedulerBuilder = {
6510
6583
  yearlyOn: (month?: number, dayOfMonth?: number, time?: string) => ScheduledTask
6511
6584
  }
6512
6585
 
6586
+ class SchedulerError = {
6587
+ new (message: string, code?: string, status?: number, context?: Record<string, unknown>): SchedulerError
6588
+ readonly code: string
6589
+ readonly context?: Record<string, unknown> | undefined
6590
+ readonly status: number
6591
+ }
6592
+
6513
6593
  class SchedulerManager = {
6514
6594
  new (): SchedulerManager
6515
6595
  add: (name: string, cronExpression: string, callback: TaskCallback) => ScheduledTask
@@ -6561,14 +6641,25 @@ class TaskSkipped = {
6561
6641
  readonly reason: 'lock' | 'window' | 'env' | 'when' | 'skip' | 'overlap'
6562
6642
  }
6563
6643
 
6644
+ class UnknownTimeZoneError = {
6645
+ new (task: string, timezone: string): UnknownTimeZoneError
6646
+ readonly code: string
6647
+ readonly context?: Record<string, unknown> | undefined
6648
+ readonly status: number
6649
+ }
6650
+
6564
6651
  const Scheduler = SchedulerManager
6565
6652
 
6653
+ function isValidTimeZone = (timeZone: string) => boolean
6654
+
6566
6655
  function SchedulerConfig = (options?: Partial<SchedulerConfigShape>) => SchedulerConfigShape
6567
6656
 
6657
+ function wallClockIn = (date: Date, timeZone: string) => Date
6658
+
6568
6659
  interface OverlapLockOptions = {
6569
- crossProcess?: boolean
6570
- expiresAfterMinutes?: number
6571
- refresh?: boolean
6660
+ crossProcess?: boolean | undefined
6661
+ expiresAfterMinutes?: number | undefined
6662
+ refresh?: boolean | undefined
6572
6663
  }
6573
6664
 
6574
6665
  interface RunLogConfig = {
@@ -6635,7 +6726,7 @@ function redactGraph = (value: unknown, options: RedactGraphOptions) => unknown
6635
6726
 
6636
6727
  interface RedactGraphOptions = {
6637
6728
  circular: string
6638
- flatten?: (value: unknown) => string | undefined
6729
+ flatten?: ((value: unknown) => string | undefined) | undefined
6639
6730
  mask: string
6640
6731
  maxDepth: number
6641
6732
  sensitive: (key: string) => boolean
@@ -6774,7 +6865,7 @@ const Session = SessionAccessor
6774
6865
  function SessionConfig = (options?: Partial<SessionConfigShape>) => SessionConfigShape
6775
6866
 
6776
6867
  interface CsrfOptions = {
6777
- secure?: boolean
6868
+ secure?: boolean | undefined
6778
6869
  }
6779
6870
 
6780
6871
  interface SessionConfigShape = {
@@ -6794,7 +6885,7 @@ interface SessionDriver = {
6794
6885
  }
6795
6886
 
6796
6887
  interface SessionOptions = {
6797
- driver?: SessionDriver
6888
+ driver?: SessionDriver | undefined
6798
6889
  }
6799
6890
 
6800
6891
  interface SessionPayload = {
@@ -6823,27 +6914,27 @@ function snakeCase = (value: string) => string
6823
6914
  function tableNameFor = (className: string) => string
6824
6915
 
6825
6916
  interface DateOptions = {
6826
- dateStyle?: 'medium' | 'short' | 'full' | 'long'
6827
- locale?: string
6828
- timeStyle?: 'medium' | 'short' | 'full' | 'long'
6829
- timeZone?: string
6917
+ dateStyle?: 'medium' | 'short' | 'full' | 'long' | undefined
6918
+ locale?: string | undefined
6919
+ timeStyle?: 'medium' | 'short' | 'full' | 'long' | undefined
6920
+ timeZone?: string | undefined
6830
6921
  }
6831
6922
 
6832
6923
  interface FormatOptions = {
6833
- locale?: string
6924
+ locale?: string | undefined
6834
6925
  }
6835
6926
 
6836
6927
  interface MoneyOptions = {
6837
6928
  currency: string
6838
- fractionDigits?: number
6839
- locale?: string
6840
- minorUnits?: boolean
6929
+ fractionDigits?: number | undefined
6930
+ locale?: string | undefined
6931
+ minorUnits?: boolean | undefined
6841
6932
  }
6842
6933
 
6843
6934
  interface NumberOptions = {
6844
- locale?: string
6845
- maximumFractionDigits?: number
6846
- minimumFractionDigits?: number
6935
+ locale?: string | undefined
6936
+ maximumFractionDigits?: number | undefined
6937
+ minimumFractionDigits?: number | undefined
6847
6938
  }
6848
6939
 
6849
6940
  ## ./storage `(./src/storage.ts)`
@@ -7010,10 +7101,10 @@ const Storage = StorageManager
7010
7101
  function StorageConfig = (options?: Partial<StorageConfigShape>) => StorageConfigShape
7011
7102
 
7012
7103
  interface DiskServeConfig = {
7013
- expiresIn?: number
7014
- headers?: Record<string, string>
7104
+ expiresIn?: number | undefined
7105
+ headers?: Record<string, string> | undefined
7015
7106
  path: string
7016
- signed?: boolean
7107
+ signed?: boolean | undefined
7017
7108
  }
7018
7109
 
7019
7110
  interface FakeStoredFile = {
@@ -7027,24 +7118,24 @@ interface FakeStoredFile = {
7027
7118
  interface LocalDiskConfig = {
7028
7119
  driver: 'local'
7029
7120
  root: string
7030
- serve?: DiskServeConfig
7031
- url?: string
7121
+ serve?: DiskServeConfig | undefined
7122
+ url?: string | undefined
7032
7123
  }
7033
7124
 
7034
7125
  interface PutOptions = {
7035
- contentType?: string
7036
- visibility?: 'public' | 'private'
7126
+ contentType?: string | undefined
7127
+ visibility?: 'public' | 'private' | undefined
7037
7128
  }
7038
7129
 
7039
7130
  interface S3DiskConfig = {
7040
7131
  bucket: string
7041
7132
  driver: 's3'
7042
- endpoint?: string
7133
+ endpoint?: string | undefined
7043
7134
  key: string
7044
7135
  region: string
7045
7136
  secret: string
7046
- serve?: DiskServeConfig
7047
- url?: string
7137
+ serve?: DiskServeConfig | undefined
7138
+ url?: string | undefined
7048
7139
  }
7049
7140
 
7050
7141
  interface StorageConfigShape = {
@@ -7069,8 +7160,8 @@ interface StorageDriver = {
7069
7160
  }
7070
7161
 
7071
7162
  interface StorageFilesOptions = {
7072
- mounts?: Mount[]
7073
- storage?: StorageManager
7163
+ mounts?: Mount[] | undefined
7164
+ storage?: StorageManager | undefined
7074
7165
  }
7075
7166
 
7076
7167
  type DiskConfig = LocalDiskConfig | S3DiskConfig
@@ -7259,6 +7350,7 @@ class TestResponse = {
7259
7350
  assertHeaderMissing: (name: string) => TestResponse
7260
7351
  assertInertia: (component?: string, props?: Record<string, unknown>) => TestResponse
7261
7352
  assertInertiaProp: (key: string, value?: unknown) => TestResponse
7353
+ assertInertiaRedirect: (url: string, status?: number) => TestResponse
7262
7354
  assertInvalid: (fields?: string | string[] | Record<string, string>) => TestResponse
7263
7355
  assertJson: (expected: Record<string, unknown>) => TestResponse
7264
7356
  assertJsonCount: (count: number, key?: string) => TestResponse
@@ -7268,6 +7360,7 @@ class TestResponse = {
7268
7360
  assertNotFound: () => TestResponse
7269
7361
  assertOk: () => TestResponse
7270
7362
  assertRedirect: (url: string) => TestResponse
7363
+ assertRedirectContains: (fragment: string) => TestResponse
7271
7364
  assertSee: (needle: string) => TestResponse
7272
7365
  assertSeeText: (needle: string) => TestResponse
7273
7366
  assertServerError: () => TestResponse
@@ -7333,16 +7426,16 @@ interface InertiaPage = {
7333
7426
  }
7334
7427
 
7335
7428
  interface MigrateDatabaseOptions = {
7336
- connection?: SQLInstance
7337
- path?: string
7338
- table?: string
7429
+ connection?: SQLInstance | undefined
7430
+ path?: string | undefined
7431
+ table?: string | undefined
7339
7432
  }
7340
7433
 
7341
7434
  interface RefreshDatabaseOptions = {
7342
- connection?: SQLInstance
7343
- migrate?: string | boolean
7344
- setup?: (db: SQLInstance) => void | Promise<void>
7345
- teardown?: (db: SQLInstance) => void | Promise<void>
7435
+ connection?: SQLInstance | undefined
7436
+ migrate?: string | boolean | undefined
7437
+ setup?: ((db: SQLInstance) => void | Promise<void>) | undefined
7438
+ teardown?: ((db: SQLInstance) => void | Promise<void>) | undefined
7346
7439
  }
7347
7440
 
7348
7441
  interface TestFileInput = {
@@ -7702,7 +7795,7 @@ interface FieldRuleDefinition = {
7702
7795
  }
7703
7796
 
7704
7797
  interface UniqueOptions = {
7705
- ignoreId?: string | number
7798
+ ignoreId?: string | number | undefined
7706
7799
  }
7707
7800
 
7708
7801
  interface ValidatorConfigShape = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerotal",
3
- "version": "1.9.0",
3
+ "version": "1.11.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.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"
66
+ "@zerotal/auth": "1.11.0",
67
+ "@zerotal/cache": "1.11.0",
68
+ "@zerotal/client": "1.11.0",
69
+ "@zerotal/core": "1.11.0",
70
+ "@zerotal/media": "1.11.0",
71
+ "@zerotal/orm": "1.11.0",
72
+ "@zerotal/queue": "1.11.0",
73
+ "@zerotal/scheduler": "1.11.0",
74
+ "@zerotal/session": "1.11.0",
75
+ "@zerotal/testing": "1.11.0",
76
+ "@zerotal/validator": "1.11.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";