exisjs 0.7.12 → 0.7.13
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 +195 -39
- package/dist/config/types.d.ts +2 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/decorators/params.d.ts +21 -0
- package/dist/decorators/params.d.ts.map +1 -1
- package/dist/decorators/params.js +21 -1
- package/dist/decorators/params.js.map +1 -1
- package/dist/di/container.d.ts +15 -6
- package/dist/di/container.d.ts.map +1 -1
- package/dist/di/container.js +26 -3
- package/dist/di/container.js.map +1 -1
- package/dist/di/index.d.ts +1 -1
- package/dist/di/index.d.ts.map +1 -1
- package/dist/di/index.js.map +1 -1
- package/dist/di/inject.d.ts +2 -1
- package/dist/di/inject.d.ts.map +1 -1
- package/dist/di/inject.js +2 -1
- package/dist/di/inject.js.map +1 -1
- package/dist/docs/BENCHMARKS.md +4 -4
- package/dist/docs/content/README.md +43 -44
- package/dist/docs/content/boundaries.mdx +138 -61
- package/dist/docs/content/cli/commands.mdx +151 -128
- package/dist/docs/content/cli/overview.mdx +61 -47
- package/dist/docs/content/cli/usage.mdx +107 -30
- package/dist/docs/content/config.mdx +145 -158
- package/dist/docs/content/controllers.mdx +193 -464
- package/dist/docs/content/cron.mdx +183 -69
- package/dist/docs/content/decorators.mdx +449 -154
- package/dist/docs/content/errors.mdx +202 -305
- package/dist/docs/content/exisjs-mcp.mdx +59 -49
- package/dist/docs/content/installation.mdx +243 -157
- package/dist/docs/content/introduction.mdx +220 -48
- package/dist/docs/content/middleware.mdx +171 -497
- package/dist/docs/content/modules.mdx +141 -83
- package/dist/docs/content/providers.mdx +216 -180
- package/dist/docs/content/requests.mdx +168 -488
- package/dist/docs/content/responses.mdx +200 -533
- package/dist/docs/content/routing.mdx +235 -598
- package/dist/docs/content/security.mdx +233 -57
- package/dist/docs/content/structure.mdx +151 -240
- package/dist/docs/content/swagger.mdx +192 -91
- package/dist/docs/content/testing.mdx +205 -74
- package/dist/docs/content/validation.mdx +479 -341
- package/dist/docs/reference/README.md +34 -2
- package/dist/docs/reference/config.mdx +277 -75
- package/dist/docs/reference/context.mdx +197 -106
- package/dist/docs/reference/cron.mdx +266 -152
- package/dist/docs/reference/database.mdx +135 -53
- package/dist/docs/reference/decorators.mdx +234 -116
- package/dist/docs/reference/di.mdx +146 -112
- package/dist/docs/reference/error.mdx +155 -178
- package/dist/docs/reference/exis.mdx +141 -70
- package/dist/docs/reference/logger.mdx +110 -126
- package/dist/docs/reference/middleware.mdx +235 -158
- package/dist/docs/reference/plugin.mdx +136 -64
- package/dist/docs/reference/router.mdx +275 -293
- package/dist/docs/reference/sanitize.mdx +91 -87
- package/dist/docs/reference/swagger.mdx +280 -100
- package/dist/docs/reference/testing.mdx +223 -89
- package/dist/docs/reference/validator.mdx +194 -206
- package/dist/lib/start-server.js +3 -8
- package/dist/lib/start-server.js.map +1 -1
- package/dist/module/module.d.ts +6 -3
- package/dist/module/module.d.ts.map +1 -1
- package/dist/module/module.js +17 -3
- package/dist/module/module.js.map +1 -1
- package/dist/router/controller-registrar.d.ts.map +1 -1
- package/dist/router/controller-registrar.js +26 -4
- package/dist/router/controller-registrar.js.map +1 -1
- package/dist/server/app.d.ts +3 -1
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +24 -8
- package/dist/server/app.js.map +1 -1
- package/dist/server/request.d.ts +2 -0
- package/dist/server/request.d.ts.map +1 -1
- package/dist/server/request.js +11 -0
- package/dist/server/request.js.map +1 -1
- package/dist/swagger/generator.d.ts.map +1 -1
- package/dist/swagger/generator.js +130 -10
- package/dist/swagger/generator.js.map +1 -1
- package/dist/telemetry/index.d.ts +12 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +121 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/testing/client.d.ts +1 -0
- package/dist/testing/client.d.ts.map +1 -1
- package/dist/testing/client.js +4 -1
- package/dist/testing/client.js.map +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +11 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/validator/builder.d.ts +26 -1
- package/dist/validator/builder.d.ts.map +1 -1
- package/dist/validator/builder.js +31 -0
- package/dist/validator/builder.js.map +1 -1
- package/dist/validator/engine.d.ts +23 -0
- package/dist/validator/engine.d.ts.map +1 -1
- package/dist/validator/engine.js +228 -31
- package/dist/validator/engine.js.map +1 -1
- package/dist/validator/index.d.ts +8 -4
- package/dist/validator/index.d.ts.map +1 -1
- package/dist/validator/index.js +4 -1
- package/dist/validator/index.js.map +1 -1
- package/dist/validator/tex-types.d.ts +15 -0
- package/dist/validator/tex-types.d.ts.map +1 -1
- package/dist/validator/tex-types.js +102 -0
- package/dist/validator/tex-types.js.map +1 -1
- package/dist/validator/tex.d.ts +1 -1
- package/dist/validator/tex.d.ts.map +1 -1
- package/dist/validator/tex.js +3 -1
- package/dist/validator/tex.js.map +1 -1
- package/dist/validator/types.d.ts +1 -0
- package/dist/validator/types.d.ts.map +1 -1
- package/package.json +46 -14
- package/dist/docs/content/dataloader.mdx +0 -170
- package/dist/docs/reference/dataloader.mdx +0 -91
|
@@ -1,281 +1,269 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
description: "API Reference for
|
|
2
|
+
title: "exisjs/validator"
|
|
3
|
+
description: "API Reference for the Tex validation engine, primitive types, modifier methods, pagination helpers, and schema resolution."
|
|
4
|
+
nextUrl: "/docs/reference/decorators"
|
|
5
|
+
nextTitle: "Decorators Reference"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# `exisjs/validator`
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
The `exisjs/validator` module provides the `tex` schema builder, Rust-accelerated `TexEngine`, data transformation modifiers, and pagination helpers for request body, query, and parameter validation.
|
|
9
11
|
|
|
10
12
|
---
|
|
11
13
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
The `tex` object provides factory functions for every common primitive and data structure:
|
|
15
|
-
|
|
16
|
-
- `tex.string(options?)`: Validates a string (supports min, max, trim, sanitizers, masking, SQL injection prevention, defaults).
|
|
17
|
-
- `tex.number(options?)`: Validates a numeric value. Automatically coerces numeric strings in query parameters (e.g., `?limit=100` $\to$ `100`) and supports `{ coerce: true, min, max, default }`.
|
|
18
|
-
- `tex.boolean(options?)`: Validates a boolean value. Automatically coerces boolean strings in query parameters (e.g., `?active=true` $\to$ `true`, `"1"`/`"0"`, `"yes"`/`"no"`) and supports `{ coerce: true, default }`.
|
|
19
|
-
- `tex.email(options?)`: Validates standard email formatting.
|
|
20
|
-
- `tex.uuid(options?)`: Validates UUID v1 or v4 strings (`{ version: 1 | 4 }`).
|
|
21
|
-
- `tex.cuid(options?)`: Validates CUID identifiers.
|
|
22
|
-
- `tex.password(options?)`: Enforces password complexity rules (`requireNumbers`, `requireSymbols`, `requireUppercase`, `requireLowercase`).
|
|
23
|
-
- `tex.creditCard(options?)`: Validates credit card number format with optional masking (`{ mask: true }`).
|
|
24
|
-
- `tex.date(options?)`: Validates Date instances, or coerces ISO 8601 strings and UNIX timestamps with `minDate` / `maxDate` bounds.
|
|
25
|
-
- `tex.enum(values, options?)`: Validates against a specific set of allowed strings.
|
|
26
|
-
- `tex.literal(value)`: Validates against an exact literal value (`string | number | boolean`).
|
|
27
|
-
- `tex.record(schema)`: Validates a dictionary / map of key-value pairs matching the given value schema.
|
|
28
|
-
- `tex.union(schemas)`: Validates that the input matches at least one of the provided schemas.
|
|
29
|
-
- `tex.any()`: Allows any arbitrary payload value without constraints.
|
|
30
|
-
- `tex.file(options?)`: Validates multipart file uploads (`maxSize`, `mimeTypes`).
|
|
31
|
-
|
|
32
|
-
### Objects & Arrays
|
|
33
|
-
|
|
34
|
-
- `tex.object({ ... })`: Validates an object against a strict shape. Supports arbitrarily nested sub-documents (`tex.object({ nested: tex.object(...) })`).
|
|
35
|
-
- `tex.array(schema, options?)`: Validates an array of items matching the given schema.
|
|
36
|
-
- **Schema Types**: Accepts primitive types (`tex.string()`), nested `tex.object(...)`, or shorthand plain objects (`tex.array({ ... })`).
|
|
37
|
-
- **TypeScript Inference**: TypeScript automatically infers the element object shape for both `tex.object(...)` and plain objects without falling back to `never`.
|
|
38
|
-
- **Single-Object Coercion**: Automatically coerces single objects (e.g. `{ item: { ... } }` from HTML forms) into single-item arrays `[ { ... } ]` rather than throwing `"Must be an array"`.
|
|
39
|
-
- **Stringified JSON**: Automatically parses and deserializes stringified JSON arrays (e.g. from `multipart/form-data`).
|
|
40
|
-
- **Options**: Supports `{ min, max, dedupe, optional, nullable, nullish }`.
|
|
14
|
+
## Module Exports
|
|
41
15
|
|
|
42
16
|
```typescript
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
17
|
+
import {
|
|
18
|
+
tex,
|
|
19
|
+
TexBuilder,
|
|
20
|
+
TexEngine,
|
|
21
|
+
TexTransformedEngine,
|
|
22
|
+
TexDiscriminatedUnionEngine,
|
|
23
|
+
TexType,
|
|
24
|
+
ValidatorError,
|
|
25
|
+
paginate,
|
|
26
|
+
getPaginationSkip,
|
|
27
|
+
} from 'exisjs/validator'
|
|
28
|
+
|
|
29
|
+
import type {
|
|
30
|
+
Infer,
|
|
31
|
+
ResolveSchema,
|
|
32
|
+
TexBaseOptions,
|
|
33
|
+
TexStringOptions,
|
|
34
|
+
TexNumberOptions,
|
|
35
|
+
TexBooleanOptions,
|
|
36
|
+
TexArrayOptions,
|
|
37
|
+
TexEnumOptions,
|
|
38
|
+
TexDateOptions,
|
|
39
|
+
TexFileOptions,
|
|
40
|
+
TexPasswordOptions,
|
|
41
|
+
TexObjectOptions,
|
|
42
|
+
ValidationErrorDescriptor,
|
|
43
|
+
PaginationMeta,
|
|
44
|
+
PaginatedResult,
|
|
45
|
+
} from 'exisjs/validator'
|
|
56
46
|
```
|
|
57
47
|
|
|
58
|
-
|
|
48
|
+
---
|
|
59
49
|
|
|
60
|
-
|
|
50
|
+
## Schema Factory (`tex`)
|
|
51
|
+
|
|
52
|
+
The `tex` instance exposes factory functions for all standard primitives, complex structures, and specialized validators.
|
|
53
|
+
|
|
54
|
+
### Primitive Validators
|
|
55
|
+
|
|
56
|
+
| Method | Return Type | Options Interface | Description |
|
|
57
|
+
| :--- | :--- | :--- | :--- |
|
|
58
|
+
| `tex.string(options?)` | `TexType<string>` | `TexStringOptions` | String validation with trimming, HTML escaping, min/max bounds, masking, coercion, and injection checks. |
|
|
59
|
+
| `tex.number(options?)` | `TexType<number>` | `TexNumberOptions` | Number validation with optional string coercion (`coerce: true`) and min/max limits. |
|
|
60
|
+
| `tex.boolean(options?)` | `TexType<boolean>` | `TexBooleanOptions` | Boolean validation with string/numeric coercion (`"true"`, `"1"` -> `true`). |
|
|
61
|
+
| `tex.email(options?)` | `TexType<string>` | `TexStringOptions` | Standard RFC 5322 email format validation. |
|
|
62
|
+
| `tex.uuid(options?)` | `TexType<string>` | `{ version?: 1 \| 4 }` | Validates UUID strings (v1 or v4). |
|
|
63
|
+
| `tex.cuid(options?)` | `TexType<string>` | `TexBaseOptions` | Validates CUID identifiers. |
|
|
64
|
+
| `tex.date(options?)` | `TexType<Date>` | `TexDateOptions` | Validates `Date` objects, ISO 8601 strings, or numeric timestamps (`minDate`, `maxDate`). |
|
|
65
|
+
| `tex.password(options?)` | `TexType<string>` | `TexPasswordOptions` | Enforces password complexity (uppercase, lowercase, numbers, symbols). |
|
|
66
|
+
| `tex.creditCard(options?)` | `TexType<string>` | `{ mask?: boolean }` | Luhn-validated credit card numbers with optional masking. |
|
|
67
|
+
| `tex.file(options?)` | `TexType<ExisFile>` | `TexFileOptions` | Multipart file upload validation (`maxSize`, `mimeTypes`). |
|
|
68
|
+
| `tex.enum(values, options?)` | `TexType<T>` | `TexEnumOptions<T>` | Validates against a fixed array or tuple of string literal values. |
|
|
69
|
+
| `tex.literal(value)` | `TexType<T>` | None | Validates an exact primitive literal (`string \| number \| boolean`). |
|
|
70
|
+
| `tex.record(schema)` | `TexType<Record<string, V>>` | None | Validates key-value dictionaries matching value schema `V`. |
|
|
71
|
+
| `tex.union(schemas)` | `TexType<T>` | None | Validates against any one of the provided schemas. |
|
|
72
|
+
| `tex.any()` | `TexType<any>` | None | Allows any arbitrary unconstrained value. |
|
|
61
73
|
|
|
62
|
-
|
|
63
|
-
import { tex, paginate, getPaginationSkip } from 'exisjs/validator'
|
|
74
|
+
---
|
|
64
75
|
|
|
65
|
-
|
|
66
|
-
defaultLimit: 20,
|
|
67
|
-
maxLimit: 100,
|
|
68
|
-
})
|
|
76
|
+
### Explicit Coercion (`tex.coerce`)
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
const { skip, limit, page } = getPaginationSkip({ page: 2, limit: 20 })
|
|
72
|
-
// skip = 20, limit = 20, page = 2
|
|
78
|
+
The `tex.coerce` namespace provides explicit coercion primitives for query parameters, path variables, and form inputs:
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
| Method | Return Type | Description |
|
|
81
|
+
| :--- | :--- | :--- |
|
|
82
|
+
| `tex.coerce.number(options?)` | `TexType<number>` | Coerces string and numeric input to `number`. |
|
|
83
|
+
| `tex.coerce.boolean(options?)` | `TexType<boolean>` | Coerces `"true"`, `"false"`, `"1"`, `"0"` to `boolean`. |
|
|
84
|
+
| `tex.coerce.date(options?)` | `TexType<Date>` | Coerces ISO 8601 strings and timestamps to native `Date`. |
|
|
85
|
+
| `tex.coerce.string(options?)` | `TexType<string>` | Coerces numeric and primitive inputs to `string`. |
|
|
77
86
|
|
|
78
87
|
---
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
### Complex Structures
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
#### `tex.object(shape, options?)`
|
|
83
92
|
|
|
84
|
-
|
|
85
|
-
```typescript filename="src/http/users/route.ts"
|
|
86
|
-
import { Controller, Post, Body } from 'exisjs/decorators'
|
|
87
|
-
import { tex } from 'exisjs/validator'
|
|
93
|
+
Validates an object against a structured field schema.
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
95
|
+
```typescript
|
|
96
|
+
const UserSchema = tex.object({
|
|
97
|
+
id: tex.string(),
|
|
98
|
+
profile: tex.object({
|
|
99
|
+
bio: tex.string().optional(),
|
|
100
|
+
avatarUrl: tex.string().optional(),
|
|
101
|
+
}),
|
|
102
|
+
roles: tex.array(tex.enum(['admin', 'user', 'guest'] as const)),
|
|
103
|
+
})
|
|
98
104
|
```
|
|
99
105
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
body: CreateUserSchema,
|
|
110
|
-
async handle(ctx) {
|
|
111
|
-
// ctx.body is strictly inferred as { email: string }
|
|
112
|
-
return { success: true, email: ctx.body.email }
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
})
|
|
106
|
+
#### `tex.discriminatedUnion(discriminator, variants)`
|
|
107
|
+
|
|
108
|
+
Validates polymorphic object variants by inspecting a literal or enum discriminator property:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
const ActionSchema = tex.discriminatedUnion('kind', [
|
|
112
|
+
tex.object({ kind: tex.literal('create'), name: tex.string() }),
|
|
113
|
+
tex.object({ kind: tex.literal('delete'), id: tex.uuid() }),
|
|
114
|
+
])
|
|
116
115
|
```
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
#### `tex.array(schema, options?)`
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
All validators accept an options object that allows you to configure validation constraints and behaviors.
|
|
123
|
-
|
|
124
|
-
- `optional` / `.optional()`: Marks the field as optional (allows `undefined`).
|
|
125
|
-
- `nullable` / `.nullable()`: Marks the field as nullable (allows `null`).
|
|
126
|
-
- `nullish` / `.nullish()`: Marks the field as nullish (allows both `null` and `undefined`).
|
|
127
|
-
- `default`: Accepts a static literal value (`string | number | boolean | ...`) or a lazy factory function (`() => value`). Automatically marks the field as optional in schemas while inferring a non-optional concrete TypeScript return type.
|
|
128
|
-
- `coerce`: Instructs the Rust engine to automatically convert types when possible before validating. For example, converting `"123"` into a number, or `3000` into a string.
|
|
129
|
-
|
|
130
|
-
> [!TIP]
|
|
131
|
-
> **Static vs. Dynamic Defaults**:
|
|
132
|
-
> ```typescript
|
|
133
|
-
> const ConfigSchema = tex.object({
|
|
134
|
-
> // Static defaults
|
|
135
|
-
> PORT: tex.number({ coerce: true, default: 3000 }),
|
|
136
|
-
> THEME: tex.enum(['light', 'dark'] as const, { default: 'light' }),
|
|
137
|
-
> TAGS: tex.array(tex.string(), { default: ['exis', 'framework'] }),
|
|
138
|
-
>
|
|
139
|
-
> // Dynamic defaults (evaluated per parse call)
|
|
140
|
-
> createdAt: tex.date({ default: () => new Date() }),
|
|
141
|
-
> requestId: tex.string({ default: () => crypto.randomUUID() }),
|
|
142
|
-
> })
|
|
143
|
-
> ```
|
|
144
|
-
|
|
145
|
-
> [!NOTE]
|
|
146
|
-
> **Empty String Interop**: If an incoming string is empty (`""`), and the field is configured as `optional`, `nullable`, or `nullish`, ExisJS automatically converts it to `undefined` or `null` before running type checks. This cleanly handles form submissions and query strings without requiring ad-hoc pre-processors.
|
|
119
|
+
Validates an array of items matching a schema or object shape shorthand.
|
|
147
120
|
|
|
148
121
|
```typescript
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// Converts boolean 'false' or number '0' to string "false" / "0"
|
|
155
|
-
ID_AS_STRING: tex.string({ coerce: true }),
|
|
156
|
-
|
|
157
|
-
// Converts string "true" or number '1' to boolean true
|
|
158
|
-
ENABLE_FEATURE: tex.boolean({ coerce: true })
|
|
122
|
+
const CartSchema = tex.object({
|
|
123
|
+
items: tex.array({
|
|
124
|
+
sku: tex.string(),
|
|
125
|
+
quantity: tex.number({ min: 1 }),
|
|
126
|
+
}, { min: 1, max: 50 }),
|
|
159
127
|
})
|
|
160
128
|
```
|
|
161
129
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
| :--- | :--- |
|
|
166
|
-
| `tex.string(opts?)` | `min`, `max`, `trim`, `collapseWhitespace`, `toLowerCase`, `toUpperCase`, `escapeHtml`, `stripHtml`, `slugify`, `mask`, `preventSql`, `preventTraversal`, `default`, `optional`, `nullable`, `nullish` |
|
|
167
|
-
| `tex.number(opts?)` | `min`, `max`, `coerce`, `default`, `optional`, `nullable`, `nullish` |
|
|
168
|
-
| `tex.boolean(opts?)` | `coerce`, `default`, `optional`, `nullable`, `nullish` |
|
|
169
|
-
| `tex.date(opts?)` | `coerce`, `minDate`, `maxDate`, `default`, `optional`, `nullable`, `nullish` |
|
|
170
|
-
| `tex.array(schema, opts?)` | `min`, `max`, `dedupe`, `coerce`, `default`, `optional`, `nullable`, `nullish` |
|
|
171
|
-
| `tex.enum(values, opts?)` | `default`, `optional`, `nullable`, `nullish` |
|
|
172
|
-
| `tex.uuid(opts?)` | `version: 1 \| 4`, `default`, `optional`, `nullable`, `nullish` |
|
|
173
|
-
| `tex.password(opts?)` | `min`, `max`, `requireNumbers`, `requireSymbols`, `requireUppercase`, `requireLowercase`, `optional`, `nullable`, `nullish` |
|
|
174
|
-
| `tex.creditCard(opts?)` | `mask: boolean`, `optional`, `nullable`, `nullish` |
|
|
175
|
-
| `tex.file(opts?)` | `maxSize`, `mimeTypes: string[]`, `optional`, `nullable`, `nullish` |
|
|
130
|
+
#### `tex.env(shape)`
|
|
131
|
+
|
|
132
|
+
Constructs a boot-time environment parser that automatically enables coercion for all numeric, boolean, date, and array fields.
|
|
176
133
|
|
|
177
134
|
```typescript
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
})
|
|
135
|
+
export const env = tex.env({
|
|
136
|
+
PORT: tex.number({ default: 3000 }),
|
|
137
|
+
HOST: tex.string({ default: '0.0.0.0' }),
|
|
138
|
+
DATABASE_URL: tex.string(),
|
|
139
|
+
CORS_ORIGINS: tex.array(tex.string()),
|
|
140
|
+
}).parse(process.env)
|
|
185
141
|
```
|
|
186
142
|
|
|
187
143
|
---
|
|
188
144
|
|
|
189
|
-
##
|
|
145
|
+
## Modifier Methods & Schema Chaining
|
|
190
146
|
|
|
191
|
-
|
|
192
|
-
Runs one or more synchronous sanitization functions over the data **before** the Rust validation executes. Use this for complex object transformations or string formatting. ExisJS provides a rich suite of built-in sanitizers through the `exisjs/sanitize` module.
|
|
147
|
+
All `TexType` instances provide fluent modifier and documentation methods:
|
|
193
148
|
|
|
194
|
-
|
|
195
|
-
|
|
149
|
+
| Method | Signature | Description |
|
|
150
|
+
| :--- | :--- | :--- |
|
|
151
|
+
| `.optional()` | `() => TexType<T \| undefined>` | Marks the field as optional (permits `undefined`). |
|
|
152
|
+
| `.nullable()` | `() => TexType<T \| null>` | Marks the field as nullable (permits `null`). |
|
|
153
|
+
| `.nullish()` | `() => TexType<T \| null \| undefined>` | Permits both `null` and `undefined`. |
|
|
154
|
+
| `.default(val)` | `(val: T \| (() => T)) => TexType<T>` | Sets a static value or dynamic factory returned when input is omitted. |
|
|
155
|
+
| `.describe(text)` | `(description: string) => this` | Sets documentation description metadata for OpenAPI 3.1 generation. |
|
|
156
|
+
| `.example(val)` | `(example: any) => this` | Sets example value metadata for OpenAPI 3.1 generation. |
|
|
157
|
+
| `.sanitize(...fns)` | `(...fns: ((val: T) => T)[]) => this` | Executes synchronous transformation functions before validation. |
|
|
158
|
+
| `.refine(fn, message)` | `(fn: (val: T) => boolean, msg: string) => this` | Adds custom validation logic evaluated after native validation. |
|
|
159
|
+
| `.refineAsync(fn, message)` | `(fn: (val: T) => Promise<boolean>, msg: string) => this` | Adds asynchronous validation logic (e.g. database lookups). |
|
|
160
|
+
| `.transform(fn)` | `<Out>(fn: (val: T) => Out) => TexTransformed<Out>` | Applies a synchronous transformation to validated field data. |
|
|
161
|
+
| `.toOpenApi()` | `() => Record<string, any>` | Converts the type definition into an OpenAPI 3.1 schema object. |
|
|
196
162
|
|
|
197
|
-
|
|
198
|
-
const CleanString = tex.string().sanitize(sanitize.trim, sanitize.toLowerCase)
|
|
163
|
+
---
|
|
199
164
|
|
|
200
|
-
|
|
201
|
-
const WhiteListIPs = tex.array(tex.string())
|
|
202
|
-
.sanitize((val) => typeof val === 'string' ? val.split(',') : val)
|
|
203
|
-
```
|
|
165
|
+
## `TexEngine` Schema Object Methods
|
|
204
166
|
|
|
205
|
-
|
|
206
|
-
Runs custom validation logic **after** the Rust validation executes. Useful for complex business logic that cannot be expressed purely with basic schema types.
|
|
167
|
+
`TexEngine` instances constructed via `tex.object()`, `tex.env()`, or derived builders provide composition and execution methods:
|
|
207
168
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
169
|
+
| Method | Signature | Description |
|
|
170
|
+
| :--- | :--- | :--- |
|
|
171
|
+
| `partial()` | `() => TexEngine<Partial<T>>` | Returns a copy of the schema with all fields marked optional. |
|
|
172
|
+
| `pick(keys)` | `<K extends keyof T>(keys: K[]) => TexEngine<Pick<T, K>>` | Creates a new schema containing only the specified keys. |
|
|
173
|
+
| `omit(keys)` | `<K extends keyof T>(keys: K[]) => TexEngine<Omit<T, K>>` | Creates a new schema omitting the specified keys. |
|
|
174
|
+
| `extend(shape)` | `<E>(extension: E) => TexEngine<T & ResolveSchema<E>>` | Merges additional or overridden fields into the existing schema. |
|
|
175
|
+
| `merge(other)` | `<U>(other: TexEngine<U>) => TexEngine<T & U>` | Deeply merges two `TexEngine` schemas into a combined validator. |
|
|
176
|
+
| `transform(fn)` | `<Out>(fn: (data: T) => Out) => TexTransformedEngine<T, Out>` | Applies post-validation data reshaping to the entire schema output. |
|
|
177
|
+
| `parse(data)` | `(data: unknown) => T` | Synchronously parses and validates data, throwing `ValidatorError` on failure. |
|
|
178
|
+
| `parseAsync(data)` | `(data: unknown) => Promise<T>` | Asynchronously parses and validates data, evaluating async refinements. |
|
|
179
|
+
| `safeParse(data)` | `(data: unknown) => { success: true, data: T } \| { success: false, error: ValidatorError }` | Validates data without throwing exceptions. |
|
|
180
|
+
| `toOpenApi()` | `() => Record<string, any>` | Translates the schema into an OpenAPI 3.1 JSON schema representation. |
|
|
214
181
|
|
|
215
182
|
---
|
|
216
183
|
|
|
217
|
-
## Type
|
|
184
|
+
## TypeScript Type Extraction
|
|
218
185
|
|
|
219
|
-
|
|
186
|
+
Extract static TypeScript types from any schema using `Infer<T>` or `ResolveSchema<T>`:
|
|
220
187
|
|
|
221
188
|
```typescript
|
|
222
|
-
import { tex, type ResolveSchema } from 'exisjs/validator'
|
|
189
|
+
import { tex, type Infer, type ResolveSchema } from 'exisjs/validator'
|
|
223
190
|
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
191
|
+
const CreateProductSchema = tex.object({
|
|
192
|
+
title: tex.string(),
|
|
193
|
+
price: tex.number({ min: 0 }),
|
|
194
|
+
tags: tex.array(tex.string()).optional(),
|
|
227
195
|
})
|
|
228
196
|
|
|
229
|
-
//
|
|
230
|
-
type
|
|
197
|
+
// Using Infer:
|
|
198
|
+
type CreateProductInput = Infer<typeof CreateProductSchema>
|
|
199
|
+
|
|
200
|
+
// Using ResolveSchema:
|
|
201
|
+
type ProductDto = ResolveSchema<typeof CreateProductSchema>
|
|
231
202
|
```
|
|
232
203
|
|
|
233
204
|
---
|
|
234
205
|
|
|
235
|
-
##
|
|
206
|
+
## Pagination Utilities
|
|
236
207
|
|
|
237
|
-
|
|
208
|
+
### `tex.pagination(options?)`
|
|
238
209
|
|
|
239
|
-
|
|
210
|
+
Creates a pre-configured query string schema for paginated endpoints:
|
|
240
211
|
|
|
241
|
-
|
|
212
|
+
```typescript
|
|
213
|
+
const paginationQuery = tex.pagination({
|
|
214
|
+
defaultLimit: 20,
|
|
215
|
+
maxLimit: 100,
|
|
216
|
+
})
|
|
217
|
+
```
|
|
242
218
|
|
|
243
|
-
|
|
219
|
+
### `getPaginationSkip(query)`
|
|
244
220
|
|
|
245
|
-
|
|
246
|
-
import { tex } from 'exisjs/validator'
|
|
221
|
+
Calculates database offset values (`skip`, `limit`, `page`) from query inputs.
|
|
247
222
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
DEBUG: tex.boolean({ default: false }), // Parsed from "true" | "1" | "false" | "0"
|
|
252
|
-
DATABASE_URL: tex.string(),
|
|
253
|
-
JWT_SECRET: tex.string({ min: 32 }),
|
|
254
|
-
ALLOWED_ORIGINS: tex.array(tex.string()), // Parsed from "http://localhost:3000,https://app.com"
|
|
255
|
-
NODE_ENV: tex.enum(['development', 'production', 'test'] as const, {
|
|
256
|
-
default: 'development',
|
|
257
|
-
}),
|
|
258
|
-
}).parse(process.env)
|
|
223
|
+
```typescript
|
|
224
|
+
const { skip, limit, page } = getPaginationSkip({ page: 3, limit: 25 })
|
|
225
|
+
// Result: skip = 50, limit = 25, page = 3
|
|
259
226
|
```
|
|
260
227
|
|
|
261
|
-
|
|
262
|
-
|
|
228
|
+
### `paginate(items, total, options)`
|
|
229
|
+
|
|
230
|
+
Wraps an array of items into a standardized paginated response envelope:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
const result = paginate(items, 250, { page: 1, limit: 20 })
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Envelope Output Structure
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
export interface PaginatedResult<T> {
|
|
240
|
+
data: T[]
|
|
241
|
+
pagination: {
|
|
242
|
+
page: number
|
|
243
|
+
limit: number
|
|
244
|
+
total: number
|
|
245
|
+
totalPages: number
|
|
246
|
+
hasNextPage: boolean
|
|
247
|
+
hasPrevPage: boolean
|
|
248
|
+
hasNext: boolean
|
|
249
|
+
hasPrev: boolean
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
```
|
|
263
253
|
|
|
264
254
|
---
|
|
265
255
|
|
|
266
|
-
##
|
|
256
|
+
## Error Handling & Diagnostics
|
|
267
257
|
|
|
268
|
-
When validation fails,
|
|
258
|
+
When validation fails, `TexEngine` raises a `ValidatorError` containing an array of structured issue descriptors:
|
|
269
259
|
|
|
270
260
|
```typescript
|
|
271
261
|
export interface ValidationErrorDescriptor {
|
|
272
|
-
path: string // e.g. "email"
|
|
273
|
-
message: string //
|
|
274
|
-
expected
|
|
275
|
-
received
|
|
276
|
-
code
|
|
262
|
+
path: string // Property key or nested path (e.g. "user.email", "items[0].sku")
|
|
263
|
+
message: string // Descriptive validation error message
|
|
264
|
+
expected?: string // Expected constraint or format
|
|
265
|
+
received?: string // Received value type representation
|
|
266
|
+
code?: string // Machine-readable error code (e.g. MISSING_REQUIRED_FIELD)
|
|
277
267
|
}
|
|
278
268
|
```
|
|
279
269
|
|
|
280
|
-
In HTTP 400 responses, the envelope contains both a legacy `errors: Record<string, string>` dictionary for backward compatibility and a structured `details: ValidationErrorDescriptor[]` array for modern form libraries.
|
|
281
|
-
|
package/dist/lib/start-server.js
CHANGED
|
@@ -156,16 +156,11 @@ async function start() {
|
|
|
156
156
|
app.options.telemetry &&
|
|
157
157
|
app.options.telemetry.enabled) {
|
|
158
158
|
try {
|
|
159
|
-
const telemetry = await Promise.resolve().then(() => __importStar(require('
|
|
160
|
-
telemetry.initTelemetry(app.options.telemetry);
|
|
159
|
+
const telemetry = await Promise.resolve().then(() => __importStar(require('../telemetry/index.js')));
|
|
160
|
+
await telemetry.initTelemetry(app.options.telemetry);
|
|
161
161
|
}
|
|
162
162
|
catch (err) {
|
|
163
|
-
|
|
164
|
-
console.warn('\x1b[33m[ExisJS] Warning: config.telemetry is enabled, but @exisjs/telemetry is not installed. Please run `npm install @exisjs/telemetry`.\x1b[0m');
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
console.error('[ExisJS] Failed to initialize telemetry:', err);
|
|
168
|
-
}
|
|
163
|
+
console.error('[ExisJS] Failed to initialize telemetry:', err);
|
|
169
164
|
}
|
|
170
165
|
}
|
|
171
166
|
if (typeof app.onStartHook === 'function') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-server.js","sourceRoot":"","sources":["../../src/lib/start-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwB;AACxB,uCAAwC;AACxC,qDAAmD;AAEnD,KAAK,UAAU,KAAK;IAClB,2EAA2E;IAC3E,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,MAAM,KAAK,GAAG,iBAAE,CAAC,iBAAiB,EAAE,CAAA;QACpC,IAAI,KAAK,CAAC,cAAc,GAAG,GAAG,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;YACvD,OAAO,CAAC,KAAK,CACX,6EAA6E,CAC9E,CAAA;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAC,+BAA+B;QACnD,CAAC;IACH,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAA,CAAC,6BAA6B;IAE/C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAA;IAE7C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,wDAAa,wBAAwB,GAAC,CAAA;QACnE,gBAAgB,CAAC,aAAa,EAAE,CAAA;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EAAE,GAAG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C;YAC1B,qCAAqC;YACrC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC1B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,wEAAwE;QACxE,0DAA0D;IAC5D,CAAC;IAED,IAAA,yBAAY,EACV,GAAG,EAAE;QACH,KAAK,EAAE,CAAA;IACT,CAAC,EACD,EAAE,OAAO,EAAE,CACZ,CAAA;AACH,CAAC;AAED,SAAS,EAAE,CAAA"}
|
package/dist/module/module.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { App } from '../server/app';
|
|
2
2
|
import type { ExisPlugin } from '../types';
|
|
3
|
-
import type { ProviderDefinition } from '../di/container';
|
|
3
|
+
import type { ProviderToken, ProviderDefinition, CustomProvider } from '../di/container';
|
|
4
|
+
export type ModuleProviderItem = [ProviderToken<any>, ProviderDefinition<any>] | CustomProvider<any> | (new (...args: any[]) => any) | any;
|
|
4
5
|
export interface ModuleOptions {
|
|
5
6
|
name: string;
|
|
6
7
|
imports?: ExisPlugin[];
|
|
7
|
-
providers?: [
|
|
8
|
+
providers?: ModuleProviderItem[];
|
|
8
9
|
routes?: (app: App) => void;
|
|
9
10
|
onStart?: (app: App) => void | Promise<void>;
|
|
10
11
|
onClose?: (app: App) => void | Promise<void>;
|
|
@@ -18,7 +19,9 @@ export interface ModuleOptions {
|
|
|
18
19
|
* export const userModule = defineModule({
|
|
19
20
|
* name: 'UserModule',
|
|
20
21
|
* providers: [
|
|
21
|
-
*
|
|
22
|
+
* UserService,
|
|
23
|
+
* { provide: 'CONFIG', useValue: { port: 3000 } },
|
|
24
|
+
* ['CustomToken', { useClass: CustomService }]
|
|
22
25
|
* ],
|
|
23
26
|
* routes(app) {
|
|
24
27
|
* app.router.use('/users', userController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,cAAc,EACf,MAAM,iBAAiB,CAAA;AAExB,MAAM,MAAM,kBAAkB,GAC1B,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAC7C,cAAc,CAAC,GAAG,CAAC,GACnB,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAC7B,GAAG,CAAA;AAEP,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAChC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,CAwC/D"}
|
package/dist/module/module.js
CHANGED
|
@@ -10,7 +10,9 @@ exports.defineModule = defineModule;
|
|
|
10
10
|
* export const userModule = defineModule({
|
|
11
11
|
* name: 'UserModule',
|
|
12
12
|
* providers: [
|
|
13
|
-
*
|
|
13
|
+
* UserService,
|
|
14
|
+
* { provide: 'CONFIG', useValue: { port: 3000 } },
|
|
15
|
+
* ['CustomToken', { useClass: CustomService }]
|
|
14
16
|
* ],
|
|
15
17
|
* routes(app) {
|
|
16
18
|
* app.router.use('/users', userController);
|
|
@@ -35,8 +37,20 @@ function defineModule(options) {
|
|
|
35
37
|
}
|
|
36
38
|
// 2. Register Providers into the DI container
|
|
37
39
|
if (options.providers) {
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
+
for (const item of options.providers) {
|
|
41
|
+
if (Array.isArray(item)) {
|
|
42
|
+
const [token, config] = item;
|
|
43
|
+
app.provide(token, config);
|
|
44
|
+
}
|
|
45
|
+
else if (typeof item === 'function') {
|
|
46
|
+
app.provide(item, { useClass: item });
|
|
47
|
+
}
|
|
48
|
+
else if (item && typeof item === 'object' && 'provide' in item) {
|
|
49
|
+
app.provide(item);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
app.provide(item, item);
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
55
|
}
|
|
42
56
|
// 3. Register optional manual routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":";;AA6CA,oCAwCC;AA9DD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,YAAY,CAAC,OAAsB;IACjD,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;YAC3B,mCAAmC;YACnC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;oBAClC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CA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AAG,EAAE,MAAM,eAAe,CAAA;AAGxC,qBAAa,mBAAmB;IAClB,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC;IAI1B,mBAAmB,CACxB,WAAW,EAAE,GAAG,EAAE,EAClB,QAAQ,SAAK,EACb,iBAAiB,GAAE,GAAG,EAAO,GAC5B,GAAG,CAAC,GAAG,CAAC;IAIX,OAAO,CAAC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"controller-registrar.d.ts","sourceRoot":"","sources":["../../src/router/controller-registrar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC,qBAAa,mBAAmB;IAClB,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC;IAI1B,mBAAmB,CACxB,WAAW,EAAE,GAAG,EAAE,EAClB,QAAQ,SAAK,EACb,iBAAiB,GAAE,GAAG,EAAO,GAC5B,GAAG,CAAC,GAAG,CAAC;IAIX,OAAO,CAAC,oBAAoB;CA2tB7B"}
|