zerotal 1.7.0 → 1.7.3
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 +35 -2
- package/package.json +12 -12
package/api-surface.md
CHANGED
|
@@ -316,6 +316,7 @@ class HttpContext = {
|
|
|
316
316
|
new <TParams extends Record<string, unknown> = Record<string, string>>(request: Request, container: ScopedResolver): HttpContext<TParams>
|
|
317
317
|
static fake: (url?: string, init?: RequestInit, container?: ScopedResolver) => HttpContext
|
|
318
318
|
static tryGet: () => HttpContext | undefined
|
|
319
|
+
__: (key: string, replacements?: Replacements, locale?: string) => string
|
|
319
320
|
_afterResponseCallbacks: (() => Promise<void>)[]
|
|
320
321
|
_pageResolver?: (pageName: string) => number | undefined
|
|
321
322
|
_primeBody: (data: Record<string, unknown>) => void
|
|
@@ -368,7 +369,6 @@ class HttpContext = {
|
|
|
368
369
|
string: (key: string, fallback?: string) => string | undefined
|
|
369
370
|
subdomain: (name: string) => string | null
|
|
370
371
|
subdomains: Record<string, string>
|
|
371
|
-
t: (key: string, replacements?: Replacements, locale?: string) => string
|
|
372
372
|
took: number
|
|
373
373
|
user?: UserModel | undefined
|
|
374
374
|
view: { (markup: ViewMarkup, status?: number): void; <P extends Record<string, unknown> = Record<string, never>>(component: (ctx: HttpContext, props: P) => ViewMarkup | Promise<ViewMarkup>, props?: P | undefined, status?: number): void | Promise<void>;}
|
|
@@ -1101,6 +1101,7 @@ interface WebhookOptions = {
|
|
|
1101
1101
|
interface WebSocketHandlers = {
|
|
1102
1102
|
close?: (ws: unknown, code: number, reason: string) => void
|
|
1103
1103
|
drain?: (ws: unknown) => void
|
|
1104
|
+
idleTimeout?: number
|
|
1104
1105
|
message: (ws: unknown, message: string | Uint8Array) => void
|
|
1105
1106
|
open?: (ws: unknown) => void
|
|
1106
1107
|
}
|
|
@@ -5595,7 +5596,7 @@ class Cast = {
|
|
|
5595
5596
|
}
|
|
5596
5597
|
|
|
5597
5598
|
class ColumnBuilder = {
|
|
5598
|
-
new <Locked extends string = never>(name: string, _sqlType: string, isPrimary?: boolean, isAutoIncrement?: boolean): ColumnBuilder<Locked>
|
|
5599
|
+
new <Locked extends string = never>(name: string, _sqlType: string, isPrimary?: boolean, isAutoIncrement?: boolean, _isBoolean?: boolean): ColumnBuilder<Locked>
|
|
5599
5600
|
after: (_column: string) => ColumnBuilder<Locked>
|
|
5600
5601
|
alter: () => ColumnBuilder<Locked>
|
|
5601
5602
|
before: (_column: string) => ColumnBuilder<Locked>
|
|
@@ -5979,9 +5980,11 @@ class MysqlDialect = {
|
|
|
5979
5980
|
advisoryLockSql: (key: number) => DialectQuery
|
|
5980
5981
|
advisoryUnlockSql: (key: number) => DialectQuery
|
|
5981
5982
|
autoIncrementColumn: (column: string) => string
|
|
5983
|
+
booleanLiteral: (value: boolean) => string
|
|
5982
5984
|
dateExpr: (part: DatePart, column: string) => string
|
|
5983
5985
|
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
5984
5986
|
hasTableSql: (table: string) => DialectQuery
|
|
5987
|
+
readonly booleanType: 'INTEGER'
|
|
5985
5988
|
readonly name: 'mysql'
|
|
5986
5989
|
readonly supportsAdvisoryLocks: true
|
|
5987
5990
|
readonly supportsTransactionalDdl: false
|
|
@@ -6018,9 +6021,11 @@ class PostgresDialect = {
|
|
|
6018
6021
|
advisoryLockSql: (key: number) => DialectQuery
|
|
6019
6022
|
advisoryUnlockSql: (key: number) => DialectQuery
|
|
6020
6023
|
autoIncrementColumn: (column: string) => string
|
|
6024
|
+
booleanLiteral: (value: boolean) => string
|
|
6021
6025
|
dateExpr: (part: DatePart, column: string) => string
|
|
6022
6026
|
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
6023
6027
|
hasTableSql: (table: string) => DialectQuery
|
|
6028
|
+
readonly booleanType: 'BOOLEAN'
|
|
6024
6029
|
readonly name: 'postgres'
|
|
6025
6030
|
readonly supportsAdvisoryLocks: true
|
|
6026
6031
|
readonly supportsTransactionalDdl: true
|
|
@@ -6155,9 +6160,11 @@ class SqliteDialect = {
|
|
|
6155
6160
|
advisoryLockSql: () => DialectQuery | null
|
|
6156
6161
|
advisoryUnlockSql: () => DialectQuery | null
|
|
6157
6162
|
autoIncrementColumn: (column: string) => string
|
|
6163
|
+
booleanLiteral: (value: boolean) => string
|
|
6158
6164
|
dateExpr: (part: DatePart, column: string) => string
|
|
6159
6165
|
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
6160
6166
|
hasTableSql: (table: string) => DialectQuery
|
|
6167
|
+
readonly booleanType: 'INTEGER'
|
|
6161
6168
|
readonly name: 'sqlite'
|
|
6162
6169
|
readonly supportsAdvisoryLocks: false
|
|
6163
6170
|
readonly supportsTransactionalDdl: true
|
|
@@ -6673,9 +6680,11 @@ interface SqlDialect = {
|
|
|
6673
6680
|
advisoryLockSql: (key: number) => DialectQuery | null
|
|
6674
6681
|
advisoryUnlockSql: (key: number) => DialectQuery | null
|
|
6675
6682
|
autoIncrementColumn: (column: string) => string
|
|
6683
|
+
booleanLiteral: (value: boolean) => string
|
|
6676
6684
|
dateExpr: (part: DatePart, column: string) => string
|
|
6677
6685
|
hasColumnSql: (table: string, column: string) => DialectQuery
|
|
6678
6686
|
hasTableSql: (table: string) => DialectQuery
|
|
6687
|
+
readonly booleanType: string
|
|
6679
6688
|
readonly name: DialectName
|
|
6680
6689
|
readonly supportsAdvisoryLocks: boolean
|
|
6681
6690
|
readonly supportsTransactionalDdl: boolean
|
|
@@ -7073,14 +7082,37 @@ type WorkerResult = { success: true;} | { success: false; error: string
|
|
|
7073
7082
|
|
|
7074
7083
|
const route = RouteBuilder
|
|
7075
7084
|
|
|
7085
|
+
function action = <N extends RouteTarget>(name: N, params?: RouteParamValues | undefined, query?: RouteQuery | undefined) => RouteAction
|
|
7086
|
+
|
|
7087
|
+
function defineRouteMethods = (table: Readonly<Record<string, string>>) => void
|
|
7088
|
+
|
|
7076
7089
|
function defineRoutes = (table: RouteTable) => void
|
|
7077
7090
|
|
|
7078
7091
|
function hasRoute = (name: string) => boolean
|
|
7079
7092
|
|
|
7080
7093
|
function resetRoutes = () => void
|
|
7081
7094
|
|
|
7095
|
+
function routeMethod = (name: string) => string | undefined
|
|
7096
|
+
|
|
7097
|
+
interface RouteAction = {
|
|
7098
|
+
method: string
|
|
7099
|
+
url: string
|
|
7100
|
+
}
|
|
7101
|
+
|
|
7102
|
+
interface RouteMethodRegistry = {}
|
|
7103
|
+
|
|
7104
|
+
type MethodedRouteName = never
|
|
7105
|
+
|
|
7106
|
+
type RouteArgs = [params?: RouteParamValues, query?: RouteQuery]
|
|
7107
|
+
|
|
7108
|
+
type RouteParamValues = { [x: string]: RouteParamValue | readonly RouteParamValue[];}
|
|
7109
|
+
|
|
7110
|
+
type RouteQuery = { [x: string]: string | number | boolean | readonly (string | number | boolean)[] | null | undefined;}
|
|
7111
|
+
|
|
7082
7112
|
type RouteTable = Readonly<Record<string, string>> | ReadonlyMap<string, string>
|
|
7083
7113
|
|
|
7114
|
+
type RouteTarget = string
|
|
7115
|
+
|
|
7084
7116
|
## ./scheduler `(./src/scheduler.ts)`
|
|
7085
7117
|
|
|
7086
7118
|
class CronExpression = {
|
|
@@ -8159,6 +8191,7 @@ class FormRequest = {
|
|
|
8159
8191
|
static macro: (name: string, fn: (this: FormRequest, ...args: unknown[]) => unknown) => void
|
|
8160
8192
|
static validate: <T extends FormRequest>(this: new () => T) => Promise<Infer<ExtractDefs<ReturnType<T['rules']>>>>
|
|
8161
8193
|
authorize: () => boolean | Promise<boolean>
|
|
8194
|
+
prepareForValidation: (body: Record<string, unknown>) => Record<string, unknown>
|
|
8162
8195
|
rules: (_r: RuleBuilder) => Record<string, FieldRule>
|
|
8163
8196
|
}
|
|
8164
8197
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zerotal",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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.3",
|
|
65
|
+
"@zerotal/cache": "1.7.3",
|
|
66
|
+
"@zerotal/client": "1.7.3",
|
|
67
|
+
"@zerotal/core": "1.7.3",
|
|
68
|
+
"@zerotal/media": "1.7.3",
|
|
69
|
+
"@zerotal/orm": "1.7.3",
|
|
70
|
+
"@zerotal/queue": "1.7.3",
|
|
71
|
+
"@zerotal/scheduler": "1.7.3",
|
|
72
|
+
"@zerotal/session": "1.7.3",
|
|
73
|
+
"@zerotal/testing": "1.7.3",
|
|
74
|
+
"@zerotal/validator": "1.7.3"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"typescript": "^5.8.0"
|