zerotal 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-surface.md +25 -189
- package/package.json +12 -12
package/api-surface.md
CHANGED
|
@@ -686,8 +686,6 @@ function data_get = (target: unknown, key: string, defaultValue?: unknown) => un
|
|
|
686
686
|
|
|
687
687
|
function deepMerge = <T extends object>(base: T, override: DeepPartial<T>) => T
|
|
688
688
|
|
|
689
|
-
function deployEnv = () => string
|
|
690
|
-
|
|
691
689
|
function devSurfacesEnabled = () => boolean
|
|
692
690
|
|
|
693
691
|
function env = { (key: string): string | undefined; (key: string, fallback: string): string; (key: string, fallback: boolean): boolean; (key: string, fallback: number): number;}
|
|
@@ -704,8 +702,6 @@ function inject = (...tokens: BindingToken[]) => (target: new (...args: any[]) =
|
|
|
704
702
|
|
|
705
703
|
function isDevSurfaceAllowed = (env: string) => boolean
|
|
706
704
|
|
|
707
|
-
function isProdLike = (env: string) => boolean
|
|
708
|
-
|
|
709
705
|
function json = (data: unknown, status?: number) => void
|
|
710
706
|
|
|
711
707
|
function make = <T>(token: BindingToken<T>) => Promise<T>
|
|
@@ -728,8 +724,6 @@ function redirect = { (url: string, status?: 301 | 302 | 303 | 307 | 308): Re
|
|
|
728
724
|
|
|
729
725
|
function redirectTo = <N extends RouteTarget>(name: N, params?: RouteParamsArg<N>, status?: 301 | 302 | 303 | 307 | 308) => ResponseBuilder
|
|
730
726
|
|
|
731
|
-
function registerAppScope = (installer: AppScopeInstaller) => void
|
|
732
|
-
|
|
733
727
|
function registerErrorDiagnoser = (diagnoser: ErrorDiagnoser) => void
|
|
734
728
|
|
|
735
729
|
function registerFileRouteResolver = (resolver: FileRouteResolver) => void
|
|
@@ -754,8 +748,6 @@ function setAppEnv = (command?: string) => void
|
|
|
754
748
|
|
|
755
749
|
function setCurrentPageResolver = (resolver: CurrentPageResolver) => void
|
|
756
750
|
|
|
757
|
-
function setImplicitModelResolver = (fn: ((paramName: string) => ModelBindingResolver | undefined) | null) => void
|
|
758
|
-
|
|
759
751
|
function sha256Hex = (input: string | Uint8Array) => string
|
|
760
752
|
|
|
761
753
|
function singularize = (value: string) => string
|
|
@@ -1112,9 +1104,7 @@ type AppScopeInstaller = () => () => void
|
|
|
1112
1104
|
|
|
1113
1105
|
type ArgDef = { name: string; required?: boolean; default?: string;}
|
|
1114
1106
|
|
|
1115
|
-
type BindingToken =
|
|
1116
|
-
|
|
1117
|
-
type ClassRef = abstract new (...args: never[]) => unknown
|
|
1107
|
+
type BindingToken = ClassToken<T> | AbstractToken<T> | keyof ContainerBindings
|
|
1118
1108
|
|
|
1119
1109
|
type ContextKey = never
|
|
1120
1110
|
|
|
@@ -1140,7 +1130,7 @@ type FileRouteResolver = (ctx: FileRouteContext) => boolean
|
|
|
1140
1130
|
|
|
1141
1131
|
type FileRoutingConfig = { [x: string]: FileRoutingEntry;}
|
|
1142
1132
|
|
|
1143
|
-
type FileRoutingEntry = string | {
|
|
1133
|
+
type FileRoutingEntry = string | { dir: string; prefix?: string; middleware?: MiddlewareInput }
|
|
1144
1134
|
|
|
1145
1135
|
type FlagDef = { name: string; short?: string; type: 'string' | 'boolean' | 'number'; description?: string; default?: unknown;}
|
|
1146
1136
|
|
|
@@ -1178,7 +1168,7 @@ type RouteTarget = string
|
|
|
1178
1168
|
|
|
1179
1169
|
type RoutingConfig = { [x: string]: RoutingEntry;}
|
|
1180
1170
|
|
|
1181
|
-
type RoutingEntry = string | {
|
|
1171
|
+
type RoutingEntry = string | { file: string; prefix?: string; middleware?: MiddlewareInput }
|
|
1182
1172
|
|
|
1183
1173
|
type SameSite = 'Strict' | 'Lax' | 'None'
|
|
1184
1174
|
|
|
@@ -2094,8 +2084,6 @@ const TWO_FACTOR_SESSION_KEY = 'two_factor_confirmed'
|
|
|
2094
2084
|
|
|
2095
2085
|
const TwoFactor = TwoFactorService
|
|
2096
2086
|
|
|
2097
|
-
function _attachModelPermissions = (modelType: string, modelId: unknown, permissionIds: number[]) => Promise<void>
|
|
2098
|
-
|
|
2099
2087
|
function AuthConfig = (options?: Partial<AuthConfigShape>) => AuthConfigShape
|
|
2100
2088
|
|
|
2101
2089
|
function Authenticatable = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): Authenticatable; prototype: Authenticatable<any>.Authenticatable;} & TBase
|
|
@@ -2313,11 +2301,6 @@ interface RememberMeOptions = {
|
|
|
2313
2301
|
secure?: boolean
|
|
2314
2302
|
}
|
|
2315
2303
|
|
|
2316
|
-
interface SocialHttpContext = {
|
|
2317
|
-
redirect: (url: string) => void
|
|
2318
|
-
request: { readonly method: string; readonly url: string; formData(): Promise<FormData>;}
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
2304
|
interface SocialSession = {
|
|
2322
2305
|
forget: (key: string) => void
|
|
2323
2306
|
get: <T>(key: string) => T | undefined
|
|
@@ -3106,7 +3089,7 @@ type ResponseInterceptor = (ctx: ResponseContext) => ResponseContext | Promise<R
|
|
|
3106
3089
|
|
|
3107
3090
|
type ResponseOf = `${Method} ${Path}` extends keyof Routes ? Routes[`${Method} ${Path}`] extends { response: infer R;} ? R : unknown : unknown
|
|
3108
3091
|
|
|
3109
|
-
type SocketState = '
|
|
3092
|
+
type SocketState = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'error'
|
|
3110
3093
|
|
|
3111
3094
|
type TokenSource = string | (() => string | null | undefined | Promise<string | null | undefined>)
|
|
3112
3095
|
|
|
@@ -3196,35 +3179,6 @@ class CssBuildCommand = {
|
|
|
3196
3179
|
write: (msg: string) => void
|
|
3197
3180
|
}
|
|
3198
3181
|
|
|
3199
|
-
class DeployCommand = {
|
|
3200
|
-
new (): DeployCommand
|
|
3201
|
-
static args: ArgDef[]
|
|
3202
|
-
static commandName: string
|
|
3203
|
-
static description: string
|
|
3204
|
-
static flags: ({ name: string; type: 'boolean'; description: string; default: boolean;} | { name: string; type: 'string'; description: string; default?: never;})[]
|
|
3205
|
-
static needsApp: boolean
|
|
3206
|
-
static target: string
|
|
3207
|
-
_readLine: () => Promise<string>
|
|
3208
|
-
_writer: OutputWriter
|
|
3209
|
-
app: unknown
|
|
3210
|
-
args: Record<string, string>
|
|
3211
|
-
ask: (question: string, defaultValue?: string) => Promise<string>
|
|
3212
|
-
choice: (question: string, options: string[]) => Promise<string>
|
|
3213
|
-
confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
|
|
3214
|
-
dim: (msg: string) => void
|
|
3215
|
-
error: (msg: string) => void
|
|
3216
|
-
flags: Record<string, string | number | boolean>
|
|
3217
|
-
info: (msg: string) => void
|
|
3218
|
-
line: (msg: string) => void
|
|
3219
|
-
newLine: () => void
|
|
3220
|
-
run: () => Promise<void>
|
|
3221
|
-
secret: (question: string) => Promise<string>
|
|
3222
|
-
section: (title: string) => void
|
|
3223
|
-
table: (rows: [string, string][], indent?: number) => void
|
|
3224
|
-
warn: (msg: string) => void
|
|
3225
|
-
write: (msg: string) => void
|
|
3226
|
-
}
|
|
3227
|
-
|
|
3228
3182
|
class DevCommand = {
|
|
3229
3183
|
new (): DevCommand
|
|
3230
3184
|
static aliases: string[]
|
|
@@ -3986,8 +3940,6 @@ class WorkerCommand = {
|
|
|
3986
3940
|
write: (msg: string) => void
|
|
3987
3941
|
}
|
|
3988
3942
|
|
|
3989
|
-
function makeDeployCommand = (target: string) => DeployCommandClass
|
|
3990
|
-
|
|
3991
3943
|
## ./config `(./src/config-reexport.ts)`
|
|
3992
3944
|
|
|
3993
3945
|
class ConfigLoader = {
|
|
@@ -4099,7 +4051,7 @@ interface RegisteredConfigValidator = {
|
|
|
4099
4051
|
validate: ConfigValidator
|
|
4100
4052
|
}
|
|
4101
4053
|
|
|
4102
|
-
type AssetLoaderKind = '
|
|
4054
|
+
type AssetLoaderKind = 'file' | 'dataurl' | 'base64' | 'text' | 'json' | 'toml'
|
|
4103
4055
|
|
|
4104
4056
|
type ConfigIssueLevel = 'error' | 'warning'
|
|
4105
4057
|
|
|
@@ -4181,8 +4133,6 @@ const SERVER_PROCESS_NAME = 'server'
|
|
|
4181
4133
|
|
|
4182
4134
|
function bootBuildDecision = (outDirs: string[], env: string | undefined) => Promise<BootBuildDecision>
|
|
4183
4135
|
|
|
4184
|
-
function browserEnvDefines = (isProduction: boolean) => Record<string, string>
|
|
4185
|
-
|
|
4186
4136
|
function buildCssBundle = (input: string, outdir: string, minify?: boolean, loader?: Record<string, string>) => Promise<BundleResult>
|
|
4187
4137
|
|
|
4188
4138
|
function buildJsBundle = (input: string, outdir: string, minify?: boolean) => Promise<BundleResult>
|
|
@@ -4193,14 +4143,8 @@ function createDeck = (options: DeckOptions) => Deck
|
|
|
4193
4143
|
|
|
4194
4144
|
function detectCssPlugins = (cwd: string) => Promise<BunPlugin[]>
|
|
4195
4145
|
|
|
4196
|
-
function isDevOrchestrated = (env?: Record<string, string | undefined>, argv?: readonly string[]) => boolean
|
|
4197
|
-
|
|
4198
4146
|
function isWritableDir = (dir: string) => Promise<boolean>
|
|
4199
4147
|
|
|
4200
|
-
function pruneBuildOutput = (outdir: string, outputs: readonly { path: string;}[]) => Promise<string[]>
|
|
4201
|
-
|
|
4202
|
-
function registerDevBuildHook = (name: string, fn: BuildHookFn) => void
|
|
4203
|
-
|
|
4204
4148
|
function registerDevHtmlSnippet = (name: string, fn: DevHtmlSnippet) => void
|
|
4205
4149
|
|
|
4206
4150
|
function startDevMode = (options: StartDevModeOptions) => Promise<void>
|
|
@@ -4316,7 +4260,7 @@ const t = { readonly string: () => Def<string | undefined>; readonly numbe
|
|
|
4316
4260
|
|
|
4317
4261
|
type EnvOutput = { readonly [K in keyof S]: InferDef<S[K]>; }
|
|
4318
4262
|
|
|
4319
|
-
type FieldType = 'string' | 'number' | 'boolean' | '
|
|
4263
|
+
type FieldType = 'string' | 'number' | 'boolean' | 'enum' | 'url' | 'port'
|
|
4320
4264
|
|
|
4321
4265
|
type InferDef = D extends Def<infer T> ? T : never
|
|
4322
4266
|
|
|
@@ -4666,7 +4610,7 @@ interface WebContext = {
|
|
|
4666
4610
|
view: (markup: string | { toString(): string;}, status?: number) => void
|
|
4667
4611
|
}
|
|
4668
4612
|
|
|
4669
|
-
type AnsiColor = '
|
|
4613
|
+
type AnsiColor = 'red' | 'green' | 'yellow' | 'blue' | 'cyan' | 'dim'
|
|
4670
4614
|
|
|
4671
4615
|
type Channel = 'web' | 'json' | 'cli'
|
|
4672
4616
|
|
|
@@ -4878,8 +4822,6 @@ class StackChannel = {
|
|
|
4878
4822
|
|
|
4879
4823
|
const Log = LogManager
|
|
4880
4824
|
|
|
4881
|
-
function frameworkLog = (scope: string) => BoundLogger
|
|
4882
|
-
|
|
4883
4825
|
function LoggingConfig = (options?: Partial<LoggingConfigShape>) => LoggingConfigShape
|
|
4884
4826
|
|
|
4885
4827
|
function renderTable = (data: TableData, indent?: number) => string[]
|
|
@@ -4927,11 +4869,11 @@ interface LoggingConfigShape = {
|
|
|
4927
4869
|
slowQueryMs?: number
|
|
4928
4870
|
}
|
|
4929
4871
|
|
|
4930
|
-
type ChannelConfig = {
|
|
4872
|
+
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' }
|
|
4931
4873
|
|
|
4932
|
-
type LogLevel = '
|
|
4874
|
+
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal'
|
|
4933
4875
|
|
|
4934
|
-
type TableData = Record<string, unknown> |
|
|
4876
|
+
type TableData = Record<string, unknown> | ReadonlyArray<Record<string, unknown>>
|
|
4935
4877
|
|
|
4936
4878
|
## ./media `(./src/media.ts)`
|
|
4937
4879
|
|
|
@@ -4946,12 +4888,6 @@ class BunImageDriver = {
|
|
|
4946
4888
|
readonly supportsCrop: true
|
|
4947
4889
|
}
|
|
4948
4890
|
|
|
4949
|
-
class ConversionRunner = {
|
|
4950
|
-
new (driver: ImageDriver, config: MediaConfigShape): ConversionRunner
|
|
4951
|
-
run: (media: MediaItem, conversions: ConversionMap) => Promise<{ generated: string[]; failed: Array<{ name: string; reason: string; }>;}>
|
|
4952
|
-
runResponsive: (media: MediaItem, widths: number[]) => Promise<ResponsiveImageSet | null>
|
|
4953
|
-
}
|
|
4954
|
-
|
|
4955
4891
|
class DefaultPathGenerator = {
|
|
4956
4892
|
new (prefix?: string): DefaultPathGenerator
|
|
4957
4893
|
forConversions: (media: MediaItem) => string
|
|
@@ -5214,42 +5150,12 @@ const MediaFake = { all(owner: { id: number | string; construct
|
|
|
5214
5150
|
|
|
5215
5151
|
const MediaLibrary = MediaManager
|
|
5216
5152
|
|
|
5217
|
-
const mediaSchemaConcern = ConcernDescriptor
|
|
5218
|
-
|
|
5219
|
-
function applyRetentionRules = (modelType: string, modelId: number | string, collection: string, definition: CollectionDefinition, justAdded: MediaItem) => Promise<void>
|
|
5220
|
-
|
|
5221
|
-
function collectionNames = (host: CollectionHost) => string[]
|
|
5222
|
-
|
|
5223
|
-
function defaultDiskName = () => string
|
|
5224
|
-
|
|
5225
|
-
function diskFor = (name?: string | null) => StorageDriver
|
|
5226
|
-
|
|
5227
|
-
function dispatchConversions = (mediaId: number, conversions: string[]) => Promise<void>
|
|
5228
|
-
|
|
5229
|
-
function fromDisk = (path: string, disk?: string) => SourceResolver
|
|
5230
|
-
|
|
5231
|
-
function fromPath = (path: string) => SourceResolver
|
|
5232
|
-
|
|
5233
|
-
function fromUrl = (url: string, maxBytes: number) => SourceResolver
|
|
5234
|
-
|
|
5235
|
-
function fromValue = (source: MediaSource, fileName?: string) => SourceResolver
|
|
5236
|
-
|
|
5237
|
-
function hasCollection = (host: CollectionHost, name: string) => boolean
|
|
5238
|
-
|
|
5239
5153
|
function isConvertible = (mimeType: string | null | undefined) => boolean
|
|
5240
5154
|
|
|
5241
|
-
function isQueueAvailable = () => boolean
|
|
5242
|
-
|
|
5243
5155
|
function Media = <TBase extends Constructor>(Base: TBase) => { new (...args: any[]): MediaModel; prototype: Media<any>.MediaModel; mediaCollections: MediaCollections;} & TBase
|
|
5244
5156
|
|
|
5245
5157
|
function MediaConfig = (options?: Partial<MediaConfigShape>) => MediaConfigShape
|
|
5246
5158
|
|
|
5247
|
-
function mediaDefaults = () => MediaConfigShape
|
|
5248
|
-
|
|
5249
|
-
function pathGenerator = () => PathGenerator
|
|
5250
|
-
|
|
5251
|
-
function resolveCollection = (host: CollectionHost, name: string) => CollectionDefinition
|
|
5252
|
-
|
|
5253
5159
|
function setPathGenerator = (generator: PathGenerator) => void
|
|
5254
5160
|
|
|
5255
5161
|
interface CleanReport = {
|
|
@@ -5271,11 +5177,6 @@ interface CollectionDefinition = {
|
|
|
5271
5177
|
single?: boolean
|
|
5272
5178
|
}
|
|
5273
5179
|
|
|
5274
|
-
interface CollectionHost = {
|
|
5275
|
-
mediaCollections?: MediaCollections
|
|
5276
|
-
name: string
|
|
5277
|
-
}
|
|
5278
|
-
|
|
5279
5180
|
interface ConversionDefinition = {
|
|
5280
5181
|
allowEnlargement?: boolean
|
|
5281
5182
|
fit?: ConversionFit
|
|
@@ -5363,11 +5264,6 @@ interface PendingMediaMeta = {
|
|
|
5363
5264
|
order?: number
|
|
5364
5265
|
}
|
|
5365
5266
|
|
|
5366
|
-
interface ResolvedSource = {
|
|
5367
|
-
bytes: Uint8Array<ArrayBufferLike>
|
|
5368
|
-
originalName: string
|
|
5369
|
-
}
|
|
5370
|
-
|
|
5371
5267
|
interface ResponsiveImage = {
|
|
5372
5268
|
fileName: string
|
|
5373
5269
|
height: number
|
|
@@ -5379,7 +5275,7 @@ interface ResponsiveImageSet = {
|
|
|
5379
5275
|
placeholder?: string
|
|
5380
5276
|
}
|
|
5381
5277
|
|
|
5382
|
-
type ConversionFit = '
|
|
5278
|
+
type ConversionFit = 'inside' | 'fill' | 'cover'
|
|
5383
5279
|
|
|
5384
5280
|
type ConversionFormat = SafeConversionFormat | 'avif' | 'heic'
|
|
5385
5281
|
|
|
@@ -5387,12 +5283,10 @@ type ConversionMap = { [x: string]: ConversionDefinition;}
|
|
|
5387
5283
|
|
|
5388
5284
|
type MediaCollections = { [x: string]: CollectionDefinition | (() => CollectionDefinition);}
|
|
5389
5285
|
|
|
5390
|
-
type MediaSource =
|
|
5286
|
+
type MediaSource = UploadedFile | File | Blob | Uint8Array | ArrayBuffer
|
|
5391
5287
|
|
|
5392
5288
|
type SafeConversionFormat = 'jpeg' | 'png' | 'webp'
|
|
5393
5289
|
|
|
5394
|
-
type SourceResolver = () => Promise<ResolvedSource>
|
|
5395
|
-
|
|
5396
5290
|
## ./metrics `(./src/metrics.ts)`
|
|
5397
5291
|
|
|
5398
5292
|
function beginHttp = () => void
|
|
@@ -5530,7 +5424,7 @@ class Blueprint = {
|
|
|
5530
5424
|
bigInteger: (name: string) => ColumnBuilder
|
|
5531
5425
|
binary: (name: string) => ColumnBuilder
|
|
5532
5426
|
boolean: (name: string) => ColumnBuilder
|
|
5533
|
-
char: (name: string,
|
|
5427
|
+
char: (name: string, length?: number) => ColumnBuilder
|
|
5534
5428
|
date: (name: string) => ColumnBuilder
|
|
5535
5429
|
dateTime: (name: string) => ColumnBuilder
|
|
5536
5430
|
datetime: (name: string) => ColumnBuilder
|
|
@@ -5567,7 +5461,7 @@ class Blueprint = {
|
|
|
5567
5461
|
smallInteger: (name: string) => ColumnBuilder
|
|
5568
5462
|
softDeletes: (column?: string) => void
|
|
5569
5463
|
spatialIndex: (columns: string | string[], name?: string) => Blueprint
|
|
5570
|
-
string: (name: string,
|
|
5464
|
+
string: (name: string, length?: number) => ColumnBuilder
|
|
5571
5465
|
text: (name: string) => ColumnBuilder
|
|
5572
5466
|
time: (name: string) => ColumnBuilder
|
|
5573
5467
|
timestamp: (name: string) => ColumnBuilder
|
|
@@ -5596,7 +5490,7 @@ class Cast = {
|
|
|
5596
5490
|
}
|
|
5597
5491
|
|
|
5598
5492
|
class ColumnBuilder = {
|
|
5599
|
-
new <Locked extends string = never>(name: string, _sqlType: string, isPrimary?: boolean, isAutoIncrement?: boolean, _isBoolean?: boolean): ColumnBuilder<Locked>
|
|
5493
|
+
new <Locked extends string = never>(name: string, _sqlType: string, isPrimary?: boolean, isAutoIncrement?: boolean, _isBoolean?: boolean, _stringLength?: number | undefined): ColumnBuilder<Locked>
|
|
5600
5494
|
after: (_column: string) => ColumnBuilder<Locked>
|
|
5601
5495
|
alter: () => ColumnBuilder<Locked>
|
|
5602
5496
|
before: (_column: string) => ColumnBuilder<Locked>
|
|
@@ -5691,13 +5585,6 @@ class ForeignKeyBuilder = {
|
|
|
5691
5585
|
toConstraintSQL: () => string
|
|
5692
5586
|
}
|
|
5693
5587
|
|
|
5694
|
-
class HookRegistry = {
|
|
5695
|
-
new (): HookRegistry
|
|
5696
|
-
static onAfterRun: ((ModelClass: ClassRef, hook: HookName, model: unknown) => void) | undefined
|
|
5697
|
-
static register: <T>(ModelClass: ClassRef, hook: HookName, fn: HookFn<T>) => void
|
|
5698
|
-
static run: <T>(ModelClass: ClassRef, hook: HookName, model: T) => Promise<void>
|
|
5699
|
-
}
|
|
5700
|
-
|
|
5701
5588
|
class JsonCast = {
|
|
5702
5589
|
new <T = unknown>(mapper?: CastMapper<T> | undefined): JsonCast<T>
|
|
5703
5590
|
fields: () => CastField[]
|
|
@@ -5988,6 +5875,7 @@ class MysqlDialect = {
|
|
|
5988
5875
|
readonly name: 'mysql'
|
|
5989
5876
|
readonly supportsAdvisoryLocks: true
|
|
5990
5877
|
readonly supportsTransactionalDdl: false
|
|
5878
|
+
stringType: (length: number) => string
|
|
5991
5879
|
}
|
|
5992
5880
|
|
|
5993
5881
|
class NPlusOneDetected = {
|
|
@@ -6029,6 +5917,7 @@ class PostgresDialect = {
|
|
|
6029
5917
|
readonly name: 'postgres'
|
|
6030
5918
|
readonly supportsAdvisoryLocks: true
|
|
6031
5919
|
readonly supportsTransactionalDdl: true
|
|
5920
|
+
stringType: () => string
|
|
6032
5921
|
}
|
|
6033
5922
|
|
|
6034
5923
|
class QueryBuilder = {
|
|
@@ -6168,6 +6057,7 @@ class SqliteDialect = {
|
|
|
6168
6057
|
readonly name: 'sqlite'
|
|
6169
6058
|
readonly supportsAdvisoryLocks: false
|
|
6170
6059
|
readonly supportsTransactionalDdl: true
|
|
6060
|
+
stringType: () => string
|
|
6171
6061
|
}
|
|
6172
6062
|
|
|
6173
6063
|
class StateError = {
|
|
@@ -6212,14 +6102,10 @@ class UnsupportedDialectError = {
|
|
|
6212
6102
|
readonly status: number
|
|
6213
6103
|
}
|
|
6214
6104
|
|
|
6215
|
-
const columnRegistry = Map<ClassRef, Map<string, ColumnOptions>>
|
|
6216
|
-
|
|
6217
6105
|
const DB = { table(tableName: string): QueryBuilder; raw<T = Record<string, unknown>>(sql: TemplateStringsArray | string, ...rest: unknown[]): Promise<T[]>; transaction<T>(callback: (tx?: SQLInstance) => Promise<T>, attempts?: number): Promise<T>; beginTransaction(): Promise<ManualTransaction>; onPrimary(): { table(name: string): QueryBuilder; }; currentTx(): unknown | undefined; advisoryLock<T>(key: number, callback: () => Promise<T>): Promise<T>; preventNPlusOne(options?: NPlusOneOptions): void; allowNPlusOne(pattern: string, options?: { once?: boolean; }): void;}
|
|
6218
6106
|
|
|
6219
6107
|
const ModelInspector = { load(pattern: string, cwd?: string): Promise<void>; all(): ModelSchema[]; fromClass(ctor: ClassRef): ModelSchema | null;}
|
|
6220
6108
|
|
|
6221
|
-
const modelsByName = Map<string, ClassRef>
|
|
6222
|
-
|
|
6223
6109
|
const relationRegistry = Map<ClassRef, Map<string, RelationMetadata>>
|
|
6224
6110
|
|
|
6225
6111
|
const Schema = { create(table: string, callback: (bp: Blueprint) => void): Promise<void>; createIfNotExists(table: string, callback: (bp: Blueprint) => void): Promise<void>; table(name: string, callback: (bp: Blueprint) => void): Promise<void>; alter(name: string, callback: (bp: Blueprint) => void): Promise<void>; drop(table: string): Promise<void>; dropIfExists(table: string): Promise<void>; rename(from: string, to: string): Promise<void>; hasTable(table: string): Promise<boolean>; hasColumn(table: string, column: string): Promise<boolean>;}
|
|
@@ -6230,32 +6116,14 @@ const SchemaInspector = { tables(): Promise<string[]>; columns(table: stri
|
|
|
6230
6116
|
|
|
6231
6117
|
const TransactionContext = AsyncLocalStorage<SQLInstance>
|
|
6232
6118
|
|
|
6233
|
-
function _clearModelConnections = () => void
|
|
6234
|
-
|
|
6235
|
-
function _clearTransitionCallbacks = () => void
|
|
6236
|
-
|
|
6237
6119
|
function _getConnection = () => SQLInstance
|
|
6238
6120
|
|
|
6239
6121
|
function _getDbConnectionOverride = () => SQLInstance | null
|
|
6240
6122
|
|
|
6241
|
-
function _getDialect = () => 'sqlite' | 'postgres' | 'mysql'
|
|
6242
|
-
|
|
6243
|
-
function _getModelConnection = () => SQLInstance
|
|
6244
|
-
|
|
6245
6123
|
function _globalScopeRegistry = () => Map<ClassRef, Map<string, GlobalScopeCallback>>
|
|
6246
6124
|
|
|
6247
|
-
function _normaliseSqliteUrl = (raw: string) => string
|
|
6248
|
-
|
|
6249
|
-
function _resolveConn = (ModelClass?: typeof BaseModel) => SQLInstance
|
|
6250
|
-
|
|
6251
|
-
function _setBaseModelConnection = (conn: SQLInstance | null) => void
|
|
6252
|
-
|
|
6253
|
-
function _setBaseModelDialect = (dialect: 'sqlite' | 'postgres' | 'mysql') => void
|
|
6254
|
-
|
|
6255
6125
|
function _setDbConnection = (conn: SQLInstance | null) => void
|
|
6256
6126
|
|
|
6257
|
-
function _setQueryBuilderDialect = (d: Dialect) => void
|
|
6258
|
-
|
|
6259
6127
|
function _setReadReplicas = (primary: SQLInstance, replicas: SQLInstance[]) => void
|
|
6260
6128
|
|
|
6261
6129
|
function _suppressHooks = <T>(fn: () => Promise<T>) => Promise<T>
|
|
@@ -6268,8 +6136,6 @@ function belongsTo = (related: () => unknown, options: BelongsToOptions) => (_va
|
|
|
6268
6136
|
|
|
6269
6137
|
function column = { (): ColumnDecorator; (type: ColumnShorthand): ColumnDecorator; (options: ColumnOptions): ColumnDecorator; (type: ColumnShorthand, options: Omit<ColumnOptions, 'type'>): ColumnDecorator;}
|
|
6270
6138
|
|
|
6271
|
-
function columnsFor = (ctor: ClassRef) => Map<string, ColumnOptions> | null
|
|
6272
|
-
|
|
6273
6139
|
function createReadWriteRouter = (primary: SQLInstance, replicas: SQLInstance[]) => SQLInstance
|
|
6274
6140
|
|
|
6275
6141
|
function currentOrmContext = () => OrmContext
|
|
@@ -6296,10 +6162,6 @@ function json = <T = unknown>(mapper?: CastMapper<T>) => JsonCast<T>
|
|
|
6296
6162
|
|
|
6297
6163
|
function manyToMany = (related: () => unknown, options: ManyToManyOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
6298
6164
|
|
|
6299
|
-
function modelByName = (name: string) => ClassRef | undefined
|
|
6300
|
-
|
|
6301
|
-
function modelForParam = (paramName: string) => ImplicitModel | undefined
|
|
6302
|
-
|
|
6303
6165
|
function morphedByMany = (related: () => unknown, options: MorphedByManyOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
6304
6166
|
|
|
6305
6167
|
function morphMany = (related: () => unknown, options: MorphManyOptions) => (_value: unknown, context: ClassFieldDecoratorContext) => void
|
|
@@ -6314,14 +6176,10 @@ function objectOf = <T = unknown>(mapper?: CastMapper<T>) => JsonCast<T>
|
|
|
6314
6176
|
|
|
6315
6177
|
function preventNPlusOne = (options?: NPlusOneOptions) => void
|
|
6316
6178
|
|
|
6317
|
-
function registerColumn = (ctor: ClassRef, name: string, options: ColumnOptions) => void
|
|
6318
|
-
|
|
6319
6179
|
function registerConnectionResolver = (fn: ContextConnectionResolver | null) => void
|
|
6320
6180
|
|
|
6321
6181
|
function registerImplicitBinding = () => void
|
|
6322
6182
|
|
|
6323
|
-
function registerModel = (ctor: ClassRef) => void
|
|
6324
|
-
|
|
6325
6183
|
function registerModelConnection = (name: string, conn: SQLInstance, dialect?: Dialect) => void
|
|
6326
6184
|
|
|
6327
6185
|
function resetOrmContext = () => void
|
|
@@ -6617,21 +6475,6 @@ interface PaginateResult = {
|
|
|
6617
6475
|
url: (page: number, baseUrl?: string, query?: Record<string, string>) => string
|
|
6618
6476
|
}
|
|
6619
6477
|
|
|
6620
|
-
interface QueryState = {
|
|
6621
|
-
distinct: boolean
|
|
6622
|
-
groupBys: string[]
|
|
6623
|
-
havings: HavingClause[]
|
|
6624
|
-
joins: JoinClause[]
|
|
6625
|
-
limit: number | undefined
|
|
6626
|
-
lock: string | undefined
|
|
6627
|
-
offset: number | undefined
|
|
6628
|
-
orders: OrderClause[]
|
|
6629
|
-
selects: string[]
|
|
6630
|
-
table: string
|
|
6631
|
-
unions: UnionClause[]
|
|
6632
|
-
wheres: WhereClause[]
|
|
6633
|
-
}
|
|
6634
|
-
|
|
6635
6478
|
interface RelationMetadata = {
|
|
6636
6479
|
firstKey?: string
|
|
6637
6480
|
foreignKey: string
|
|
@@ -6688,6 +6531,7 @@ interface SqlDialect = {
|
|
|
6688
6531
|
readonly name: DialectName
|
|
6689
6532
|
readonly supportsAdvisoryLocks: boolean
|
|
6690
6533
|
readonly supportsTransactionalDdl: boolean
|
|
6534
|
+
stringType: (length: number) => string
|
|
6691
6535
|
}
|
|
6692
6536
|
|
|
6693
6537
|
interface SQLInstance = {
|
|
@@ -6725,17 +6569,15 @@ interface TransitionContext = {
|
|
|
6725
6569
|
|
|
6726
6570
|
type CastMapper = ((raw: unknown) => T) | (new (...args: never[]) => T)
|
|
6727
6571
|
|
|
6728
|
-
type ClassRef = abstract new (...args: never[]) => unknown
|
|
6729
|
-
|
|
6730
6572
|
type Columns = { [K in keyof T & string]: K extends `_${string}` ? never : T[K] extends (...args: any[]) => any ? never : K; }[keyof T & string]
|
|
6731
6573
|
|
|
6732
|
-
type ColumnShorthand = 'string' | '
|
|
6574
|
+
type ColumnShorthand = 'string' | 'text' | 'integer' | 'number' | 'float' | 'boolean' | 'datetime' | 'date' | 'json' | 'array' | 'encrypted' | 'encrypted:json'
|
|
6733
6575
|
|
|
6734
6576
|
type Constructor = new (...args: any[]) => T
|
|
6735
6577
|
|
|
6736
6578
|
type ContextConnectionResolver = (ModelClass?: typeof BaseModel) => SQLInstance | null
|
|
6737
6579
|
|
|
6738
|
-
type DatePart = 'date' | 'time' | '
|
|
6580
|
+
type DatePart = 'date' | 'time' | 'day' | 'month' | 'year'
|
|
6739
6581
|
|
|
6740
6582
|
type DialectName = 'sqlite' | 'postgres' | 'mysql'
|
|
6741
6583
|
|
|
@@ -7070,13 +6912,13 @@ interface WorkerPoolOptions = {
|
|
|
7070
6912
|
size: number
|
|
7071
6913
|
}
|
|
7072
6914
|
|
|
7073
|
-
type BatchStatus = '
|
|
6915
|
+
type BatchStatus = 'pending' | 'complete' | 'failed'
|
|
7074
6916
|
|
|
7075
6917
|
type JobStatus = 'dispatched' | 'completed' | 'failed' | 'retried'
|
|
7076
6918
|
|
|
7077
6919
|
type SerializedJob = { className: string; payload: Record<string, unknown>;}
|
|
7078
6920
|
|
|
7079
|
-
type WorkerResult = {
|
|
6921
|
+
type WorkerResult = { success: true } | { success: false; error: string }
|
|
7080
6922
|
|
|
7081
6923
|
## ./routes `(./src/routes.ts)`
|
|
7082
6924
|
|
|
@@ -7092,17 +6934,11 @@ function hasRoute = (name: string) => boolean
|
|
|
7092
6934
|
|
|
7093
6935
|
function resetRoutes = () => void
|
|
7094
6936
|
|
|
7095
|
-
function routeMethod = (name: string) => string | undefined
|
|
7096
|
-
|
|
7097
6937
|
interface RouteAction = {
|
|
7098
6938
|
method: string
|
|
7099
6939
|
url: string
|
|
7100
6940
|
}
|
|
7101
6941
|
|
|
7102
|
-
interface RouteMethodRegistry = {}
|
|
7103
|
-
|
|
7104
|
-
type MethodedRouteName = never
|
|
7105
|
-
|
|
7106
6942
|
type RouteArgs = [params?: RouteParamValues, query?: RouteQuery]
|
|
7107
6943
|
|
|
7108
6944
|
type RouteParamValues = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
|
|
@@ -7382,7 +7218,7 @@ interface RedactGraphOptions = {
|
|
|
7382
7218
|
tooDeep: string
|
|
7383
7219
|
}
|
|
7384
7220
|
|
|
7385
|
-
type HashAlgorithm = '
|
|
7221
|
+
type HashAlgorithm = 'argon2id' | 'argon2i' | 'argon2d' | 'bcrypt'
|
|
7386
7222
|
|
|
7387
7223
|
## ./session `(./src/session.ts)`
|
|
7388
7224
|
|
|
@@ -8062,7 +7898,7 @@ type FakeFile = { create(name: string, content?: string | Uint8Array, type?:
|
|
|
8062
7898
|
|
|
8063
7899
|
type SessionDecoder = (response: Response) => Promise<Record<string, unknown> | null>
|
|
8064
7900
|
|
|
8065
|
-
type TestFormValue = string | number | boolean |
|
|
7901
|
+
type TestFormValue = string | number | boolean | null | undefined | TestFileInput | File | Blob
|
|
8066
7902
|
|
|
8067
7903
|
## ./validator `(./src/validator.ts)`
|
|
8068
7904
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zerotal",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -61,17 +61,17 @@
|
|
|
61
61
|
"typecheck": "tsc --noEmit"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@zerotal/auth": "1.7.
|
|
65
|
-
"@zerotal/cache": "1.7.
|
|
66
|
-
"@zerotal/client": "1.7.
|
|
67
|
-
"@zerotal/core": "1.7.
|
|
68
|
-
"@zerotal/media": "1.7.
|
|
69
|
-
"@zerotal/orm": "1.7.
|
|
70
|
-
"@zerotal/queue": "1.7.
|
|
71
|
-
"@zerotal/scheduler": "1.7.
|
|
72
|
-
"@zerotal/session": "1.7.
|
|
73
|
-
"@zerotal/testing": "1.7.
|
|
74
|
-
"@zerotal/validator": "1.7.
|
|
64
|
+
"@zerotal/auth": "1.7.5",
|
|
65
|
+
"@zerotal/cache": "1.7.5",
|
|
66
|
+
"@zerotal/client": "1.7.5",
|
|
67
|
+
"@zerotal/core": "1.7.5",
|
|
68
|
+
"@zerotal/media": "1.7.5",
|
|
69
|
+
"@zerotal/orm": "1.7.5",
|
|
70
|
+
"@zerotal/queue": "1.7.5",
|
|
71
|
+
"@zerotal/scheduler": "1.7.5",
|
|
72
|
+
"@zerotal/session": "1.7.5",
|
|
73
|
+
"@zerotal/testing": "1.7.5",
|
|
74
|
+
"@zerotal/validator": "1.7.5"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"typescript": "^5.8.0"
|