@feathersjs/typebox
Advanced tools
Comparing version 5.0.1 to 5.0.3
@@ -6,2 +6,11 @@ # Change Log | ||
## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) | ||
### Bug Fixes | ||
- **authentication:** Ensure authentication.entity configuration can be null ([#3136](https://github.com/feathersjs/feathers/issues/3136)) ([c47349b](https://github.com/feathersjs/feathers/commit/c47349b9dcf2067b7b572c5463b15b2a8fbda972)) | ||
- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) | ||
- **knex:** Get by id and transactions should work with params.knex ([#3146](https://github.com/feathersjs/feathers/issues/3146)) ([b172b5e](https://github.com/feathersjs/feathers/commit/b172b5ea9b461642874eb7d2ba01dc4cfc275155)) | ||
- **typebox:** Upgrade to TypeBox 0.26.0 ([#3113](https://github.com/feathersjs/feathers/issues/3113)) ([d1d9598](https://github.com/feathersjs/feathers/commit/d1d95984dd94d2b9305e7338421f84f9c4f733fd)) | ||
## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) | ||
@@ -8,0 +17,0 @@ |
import { Static } from '@sinclair/typebox'; | ||
export declare const authenticationSettingsSchema: import("@sinclair/typebox").TObject<{ | ||
secret: import("@sinclair/typebox").TString<string>; | ||
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TNull]>>; | ||
entityId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
@@ -33,9 +33,9 @@ service: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
client: import("@sinclair/typebox").TString<string>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TString<string>; | ||
port: import("@sinclair/typebox").TNumber; | ||
user: import("@sinclair/typebox").TString<string>; | ||
password: import("@sinclair/typebox").TString<string>; | ||
database: import("@sinclair/typebox").TString<string>; | ||
}>>]>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{ | ||
@@ -49,3 +49,3 @@ min: import("@sinclair/typebox").TNumber; | ||
secret: import("@sinclair/typebox").TString<string>; | ||
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TNull]>>; | ||
entityId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
@@ -85,9 +85,9 @@ service: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
client: import("@sinclair/typebox").TString<string>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TString<string>; | ||
port: import("@sinclair/typebox").TNumber; | ||
user: import("@sinclair/typebox").TString<string>; | ||
password: import("@sinclair/typebox").TString<string>; | ||
database: import("@sinclair/typebox").TString<string>; | ||
}>>]>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{ | ||
@@ -100,9 +100,9 @@ min: import("@sinclair/typebox").TNumber; | ||
client: import("@sinclair/typebox").TString<string>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TString<string>; | ||
port: import("@sinclair/typebox").TNumber; | ||
user: import("@sinclair/typebox").TString<string>; | ||
password: import("@sinclair/typebox").TString<string>; | ||
database: import("@sinclair/typebox").TString<string>; | ||
}>>]>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{ | ||
@@ -115,9 +115,9 @@ min: import("@sinclair/typebox").TNumber; | ||
client: import("@sinclair/typebox").TString<string>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TString<string>; | ||
port: import("@sinclair/typebox").TNumber; | ||
user: import("@sinclair/typebox").TString<string>; | ||
password: import("@sinclair/typebox").TString<string>; | ||
database: import("@sinclair/typebox").TString<string>; | ||
}>>]>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{ | ||
@@ -130,9 +130,9 @@ min: import("@sinclair/typebox").TNumber; | ||
client: import("@sinclair/typebox").TString<string>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TString<string>; | ||
port: import("@sinclair/typebox").TNumber; | ||
user: import("@sinclair/typebox").TString<string>; | ||
password: import("@sinclair/typebox").TString<string>; | ||
database: import("@sinclair/typebox").TString<string>; | ||
}>>]>; | ||
connection: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{ | ||
host: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
port: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
user: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
password: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
database: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
pool: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{ | ||
@@ -139,0 +139,0 @@ min: import("@sinclair/typebox").TNumber; |
@@ -7,3 +7,6 @@ "use strict"; | ||
secret: typebox_1.Type.String({ description: 'The JWT signing secret' }), | ||
entity: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'The name of the authentication entity (e.g. user)' })), | ||
entity: typebox_1.Type.Optional(typebox_1.Type.Union([ | ||
typebox_1.Type.String({ description: 'The name of the authentication entity (e.g. user)' }), | ||
typebox_1.Type.Null() | ||
])), | ||
entityId: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'The name of the authentication entity id property' })), | ||
@@ -10,0 +13,0 @@ service: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'The path of the entity service' })), |
@@ -5,2 +5,7 @@ import { TObject, TInteger, TOptional, TSchema, TIntersect, ObjectOptions } from '@sinclair/typebox'; | ||
export * from './default-schemas'; | ||
export declare const Intersect: { | ||
(allOf: [], options?: import("@sinclair/typebox").SchemaOptions): import("@sinclair/typebox").TNever; | ||
<T extends [TSchema]>(allOf: [...T], options?: import("@sinclair/typebox").SchemaOptions): T[0]; | ||
<T_1 extends TSchema[]>(allOf: [...T_1], options?: import("@sinclair/typebox").IntersectOptions): TIntersect<T_1>; | ||
}; | ||
export type TDataSchemaMap = { | ||
@@ -18,3 +23,3 @@ create: TObject; | ||
*/ | ||
export declare const getValidator: <T = any, R = T>(schema: TObject, validator: Ajv) => Validator<T, R>; | ||
export declare const getValidator: <T = any, R = T>(schema: TObject | TIntersect, validator: Ajv) => Validator<T, R>; | ||
/** | ||
@@ -43,3 +48,3 @@ * Returns compiled validation functions to validate data for the `create`, `update` and `patch` | ||
*/ | ||
export declare function sortDefinition<T extends TObject>(schema: T): TObject<T["properties"] extends infer T_1 ? { [K in keyof T_1]: TOptional<TInteger>; } : never>; | ||
export declare function sortDefinition<T extends TObject | TIntersect>(schema: T): TObject<T["properties"] extends infer T_1 ? { [K in keyof T_1]: TOptional<TInteger>; } : never>; | ||
/** | ||
@@ -55,11 +60,11 @@ * Returns the standard Feathers query syntax for a property schema, | ||
[key: string]: TSchema; | ||
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T; | ||
$gte: T; | ||
$lt: T; | ||
$lte: T; | ||
$ne: T; | ||
$in: import("@sinclair/typebox").TArray<T>; | ||
$nin: import("@sinclair/typebox").TArray<T>; | ||
}>, TObject<X>]>>]>>; | ||
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>; | ||
$gte: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>; | ||
$lt: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>; | ||
$lte: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>; | ||
$ne: T extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ [K in keyof X]: X[K] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K]>; }, import("@sinclair/typebox").TProperties>>>]>]>>; | ||
/** | ||
@@ -72,13 +77,13 @@ * Creates a Feathers query syntax schema for the properties defined in `definition`. | ||
*/ | ||
export declare const queryProperties: <T extends TObject<import("@sinclair/typebox").TProperties>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: { | ||
export declare const queryProperties: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<TSchema[]>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: { | ||
[key: string]: TSchema; | ||
}; } : never>(definition: T, extensions?: X) => TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_1]; | ||
$gte: T["properties"][K_1]; | ||
$lt: T["properties"][K_1]; | ||
$lte: T["properties"][K_1]; | ||
$ne: T["properties"][K_1]; | ||
$in: import("@sinclair/typebox").TArray<T["properties"][K_1]>; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_1]>; | ||
}>, TObject<X[K_1]>]>>]>>; } : never>>; | ||
}; } : never>(definition: T, extensions?: X) => TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_1], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>; | ||
$gte: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>; | ||
$lt: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>; | ||
$lte: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>; | ||
$ne: T["properties"][K_1] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_1] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_1] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_1]>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_1]>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_1]>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_1] extends infer T_3 extends import("@sinclair/typebox").TProperties ? { [K_2 in keyof T_3]: X[K_1][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_1][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_1][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_1][K_2]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>; | ||
/** | ||
@@ -93,46 +98,46 @@ * Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or` | ||
*/ | ||
export declare const querySyntax: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<TObject<import("@sinclair/typebox").TProperties>[]>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: { | ||
export declare const querySyntax: <T extends TObject<import("@sinclair/typebox").TProperties> | TIntersect<TSchema[]>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: { | ||
[key: string]: TSchema; | ||
}; } : never>(type: T, extensions?: X, options?: ObjectOptions) => TIntersect<[import("@sinclair/typebox").TPartial<TObject<{ | ||
$limit: import("@sinclair/typebox").TNumber; | ||
$skip: import("@sinclair/typebox").TNumber; | ||
$sort: TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<TInteger>; } : never>; | ||
$select: import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>; | ||
$and: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
$gte: T["properties"][K_2]; | ||
$lt: T["properties"][K_2]; | ||
$lte: T["properties"][K_2]; | ||
$ne: T["properties"][K_2]; | ||
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>, TObject<{ | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
$gte: T["properties"][K_2]; | ||
$lt: T["properties"][K_2]; | ||
$lte: T["properties"][K_2]; | ||
$ne: T["properties"][K_2]; | ||
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>>; | ||
}>]>>; | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
$gte: T["properties"][K_2]; | ||
$lt: T["properties"][K_2]; | ||
$lte: T["properties"][K_2]; | ||
$ne: T["properties"][K_2]; | ||
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>>; | ||
}>>, TOptional<TObject<T["properties"] extends infer T_4 ? { [K_2 in keyof T_4]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
$gte: T["properties"][K_2]; | ||
$lt: T["properties"][K_2]; | ||
$lte: T["properties"][K_2]; | ||
$ne: T["properties"][K_2]; | ||
$in: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>]>; | ||
}; } : never>(type: T, extensions?: X, options?: ObjectOptions) => TIntersect<[TObject<{ | ||
$limit: TOptional<import("@sinclair/typebox").TNumber>; | ||
$skip: TOptional<import("@sinclair/typebox").TNumber>; | ||
$sort: TOptional<TObject<T["properties"] extends infer T_2 ? { [K_1 in keyof T_2]: TOptional<TInteger>; } : never>>; | ||
$select: TOptional<import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>>; | ||
$and: TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>, TObject<{ | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>>; | ||
}>]>>>; | ||
$or: TOptional<import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_3 ? { [K_2 in keyof T_3]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_4 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_4]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>>>; | ||
}>, TOptional<TObject<T["properties"] extends infer T_5 ? { [K_2 in keyof T_5]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], TIntersect<[TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<{ | ||
$gt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$gte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lt: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$lte: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$ne: T["properties"][K_2] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : T["properties"][K_2] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : T["properties"][K_2] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<T["properties"][K_2]>; | ||
$in: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
$nin: TOptional<import("@sinclair/typebox").TArray<T["properties"][K_2]>>; | ||
}, import("@sinclair/typebox").TProperties>>>, TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").Assert<X[K_2] extends infer T_6 extends import("@sinclair/typebox").TProperties ? { [K_3 in keyof T_6]: X[K_2][K_3] extends import("@sinclair/typebox").TReadonlyOptional<infer U extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U> : X[K_2][K_3] extends import("@sinclair/typebox").TReadonly<infer U_1 extends TSchema> ? import("@sinclair/typebox").TReadonlyOptional<U_1> : X[K_2][K_3] extends TOptional<infer U_2 extends TSchema> ? TOptional<U_2> : TOptional<X[K_2][K_3]>; } : never, import("@sinclair/typebox").TProperties>>>]>]>>; } : never>>]>; | ||
export declare const ObjectIdSchema: () => import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, TObject<{}>]>; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.sortDefinition = exports.StringEnum = exports.getDataValidator = exports.getValidator = void 0; | ||
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.sortDefinition = exports.StringEnum = exports.getDataValidator = exports.getValidator = exports.Intersect = void 0; | ||
const typebox_1 = require("@sinclair/typebox"); | ||
@@ -23,2 +23,6 @@ const schema_1 = require("@feathersjs/schema"); | ||
__exportStar(require("./default-schemas"), exports); | ||
// Export new intersect | ||
exports.Intersect = typebox_1.Type.Intersect; | ||
// This is necessary to maintain backwards compatibility between 0.25 and 0.26 | ||
typebox_1.Type.Intersect = typebox_1.Type.Composite; | ||
/** | ||
@@ -25,0 +29,0 @@ * Returns a compiled validation function for a TypeBox object and AJV validator instance. |
{ | ||
"name": "@feathersjs/typebox", | ||
"description": "TypeBox integration for @feathersjs/schema", | ||
"version": "5.0.1", | ||
"version": "5.0.3", | ||
"homepage": "https://feathersjs.com", | ||
@@ -57,13 +57,13 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/schema": "^5.0.1", | ||
"@sinclair/typebox": "^0.25.24" | ||
"@feathersjs/schema": "^5.0.3", | ||
"@sinclair/typebox": "^0.26.8" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.14.6", | ||
"@types/node": "^18.15.11", | ||
"mocha": "^10.2.0", | ||
"shx": "^0.3.4", | ||
"typescript": "^4.9.5" | ||
"typescript": "^5.0.3" | ||
}, | ||
"gitHead": "18b7f4ab0a8075572a81d78956ba1205a9795c91" | ||
"gitHead": "a6ba4dfd08f537a7d4778bed4c45091cbe3802aa" | ||
} |
@@ -5,3 +5,8 @@ import { Type, Static } from '@sinclair/typebox' | ||
secret: Type.String({ description: 'The JWT signing secret' }), | ||
entity: Type.Optional(Type.String({ description: 'The name of the authentication entity (e.g. user)' })), | ||
entity: Type.Optional( | ||
Type.Union([ | ||
Type.String({ description: 'The name of the authentication entity (e.g. user)' }), | ||
Type.Null() | ||
]) | ||
), | ||
entityId: Type.Optional(Type.String({ description: 'The name of the authentication entity id property' })), | ||
@@ -8,0 +13,0 @@ service: Type.Optional(Type.String({ description: 'The path of the entity service' })), |
@@ -7,2 +7,8 @@ import { Type, TObject, TInteger, TOptional, TSchema, TIntersect, ObjectOptions } from '@sinclair/typebox' | ||
// Export new intersect | ||
export const Intersect = Type.Intersect | ||
// This is necessary to maintain backwards compatibility between 0.25 and 0.26 | ||
Type.Intersect = Type.Composite as any | ||
export type TDataSchemaMap = { | ||
@@ -21,3 +27,3 @@ create: TObject | ||
*/ | ||
export const getValidator = <T = any, R = T>(schema: TObject, validator: Ajv): Validator<T, R> => | ||
export const getValidator = <T = any, R = T>(schema: TObject | TIntersect, validator: Ajv): Validator<T, R> => | ||
jsonSchema.getValidator(schema as any, validator) | ||
@@ -47,3 +53,3 @@ | ||
const arrayOfKeys = <T extends TObject>(type: T) => { | ||
const arrayOfKeys = <T extends TObject | TIntersect>(type: T) => { | ||
const keys = Object.keys(type.properties) | ||
@@ -66,3 +72,3 @@ return Type.Unsafe<(keyof T['properties'])[]>({ | ||
*/ | ||
export function sortDefinition<T extends TObject>(schema: T) { | ||
export function sortDefinition<T extends TObject | TIntersect>(schema: T) { | ||
const properties = Object.keys(schema.properties).reduce((res, key) => { | ||
@@ -126,3 +132,3 @@ const result = res as any | ||
export const queryProperties = < | ||
T extends TObject, | ||
T extends TObject | TIntersect, | ||
X extends { [K in keyof T['properties']]?: { [key: string]: TSchema } } | ||
@@ -129,0 +135,0 @@ >( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70779
818
+ Added@sinclair/typebox@0.26.8(transitive)
- Removed@sinclair/typebox@0.25.24(transitive)
Updated@feathersjs/schema@^5.0.3
Updated@sinclair/typebox@^0.26.8