@feathersjs/typebox 5.0.39 → 6.0.0-pre.0
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/CHANGELOG.md +45 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/default-schemas.d.ts +116 -115
- package/lib/default-schemas.js +51 -54
- package/lib/default-schemas.js.map +1 -1
- package/lib/index.d.ts +57 -74
- package/lib/index.js +45 -66
- package/lib/index.js.map +1 -1
- package/package.json +10 -7
- package/src/default-schemas.ts +2 -2
- package/src/index.ts +167 -100
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TObject, TInteger, TOptional, TSchema,
|
|
2
|
-
import { Validator, DataValidatorMap
|
|
3
|
-
|
|
4
|
-
export * from './default-schemas';
|
|
1
|
+
import Type, { TObject, TInteger, TOptional, TSchema, TIntersect, TUnion, type TObjectOptions, type TRecord } from 'typebox';
|
|
2
|
+
import type { Validator, DataValidatorMap } from '@feathersjs/schema';
|
|
3
|
+
import { Ajv } from '@feathersjs/schema';
|
|
4
|
+
export * from './default-schemas.js';
|
|
5
|
+
export { Type, Static } from 'typebox';
|
|
5
6
|
export type TDataSchemaMap = {
|
|
6
7
|
create: TObject;
|
|
7
8
|
update?: TObject;
|
|
@@ -31,16 +32,35 @@ export declare const getDataValidator: (def: TObject | TDataSchemaMap, validator
|
|
|
31
32
|
* @param allowedValues array of strings for the enum
|
|
32
33
|
* @returns TypeBox.Type
|
|
33
34
|
*/
|
|
34
|
-
export declare function StringEnum<
|
|
35
|
-
default:
|
|
36
|
-
}):
|
|
35
|
+
export declare function StringEnum<Values extends string[]>(allowedValues: [...Values], options?: {
|
|
36
|
+
default: Values[number];
|
|
37
|
+
}): Type.TUnsafe<Values[number]>;
|
|
38
|
+
export type TArrayOfKeys<Type extends TObject> = Type.TUnsafe<(keyof Type['properties'])[]>;
|
|
39
|
+
export type TSortDefinition<Type extends TObject, Properties extends Type.TProperties = {
|
|
40
|
+
[K in keyof Type['properties']]: TOptional<TInteger>;
|
|
41
|
+
}, Return extends Type.TSchema = Type.TObject<Properties>> = Return;
|
|
37
42
|
/**
|
|
38
43
|
* Creates the `$sort` Feathers query syntax schema for an object schema
|
|
39
44
|
*
|
|
40
|
-
* @param
|
|
45
|
+
* @param type The TypeBox object schema
|
|
41
46
|
* @returns The `$sort` syntax schema
|
|
42
47
|
*/
|
|
43
|
-
export declare function sortDefinition<
|
|
48
|
+
export declare function sortDefinition<Type extends TObject>(type: Type): TSortDefinition<Type>;
|
|
49
|
+
export type TQueryProperty<Def extends TSchema, Extension extends Type.TProperties, Return extends Type.TSchema = Type.TUnion<[
|
|
50
|
+
Def,
|
|
51
|
+
Type.TPartial<Type.TIntersect<[
|
|
52
|
+
Type.TObject<{
|
|
53
|
+
$gt: Def;
|
|
54
|
+
$gte: Def;
|
|
55
|
+
$lt: Def;
|
|
56
|
+
$lte: Def;
|
|
57
|
+
$ne: Def;
|
|
58
|
+
$in: Type.TArray<Def>;
|
|
59
|
+
$nin: Type.TArray<Def>;
|
|
60
|
+
}>,
|
|
61
|
+
Type.TObject<Extension>
|
|
62
|
+
]>>
|
|
63
|
+
]>> = Return;
|
|
44
64
|
/**
|
|
45
65
|
* Returns the standard Feathers query syntax for a property schema,
|
|
46
66
|
* including operators like `$gt`, `$lt` etc. for a single property
|
|
@@ -49,17 +69,16 @@ export declare function sortDefinition<T extends TObject>(schema: T): TObject<{
|
|
|
49
69
|
* @param extension Additional properties to add to the property query
|
|
50
70
|
* @returns The Feathers query syntax schema
|
|
51
71
|
*/
|
|
52
|
-
export declare const queryProperty: <
|
|
72
|
+
export declare const queryProperty: <Def extends TSchema, Extension extends {
|
|
53
73
|
[key: string]: TSchema;
|
|
54
|
-
}>(def:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}>, TObject<X>]>>]>>;
|
|
74
|
+
}>(def: Def, extension: Extension) => TQueryProperty<Def, Extension>;
|
|
75
|
+
type TQueryProperties<Type extends TObject, Extensions extends {
|
|
76
|
+
[K in keyof Type['properties']]?: {
|
|
77
|
+
[key: string]: TSchema;
|
|
78
|
+
};
|
|
79
|
+
}, Properties extends Type.TProperties = {
|
|
80
|
+
[K in keyof Type['properties']]: TQueryProperty<Type['properties'][K], NonNullable<Extensions[K]>>;
|
|
81
|
+
}, Return extends Type.TSchema = Type.TOptional<Type.TObject<Properties>>> = Return;
|
|
63
82
|
/**
|
|
64
83
|
* Creates a Feathers query syntax schema for the properties defined in `definition`.
|
|
65
84
|
*
|
|
@@ -67,68 +86,32 @@ export declare const queryProperty: <T extends TSchema, X extends {
|
|
|
67
86
|
* @param extensions Additional properties to add to a property query
|
|
68
87
|
* @returns The Feathers query syntax schema
|
|
69
88
|
*/
|
|
70
|
-
export declare const queryProperties: <
|
|
89
|
+
export declare const queryProperties: <Type extends TObject, Extensions extends { [K in keyof Type["properties"]]?: {
|
|
71
90
|
[key: string]: TSchema;
|
|
72
|
-
}; }>(definition:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$
|
|
79
|
-
$
|
|
80
|
-
|
|
91
|
+
}; }>(definition: Type, extensions: Extensions) => TQueryProperties<Type, Extensions>;
|
|
92
|
+
export type TQuerySyntax<Type extends TObject, Extensions extends {
|
|
93
|
+
[K in keyof Type['properties']]?: {
|
|
94
|
+
[key: string]: TSchema;
|
|
95
|
+
};
|
|
96
|
+
}, PropertySchema extends Type.TObject = TQueryProperties<Type, Extensions>, Or extends TSchema = Type.TArray<PropertySchema>, And extends TSchema = Type.TArray<Type.TUnion<[PropertySchema, Or]>>, Return extends TSchema = Type.TPartial<Type.TObject<{
|
|
97
|
+
$limit: Type.TNumber;
|
|
98
|
+
$skip: Type.TNumber;
|
|
99
|
+
$sort: TSortDefinition<Type>;
|
|
100
|
+
$select: TArrayOfKeys<Type>;
|
|
101
|
+
$or: Or;
|
|
102
|
+
$and: And;
|
|
103
|
+
} & PropertySchema['properties']>>> = Return;
|
|
81
104
|
/**
|
|
82
105
|
* Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or`
|
|
83
106
|
* and `$sort` and `$select` for the allowed properties.
|
|
84
107
|
*
|
|
85
108
|
* @param type The properties to create the query syntax for
|
|
86
|
-
* @param extensions Additional properties to add to the query syntax
|
|
109
|
+
* @param extensions Additional properties to add to the query syntax, use `{}` if none
|
|
87
110
|
* @param options Options for the TypeBox object schema
|
|
88
111
|
* @returns A TypeBox object representing the complete Feathers query syntax for the given properties
|
|
89
112
|
*/
|
|
90
|
-
export declare const querySyntax: <
|
|
113
|
+
export declare const querySyntax: <Type extends TObject, Extensions extends { [K in keyof Type["properties"]]?: {
|
|
91
114
|
[key: string]: TSchema;
|
|
92
|
-
}; }>(type:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
$sort: TObject<{ [K in keyof T["properties"]]: TOptional<TInteger>; }>;
|
|
96
|
-
$select: import("@sinclair/typebox").TUnsafe<(keyof T["properties"])[]>;
|
|
97
|
-
$and: import("@sinclair/typebox").TArray<TUnion<[TOptional<TObject<{ [K_1 in keyof T["properties"]]: TOptional<TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
98
|
-
$gt: T["properties"][K_1];
|
|
99
|
-
$gte: T["properties"][K_1];
|
|
100
|
-
$lt: T["properties"][K_1];
|
|
101
|
-
$lte: T["properties"][K_1];
|
|
102
|
-
$ne: T["properties"][K_1];
|
|
103
|
-
$in: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
104
|
-
$nin: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
105
|
-
}>, TObject<X[K_1]>]>>]>>; }>>, TObject<{
|
|
106
|
-
$or: import("@sinclair/typebox").TArray<TOptional<TObject<{ [K_1 in keyof T["properties"]]: TOptional<TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
107
|
-
$gt: T["properties"][K_1];
|
|
108
|
-
$gte: T["properties"][K_1];
|
|
109
|
-
$lt: T["properties"][K_1];
|
|
110
|
-
$lte: T["properties"][K_1];
|
|
111
|
-
$ne: T["properties"][K_1];
|
|
112
|
-
$in: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
113
|
-
$nin: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
114
|
-
}>, TObject<X[K_1]>]>>]>>; }>>>;
|
|
115
|
-
}>]>>;
|
|
116
|
-
$or: import("@sinclair/typebox").TArray<TOptional<TObject<{ [K_1 in keyof T["properties"]]: TOptional<TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
117
|
-
$gt: T["properties"][K_1];
|
|
118
|
-
$gte: T["properties"][K_1];
|
|
119
|
-
$lt: T["properties"][K_1];
|
|
120
|
-
$lte: T["properties"][K_1];
|
|
121
|
-
$ne: T["properties"][K_1];
|
|
122
|
-
$in: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
123
|
-
$nin: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
124
|
-
}>, TObject<X[K_1]>]>>]>>; }>>>;
|
|
125
|
-
}>>, TOptional<TObject<{ [K_1 in keyof T["properties"]]: TOptional<TUnion<[T["properties"][K_1], import("@sinclair/typebox").TPartial<TIntersect<[TObject<{
|
|
126
|
-
$gt: T["properties"][K_1];
|
|
127
|
-
$gte: T["properties"][K_1];
|
|
128
|
-
$lt: T["properties"][K_1];
|
|
129
|
-
$lte: T["properties"][K_1];
|
|
130
|
-
$ne: T["properties"][K_1];
|
|
131
|
-
$in: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
132
|
-
$nin: T["properties"][K_1] | import("@sinclair/typebox").TArray<T["properties"][K_1]>;
|
|
133
|
-
}>, TObject<X[K_1]>]>>]>>; }>>]>;
|
|
134
|
-
export declare const ObjectIdSchema: () => TUnion<[import("@sinclair/typebox").TString<string>, TObject<{}>]>;
|
|
115
|
+
}; }>(type: Type, extensions: Extensions, options?: TObjectOptions) => TQuerySyntax<Type, Extensions>;
|
|
116
|
+
export type TObjectIdSchema = Type.TUnion<[Type.TString, Type.TObject<Type.TProperties>]>;
|
|
117
|
+
export declare const ObjectIdSchema: () => TObjectIdSchema;
|
package/lib/index.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ObjectIdSchema = exports.querySyntax = exports.queryProperties = exports.queryProperty = exports.getDataValidator = exports.getValidator = void 0;
|
|
18
|
-
exports.StringEnum = StringEnum;
|
|
19
|
-
exports.sortDefinition = sortDefinition;
|
|
20
|
-
const typebox_1 = require("@sinclair/typebox");
|
|
21
|
-
const schema_1 = require("@feathersjs/schema");
|
|
22
|
-
__exportStar(require("@sinclair/typebox"), exports);
|
|
23
|
-
__exportStar(require("./default-schemas"), exports);
|
|
1
|
+
import Type from 'typebox';
|
|
2
|
+
import { jsonSchema } from '@feathersjs/schema';
|
|
3
|
+
export * from './default-schemas.js';
|
|
4
|
+
export { Type } from 'typebox';
|
|
5
|
+
// ------------------------------------------------------------------
|
|
6
|
+
// GetValidator: No Change
|
|
7
|
+
// ------------------------------------------------------------------
|
|
24
8
|
/**
|
|
25
9
|
* Returns a compiled validation function for a TypeBox object and AJV validator instance.
|
|
26
10
|
*
|
|
@@ -28,8 +12,7 @@ __exportStar(require("./default-schemas"), exports);
|
|
|
28
12
|
* @param validator The AJV validation instance
|
|
29
13
|
* @returns A compiled validation function
|
|
30
14
|
*/
|
|
31
|
-
const getValidator = (schema, validator) =>
|
|
32
|
-
exports.getValidator = getValidator;
|
|
15
|
+
export const getValidator = (schema, validator) => jsonSchema.getValidator(schema, validator);
|
|
33
16
|
/**
|
|
34
17
|
* Returns compiled validation functions to validate data for the `create`, `update` and `patch`
|
|
35
18
|
* service methods. If not passed explicitly, the `update` validator will be the same as the `create`
|
|
@@ -40,19 +23,21 @@ exports.getValidator = getValidator;
|
|
|
40
23
|
* @param validator The Ajv instance to use as the validator
|
|
41
24
|
* @returns A map of validator functions
|
|
42
25
|
*/
|
|
43
|
-
const getDataValidator = (def, validator) =>
|
|
44
|
-
|
|
26
|
+
export const getDataValidator = (def, validator) => jsonSchema.getDataValidator(def, validator);
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
// StringEnum: Tip Type.Enum([]) to produce { enum: [...] } schema
|
|
29
|
+
// ------------------------------------------------------------------
|
|
45
30
|
/**
|
|
46
31
|
* A TypeBox utility that converts an array of provided strings into a string enum.
|
|
47
32
|
* @param allowedValues array of strings for the enum
|
|
48
33
|
* @returns TypeBox.Type
|
|
49
34
|
*/
|
|
50
|
-
function StringEnum(allowedValues, options) {
|
|
51
|
-
return
|
|
35
|
+
export function StringEnum(allowedValues, options) {
|
|
36
|
+
return Type.Unsafe({ type: 'string', enum: allowedValues, ...options });
|
|
52
37
|
}
|
|
53
38
|
const arrayOfKeys = (type) => {
|
|
54
39
|
const keys = Object.keys(type.properties);
|
|
55
|
-
return
|
|
40
|
+
return Type.Unsafe({
|
|
56
41
|
type: 'array',
|
|
57
42
|
maxItems: keys.length,
|
|
58
43
|
items: {
|
|
@@ -64,16 +49,16 @@ const arrayOfKeys = (type) => {
|
|
|
64
49
|
/**
|
|
65
50
|
* Creates the `$sort` Feathers query syntax schema for an object schema
|
|
66
51
|
*
|
|
67
|
-
* @param
|
|
52
|
+
* @param type The TypeBox object schema
|
|
68
53
|
* @returns The `$sort` syntax schema
|
|
69
54
|
*/
|
|
70
|
-
function sortDefinition(
|
|
71
|
-
const properties = Object.keys(
|
|
55
|
+
export function sortDefinition(type) {
|
|
56
|
+
const properties = Object.keys(type.properties).reduce((res, key) => {
|
|
72
57
|
const result = res;
|
|
73
|
-
result[key] =
|
|
58
|
+
result[key] = Type.Optional(Type.Integer({ minimum: -1, maximum: 1 }));
|
|
74
59
|
return result;
|
|
75
60
|
}, {});
|
|
76
|
-
return
|
|
61
|
+
return Type.Object(properties, { additionalProperties: false });
|
|
77
62
|
}
|
|
78
63
|
/**
|
|
79
64
|
* Returns the standard Feathers query syntax for a property schema,
|
|
@@ -83,22 +68,21 @@ function sortDefinition(schema) {
|
|
|
83
68
|
* @param extension Additional properties to add to the property query
|
|
84
69
|
* @returns The Feathers query syntax schema
|
|
85
70
|
*/
|
|
86
|
-
const queryProperty = (def, extension
|
|
71
|
+
export const queryProperty = (def, extension) => Type.Union([
|
|
87
72
|
def,
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
Type.Partial(Type.Intersect([
|
|
74
|
+
Type.Object({
|
|
90
75
|
$gt: def,
|
|
91
76
|
$gte: def,
|
|
92
77
|
$lt: def,
|
|
93
78
|
$lte: def,
|
|
94
79
|
$ne: def,
|
|
95
|
-
$in:
|
|
96
|
-
$nin:
|
|
80
|
+
$in: Type.Array(def),
|
|
81
|
+
$nin: Type.Array(def)
|
|
97
82
|
}),
|
|
98
|
-
|
|
83
|
+
Type.Object((extension || {}))
|
|
99
84
|
], { additionalProperties: false }))
|
|
100
|
-
])
|
|
101
|
-
exports.queryProperty = queryProperty;
|
|
85
|
+
]);
|
|
102
86
|
/**
|
|
103
87
|
* Creates a Feathers query syntax schema for the properties defined in `definition`.
|
|
104
88
|
*
|
|
@@ -106,42 +90,37 @@ exports.queryProperty = queryProperty;
|
|
|
106
90
|
* @param extensions Additional properties to add to a property query
|
|
107
91
|
* @returns The Feathers query syntax schema
|
|
108
92
|
*/
|
|
109
|
-
const queryProperties = (definition, extensions
|
|
93
|
+
export const queryProperties = (definition, extensions) => {
|
|
110
94
|
const properties = Object.keys(definition.properties).reduce((res, key) => {
|
|
111
95
|
const result = res;
|
|
112
96
|
const value = definition.properties[key];
|
|
113
|
-
result[key] =
|
|
97
|
+
result[key] = queryProperty(value, extensions[key] || {});
|
|
114
98
|
return result;
|
|
115
99
|
}, {});
|
|
116
|
-
return
|
|
100
|
+
return Type.Optional(Type.Object(properties, { additionalProperties: false }));
|
|
117
101
|
};
|
|
118
|
-
exports.queryProperties = queryProperties;
|
|
119
102
|
/**
|
|
120
103
|
* Creates a TypeBox schema for the complete Feathers query syntax including `$limit`, $skip`, `$or`
|
|
121
104
|
* and `$sort` and `$select` for the allowed properties.
|
|
122
105
|
*
|
|
123
106
|
* @param type The properties to create the query syntax for
|
|
124
|
-
* @param extensions Additional properties to add to the query syntax
|
|
107
|
+
* @param extensions Additional properties to add to the query syntax, use `{}` if none
|
|
125
108
|
* @param options Options for the TypeBox object schema
|
|
126
109
|
* @returns A TypeBox object representing the complete Feathers query syntax for the given properties
|
|
127
110
|
*/
|
|
128
|
-
const querySyntax = (type, extensions
|
|
129
|
-
const propertySchema =
|
|
130
|
-
const $or =
|
|
131
|
-
const $and =
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
propertySchema
|
|
142
|
-
], options);
|
|
111
|
+
export const querySyntax = (type, extensions, options = { additionalProperties: false }) => {
|
|
112
|
+
const propertySchema = queryProperties(type, extensions);
|
|
113
|
+
const $or = Type.Array(propertySchema);
|
|
114
|
+
const $and = Type.Array(Type.Union([propertySchema, Type.Object({ $or })]));
|
|
115
|
+
return Type.Partial(Type.Object({
|
|
116
|
+
$limit: Type.Number({ minimum: 0 }),
|
|
117
|
+
$skip: Type.Number({ minimum: 0 }),
|
|
118
|
+
$sort: sortDefinition(type),
|
|
119
|
+
$select: arrayOfKeys(type),
|
|
120
|
+
$and,
|
|
121
|
+
$or,
|
|
122
|
+
...propertySchema.properties
|
|
123
|
+
}, { additionalProperties: false }), options);
|
|
143
124
|
};
|
|
144
|
-
|
|
145
|
-
const ObjectIdSchema = () => typebox_1.Type.Union([typebox_1.Type.String({ objectid: true }), typebox_1.Type.Object({}, { additionalProperties: true })]);
|
|
146
|
-
exports.ObjectIdSchema = ObjectIdSchema;
|
|
125
|
+
export const ObjectIdSchema = () => Type.Union([Type.String({ objectid: true }), Type.Object({}, { additionalProperties: true })]);
|
|
147
126
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IASN,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,UAAU,EAAO,MAAM,oBAAoB,CAAA;AACpD,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,IAAI,EAAU,MAAM,SAAS,CAAA;AAOtC,qEAAqE;AACrE,0BAA0B;AAC1B,qEAAqE;AACrE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAA0D,EAC1D,SAAc,EACG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,MAAa,EAAE,SAAS,CAAC,CAAA;AAEvE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAA6B,EAAE,SAAc,EAAoB,EAAE,CAClG,UAAU,CAAC,gBAAgB,CAAC,GAAU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
"description": "TypeBox integration for @feathersjs/schema",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0-pre.0",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
|
-
"main": "lib/",
|
|
7
|
-
"
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"type": "module",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"feathers",
|
|
10
10
|
"feathers-plugin"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"url": "https://github.com/feathersjs/feathers/issues"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
32
|
+
"node": ">= 20"
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"CHANGELOG.md",
|
|
@@ -54,15 +54,18 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@feathersjs/schema": "^
|
|
58
|
-
|
|
57
|
+
"@feathersjs/schema": "^6.0.0-pre.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"typebox": "^1.0.80"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@types/mocha": "^10.0.10",
|
|
62
64
|
"@types/node": "^25.1.0",
|
|
63
65
|
"mocha": "^11.7.5",
|
|
64
66
|
"shx": "^0.4.0",
|
|
67
|
+
"typebox": "^1.0.80",
|
|
65
68
|
"typescript": "^5.9.3"
|
|
66
69
|
},
|
|
67
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "8fad4bb3d393794fb98fa5fe7cfc327661fedbd2"
|
|
68
71
|
}
|
package/src/default-schemas.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { Static } from 'typebox'
|
|
2
|
+
import { Type } from 'typebox'
|
|
3
3
|
export const authenticationSettingsSchema = Type.Object({
|
|
4
4
|
secret: Type.String({ description: 'The JWT signing secret' }),
|
|
5
5
|
entity: Type.Optional(
|