@nhtio/validation 1.20251029.2 → 1.20251030.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhtio/validation",
3
- "version": "1.20251029.2",
3
+ "version": "1.20251030.1",
4
4
  "description": "A powerful schema description language and data validator",
5
5
  "keywords": [],
6
6
  "author": "Jak Giveon <jak@nht.io>",
@@ -0,0 +1,62 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { Knex } from 'knex';
3
+ declare class Client extends EventEmitter implements Knex.Client {
4
+ config: any;
5
+ logger: any;
6
+ version?: string;
7
+ connectionConfigProvider?: any;
8
+ connectionConfigExpirationChecker?: any;
9
+ connectionSettings: any;
10
+ driver?: any;
11
+ pool?: any;
12
+ valueForUndefined: any;
13
+ dialect?: string;
14
+ driverName?: string;
15
+ constructor(config?: any);
16
+ formatter(builder: any): any;
17
+ queryBuilder(): any;
18
+ transaction(container: any, config: any, outerTx: any): any;
19
+ queryCompiler(builder: any, formatter: any): any;
20
+ schemaBuilder(): any;
21
+ schemaCompiler(builder: any): any;
22
+ tableBuilder(type: any, tableName: any, tableNameLike: any, fn: any): any;
23
+ viewBuilder(type: any, viewBuilder: any, fn: any): any;
24
+ tableCompiler(tableBuilder: any): any;
25
+ viewCompiler(viewCompiler: any): any;
26
+ columnBuilder(tableBuilder: any, type: any, args: any): any;
27
+ columnCompiler(tableBuilder: any, columnBuilder: any): any;
28
+ runner(builder: any): any;
29
+ raw(): any;
30
+ ref(): any;
31
+ query(connection: any, queryParam: any): any;
32
+ stream(connection: any, queryParam: any, stream: any, options: any): any;
33
+ prepBindings(bindings: any): any;
34
+ positionBindings(sql: any): any;
35
+ postProcessResponse(resp: any, queryContext: any): any;
36
+ wrapIdentifier(value: any, queryContext: any): any;
37
+ customWrapIdentifier(value: any, origImpl: any, queryContext: any): any;
38
+ wrapIdentifierImpl(value: any): string;
39
+ initializeDriver(): void;
40
+ poolDefaults(): {
41
+ min: number;
42
+ max: number;
43
+ propagateCreateError: boolean;
44
+ };
45
+ getPoolSettings(poolConfig: any): any;
46
+ initializePool(config?: any): void;
47
+ validateConnection(_connection: any): boolean;
48
+ acquireConnection(): Promise<any>;
49
+ releaseConnection(connection: any): Promise<void>;
50
+ destroy(callback?: any): Promise<any>;
51
+ database(): any;
52
+ toString(): string;
53
+ assertCanCancelQuery(): void;
54
+ cancelQuery(): void;
55
+ alias(first: any, second: any): string;
56
+ parameter(value: any, builder: any, bindingsHolder: any): any;
57
+ parameterize(values: any, notSetValue: any, builder: any, bindingsHolder: any): any;
58
+ values(values: any, builder: any, bindingsHolder: any): any;
59
+ processPassedConnection(_connection: any): void;
60
+ toPathForJson(jsonPath: any): any;
61
+ }
62
+ export { Client };
@@ -0,0 +1,10 @@
1
+ import type { Knex } from 'knex';
2
+ export declare function knex(config?: Knex.Config, ...additional: any[]): Knex;
3
+ export declare namespace knex {
4
+ var Client: typeof import("./client").Client;
5
+ var KnexTimeoutError: any;
6
+ var QueryBuilder: {
7
+ extend: (methodName: string, fn: Function) => void;
8
+ };
9
+ }
10
+ export { knex as knexInit };
@@ -0,0 +1,15 @@
1
+ declare class Logger {
2
+ _inspectionDepth: number;
3
+ _enableColors: boolean;
4
+ _debug: (msg: any) => void;
5
+ _warn: (msg: any) => void;
6
+ _error: (msg: any) => void;
7
+ _deprecate: (msg: any) => void;
8
+ constructor(config?: any);
9
+ _log(message: any, userFn: (msg: any) => void, colorFn?: (msg: string) => string): void;
10
+ debug(message: any): void;
11
+ warn(message: any): void;
12
+ error(message: any): void;
13
+ deprecate(method: string, alternative: string): void;
14
+ }
15
+ export default Logger;
@@ -0,0 +1,2 @@
1
+ import type { Knex } from 'knex';
2
+ export declare function makeKnex(client: Knex.Client): Knex;
@@ -0,0 +1,37 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import type { Knex } from 'knex';
3
+ declare class Transaction extends EventEmitter implements Knex.Transaction<any, any> {
4
+ userParams: any;
5
+ doNotRejectOnRollback: any;
6
+ txid: any;
7
+ client: any;
8
+ logger: any;
9
+ outerTx: any;
10
+ trxClient: any;
11
+ _completed: any;
12
+ _debug: any;
13
+ readOnly: any;
14
+ isolationLevel: any;
15
+ _lastChild: any;
16
+ _promise: any;
17
+ _resolver: any;
18
+ _rejecter: any;
19
+ transactor: any;
20
+ constructor(client: any, container: any, config?: any, outerTx?: any);
21
+ isCompleted(): any;
22
+ begin(conn: any): any;
23
+ savepoint(conn: any): any;
24
+ commit(conn: any, value: any): any;
25
+ release(conn: any, value: any): any;
26
+ setIsolationLevel(isolationLevel: any): this;
27
+ rollback(conn: any, error: any): any;
28
+ rollbackTo(conn: any, error: any): any;
29
+ query(conn: any, sql: any, status?: any, value?: any): any;
30
+ debug(enabled?: any): this;
31
+ _evaluateContainer(config: any, container: any): Promise<any>;
32
+ acquireConnection(config: any, cb: any): Promise<any>;
33
+ then(onResolve?: any, onReject?: any): any;
34
+ catch(...args: any[]): any;
35
+ asCallback(cb: any): any;
36
+ }
37
+ export default Transaction;
@@ -0,0 +1,5 @@
1
+ import type { SchemaTypeDefinititionMiddlewareFn } from '../core/root';
2
+ export declare const fqdnMessages: {
3
+ 'string.fqdn': string;
4
+ };
5
+ export declare const fqdn: SchemaTypeDefinititionMiddlewareFn;
@@ -366,6 +366,12 @@ export interface StringSchema<TSchema = string> extends AnySchema<TSchema> {
366
366
  * - `helpers` - Validation helper functions for custom validation logic
367
367
  */
368
368
  default(value?: DefaultableValue): this;
369
+ /**
370
+ * Requires the string value to be a valid fully qualified domain name.
371
+ *
372
+ * @tip This does not do fully RFC-compliant validation, but a practical approximation.
373
+ */
374
+ fqdn(): this;
369
375
  }
370
376
  /**
371
377
  * Schema type for binary data validation.
@@ -1,6 +0,0 @@
1
- import type { Knex } from 'knex';
2
- export interface KnexInit<TRecord extends {} = any, TResult = unknown[]> {
3
- (config: Knex.Config | string): Knex<TRecord, TResult>;
4
- }
5
- export declare const knexInit: KnexInit;
6
- export { knexInit as knex };