@aeriajs/types 0.0.61 → 0.0.63
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/dist/context.d.ts +1 -1
- package/dist/functions.d.ts +1 -1
- package/dist/property.d.ts +1 -1
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { PackReferences, SchemaWithId } from './schema.js';
|
|
|
10
10
|
import type { RateLimitingParams, RateLimitingError } from './security.js';
|
|
11
11
|
import type { Token } from './token.js';
|
|
12
12
|
export type CollectionModel<TDescription extends Description> = MongoCollection<Omit<PackReferences<SchemaWithId<TDescription>>, '_id'>>;
|
|
13
|
-
type OmitContextParameter<TFunction> = TFunction extends () => any ? TFunction : TFunction extends (payload: undefined, ...args: any[]) => infer Return ? () => Return : TFunction extends (payload: infer Payload, context: Context
|
|
13
|
+
type OmitContextParameter<TFunction> = TFunction extends () => any ? TFunction : TFunction extends (payload: undefined, ...args: any[]) => infer Return ? () => Return : TFunction extends (payload: infer Payload, context: Context<any>, ...args: infer Rest) => infer Return ? (payload: Payload, ...args: Rest) => Return : never;
|
|
14
14
|
type RestParameters<TFunction> = TFunction extends (payload: any, context: Context<any>, ...args: infer Rest) => any ? Rest : never;
|
|
15
15
|
type UnionFunctions<TFunctions, TSchema extends CollectionDocument<any>> = {
|
|
16
16
|
[P in keyof TFunctions]: (P extends keyof CollectionFunctions<any> ? CollectionFunctions<TSchema>[P] extends infer CollFunction ? CollFunction extends (...args: any[]) => any ? Extract<undefined, Parameters<CollFunction>[0]> extends never ? (payload: Parameters<CollFunction>[0], ...args: RestParameters<TFunctions[P]>) => ReturnType<CollFunction> : (payload?: Parameters<CollFunction>[0], ...args: RestParameters<TFunctions[P]>) => ReturnType<CollFunction> : never : never : OmitContextParameter<TFunctions[P]>) extends (...args: infer Args) => infer Return ? Return extends Promise<any> ? (...args: Args) => Return : (...args: Args) => Promise<Return> : never;
|
package/dist/functions.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type RemoveAny<T> = {
|
|
|
23
23
|
};
|
|
24
24
|
export type StrictFilter<TDocument> = RemoveAny<Filter<DocumentFilter<TDocument>>>;
|
|
25
25
|
export type StrictFilterOperators<TDocument> = RemoveAny<FilterOperators<DocumentFilter<TDocument>>>;
|
|
26
|
-
export type Filters<TDocument> = StrictFilter<
|
|
26
|
+
export type Filters<TDocument> = StrictFilter<TDocument> & Partial<{
|
|
27
27
|
[P in keyof TDocument]: null | (TDocument[P] extends infer Field ? Field extends ObjectId ? Field | string : Field extends {
|
|
28
28
|
_id: infer Id;
|
|
29
29
|
} ? Id | string : Field : never) extends infer Field ? Field | StrictFilterOperators<Field> | null : never;
|
package/dist/property.d.ts
CHANGED
|
@@ -94,7 +94,7 @@ export type GetterProperty = {
|
|
|
94
94
|
getter: (document: any) => any;
|
|
95
95
|
};
|
|
96
96
|
export type ConstProperty = {
|
|
97
|
-
const: string | number | boolean | undefined;
|
|
97
|
+
const: string | number | boolean | undefined | null;
|
|
98
98
|
};
|
|
99
99
|
export type MixedProperty = RefProperty | FileProperty | EnumProperty | ArrayProperty | ObjectProperty | StringProperty | NumberProperty | BooleanProperty | GetterProperty | ConstProperty;
|
|
100
100
|
export type NonCircularMixedProperty = NonCircularRefProperty | FileProperty | EnumProperty | ArrayProperty | ObjectProperty | StringProperty | NumberProperty | BooleanProperty | GetterProperty | ConstProperty;
|