@feathersjs/typebox
Advanced tools
Comparing version 5.0.5 to 5.0.6
@@ -6,2 +6,6 @@ # Change Log | ||
## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) | ||
**Note:** Version bump only for package @feathersjs/typebox | ||
## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) | ||
@@ -8,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { TObject, TInteger, TOptional, TSchema, ObjectOptions } from '@sinclair/typebox'; | ||
import { TObject, TInteger, TOptional, TSchema, ObjectOptions, TIntersect } from '@sinclair/typebox'; | ||
import { Validator, DataValidatorMap, Ajv } from '@feathersjs/schema'; | ||
@@ -17,3 +17,3 @@ export * from '@sinclair/typebox'; | ||
*/ | ||
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>; | ||
/** | ||
@@ -42,3 +42,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>(schema: T): TObject<{ [K in keyof T["properties"]]: TOptional<TInteger>; }>; | ||
/** | ||
@@ -54,3 +54,3 @@ * 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<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
}>(def: T, extension?: X) => TOptional<import("@sinclair/typebox").TUnion<[T, import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T; | ||
@@ -71,5 +71,5 @@ $gte: T; | ||
*/ | ||
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>, X extends { [K in keyof T["properties"]]?: { | ||
[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<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
}; }>(definition: T, extensions?: X) => TOptional<TObject<{ [K_1 in keyof T["properties"]]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_1]; | ||
@@ -82,3 +82,3 @@ $gte: T["properties"][K_1]; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_1]>; | ||
}>, TObject<X[K_1]>]>>]>>; } : never>>; | ||
}>, TObject<X[K_1]>]>>]>>; }>>; | ||
/** | ||
@@ -93,10 +93,10 @@ * 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>, X extends T["properties"] extends infer T_1 ? { [K in keyof T_1]?: { | ||
export declare const querySyntax: <T extends TObject<import("@sinclair/typebox").TProperties>, X extends { [K in keyof T["properties"]]?: { | ||
[key: string]: TSchema; | ||
}; } : never>(type: T, extensions?: X, options?: ObjectOptions) => import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TPartial<TObject<{ | ||
}; }>(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>; | ||
$sort: TObject<{ [K_1 in keyof T["properties"]]: TOptional<TInteger>; }>; | ||
$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<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
$and: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[TOptional<TObject<{ [K_2 in keyof T["properties"]]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
@@ -109,4 +109,4 @@ $gte: 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_4 ? { [K_2 in keyof T_4]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
}>, TObject<X[K_2]>]>>]>>; }>>, TObject<{ | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<{ [K_2 in keyof T["properties"]]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
@@ -119,5 +119,5 @@ $gte: T["properties"][K_2]; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>>; | ||
}>, TObject<X[K_2]>]>>]>>; }>>>; | ||
}>]>>; | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<T["properties"] extends infer T_5 ? { [K_2 in keyof T_5]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
$or: import("@sinclair/typebox").TArray<TOptional<TObject<{ [K_2 in keyof T["properties"]]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
@@ -130,4 +130,4 @@ $gte: 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_6 ? { [K_2 in keyof T_6]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<import("@sinclair/typebox").TIntersect<[TObject<{ | ||
}>, TObject<X[K_2]>]>>]>>; }>>>; | ||
}>>, TOptional<TObject<{ [K_2 in keyof T["properties"]]: TOptional<import("@sinclair/typebox").TUnion<[T["properties"][K_2], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{ | ||
$gt: T["properties"][K_2]; | ||
@@ -140,3 +140,3 @@ $gte: T["properties"][K_2]; | ||
$nin: import("@sinclair/typebox").TArray<T["properties"][K_2]>; | ||
}>, TObject<X[K_2]>]>>]>>; } : never>>]>; | ||
}>, TObject<X[K_2]>]>>]>>; }>>]>; | ||
export declare const ObjectIdSchema: () => import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, TObject<{}>]>; |
{ | ||
"name": "@feathersjs/typebox", | ||
"description": "TypeBox integration for @feathersjs/schema", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"homepage": "https://feathersjs.com", | ||
@@ -57,3 +57,3 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/schema": "^5.0.5", | ||
"@feathersjs/schema": "^5.0.6", | ||
"@sinclair/typebox": "^0.25.0" | ||
@@ -63,8 +63,8 @@ }, | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.15.11", | ||
"@types/node": "^20.3.1", | ||
"mocha": "^10.2.0", | ||
"shx": "^0.3.4", | ||
"typescript": "^5.0.3" | ||
"typescript": "^5.1.3" | ||
}, | ||
"gitHead": "42bd5e40ec73b10939b9a008ae8e49c39a191009" | ||
"gitHead": "71ac655d260fbc9aa65cd5b9a6c088f0187ace4e" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Type, TObject, TInteger, TOptional, TSchema, ObjectOptions } from '@sinclair/typebox' | ||
import { Type, TObject, TInteger, TOptional, TSchema, ObjectOptions, TIntersect } from '@sinclair/typebox' | ||
import { jsonSchema, Validator, DataValidatorMap, Ajv } from '@feathersjs/schema' | ||
@@ -20,3 +20,3 @@ | ||
*/ | ||
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) | ||
@@ -23,0 +23,0 @@ |
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
53975
759
Updated@feathersjs/schema@^5.0.6