@cyberskill/shared 1.2.0 → 1.4.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/dist/.gitignore +3 -0
- package/package.json +16 -15
- package/dist/commands.cjs +0 -2
- package/dist/commands.d.cts +0 -1
- package/dist/commands.d.ts +0 -1
- package/dist/commands.js +0 -2
- package/dist/components/react/index.cjs +0 -1
- package/dist/components/react/index.d.cts +0 -2
- package/dist/components/react/index.d.ts +0 -2
- package/dist/components/react/index.js +0 -1
- package/dist/components/react/loading/index.cjs +0 -1
- package/dist/components/react/loading/index.d.cts +0 -11
- package/dist/components/react/loading/index.d.ts +0 -11
- package/dist/components/react/loading/index.js +0 -1
- package/dist/components/react/loading/loading.module.d.cts +0 -2
- package/dist/components/react/loading/loading.module.d.ts +0 -2
- package/dist/components/react/loading/loading.module.scss +0 -137
- package/dist/configs/commitlint/commitlint.base.cjs +0 -1
- package/dist/configs/commitlint/commitlint.base.d.cts +0 -5
- package/dist/configs/commitlint/commitlint.base.d.ts +0 -5
- package/dist/configs/commitlint/commitlint.base.js +0 -1
- package/dist/configs/eslint/eslint.base.cjs +0 -1
- package/dist/configs/eslint/eslint.base.d.cts +0 -1154
- package/dist/configs/eslint/eslint.base.d.ts +0 -1154
- package/dist/configs/eslint/eslint.base.js +0 -1
- package/dist/configs/eslint/eslint.nestjs.cjs +0 -1
- package/dist/configs/eslint/eslint.nestjs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nestjs.d.ts +0 -1156
- package/dist/configs/eslint/eslint.nestjs.js +0 -1
- package/dist/configs/eslint/eslint.nextjs.cjs +0 -1
- package/dist/configs/eslint/eslint.nextjs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nextjs.d.ts +0 -1156
- package/dist/configs/eslint/eslint.nextjs.js +0 -1
- package/dist/configs/eslint/eslint.nodejs.cjs +0 -1
- package/dist/configs/eslint/eslint.nodejs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nodejs.d.ts +0 -1156
- package/dist/configs/eslint/eslint.nodejs.js +0 -1
- package/dist/configs/eslint/vite-react.cjs +0 -1
- package/dist/configs/eslint/vite-react.d.cts +0 -1157
- package/dist/configs/eslint/vite-react.d.ts +0 -1157
- package/dist/configs/eslint/vite-react.js +0 -1
- package/dist/configs/graphql/graphql-codegen.cjs +0 -1
- package/dist/configs/graphql/graphql-codegen.d.cts +0 -8
- package/dist/configs/graphql/graphql-codegen.d.ts +0 -8
- package/dist/configs/graphql/graphql-codegen.js +0 -1
- package/dist/configs/graphql/index.cjs +0 -1
- package/dist/configs/graphql/index.d.cts +0 -5
- package/dist/configs/graphql/index.d.ts +0 -5
- package/dist/configs/graphql/index.js +0 -1
- package/dist/configs/i18n/react/i18next.cjs +0 -1
- package/dist/configs/i18n/react/i18next.d.cts +0 -6
- package/dist/configs/i18n/react/i18next.d.ts +0 -6
- package/dist/configs/i18n/react/i18next.js +0 -1
- package/dist/configs/i18n/react/index.cjs +0 -1
- package/dist/configs/i18n/react/index.d.cts +0 -2
- package/dist/configs/i18n/react/index.d.ts +0 -2
- package/dist/configs/i18n/react/index.js +0 -1
- package/dist/configs/index.cjs +0 -1
- package/dist/configs/index.d.cts +0 -9
- package/dist/configs/index.d.ts +0 -9
- package/dist/configs/index.js +0 -1
- package/dist/configs/vitest/react/e2e.cjs +0 -1
- package/dist/configs/vitest/react/e2e.d.cts +0 -6
- package/dist/configs/vitest/react/e2e.d.ts +0 -6
- package/dist/configs/vitest/react/e2e.js +0 -1
- package/dist/configs/vitest/react/unit.cjs +0 -1
- package/dist/configs/vitest/react/unit.d.cts +0 -6
- package/dist/configs/vitest/react/unit.d.ts +0 -6
- package/dist/configs/vitest/react/unit.js +0 -1
- package/dist/configs/vitest/react/unit.setup.cjs +0 -1
- package/dist/configs/vitest/react/unit.setup.d.cts +0 -2
- package/dist/configs/vitest/react/unit.setup.d.ts +0 -2
- package/dist/configs/vitest/react/unit.setup.js +0 -1
- package/dist/constants/dirname.cjs +0 -1
- package/dist/constants/dirname.d.cts +0 -3
- package/dist/constants/dirname.d.ts +0 -3
- package/dist/constants/dirname.js +0 -1
- package/dist/constants/index.cjs +0 -1
- package/dist/constants/index.d.cts +0 -2
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/index.js +0 -1
- package/dist/constants/response-status.cjs +0 -1
- package/dist/constants/response-status.d.cts +0 -252
- package/dist/constants/response-status.d.ts +0 -252
- package/dist/constants/response-status.js +0 -1
- package/dist/contexts/react/index.cjs +0 -1
- package/dist/contexts/react/index.d.cts +0 -4
- package/dist/contexts/react/index.d.ts +0 -4
- package/dist/contexts/react/index.js +0 -1
- package/dist/contexts/react/loading.cjs +0 -1
- package/dist/contexts/react/loading.d.cts +0 -7
- package/dist/contexts/react/loading.d.ts +0 -7
- package/dist/contexts/react/loading.js +0 -1
- package/dist/controllers/index.cjs +0 -1
- package/dist/controllers/index.d.cts +0 -5
- package/dist/controllers/index.d.ts +0 -5
- package/dist/controllers/index.js +0 -1
- package/dist/controllers/migration.cjs +0 -1
- package/dist/controllers/migration.d.cts +0 -55
- package/dist/controllers/migration.d.ts +0 -55
- package/dist/controllers/migration.js +0 -1
- package/dist/controllers/mongoose.cjs +0 -1
- package/dist/controllers/mongoose.d.cts +0 -25
- package/dist/controllers/mongoose.d.ts +0 -25
- package/dist/controllers/mongoose.js +0 -1
- package/dist/hooks/react/index.cjs +0 -1
- package/dist/hooks/react/index.d.cts +0 -6
- package/dist/hooks/react/index.d.ts +0 -6
- package/dist/hooks/react/index.js +0 -1
- package/dist/hooks/react/useLoading.cjs +0 -1
- package/dist/hooks/react/useLoading.d.cts +0 -7
- package/dist/hooks/react/useLoading.d.ts +0 -7
- package/dist/hooks/react/useLoading.js +0 -1
- package/dist/hooks/react/useLocalStorage.cjs +0 -1
- package/dist/hooks/react/useLocalStorage.d.cts +0 -5
- package/dist/hooks/react/useLocalStorage.d.ts +0 -5
- package/dist/hooks/react/useLocalStorage.js +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -29
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -1
- package/dist/providers/react/apollo-client.cjs +0 -1
- package/dist/providers/react/apollo-client.d.cts +0 -11
- package/dist/providers/react/apollo-client.d.ts +0 -11
- package/dist/providers/react/apollo-client.js +0 -1
- package/dist/providers/react/index.cjs +0 -1
- package/dist/providers/react/index.d.cts +0 -6
- package/dist/providers/react/index.d.ts +0 -6
- package/dist/providers/react/index.js +0 -1
- package/dist/providers/react/loading.cjs +0 -1
- package/dist/providers/react/loading.d.cts +0 -10
- package/dist/providers/react/loading.d.ts +0 -10
- package/dist/providers/react/loading.js +0 -1
- package/dist/typescript/command.cjs +0 -1
- package/dist/typescript/command.d.cts +0 -35
- package/dist/typescript/command.d.ts +0 -35
- package/dist/typescript/command.js +0 -1
- package/dist/typescript/config.cjs +0 -1
- package/dist/typescript/config.d.cts +0 -5
- package/dist/typescript/config.d.ts +0 -5
- package/dist/typescript/config.js +0 -0
- package/dist/typescript/index.cjs +0 -1
- package/dist/typescript/index.d.cts +0 -10
- package/dist/typescript/index.d.ts +0 -10
- package/dist/typescript/index.js +0 -1
- package/dist/typescript/log.cjs +0 -1
- package/dist/typescript/log.d.cts +0 -10
- package/dist/typescript/log.d.ts +0 -10
- package/dist/typescript/log.js +0 -0
- package/dist/typescript/mongoose.cjs +0 -1
- package/dist/typescript/mongoose.d.cts +0 -163
- package/dist/typescript/mongoose.d.ts +0 -163
- package/dist/typescript/mongoose.js +0 -1
- package/dist/typescript/react.cjs +0 -1
- package/dist/typescript/react.d.cts +0 -26
- package/dist/typescript/react.d.ts +0 -26
- package/dist/typescript/react.js +0 -0
- package/dist/typescript/serializer.cjs +0 -1
- package/dist/typescript/serializer.d.cts +0 -6
- package/dist/typescript/serializer.d.ts +0 -6
- package/dist/typescript/serializer.js +0 -0
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/index.d.cts +0 -19
- package/dist/utils/index.d.ts +0 -19
- package/dist/utils/index.js +0 -1
- package/dist/utils/localStorage.cjs +0 -1
- package/dist/utils/localStorage.d.cts +0 -50
- package/dist/utils/localStorage.d.ts +0 -50
- package/dist/utils/localStorage.js +0 -1
- package/dist/utils/log.cjs +0 -1
- package/dist/utils/log.d.cts +0 -5
- package/dist/utils/log.d.ts +0 -5
- package/dist/utils/log.js +0 -1
- package/dist/utils/mongoose.cjs +0 -1
- package/dist/utils/mongoose.d.cts +0 -34
- package/dist/utils/mongoose.d.ts +0 -34
- package/dist/utils/mongoose.js +0 -1
- package/dist/utils/serializer.cjs +0 -1
- package/dist/utils/serializer.d.cts +0 -7
- package/dist/utils/serializer.d.ts +0 -7
- package/dist/utils/serializer.js +0 -1
- package/dist/utils/validate.cjs +0 -1
- package/dist/utils/validate.d.cts +0 -33
- package/dist/utils/validate.d.ts +0 -33
- package/dist/utils/validate.js +0 -1
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Db, InsertOneResult, InsertManyResult, Filter, WithId, UpdateResult, DeleteResult, Collection, OptionalUnlessRequiredId } from 'mongodb';
|
|
2
|
-
import mongoose, { Document, Model, PaginateModel, AggregatePaginateModel, FilterQuery, ProjectionType, QueryOptions, PopulateOptions, PaginateOptions, PopulateOption, PaginateResult, PipelineStage, AggregatePaginateResult, InsertManyOptions, UpdateQuery, ClientSession, QueryWithHelpers, Schema, SchemaDefinition } from 'mongoose';
|
|
3
|
-
|
|
4
|
-
declare class C_Model extends Model {
|
|
5
|
-
}
|
|
6
|
-
declare class C_Db extends Db {
|
|
7
|
-
}
|
|
8
|
-
declare class C_Document extends Document {
|
|
9
|
-
}
|
|
10
|
-
declare class C_Collection<D extends Partial<C_Document>> extends Collection<D> {
|
|
11
|
-
}
|
|
12
|
-
interface I_GenericDocument extends Partial<C_Document> {
|
|
13
|
-
id?: string;
|
|
14
|
-
isDel?: boolean;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
updatedAt?: Date;
|
|
17
|
-
}
|
|
18
|
-
interface I_VirtualNestedOptions {
|
|
19
|
-
[key: string]: I_VirtualNestedOptions | number | string | boolean;
|
|
20
|
-
}
|
|
21
|
-
interface I_HookNextFunction {
|
|
22
|
-
(error?: Error | null): void;
|
|
23
|
-
}
|
|
24
|
-
type T_MiddlewareContext<T> = T | QueryWithHelpers<T, T>;
|
|
25
|
-
interface I_VirtualOptions {
|
|
26
|
-
ref: string;
|
|
27
|
-
localField: string;
|
|
28
|
-
foreignField: string;
|
|
29
|
-
count?: boolean;
|
|
30
|
-
justOne?: boolean;
|
|
31
|
-
options?: I_VirtualNestedOptions;
|
|
32
|
-
}
|
|
33
|
-
interface I_MongooseOptions<D extends Partial<C_Document>> {
|
|
34
|
-
mongoose: typeof mongoose;
|
|
35
|
-
virtuals?: {
|
|
36
|
-
name: keyof D | string;
|
|
37
|
-
options?: I_VirtualOptions;
|
|
38
|
-
get?: (this: D) => void;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
type T_MongooseShema<D> = mongoose.Schema<D>;
|
|
42
|
-
type T_MongoosePlugin = (schema: Schema, options?: Record<string, unknown>) => void;
|
|
43
|
-
type T_Input_MongooseSchema<D> = SchemaDefinition<D>;
|
|
44
|
-
interface I_GenerateSchemaOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
45
|
-
schema: T_Input_MongooseSchema<D>;
|
|
46
|
-
standalone?: boolean;
|
|
47
|
-
}
|
|
48
|
-
type T_MongooseModelMiddlewareFunction = (this: T_MiddlewareContext<C_Document>, next: I_HookNextFunction) => void;
|
|
49
|
-
interface I_MongooseModelMiddleware {
|
|
50
|
-
method: string;
|
|
51
|
-
fn: T_MongooseModelMiddlewareFunction;
|
|
52
|
-
}
|
|
53
|
-
interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
54
|
-
schema: T_Input_MongooseSchema<D>;
|
|
55
|
-
name: string;
|
|
56
|
-
aggregate?: boolean;
|
|
57
|
-
middlewares?: I_MongooseModelMiddleware[];
|
|
58
|
-
pagination?: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
61
|
-
}
|
|
62
|
-
interface I_ReturnSuccess<D, E = {}> {
|
|
63
|
-
success: true;
|
|
64
|
-
result: D & E;
|
|
65
|
-
message?: string;
|
|
66
|
-
code?: number | string;
|
|
67
|
-
}
|
|
68
|
-
interface I_ReturnFailure {
|
|
69
|
-
success: false;
|
|
70
|
-
message: string;
|
|
71
|
-
code: number | string;
|
|
72
|
-
}
|
|
73
|
-
type I_Return<D = void, E = {}> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
74
|
-
type T_Filter<D> = Filter<D>;
|
|
75
|
-
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
76
|
-
type T_InsertManyResult<D> = InsertManyResult<D>;
|
|
77
|
-
type T_FilterQuery<T> = FilterQuery<T>;
|
|
78
|
-
type T_ProjectionType<T> = ProjectionType<T>;
|
|
79
|
-
type T_QueryOptions<T> = QueryOptions<T>;
|
|
80
|
-
type T_PaginateOptions = PaginateOptions;
|
|
81
|
-
type T_PopulateOption = PopulateOption;
|
|
82
|
-
type T_PopulateOptions = PopulateOptions;
|
|
83
|
-
type T_PipelineStage = PipelineStage;
|
|
84
|
-
type T_PaginateResult<T> = PaginateResult<T>;
|
|
85
|
-
type T_AggregatePaginateResult<T> = AggregatePaginateResult<T>;
|
|
86
|
-
type T_InsertManyOptions = InsertManyOptions;
|
|
87
|
-
type T_UpdateQuery<T> = UpdateQuery<T>;
|
|
88
|
-
type T_UpdateResult = UpdateResult;
|
|
89
|
-
type T_DeleteResult = DeleteResult;
|
|
90
|
-
type T_WithId<T> = WithId<T>;
|
|
91
|
-
type T_OptionalUnlessRequiredId<T> = OptionalUnlessRequiredId<T>;
|
|
92
|
-
type T_Input_Populate = string | string[] | T_PopulateOptions | T_PopulateOptions[];
|
|
93
|
-
interface T_PaginateOptionsWithPopulate extends T_PaginateOptions, T_PopulateOption {
|
|
94
|
-
}
|
|
95
|
-
type T_GenerateSlugQueryResponse<D> = T_FilterQuery<D> & {
|
|
96
|
-
$or: Array<{
|
|
97
|
-
slug: string;
|
|
98
|
-
} | {
|
|
99
|
-
slugHistory: string;
|
|
100
|
-
}>;
|
|
101
|
-
} & {
|
|
102
|
-
id?: {
|
|
103
|
-
$ne: string;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
interface I_Input_FindOne<T> extends T_PopulateOption {
|
|
107
|
-
filter: T_FilterQuery<T>;
|
|
108
|
-
projection?: T_ProjectionType<T>;
|
|
109
|
-
options?: T_QueryOptions<T>;
|
|
110
|
-
}
|
|
111
|
-
interface I_Input_FindAll<T> extends T_PopulateOption {
|
|
112
|
-
filter: T_FilterQuery<T>;
|
|
113
|
-
projection?: T_ProjectionType<T>;
|
|
114
|
-
options?: T_QueryOptions<T>;
|
|
115
|
-
}
|
|
116
|
-
interface I_Input_FindPaging<T> {
|
|
117
|
-
filter?: T_FilterQuery<T>;
|
|
118
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
119
|
-
}
|
|
120
|
-
interface I_Input_FindPagingAggregate {
|
|
121
|
-
pipeline: T_PipelineStage[];
|
|
122
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
123
|
-
}
|
|
124
|
-
interface I_Input_CreateOne<T> {
|
|
125
|
-
doc: T;
|
|
126
|
-
}
|
|
127
|
-
interface I_Input_CreateMany<T> {
|
|
128
|
-
docs: T[];
|
|
129
|
-
}
|
|
130
|
-
interface I_Input_UpdateOne<T> extends T_PopulateOption {
|
|
131
|
-
filter: T_FilterQuery<T>;
|
|
132
|
-
update: T_UpdateQuery<T>;
|
|
133
|
-
options?: I_UpdateOptionsExtended;
|
|
134
|
-
}
|
|
135
|
-
interface I_Input_UpdateMany<T> extends T_PopulateOption {
|
|
136
|
-
filter: T_FilterQuery<T>;
|
|
137
|
-
update: T_UpdateQuery<T>;
|
|
138
|
-
options?: I_UpdateOptionsExtended;
|
|
139
|
-
}
|
|
140
|
-
interface I_Input_DeleteOne<T> {
|
|
141
|
-
filter: T_FilterQuery<T>;
|
|
142
|
-
options?: I_DeleteOptionsExtended;
|
|
143
|
-
}
|
|
144
|
-
interface I_Input_DeleteMany<T> {
|
|
145
|
-
filter: T_FilterQuery<T>;
|
|
146
|
-
options?: I_DeleteOptionsExtended;
|
|
147
|
-
}
|
|
148
|
-
interface I_UpdateOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
149
|
-
session?: ClientSession;
|
|
150
|
-
}
|
|
151
|
-
interface I_DeleteOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
152
|
-
session?: ClientSession;
|
|
153
|
-
}
|
|
154
|
-
interface I_SlugifyOptions {
|
|
155
|
-
replacement?: string;
|
|
156
|
-
remove?: RegExp;
|
|
157
|
-
lower?: boolean;
|
|
158
|
-
strict?: boolean;
|
|
159
|
-
locale?: string;
|
|
160
|
-
trim?: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export { C_Collection, C_Db, C_Document, C_Model, type I_DeleteOptionsExtended, type I_ExtendedModel, type I_GenerateModelOptions, type I_GenerateSchemaOptions, type I_GenericDocument, type I_HookNextFunction, type I_Input_CreateMany, type I_Input_CreateOne, type I_Input_DeleteMany, type I_Input_DeleteOne, type I_Input_FindAll, type I_Input_FindOne, type I_Input_FindPaging, type I_Input_FindPagingAggregate, type I_Input_UpdateMany, type I_Input_UpdateOne, type I_MongooseModelMiddleware, type I_MongooseOptions, type I_Return, type I_ReturnFailure, type I_ReturnSuccess, type I_SlugifyOptions, type I_UpdateOptionsExtended, type T_AggregatePaginateResult, type T_DeleteResult, type T_Filter, type T_FilterQuery, type T_GenerateSlugQueryResponse, type T_Input_MongooseSchema, type T_Input_Populate, type T_InsertManyOptions, type T_InsertManyResult, type T_InsertOneResult, type T_MiddlewareContext, type T_MongooseModelMiddlewareFunction, type T_MongoosePlugin, type T_MongooseShema, type T_OptionalUnlessRequiredId, type T_PaginateOptions, type T_PaginateOptionsWithPopulate, type T_PaginateResult, type T_PipelineStage, type T_PopulateOption, type T_PopulateOptions, type T_ProjectionType, type T_QueryOptions, type T_UpdateQuery, type T_UpdateResult, type T_WithId };
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Db, InsertOneResult, InsertManyResult, Filter, WithId, UpdateResult, DeleteResult, Collection, OptionalUnlessRequiredId } from 'mongodb';
|
|
2
|
-
import mongoose, { Document, Model, PaginateModel, AggregatePaginateModel, FilterQuery, ProjectionType, QueryOptions, PopulateOptions, PaginateOptions, PopulateOption, PaginateResult, PipelineStage, AggregatePaginateResult, InsertManyOptions, UpdateQuery, ClientSession, QueryWithHelpers, Schema, SchemaDefinition } from 'mongoose';
|
|
3
|
-
|
|
4
|
-
declare class C_Model extends Model {
|
|
5
|
-
}
|
|
6
|
-
declare class C_Db extends Db {
|
|
7
|
-
}
|
|
8
|
-
declare class C_Document extends Document {
|
|
9
|
-
}
|
|
10
|
-
declare class C_Collection<D extends Partial<C_Document>> extends Collection<D> {
|
|
11
|
-
}
|
|
12
|
-
interface I_GenericDocument extends Partial<C_Document> {
|
|
13
|
-
id?: string;
|
|
14
|
-
isDel?: boolean;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
updatedAt?: Date;
|
|
17
|
-
}
|
|
18
|
-
interface I_VirtualNestedOptions {
|
|
19
|
-
[key: string]: I_VirtualNestedOptions | number | string | boolean;
|
|
20
|
-
}
|
|
21
|
-
interface I_HookNextFunction {
|
|
22
|
-
(error?: Error | null): void;
|
|
23
|
-
}
|
|
24
|
-
type T_MiddlewareContext<T> = T | QueryWithHelpers<T, T>;
|
|
25
|
-
interface I_VirtualOptions {
|
|
26
|
-
ref: string;
|
|
27
|
-
localField: string;
|
|
28
|
-
foreignField: string;
|
|
29
|
-
count?: boolean;
|
|
30
|
-
justOne?: boolean;
|
|
31
|
-
options?: I_VirtualNestedOptions;
|
|
32
|
-
}
|
|
33
|
-
interface I_MongooseOptions<D extends Partial<C_Document>> {
|
|
34
|
-
mongoose: typeof mongoose;
|
|
35
|
-
virtuals?: {
|
|
36
|
-
name: keyof D | string;
|
|
37
|
-
options?: I_VirtualOptions;
|
|
38
|
-
get?: (this: D) => void;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
type T_MongooseShema<D> = mongoose.Schema<D>;
|
|
42
|
-
type T_MongoosePlugin = (schema: Schema, options?: Record<string, unknown>) => void;
|
|
43
|
-
type T_Input_MongooseSchema<D> = SchemaDefinition<D>;
|
|
44
|
-
interface I_GenerateSchemaOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
45
|
-
schema: T_Input_MongooseSchema<D>;
|
|
46
|
-
standalone?: boolean;
|
|
47
|
-
}
|
|
48
|
-
type T_MongooseModelMiddlewareFunction = (this: T_MiddlewareContext<C_Document>, next: I_HookNextFunction) => void;
|
|
49
|
-
interface I_MongooseModelMiddleware {
|
|
50
|
-
method: string;
|
|
51
|
-
fn: T_MongooseModelMiddlewareFunction;
|
|
52
|
-
}
|
|
53
|
-
interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
54
|
-
schema: T_Input_MongooseSchema<D>;
|
|
55
|
-
name: string;
|
|
56
|
-
aggregate?: boolean;
|
|
57
|
-
middlewares?: I_MongooseModelMiddleware[];
|
|
58
|
-
pagination?: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
61
|
-
}
|
|
62
|
-
interface I_ReturnSuccess<D, E = {}> {
|
|
63
|
-
success: true;
|
|
64
|
-
result: D & E;
|
|
65
|
-
message?: string;
|
|
66
|
-
code?: number | string;
|
|
67
|
-
}
|
|
68
|
-
interface I_ReturnFailure {
|
|
69
|
-
success: false;
|
|
70
|
-
message: string;
|
|
71
|
-
code: number | string;
|
|
72
|
-
}
|
|
73
|
-
type I_Return<D = void, E = {}> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
74
|
-
type T_Filter<D> = Filter<D>;
|
|
75
|
-
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
76
|
-
type T_InsertManyResult<D> = InsertManyResult<D>;
|
|
77
|
-
type T_FilterQuery<T> = FilterQuery<T>;
|
|
78
|
-
type T_ProjectionType<T> = ProjectionType<T>;
|
|
79
|
-
type T_QueryOptions<T> = QueryOptions<T>;
|
|
80
|
-
type T_PaginateOptions = PaginateOptions;
|
|
81
|
-
type T_PopulateOption = PopulateOption;
|
|
82
|
-
type T_PopulateOptions = PopulateOptions;
|
|
83
|
-
type T_PipelineStage = PipelineStage;
|
|
84
|
-
type T_PaginateResult<T> = PaginateResult<T>;
|
|
85
|
-
type T_AggregatePaginateResult<T> = AggregatePaginateResult<T>;
|
|
86
|
-
type T_InsertManyOptions = InsertManyOptions;
|
|
87
|
-
type T_UpdateQuery<T> = UpdateQuery<T>;
|
|
88
|
-
type T_UpdateResult = UpdateResult;
|
|
89
|
-
type T_DeleteResult = DeleteResult;
|
|
90
|
-
type T_WithId<T> = WithId<T>;
|
|
91
|
-
type T_OptionalUnlessRequiredId<T> = OptionalUnlessRequiredId<T>;
|
|
92
|
-
type T_Input_Populate = string | string[] | T_PopulateOptions | T_PopulateOptions[];
|
|
93
|
-
interface T_PaginateOptionsWithPopulate extends T_PaginateOptions, T_PopulateOption {
|
|
94
|
-
}
|
|
95
|
-
type T_GenerateSlugQueryResponse<D> = T_FilterQuery<D> & {
|
|
96
|
-
$or: Array<{
|
|
97
|
-
slug: string;
|
|
98
|
-
} | {
|
|
99
|
-
slugHistory: string;
|
|
100
|
-
}>;
|
|
101
|
-
} & {
|
|
102
|
-
id?: {
|
|
103
|
-
$ne: string;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
interface I_Input_FindOne<T> extends T_PopulateOption {
|
|
107
|
-
filter: T_FilterQuery<T>;
|
|
108
|
-
projection?: T_ProjectionType<T>;
|
|
109
|
-
options?: T_QueryOptions<T>;
|
|
110
|
-
}
|
|
111
|
-
interface I_Input_FindAll<T> extends T_PopulateOption {
|
|
112
|
-
filter: T_FilterQuery<T>;
|
|
113
|
-
projection?: T_ProjectionType<T>;
|
|
114
|
-
options?: T_QueryOptions<T>;
|
|
115
|
-
}
|
|
116
|
-
interface I_Input_FindPaging<T> {
|
|
117
|
-
filter?: T_FilterQuery<T>;
|
|
118
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
119
|
-
}
|
|
120
|
-
interface I_Input_FindPagingAggregate {
|
|
121
|
-
pipeline: T_PipelineStage[];
|
|
122
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
123
|
-
}
|
|
124
|
-
interface I_Input_CreateOne<T> {
|
|
125
|
-
doc: T;
|
|
126
|
-
}
|
|
127
|
-
interface I_Input_CreateMany<T> {
|
|
128
|
-
docs: T[];
|
|
129
|
-
}
|
|
130
|
-
interface I_Input_UpdateOne<T> extends T_PopulateOption {
|
|
131
|
-
filter: T_FilterQuery<T>;
|
|
132
|
-
update: T_UpdateQuery<T>;
|
|
133
|
-
options?: I_UpdateOptionsExtended;
|
|
134
|
-
}
|
|
135
|
-
interface I_Input_UpdateMany<T> extends T_PopulateOption {
|
|
136
|
-
filter: T_FilterQuery<T>;
|
|
137
|
-
update: T_UpdateQuery<T>;
|
|
138
|
-
options?: I_UpdateOptionsExtended;
|
|
139
|
-
}
|
|
140
|
-
interface I_Input_DeleteOne<T> {
|
|
141
|
-
filter: T_FilterQuery<T>;
|
|
142
|
-
options?: I_DeleteOptionsExtended;
|
|
143
|
-
}
|
|
144
|
-
interface I_Input_DeleteMany<T> {
|
|
145
|
-
filter: T_FilterQuery<T>;
|
|
146
|
-
options?: I_DeleteOptionsExtended;
|
|
147
|
-
}
|
|
148
|
-
interface I_UpdateOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
149
|
-
session?: ClientSession;
|
|
150
|
-
}
|
|
151
|
-
interface I_DeleteOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
152
|
-
session?: ClientSession;
|
|
153
|
-
}
|
|
154
|
-
interface I_SlugifyOptions {
|
|
155
|
-
replacement?: string;
|
|
156
|
-
remove?: RegExp;
|
|
157
|
-
lower?: boolean;
|
|
158
|
-
strict?: boolean;
|
|
159
|
-
locale?: string;
|
|
160
|
-
trim?: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export { C_Collection, C_Db, C_Document, C_Model, type I_DeleteOptionsExtended, type I_ExtendedModel, type I_GenerateModelOptions, type I_GenerateSchemaOptions, type I_GenericDocument, type I_HookNextFunction, type I_Input_CreateMany, type I_Input_CreateOne, type I_Input_DeleteMany, type I_Input_DeleteOne, type I_Input_FindAll, type I_Input_FindOne, type I_Input_FindPaging, type I_Input_FindPagingAggregate, type I_Input_UpdateMany, type I_Input_UpdateOne, type I_MongooseModelMiddleware, type I_MongooseOptions, type I_Return, type I_ReturnFailure, type I_ReturnSuccess, type I_SlugifyOptions, type I_UpdateOptionsExtended, type T_AggregatePaginateResult, type T_DeleteResult, type T_Filter, type T_FilterQuery, type T_GenerateSlugQueryResponse, type T_Input_MongooseSchema, type T_Input_Populate, type T_InsertManyOptions, type T_InsertManyResult, type T_InsertOneResult, type T_MiddlewareContext, type T_MongooseModelMiddlewareFunction, type T_MongoosePlugin, type T_MongooseShema, type T_OptionalUnlessRequiredId, type T_PaginateOptions, type T_PaginateOptionsWithPopulate, type T_PaginateResult, type T_PipelineStage, type T_PopulateOption, type T_PopulateOptions, type T_ProjectionType, type T_QueryOptions, type T_UpdateQuery, type T_UpdateResult, type T_WithId };
|