Socket
Socket
Sign inDemoInstall

@typegoose/typegoose

Package Overview
Dependencies
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typegoose/typegoose - npm Package Compare versions

Comparing version 12.4.0 to 12.5.0

1

lib/defaultClasses.d.ts

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import type { Types } from 'mongoose';

@@ -27,0 +28,0 @@ import type { RefType } from './types';

69

lib/hooks.d.ts

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import type { Aggregate, AggregateExtract, CallbackError, Document, MongooseQueryOrDocumentMiddleware, ErrorHandlingMiddlewareFunction, HydratedDocument, Model, MongooseDocumentMiddleware, MongooseQueryMiddleware, PostMiddlewareFunction, PreMiddlewareFunction, PreSaveMiddlewareFunction, Query, SchemaPostOptions, SchemaPreOptions, MongooseDistinctDocumentMiddleware, MongooseDefaultQueryMiddleware, MongooseDistinctQueryMiddleware, MongooseQueryAndDocumentMiddleware, InsertManyOptions } from 'mongoose';

@@ -47,22 +48,22 @@ import type { AnyParamConstructor, DocumentType, ReturnModelType } from './types';

}): ClassDecorator;
<S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, any, "find"> ? S_4 : S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
<S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_4 : S_4 extends Document<unknown, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
<S_5 extends unknown, T_5 = S_5 extends Document<any, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
<S_6 extends unknown, T_6 = S_6 extends Document<any, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
<S_7 extends unknown, T_7 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
<S_5 extends unknown, T_5 = S_5 extends Document<unknown, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
<S_6 extends unknown, T_6 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
<S_7 extends unknown, T_7 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
document: true;
}): ClassDecorator;
<S_8 extends unknown, T_8 = S_8 extends Document<any, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
<S_8 extends unknown, T_8 = S_8 extends Document<unknown, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
document: true;
query: false;
}): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find">, T_9 = S_9 extends Query<any, any, {}, any, "find"> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find">>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find">, T_10 = S_10 extends Query<any, any, {}, any, "find"> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find">>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
<S_11 extends object | Query<any, any, {}, any, "find">, T_11 = S_11 extends Query<any, any, {}, any, "find"> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, DocumentType<S_11>, "find">>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
<S_9 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_9 = S_9 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_10 = S_10 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
<S_11 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_11 = S_11 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, DocumentType<S_11>, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
document: false;
query: true;
}): ClassDecorator;
<S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, any, "find"> ? S_12 : S_12 extends Document<any, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
<S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_12 : S_12 extends Document<unknown, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
document: true;

@@ -77,6 +78,6 @@ query: true;

export declare const post: {
<S extends object | Query<any, any, {}, any, "find">, T = S extends Query<any, any, {}, any, "find"> ? S : Query<DocumentType<S>, DocumentType<S>, {}, DocumentType<S>, "find">>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
<S extends object | Query<any, any, {}, any, "find", Record<string, never>>, T = S extends Query<any, any, {}, any, "find", Record<string, never>> ? S : Query<DocumentType<S>, DocumentType<S>, {}, DocumentType<S>, "find", Record<string, never>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
errorHandler: true;
}): ClassDecorator;
<S_1 extends unknown, T_1 = S_1 extends Document<any, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
<S_1 extends unknown, T_1 = S_1 extends Document<unknown, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
errorHandler: true;

@@ -102,14 +103,14 @@ }): ClassDecorator;

}): ClassDecorator;
<S_6 extends unknown, T_7 = S_6 extends Document<any, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
<S_7 extends unknown, T_8 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
<S_6 extends unknown, T_7 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
<S_7 extends unknown, T_8 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
document: true;
query: false;
}): ClassDecorator;
<S_8 extends object | Query<any, any, {}, any, "find">, T_9 = S_8 extends Query<any, any, {}, any, "find"> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, DocumentType<S_8>, "find">>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find">, T_10 = S_9 extends Query<any, any, {}, any, "find"> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find">>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find">, T_11 = S_10 extends Query<any, any, {}, any, "find"> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find">>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
<S_8 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_9 = S_8 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, DocumentType<S_8>, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_10 = S_9 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_11 = S_10 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
<S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, any, "find"> ? S_11 : S_11 extends Document<any, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
<S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_11 : S_11 extends Document<unknown, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
document: true;

@@ -138,22 +139,22 @@ query: true;

}): ClassDecorator;
<S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, any, "find"> ? S_4 : S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
<S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_4 : S_4 extends Document<unknown, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
<S_5 extends unknown, T_5 = S_5 extends Document<any, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
<S_6 extends unknown, T_6 = S_6 extends Document<any, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
<S_7 extends unknown, T_7 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
<S_5 extends unknown, T_5 = S_5 extends Document<unknown, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
<S_6 extends unknown, T_6 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
<S_7 extends unknown, T_7 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
document: true;
}): ClassDecorator;
<S_8 extends unknown, T_8 = S_8 extends Document<any, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
<S_8 extends unknown, T_8 = S_8 extends Document<unknown, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
document: true;
query: false;
}): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find">, T_9 = S_9 extends Query<any, any, {}, any, "find"> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find">>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find">, T_10 = S_10 extends Query<any, any, {}, any, "find"> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find">>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
<S_11 extends object | Query<any, any, {}, any, "find">, T_11 = S_11 extends Query<any, any, {}, any, "find"> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, DocumentType<S_11>, "find">>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
<S_9 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_9 = S_9 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_10 = S_10 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
<S_11 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_11 = S_11 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, DocumentType<S_11>, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
document: false;
query: true;
}): ClassDecorator;
<S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, any, "find"> ? S_12 : S_12 extends Document<any, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
<S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_12 : S_12 extends Document<unknown, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
document: true;

@@ -168,6 +169,6 @@ query: true;

export declare const Post: {
<S extends object | Query<any, any, {}, any, "find">, T = S extends Query<any, any, {}, any, "find"> ? S : Query<DocumentType<S>, DocumentType<S>, {}, DocumentType<S>, "find">>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
<S extends object | Query<any, any, {}, any, "find", Record<string, never>>, T = S extends Query<any, any, {}, any, "find", Record<string, never>> ? S : Query<DocumentType<S>, DocumentType<S>, {}, DocumentType<S>, "find", Record<string, never>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
errorHandler: true;
}): ClassDecorator;
<S_1 extends unknown, T_1 = S_1 extends Document<any, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
<S_1 extends unknown, T_1 = S_1 extends Document<unknown, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
errorHandler: true;

@@ -193,14 +194,14 @@ }): ClassDecorator;

}): ClassDecorator;
<S_6 extends unknown, T_7 = S_6 extends Document<any, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
<S_7 extends unknown, T_8 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
<S_6 extends unknown, T_7 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
<S_7 extends unknown, T_8 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
document: true;
query: false;
}): ClassDecorator;
<S_8 extends object | Query<any, any, {}, any, "find">, T_9 = S_8 extends Query<any, any, {}, any, "find"> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, DocumentType<S_8>, "find">>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find">, T_10 = S_9 extends Query<any, any, {}, any, "find"> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find">>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find">, T_11 = S_10 extends Query<any, any, {}, any, "find"> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find">>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
<S_8 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_9 = S_8 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, DocumentType<S_8>, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
<S_9 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_10 = S_9 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, DocumentType<S_9>, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
<S_10 extends object | Query<any, any, {}, any, "find", Record<string, never>>, T_11 = S_10 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, DocumentType<S_10>, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
<S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, any, "find"> ? S_11 : S_11 extends Document<any, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
<S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, any, "find", Record<string, never>> ? S_11 : S_11 extends Document<unknown, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
document: true;

@@ -207,0 +208,0 @@ query: true;

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import mongoose from 'mongoose';

@@ -27,0 +28,0 @@ import type { IndexOptions } from './types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import type { Model } from 'mongoose';

@@ -27,0 +28,0 @@ import type { IGlobalOptions } from '../types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import * as mongoose from 'mongoose';

@@ -27,0 +28,0 @@ import type { AnyParamConstructor, IBuildSchemaOptions, IModelOptions, INamingOptions } from '../types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import * as mongoose from 'mongoose';

@@ -27,0 +28,0 @@ import type { AnyParamConstructor, DeferredFunc, Func, GetTypeReturn, IModelOptions, INamingOptions, IObjectWithTypegooseFunction, IPrototype, KeyStringAny, MappedInnerOuterOptions, PropOptionsForNumber, PropOptionsForString, VirtualOptions } from '../types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import type { Query } from 'mongoose';

@@ -27,0 +28,0 @@ import type { AnyParamConstructor, QueryHelperThis } from './types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import * as mongoose from 'mongoose';

@@ -27,0 +28,0 @@ import 'reflect-metadata';

@@ -16,4 +16,4 @@ "use strict";

/* istanbul ignore next */
if (semver.lt(mongoose?.version, '8.3.1')) {
throw new Error(`Please use mongoose 8.3.1 or higher (Current mongoose: ${mongoose.version}) [E001]`);
if (semver.lt(mongoose?.version, '8.4.0')) {
throw new Error(`Please use mongoose 8.4.0 or higher (Current mongoose: ${mongoose.version}) [E001]`);
}

@@ -20,0 +20,0 @@ /* istanbul ignore next */

@@ -26,2 +26,3 @@ /// <reference types="node" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import * as mongoose from 'mongoose';

@@ -28,0 +29,0 @@ import type { DocumentType, Ref, RefType } from './types';

@@ -25,2 +25,3 @@ /// <reference types="mongoose/types/aggregate" />

/// <reference types="mongoose/types/inferschematype" />
/// <reference types="mongoose/types/inferrawdoctype" />
import type * as mongoose from 'mongoose';

@@ -27,0 +28,0 @@ import type { PropType, Severity } from './internal/constants';

{
"name": "@typegoose/typegoose",
"version": "12.4.0",
"version": "12.5.0",
"description": "Define Mongoose models using TypeScript classes",

@@ -39,3 +39,3 @@ "main": "lib/typegoose.js",

"peerDependencies": {
"mongoose": "~8.3.1"
"mongoose": "~8.4.0"
},

@@ -49,3 +49,3 @@ "devDependencies": {

"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.0",
"@types/lodash": "^4.17.4",
"@types/node": "~16.11.7",

@@ -65,5 +65,5 @@ "@types/semver": "^7.5.8",

"mongodb-memory-server": "^9.2.0",
"mongoose": "~8.3.1",
"mongoose": "~8.4.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"rimraf": "^5.0.7",
"ts-jest": "^29.1.2",

@@ -76,3 +76,3 @@ "typescript": "~5.3.3"

"reflect-metadata": "^0.2.2",
"semver": "^7.6.0",
"semver": "^7.6.2",
"tslib": "^2.6.2"

@@ -79,0 +79,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc