@cyberskill/shared 2.26.0 → 2.28.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.
Files changed (71) hide show
  1. package/README.md +1 -1
  2. package/dist/config/config.util.cjs +1 -1
  3. package/dist/config/config.util.js +14 -19
  4. package/dist/config/eslint/index.cjs +1 -1
  5. package/dist/config/eslint/index.d.ts +2 -0
  6. package/dist/config/eslint/index.js +1 -1
  7. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  8. package/dist/config/vitest/vitest.e2e.js +1 -1
  9. package/dist/config/vitest/vitest.unit.cjs +1 -1
  10. package/dist/config/vitest/vitest.unit.js +1 -1
  11. package/dist/node/cli/index.cjs +2 -5
  12. package/dist/node/cli/index.js +108 -103
  13. package/dist/node/command/command.util.js +1 -1
  14. package/dist/node/fs/fs.util.cjs +4 -1
  15. package/dist/node/fs/fs.util.d.ts +8 -0
  16. package/dist/node/fs/fs.util.js +58 -50
  17. package/dist/node/fs/index.cjs +1 -1
  18. package/dist/node/fs/index.js +13 -12
  19. package/dist/node/mongo/mongo.type.js +3 -3
  20. package/dist/node/mongo/mongo.util.cjs +2 -5
  21. package/dist/node/mongo/mongo.util.js +206 -211
  22. package/dist/node/path/index.cjs +1 -1
  23. package/dist/node/path/index.js +53 -51
  24. package/dist/node/path/path.constant.cjs +1 -1
  25. package/dist/node/path/path.constant.d.ts +3 -0
  26. package/dist/node/path/path.constant.js +63 -60
  27. package/dist/node/storage/storage.util.cjs +1 -1
  28. package/dist/node/storage/storage.util.js +1 -1
  29. package/dist/node/upload/upload.util.js +3 -3
  30. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  31. package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
  32. package/dist/react/apollo-client/apollo-client.component.js +4 -3
  33. package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
  34. package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
  35. package/dist/react/apollo-client/apollo-client.context.js +9 -8
  36. package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
  37. package/dist/react/apollo-client/apollo-client.util.js +3 -3
  38. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
  39. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
  40. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
  41. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  42. package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
  43. package/dist/react/apollo-error/apollo-error.component.js +2 -1
  44. package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
  45. package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
  46. package/dist/react/apollo-error/apollo-error.provider.js +4 -3
  47. package/dist/react/loading/loading.component.cjs +2 -2
  48. package/dist/react/loading/loading.component.d.ts +1 -1
  49. package/dist/react/loading/loading.component.js +7 -6
  50. package/dist/react/loading/loading.provider.cjs +1 -1
  51. package/dist/react/loading/loading.provider.d.ts +1 -1
  52. package/dist/react/loading/loading.provider.js +8 -7
  53. package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
  54. package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
  55. package/dist/react/next-intl/next-intl.hoc.js +12 -12
  56. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  57. package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
  58. package/dist/react/next-intl/next-intl.provider.js +5 -4
  59. package/dist/util/common/common.util.cjs +1 -1
  60. package/dist/util/common/common.util.d.ts +9 -0
  61. package/dist/util/common/common.util.js +33 -29
  62. package/dist/util/common/index.cjs +1 -1
  63. package/dist/util/common/index.js +6 -5
  64. package/dist/util/index.cjs +1 -1
  65. package/dist/util/index.js +23 -22
  66. package/dist/util/object/object.util.cjs +1 -1
  67. package/dist/util/object/object.util.js +40 -36
  68. package/package.json +45 -44
  69. package/dist/node/mongo/mongo.util.d.ts +0 -1040
  70. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
  71. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
@@ -1,1040 +0,0 @@
1
- import { default as mongooseRaw } from 'mongoose';
2
- import { default as migrate } from 'migrate-mongo';
3
- import { MongoController } from './mongo.controller.js';
4
- import { C_Document, I_CreateModelOptions, I_CreateSchemaOptions, I_DynamicVirtualConfig, I_DynamicVirtualOptions, I_ExtendedModel, I_GenericDocument, I_MongooseModelMiddleware, T_Input_Populate, T_MongoosePlugin, T_MongooseShema, T_QueryFilter, T_VirtualOptions, T_WithId } from './mongo.type.js';
5
- /**
6
- * Converts enum values to proper model names.
7
- * Handles common naming conventions like converting 'USER' to 'User'.
8
- *
9
- * @param enumValue - The enum value to convert
10
- * @returns The converted model name
11
- */
12
- export declare function convertEnumToModelName(enumValue: string): string;
13
- /**
14
- * MongoDB utility object providing comprehensive database operations and utilities.
15
- * This object contains methods for creating generic fields, applying plugins and middlewares,
16
- * creating schemas and models, validation functions, migration utilities, and regex filtering.
17
- */
18
- export declare const mongo: {
19
- /**
20
- * Creates generic fields that are commonly used across MongoDB documents.
21
- * This function generates standard fields including a UUID, deletion flag, and timestamps
22
- * that can be applied to any document schema.
23
- *
24
- * @returns An object containing generic document fields (id, isDel, createdAt, updatedAt).
25
- */
26
- createGenericFields(): I_GenericDocument;
27
- /**
28
- * Applies plugins to a Mongoose schema.
29
- * This function filters out falsy plugins and applies the remaining valid plugins
30
- * to the provided schema.
31
- *
32
- * @param schema - The Mongoose schema to apply plugins to.
33
- * @param plugins - An array of plugin functions or false values to filter and apply.
34
- */
35
- applyPlugins<T>(schema: T_MongooseShema<T>, plugins: Array<T_MongoosePlugin | false>): void;
36
- /**
37
- * Applies middleware functions to a Mongoose schema.
38
- * This function configures pre and post middleware for specified methods on the schema.
39
- *
40
- * @param schema - The Mongoose schema to apply middleware to.
41
- * @param middlewares - An array of middleware configurations with method, pre, and post functions.
42
- */
43
- applyMiddlewares<T extends Partial<C_Document>>(schema: T_MongooseShema<T>, middlewares: I_MongooseModelMiddleware<T>[]): void;
44
- /**
45
- * Creates a generic Mongoose schema with common fields.
46
- * This function creates a base schema with UUID field and deletion flag,
47
- * configured with automatic timestamps.
48
- *
49
- * @param mongoose - The Mongoose instance to create the schema with.
50
- * @returns A Mongoose schema with generic document fields.
51
- */
52
- createGenericSchema(mongoose: typeof mongooseRaw): mongooseRaw.Schema<I_GenericDocument, mongooseRaw.Model<I_GenericDocument, any, any, any, mongooseRaw.Document<unknown, any, I_GenericDocument, any, mongooseRaw.DefaultSchemaOptions> & I_GenericDocument & Required<{
53
- _id: mongooseRaw.Types.ObjectId;
54
- }> & {
55
- __v: number;
56
- }, any, I_GenericDocument>, {}, {}, {}, {}, mongooseRaw.DefaultSchemaOptions, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
57
- _id: mongooseRaw.Types.ObjectId;
58
- }> & {
59
- __v: number;
60
- }, {
61
- id?: mongooseRaw.SchemaDefinitionProperty<string, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
62
- _id: mongooseRaw.Types.ObjectId;
63
- }> & {
64
- __v: number;
65
- }> | undefined;
66
- isDel?: mongooseRaw.SchemaDefinitionProperty<boolean, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
67
- _id: mongooseRaw.Types.ObjectId;
68
- }> & {
69
- __v: number;
70
- }> | undefined;
71
- createdAt?: mongooseRaw.SchemaDefinitionProperty<string | Date, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
72
- _id: mongooseRaw.Types.ObjectId;
73
- }> & {
74
- __v: number;
75
- }> | undefined;
76
- updatedAt?: mongooseRaw.SchemaDefinitionProperty<string | Date, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
77
- _id: mongooseRaw.Types.ObjectId;
78
- }> & {
79
- __v: number;
80
- }> | undefined;
81
- _id?: mongooseRaw.SchemaDefinitionProperty<mongooseRaw.Types.ObjectId | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
82
- _id: mongooseRaw.Types.ObjectId;
83
- }> & {
84
- __v: number;
85
- }> | undefined;
86
- $assertPopulated?: mongooseRaw.SchemaDefinitionProperty<(<Paths = {}>(path: string | string[], values?: Partial<Paths> | undefined) => Omit<C_Document, keyof Paths> & Paths) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
87
- _id: mongooseRaw.Types.ObjectId;
88
- }> & {
89
- __v: number;
90
- }> | undefined;
91
- $clearModifiedPaths?: mongooseRaw.SchemaDefinitionProperty<(() => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
92
- _id: mongooseRaw.Types.ObjectId;
93
- }> & {
94
- __v: number;
95
- }> | undefined;
96
- $clone?: mongooseRaw.SchemaDefinitionProperty<(() => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
97
- _id: mongooseRaw.Types.ObjectId;
98
- }> & {
99
- __v: number;
100
- }> | undefined;
101
- $createModifiedPathsSnapshot?: mongooseRaw.SchemaDefinitionProperty<(() => mongooseRaw.ModifiedPathsSnapshot) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
102
- _id: mongooseRaw.Types.ObjectId;
103
- }> & {
104
- __v: number;
105
- }> | undefined;
106
- $getAllSubdocs?: mongooseRaw.SchemaDefinitionProperty<(() => mongooseRaw.Document[]) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
107
- _id: mongooseRaw.Types.ObjectId;
108
- }> & {
109
- __v: number;
110
- }> | undefined;
111
- $ignore?: mongooseRaw.SchemaDefinitionProperty<((path: string) => void) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
112
- _id: mongooseRaw.Types.ObjectId;
113
- }> & {
114
- __v: number;
115
- }> | undefined;
116
- $isDefault?: mongooseRaw.SchemaDefinitionProperty<((path?: string) => boolean) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
117
- _id: mongooseRaw.Types.ObjectId;
118
- }> & {
119
- __v: number;
120
- }> | undefined;
121
- $isDeleted?: mongooseRaw.SchemaDefinitionProperty<((val?: boolean) => boolean) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
122
- _id: mongooseRaw.Types.ObjectId;
123
- }> & {
124
- __v: number;
125
- }> | undefined;
126
- $getPopulatedDocs?: mongooseRaw.SchemaDefinitionProperty<(() => mongooseRaw.Document[]) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
127
- _id: mongooseRaw.Types.ObjectId;
128
- }> & {
129
- __v: number;
130
- }> | undefined;
131
- $inc?: mongooseRaw.SchemaDefinitionProperty<((path: string | string[], val?: number) => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
132
- _id: mongooseRaw.Types.ObjectId;
133
- }> & {
134
- __v: number;
135
- }> | undefined;
136
- $isEmpty?: mongooseRaw.SchemaDefinitionProperty<((path: string) => boolean) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
137
- _id: mongooseRaw.Types.ObjectId;
138
- }> & {
139
- __v: number;
140
- }> | undefined;
141
- $isValid?: mongooseRaw.SchemaDefinitionProperty<((path: string) => boolean) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
142
- _id: mongooseRaw.Types.ObjectId;
143
- }> & {
144
- __v: number;
145
- }> | undefined;
146
- $locals?: mongooseRaw.SchemaDefinitionProperty<Record<string, unknown> | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
147
- _id: mongooseRaw.Types.ObjectId;
148
- }> & {
149
- __v: number;
150
- }> | undefined;
151
- $markValid?: mongooseRaw.SchemaDefinitionProperty<((path: string) => void) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
152
- _id: mongooseRaw.Types.ObjectId;
153
- }> & {
154
- __v: number;
155
- }> | undefined;
156
- $model?: mongooseRaw.SchemaDefinitionProperty<{
157
- <ModelType = mongooseRaw.Model<unknown, {}, {}, {}, mongooseRaw.Document<unknown, {}, unknown, {}, mongooseRaw.DefaultSchemaOptions> & {
158
- _id: mongooseRaw.Types.ObjectId;
159
- } & {
160
- __v: number;
161
- } & {
162
- id: string;
163
- }, any, unknown>>(name: string): ModelType;
164
- <ModelType = mongooseRaw.Model<any, {}, {}, {}, any, any, any>>(): ModelType;
165
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
166
- _id: mongooseRaw.Types.ObjectId;
167
- }> & {
168
- __v: number;
169
- }> | undefined;
170
- $op?: mongooseRaw.SchemaDefinitionProperty<"save" | "validate" | "remove" | null | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
171
- _id: mongooseRaw.Types.ObjectId;
172
- }> & {
173
- __v: number;
174
- }> | undefined;
175
- $restoreModifiedPathsSnapshot?: mongooseRaw.SchemaDefinitionProperty<((snapshot: mongooseRaw.ModifiedPathsSnapshot) => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
176
- _id: mongooseRaw.Types.ObjectId;
177
- }> & {
178
- __v: number;
179
- }> | undefined;
180
- $session?: mongooseRaw.SchemaDefinitionProperty<((session?: mongooseRaw.ClientSession | null) => mongooseRaw.ClientSession | null) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
181
- _id: mongooseRaw.Types.ObjectId;
182
- }> & {
183
- __v: number;
184
- }> | undefined;
185
- $set?: mongooseRaw.SchemaDefinitionProperty<{
186
- (path: string | Record<string, any>, val: any, type: any, options?: mongooseRaw.DocumentSetOptions): C_Document;
187
- (path: string | Record<string, any>, val: any, options?: mongooseRaw.DocumentSetOptions): C_Document;
188
- (value: string | Record<string, any>): C_Document;
189
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
190
- _id: mongooseRaw.Types.ObjectId;
191
- }> & {
192
- __v: number;
193
- }> | undefined;
194
- $where?: mongooseRaw.SchemaDefinitionProperty<Record<string, unknown> | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
195
- _id: mongooseRaw.Types.ObjectId;
196
- }> & {
197
- __v: number;
198
- }> | undefined;
199
- baseModelName?: mongooseRaw.SchemaDefinitionProperty<string | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
200
- _id: mongooseRaw.Types.ObjectId;
201
- }> & {
202
- __v: number;
203
- }> | undefined;
204
- collection?: mongooseRaw.SchemaDefinitionProperty<mongooseRaw.Collection<mongooseRaw.mongo.BSON.Document> | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
205
- _id: mongooseRaw.Types.ObjectId;
206
- }> & {
207
- __v: number;
208
- }> | undefined;
209
- db?: mongooseRaw.SchemaDefinitionProperty<mongooseRaw.Connection | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
210
- _id: mongooseRaw.Types.ObjectId;
211
- }> & {
212
- __v: number;
213
- }> | undefined;
214
- deleteOne?: mongooseRaw.SchemaDefinitionProperty<((options?: mongooseRaw.QueryOptions) => any) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
215
- _id: mongooseRaw.Types.ObjectId;
216
- }> & {
217
- __v: number;
218
- }> | undefined;
219
- depopulate?: mongooseRaw.SchemaDefinitionProperty<(<Paths = {}>(path?: string | string[]) => mongooseRaw.MergeType<C_Document, Paths>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
220
- _id: mongooseRaw.Types.ObjectId;
221
- }> & {
222
- __v: number;
223
- }> | undefined;
224
- directModifiedPaths?: mongooseRaw.SchemaDefinitionProperty<(() => Array<string>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
225
- _id: mongooseRaw.Types.ObjectId;
226
- }> & {
227
- __v: number;
228
- }> | undefined;
229
- equals?: mongooseRaw.SchemaDefinitionProperty<((doc: mongooseRaw.Document<mongooseRaw.Types.ObjectId, any, any, Record<string, any>, {}>) => boolean) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
230
- _id: mongooseRaw.Types.ObjectId;
231
- }> & {
232
- __v: number;
233
- }> | undefined;
234
- errors?: mongooseRaw.SchemaDefinitionProperty<mongooseRaw.Error.ValidationError | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
235
- _id: mongooseRaw.Types.ObjectId;
236
- }> & {
237
- __v: number;
238
- }> | undefined;
239
- get?: mongooseRaw.SchemaDefinitionProperty<{
240
- <T extends string | number | symbol>(path: T, type?: any, options?: any): any;
241
- (path: string, type?: any, options?: any): any;
242
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
243
- _id: mongooseRaw.Types.ObjectId;
244
- }> & {
245
- __v: number;
246
- }> | undefined;
247
- getChanges?: mongooseRaw.SchemaDefinitionProperty<(() => mongooseRaw.UpdateQuery<C_Document>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
248
- _id: mongooseRaw.Types.ObjectId;
249
- }> & {
250
- __v: number;
251
- }> | undefined;
252
- increment?: mongooseRaw.SchemaDefinitionProperty<(() => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
253
- _id: mongooseRaw.Types.ObjectId;
254
- }> & {
255
- __v: number;
256
- }> | undefined;
257
- init?: mongooseRaw.SchemaDefinitionProperty<((obj: mongooseRaw.AnyObject, opts?: mongooseRaw.AnyObject) => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
258
- _id: mongooseRaw.Types.ObjectId;
259
- }> & {
260
- __v: number;
261
- }> | undefined;
262
- invalidate?: mongooseRaw.SchemaDefinitionProperty<{
263
- <T extends string | number | symbol>(path: T, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
264
- (path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null;
265
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
266
- _id: mongooseRaw.Types.ObjectId;
267
- }> & {
268
- __v: number;
269
- }> | undefined;
270
- isDirectModified?: mongooseRaw.SchemaDefinitionProperty<{
271
- <T extends string | number | symbol>(path: T | T[]): boolean;
272
- (path: string | Array<string>): boolean;
273
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
274
- _id: mongooseRaw.Types.ObjectId;
275
- }> & {
276
- __v: number;
277
- }> | undefined;
278
- isDirectSelected?: mongooseRaw.SchemaDefinitionProperty<{
279
- <T extends string | number | symbol>(path: T): boolean;
280
- (path: string): boolean;
281
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
282
- _id: mongooseRaw.Types.ObjectId;
283
- }> & {
284
- __v: number;
285
- }> | undefined;
286
- isInit?: mongooseRaw.SchemaDefinitionProperty<{
287
- <T extends string | number | symbol>(path: T): boolean;
288
- (path: string): boolean;
289
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
290
- _id: mongooseRaw.Types.ObjectId;
291
- }> & {
292
- __v: number;
293
- }> | undefined;
294
- isModified?: mongooseRaw.SchemaDefinitionProperty<{
295
- <T extends string | number | symbol>(path?: T | T[] | undefined, options?: {
296
- ignoreAtomics?: boolean;
297
- } | null): boolean;
298
- (path?: string | Array<string>, options?: {
299
- ignoreAtomics?: boolean;
300
- } | null): boolean;
301
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
302
- _id: mongooseRaw.Types.ObjectId;
303
- }> & {
304
- __v: number;
305
- }> | undefined;
306
- isNew?: mongooseRaw.SchemaDefinitionProperty<boolean | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
307
- _id: mongooseRaw.Types.ObjectId;
308
- }> & {
309
- __v: number;
310
- }> | undefined;
311
- isSelected?: mongooseRaw.SchemaDefinitionProperty<{
312
- <T extends string | number | symbol>(path: T): boolean;
313
- (path: string): boolean;
314
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
315
- _id: mongooseRaw.Types.ObjectId;
316
- }> & {
317
- __v: number;
318
- }> | undefined;
319
- markModified?: mongooseRaw.SchemaDefinitionProperty<{
320
- <T extends string | number | symbol>(path: T, scope?: any): void;
321
- (path: string, scope?: any): void;
322
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
323
- _id: mongooseRaw.Types.ObjectId;
324
- }> & {
325
- __v: number;
326
- }> | undefined;
327
- model?: mongooseRaw.SchemaDefinitionProperty<{
328
- <ModelType = mongooseRaw.Model<unknown, {}, {}, {}, mongooseRaw.Document<unknown, {}, unknown, {}, mongooseRaw.DefaultSchemaOptions> & {
329
- _id: mongooseRaw.Types.ObjectId;
330
- } & {
331
- __v: number;
332
- } & {
333
- id: string;
334
- }, any, unknown>>(name: string): ModelType;
335
- <ModelType = mongooseRaw.Model<any, {}, {}, {}, any, any, any>>(): ModelType;
336
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
337
- _id: mongooseRaw.Types.ObjectId;
338
- }> & {
339
- __v: number;
340
- }> | undefined;
341
- modifiedPaths?: mongooseRaw.SchemaDefinitionProperty<((options?: {
342
- includeChildren?: boolean;
343
- }) => Array<string>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
344
- _id: mongooseRaw.Types.ObjectId;
345
- }> & {
346
- __v: number;
347
- }> | undefined;
348
- overwrite?: mongooseRaw.SchemaDefinitionProperty<((obj: mongooseRaw.AnyObject) => C_Document) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
349
- _id: mongooseRaw.Types.ObjectId;
350
- }> & {
351
- __v: number;
352
- }> | undefined;
353
- $parent?: mongooseRaw.SchemaDefinitionProperty<(() => mongooseRaw.Document | undefined) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
354
- _id: mongooseRaw.Types.ObjectId;
355
- }> & {
356
- __v: number;
357
- }> | undefined;
358
- populate?: mongooseRaw.SchemaDefinitionProperty<{
359
- <Paths = {}>(path: string | mongooseRaw.PopulateOptions | (string | mongooseRaw.PopulateOptions)[]): Promise<mongooseRaw.MergeType<C_Document, Paths>>;
360
- <Paths = {}>(path: string, select?: string | mongooseRaw.AnyObject, model?: mongooseRaw.Model<any>, match?: mongooseRaw.AnyObject, options?: mongooseRaw.PopulateOptions): Promise<mongooseRaw.MergeType<C_Document, Paths>>;
361
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
362
- _id: mongooseRaw.Types.ObjectId;
363
- }> & {
364
- __v: number;
365
- }> | undefined;
366
- populated?: mongooseRaw.SchemaDefinitionProperty<((path: string) => any) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
367
- _id: mongooseRaw.Types.ObjectId;
368
- }> & {
369
- __v: number;
370
- }> | undefined;
371
- replaceOne?: mongooseRaw.SchemaDefinitionProperty<((replacement?: mongooseRaw.AnyObject, options?: mongooseRaw.QueryOptions | null) => mongooseRaw.Query<any, C_Document, {}, unknown, "find", Record<string, never>>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
372
- _id: mongooseRaw.Types.ObjectId;
373
- }> & {
374
- __v: number;
375
- }> | undefined;
376
- save?: mongooseRaw.SchemaDefinitionProperty<((options?: mongooseRaw.SaveOptions) => Promise<C_Document>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
377
- _id: mongooseRaw.Types.ObjectId;
378
- }> & {
379
- __v: number;
380
- }> | undefined;
381
- schema?: mongooseRaw.SchemaDefinitionProperty<mongooseRaw.Schema<any, mongooseRaw.Model<any, any, any, any, any, any, any>, {}, {}, {}, {}, mongooseRaw.DefaultSchemaOptions, {
382
- [x: number]: unknown;
383
- [x: symbol]: unknown;
384
- [x: string]: unknown;
385
- }, mongooseRaw.Document<unknown, {}, {
386
- [x: number]: unknown;
387
- [x: symbol]: unknown;
388
- [x: string]: unknown;
389
- }, {
390
- id: string;
391
- }, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & Omit<{
392
- [x: number]: unknown;
393
- [x: symbol]: unknown;
394
- [x: string]: unknown;
395
- } & Required<{
396
- _id: unknown;
397
- }> & {
398
- __v: number;
399
- }, "id"> & {
400
- id: string;
401
- }, {
402
- [path: string]: mongooseRaw.SchemaDefinitionProperty<undefined, any, any>;
403
- } | {
404
- [x: string]: mongooseRaw.SchemaDefinitionProperty<any, any, mongooseRaw.Document<unknown, {}, {
405
- [x: number]: unknown;
406
- [x: symbol]: unknown;
407
- [x: string]: unknown;
408
- }, {
409
- id: string;
410
- }, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & Omit<{
411
- [x: number]: unknown;
412
- [x: symbol]: unknown;
413
- [x: string]: unknown;
414
- } & Required<{
415
- _id: unknown;
416
- }> & {
417
- __v: number;
418
- }, "id"> & {
419
- id: string;
420
- }> | undefined;
421
- }, {
422
- [x: number]: {};
423
- [x: symbol]: {};
424
- [x: string]: {};
425
- } & Required<{
426
- _id: unknown;
427
- }> & {
428
- __v: number;
429
- }> | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
430
- _id: mongooseRaw.Types.ObjectId;
431
- }> & {
432
- __v: number;
433
- }> | undefined;
434
- set?: mongooseRaw.SchemaDefinitionProperty<{
435
- <T extends string | number | symbol>(path: T, val: any, type: any, options?: mongooseRaw.DocumentSetOptions): C_Document;
436
- (path: string | Record<string, any>, val: any, type: any, options?: mongooseRaw.DocumentSetOptions): C_Document;
437
- (path: string | Record<string, any>, val: any, options?: mongooseRaw.DocumentSetOptions): C_Document;
438
- (value: string | Record<string, any>): C_Document;
439
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
440
- _id: mongooseRaw.Types.ObjectId;
441
- }> & {
442
- __v: number;
443
- }> | undefined;
444
- toJSON?: mongooseRaw.SchemaDefinitionProperty<{
445
- (options: mongooseRaw.ToObjectOptions & {
446
- flattenMaps: false;
447
- flattenObjectIds: true;
448
- virtuals: true;
449
- versionKey: false;
450
- }): {
451
- [x: string]: any;
452
- [x: number]: any;
453
- [x: symbol]: any;
454
- };
455
- (options: mongooseRaw.ToObjectOptions & {
456
- flattenMaps: false;
457
- flattenObjectIds: true;
458
- virtuals: true;
459
- }): any;
460
- (options: mongooseRaw.ToObjectOptions & {
461
- flattenMaps: false;
462
- flattenObjectIds: false;
463
- virtuals: true;
464
- versionKey: false;
465
- }): Omit<any, "__v">;
466
- (options: mongooseRaw.ToObjectOptions & {
467
- flattenMaps: false;
468
- flattenObjectIds: false;
469
- virtuals: true;
470
- }): any;
471
- (options: mongooseRaw.ToObjectOptions & {
472
- flattenMaps: false;
473
- flattenObjectIds: true;
474
- virtuals: false;
475
- versionKey: false;
476
- }): {
477
- [x: string]: any;
478
- [x: number]: any;
479
- [x: symbol]: any;
480
- };
481
- (options: mongooseRaw.ToObjectOptions & {
482
- flattenMaps: false;
483
- flattenObjectIds: true;
484
- virtuals: false;
485
- }): any;
486
- (options: mongooseRaw.ToObjectOptions & {
487
- flattenMaps: false;
488
- flattenObjectIds: false;
489
- virtuals: false;
490
- versionKey: false;
491
- }): Omit<any, "__v">;
492
- (options: mongooseRaw.ToObjectOptions & {
493
- flattenMaps: false;
494
- flattenObjectIds: false;
495
- virtuals: false;
496
- }): any;
497
- (options: mongooseRaw.ToObjectOptions & {
498
- flattenMaps: true;
499
- flattenObjectIds: true;
500
- virtuals: true;
501
- versionKey: false;
502
- }): {
503
- [x: string]: any;
504
- [x: number]: any;
505
- [x: symbol]: any;
506
- };
507
- (options: mongooseRaw.ToObjectOptions & {
508
- flattenMaps: true;
509
- flattenObjectIds: true;
510
- virtuals: true;
511
- }): {
512
- [x: string]: any;
513
- };
514
- (options: mongooseRaw.ToObjectOptions & {
515
- flattenMaps: true;
516
- flattenObjectIds: false;
517
- virtuals: true;
518
- versionKey: false;
519
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
520
- (options: mongooseRaw.ToObjectOptions & {
521
- flattenMaps: true;
522
- flattenObjectIds: false;
523
- virtuals: true;
524
- }): mongooseRaw.FlattenMaps<any>;
525
- (options: mongooseRaw.ToObjectOptions & {
526
- flattenMaps: true;
527
- flattenObjectIds: true;
528
- virtuals: false;
529
- versionKey: false;
530
- }): {
531
- [x: string]: any;
532
- [x: number]: any;
533
- [x: symbol]: any;
534
- };
535
- (options: mongooseRaw.ToObjectOptions & {
536
- flattenMaps: true;
537
- flattenObjectIds: true;
538
- virtuals: false;
539
- }): {
540
- [x: string]: any;
541
- };
542
- (options: mongooseRaw.ToObjectOptions & {
543
- flattenMaps: true;
544
- flattenObjectIds: false;
545
- virtuals: false;
546
- versionKey: false;
547
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
548
- (options: mongooseRaw.ToObjectOptions & {
549
- flattenMaps: true;
550
- flattenObjectIds: false;
551
- virtuals: false;
552
- }): mongooseRaw.FlattenMaps<any>;
553
- (options: mongooseRaw.ToObjectOptions & {
554
- flattenMaps: true;
555
- flattenObjectIds: true;
556
- virtuals: true;
557
- }): {
558
- [x: string]: any;
559
- };
560
- (options: mongooseRaw.ToObjectOptions & {
561
- flattenMaps: true;
562
- flattenObjectIds: true;
563
- }): {
564
- [x: string]: any;
565
- };
566
- (options: mongooseRaw.ToObjectOptions & {
567
- flattenObjectIds: true;
568
- virtuals: true;
569
- }): any;
570
- (options: mongooseRaw.ToObjectOptions & {
571
- flattenObjectIds: true;
572
- }): any;
573
- (options: mongooseRaw.ToObjectOptions & {
574
- flattenMaps: true;
575
- virtuals: true;
576
- }): mongooseRaw.FlattenMaps<any>;
577
- (options: mongooseRaw.ToObjectOptions & {
578
- flattenMaps: true;
579
- }): mongooseRaw.FlattenMaps<any>;
580
- (options: mongooseRaw.ToObjectOptions & {
581
- versionKey: false;
582
- flattenMaps: true;
583
- flattenObjectIds: true;
584
- virtuals: true;
585
- }): {
586
- [x: string]: any;
587
- [x: number]: any;
588
- [x: symbol]: any;
589
- };
590
- (options: mongooseRaw.ToObjectOptions & {
591
- versionKey: false;
592
- flattenMaps: false;
593
- flattenObjectIds: true;
594
- virtuals: true;
595
- }): {
596
- [x: string]: any;
597
- [x: number]: any;
598
- [x: symbol]: any;
599
- };
600
- (options: mongooseRaw.ToObjectOptions & {
601
- versionKey: false;
602
- flattenMaps: true;
603
- virtuals: true;
604
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
605
- (options: mongooseRaw.ToObjectOptions & {
606
- versionKey: false;
607
- flattenObjectIds: true;
608
- virtuals: true;
609
- }): {
610
- [x: string]: any;
611
- [x: number]: any;
612
- [x: symbol]: any;
613
- };
614
- (options: mongooseRaw.ToObjectOptions & {
615
- versionKey: false;
616
- virtuals: true;
617
- }): Omit<any, "__v">;
618
- (options: mongooseRaw.ToObjectOptions & {
619
- versionKey: false;
620
- flattenMaps: true;
621
- flattenObjectIds: true;
622
- }): {
623
- [x: string]: any;
624
- [x: number]: any;
625
- [x: symbol]: any;
626
- };
627
- (options: mongooseRaw.ToObjectOptions & {
628
- versionKey: false;
629
- flattenObjectIds: true;
630
- }): {
631
- [x: string]: any;
632
- [x: number]: any;
633
- [x: symbol]: any;
634
- };
635
- (options: mongooseRaw.ToObjectOptions & {
636
- versionKey: false;
637
- flattenMaps: true;
638
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
639
- (options: mongooseRaw.ToObjectOptions & {
640
- versionKey: false;
641
- }): Omit<any, "__v">;
642
- (options: mongooseRaw.ToObjectOptions & {
643
- virtuals: true;
644
- }): any;
645
- (options?: mongooseRaw.ToObjectOptions): any;
646
- <T>(options?: mongooseRaw.ToObjectOptions): mongooseRaw.Require_id<T> & {
647
- __v: number;
648
- };
649
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
650
- _id: mongooseRaw.Types.ObjectId;
651
- }> & {
652
- __v: number;
653
- }> | undefined;
654
- toObject?: mongooseRaw.SchemaDefinitionProperty<{
655
- (options: mongooseRaw.ToObjectOptions & {
656
- flattenMaps: false;
657
- flattenObjectIds: true;
658
- virtuals: true;
659
- versionKey: false;
660
- }): {
661
- [x: string]: any;
662
- [x: number]: any;
663
- [x: symbol]: any;
664
- };
665
- (options: mongooseRaw.ToObjectOptions & {
666
- flattenMaps: false;
667
- flattenObjectIds: true;
668
- virtuals: true;
669
- }): any;
670
- (options: mongooseRaw.ToObjectOptions & {
671
- flattenMaps: false;
672
- flattenObjectIds: false;
673
- virtuals: true;
674
- versionKey: false;
675
- }): Omit<any, "__v">;
676
- (options: mongooseRaw.ToObjectOptions & {
677
- flattenMaps: false;
678
- flattenObjectIds: false;
679
- virtuals: true;
680
- }): any;
681
- (options: mongooseRaw.ToObjectOptions & {
682
- flattenMaps: false;
683
- flattenObjectIds: true;
684
- virtuals: false;
685
- versionKey: false;
686
- }): {
687
- [x: string]: any;
688
- [x: number]: any;
689
- [x: symbol]: any;
690
- };
691
- (options: mongooseRaw.ToObjectOptions & {
692
- flattenMaps: false;
693
- flattenObjectIds: true;
694
- virtuals: false;
695
- }): any;
696
- (options: mongooseRaw.ToObjectOptions & {
697
- flattenMaps: false;
698
- flattenObjectIds: false;
699
- virtuals: false;
700
- versionKey: false;
701
- }): Omit<any, "__v">;
702
- (options: mongooseRaw.ToObjectOptions & {
703
- flattenMaps: false;
704
- flattenObjectIds: false;
705
- virtuals: false;
706
- }): any;
707
- (options: mongooseRaw.ToObjectOptions & {
708
- flattenMaps: true;
709
- flattenObjectIds: true;
710
- virtuals: true;
711
- versionKey: false;
712
- }): {
713
- [x: string]: any;
714
- [x: number]: any;
715
- [x: symbol]: any;
716
- };
717
- (options: mongooseRaw.ToObjectOptions & {
718
- flattenMaps: true;
719
- flattenObjectIds: true;
720
- virtuals: true;
721
- }): {
722
- [x: string]: any;
723
- };
724
- (options: mongooseRaw.ToObjectOptions & {
725
- flattenMaps: true;
726
- flattenObjectIds: false;
727
- virtuals: true;
728
- versionKey: false;
729
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
730
- (options: mongooseRaw.ToObjectOptions & {
731
- flattenMaps: true;
732
- flattenObjectIds: false;
733
- virtuals: true;
734
- }): mongooseRaw.FlattenMaps<any>;
735
- (options: mongooseRaw.ToObjectOptions & {
736
- flattenMaps: true;
737
- flattenObjectIds: true;
738
- virtuals: false;
739
- versionKey: false;
740
- }): {
741
- [x: string]: any;
742
- [x: number]: any;
743
- [x: symbol]: any;
744
- };
745
- (options: mongooseRaw.ToObjectOptions & {
746
- flattenMaps: true;
747
- flattenObjectIds: true;
748
- virtuals: false;
749
- }): {
750
- [x: string]: any;
751
- };
752
- (options: mongooseRaw.ToObjectOptions & {
753
- flattenMaps: true;
754
- flattenObjectIds: false;
755
- virtuals: false;
756
- versionKey: false;
757
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
758
- (options: mongooseRaw.ToObjectOptions & {
759
- flattenMaps: true;
760
- flattenObjectIds: false;
761
- virtuals: false;
762
- }): mongooseRaw.FlattenMaps<any>;
763
- (options: mongooseRaw.ToObjectOptions & {
764
- flattenMaps: true;
765
- flattenObjectIds: true;
766
- virtuals: true;
767
- }): {
768
- [x: string]: any;
769
- };
770
- (options: mongooseRaw.ToObjectOptions & {
771
- flattenMaps: true;
772
- flattenObjectIds: true;
773
- }): {
774
- [x: string]: any;
775
- };
776
- (options: mongooseRaw.ToObjectOptions & {
777
- flattenObjectIds: true;
778
- virtuals: true;
779
- }): any;
780
- (options: mongooseRaw.ToObjectOptions & {
781
- flattenObjectIds: true;
782
- }): any;
783
- (options: mongooseRaw.ToObjectOptions & {
784
- flattenMaps: true;
785
- virtuals: true;
786
- }): mongooseRaw.FlattenMaps<any>;
787
- (options: mongooseRaw.ToObjectOptions & {
788
- flattenMaps: true;
789
- }): mongooseRaw.FlattenMaps<any>;
790
- (options: mongooseRaw.ToObjectOptions & {
791
- versionKey: false;
792
- flattenMaps: true;
793
- flattenObjectIds: true;
794
- virtuals: true;
795
- }): {
796
- [x: string]: any;
797
- [x: number]: any;
798
- [x: symbol]: any;
799
- };
800
- (options: mongooseRaw.ToObjectOptions & {
801
- versionKey: false;
802
- flattenMaps: false;
803
- flattenObjectIds: true;
804
- virtuals: true;
805
- }): {
806
- [x: string]: any;
807
- [x: number]: any;
808
- [x: symbol]: any;
809
- };
810
- (options: mongooseRaw.ToObjectOptions & {
811
- versionKey: false;
812
- flattenMaps: true;
813
- virtuals: true;
814
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
815
- (options: mongooseRaw.ToObjectOptions & {
816
- versionKey: false;
817
- flattenObjectIds: true;
818
- virtuals: true;
819
- }): {
820
- [x: string]: any;
821
- [x: number]: any;
822
- [x: symbol]: any;
823
- };
824
- (options: mongooseRaw.ToObjectOptions & {
825
- versionKey: false;
826
- virtuals: true;
827
- }): Omit<any, "__v">;
828
- (options: mongooseRaw.ToObjectOptions & {
829
- versionKey: false;
830
- flattenMaps: true;
831
- flattenObjectIds: true;
832
- }): {
833
- [x: string]: any;
834
- [x: number]: any;
835
- [x: symbol]: any;
836
- };
837
- (options: mongooseRaw.ToObjectOptions & {
838
- versionKey: false;
839
- flattenObjectIds: true;
840
- }): {
841
- [x: string]: any;
842
- [x: number]: any;
843
- [x: symbol]: any;
844
- };
845
- (options: mongooseRaw.ToObjectOptions & {
846
- versionKey: false;
847
- flattenMaps: true;
848
- }): Omit<mongooseRaw.FlattenMaps<any>, "__v">;
849
- (options: mongooseRaw.ToObjectOptions & {
850
- versionKey: false;
851
- }): Omit<any, "__v">;
852
- (options: mongooseRaw.ToObjectOptions & {
853
- virtuals: true;
854
- }): any;
855
- (options?: mongooseRaw.ToObjectOptions): any;
856
- <T>(options?: mongooseRaw.ToObjectOptions): mongooseRaw.Require_id<T> & {
857
- __v: number;
858
- };
859
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
860
- _id: mongooseRaw.Types.ObjectId;
861
- }> & {
862
- __v: number;
863
- }> | undefined;
864
- unmarkModified?: mongooseRaw.SchemaDefinitionProperty<{
865
- <T extends string | number | symbol>(path: T): void;
866
- (path: string): void;
867
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
868
- _id: mongooseRaw.Types.ObjectId;
869
- }> & {
870
- __v: number;
871
- }> | undefined;
872
- updateOne?: mongooseRaw.SchemaDefinitionProperty<((update?: mongooseRaw.UpdateWithAggregationPipeline | mongooseRaw.UpdateQuery<C_Document> | undefined, options?: mongooseRaw.QueryOptions | null) => mongooseRaw.Query<any, C_Document, {}, unknown, "find", Record<string, never>>) | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
873
- _id: mongooseRaw.Types.ObjectId;
874
- }> & {
875
- __v: number;
876
- }> | undefined;
877
- validate?: mongooseRaw.SchemaDefinitionProperty<{
878
- <T extends string | number | symbol>(pathsToValidate?: T | T[] | undefined, options?: mongooseRaw.AnyObject): Promise<void>;
879
- (pathsToValidate?: mongooseRaw.pathsToValidate, options?: mongooseRaw.AnyObject): Promise<void>;
880
- (options: {
881
- pathsToSkip?: mongooseRaw.pathsToSkip;
882
- }): Promise<void>;
883
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
884
- _id: mongooseRaw.Types.ObjectId;
885
- }> & {
886
- __v: number;
887
- }> | undefined;
888
- validateSync?: mongooseRaw.SchemaDefinitionProperty<{
889
- (options: {
890
- pathsToSkip?: mongooseRaw.pathsToSkip;
891
- [k: string]: any;
892
- }): mongooseRaw.Error.ValidationError | null;
893
- <T extends string | number | symbol>(pathsToValidate?: T | T[] | undefined, options?: mongooseRaw.AnyObject): mongooseRaw.Error.ValidationError | null;
894
- (pathsToValidate?: mongooseRaw.pathsToValidate, options?: mongooseRaw.AnyObject): mongooseRaw.Error.ValidationError | null;
895
- } | undefined, I_GenericDocument, mongooseRaw.Document<unknown, {}, I_GenericDocument, {}, mongooseRaw.ResolveSchemaOptions<mongooseRaw.DefaultSchemaOptions>> & I_GenericDocument & Required<{
896
- _id: mongooseRaw.Types.ObjectId;
897
- }> & {
898
- __v: number;
899
- }> | undefined;
900
- }, I_GenericDocument>;
901
- /**
902
- * Creates a Mongoose schema with optional virtual fields and generic fields.
903
- * This function creates a new Mongoose schema from the provided schema definition,
904
- * optionally adds virtual fields, and includes generic fields (unless standalone is true).
905
- *
906
- * @param options - Configuration options including mongoose instance, schema definition, virtuals, and standalone flag.
907
- * @param options.mongoose - The Mongoose instance to use for schema creation.
908
- * @param options.schema - The schema definition object.
909
- * @param options.virtuals - Optional array of virtual field configurations.
910
- * @param options.standalone - Whether to exclude generic fields (default: false).
911
- * @returns A configured Mongoose schema.
912
- */
913
- createSchema<T, R extends string = string>({ mongoose, schema, virtuals, standalone, }: I_CreateSchemaOptions<T, R>): T_MongooseShema<T>;
914
- /**
915
- * Creates a Mongoose model with plugins, middleware, and pagination support.
916
- * This function creates a model from a schema with optional pagination and aggregation plugins,
917
- * and applies any specified middleware. If a model with the same name already exists, it returns the existing model.
918
- *
919
- * @param options - Configuration options including mongoose instance, model name, schema, and feature flags.
920
- * @param options.mongoose - The Mongoose instance to use for model creation.
921
- * @param options.name - The name of the model to create.
922
- * @param options.schema - The schema definition for the model.
923
- * @param options.pagination - Whether to enable pagination plugin (default: false).
924
- * @param options.aggregate - Whether to enable aggregation pagination plugin (default: false).
925
- * @param options.virtuals - Optional array of virtual field configurations.
926
- * @param options.middlewares - Optional array of middleware configurations.
927
- * @returns A configured Mongoose model with extended functionality.
928
- * @throws {Error} When the model name is not provided.
929
- */
930
- createModel<T extends Partial<C_Document>, R extends string = string>({ mongoose: currentMongooseInstance, name, schema, virtuals, pagination, aggregate, middlewares, }: I_CreateModelOptions<T, R>): I_ExtendedModel<T>;
931
- /**
932
- * Validation utilities for Mongoose schemas.
933
- * This object provides common validation functions that can be used in Mongoose schema definitions.
934
- */
935
- validator: {
936
- /**
937
- * Creates a required field validator.
938
- * This function returns a validator that checks if a field value is not empty
939
- * using the validate.isEmpty utility.
940
- *
941
- * @returns A validation function that returns true if the field is not empty.
942
- */
943
- isRequired<T>(): (this: T, value: unknown) => Promise<boolean>;
944
- /**
945
- * Creates a unique field validator.
946
- * This function returns a validator that checks if a field value is unique
947
- * across the specified fields in the collection.
948
- *
949
- * @param fields - An array of field names to check for uniqueness.
950
- * @returns A validation function that returns true if the value is unique across the specified fields.
951
- * @throws {Error} When fields is not a non-empty array of strings.
952
- */
953
- isUnique<T extends {
954
- constructor: {
955
- exists: (query: {
956
- [key: string]: unknown;
957
- }) => Promise<unknown>;
958
- };
959
- }>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
960
- /**
961
- * Creates a regex pattern validator.
962
- * This function returns a validator that checks if a string value matches
963
- * all provided regular expressions.
964
- *
965
- * @param regexArray - An array of regular expressions to test against the value.
966
- * @returns A validation function that returns true if the value matches all regex patterns.
967
- * @throws {Error} When regexArray is not an array of valid RegExp objects.
968
- */
969
- matchesRegex(regexArray: RegExp[]): (value: string) => Promise<boolean>;
970
- };
971
- /**
972
- * Migration utilities for MongoDB.
973
- * This object extends the migrate-mongo library with additional configuration utilities.
974
- */
975
- migrate: {
976
- /**
977
- * Sets the migration configuration and updates .gitignore.
978
- * This function creates a migration configuration file and ensures it's properly
979
- * excluded from version control.
980
- *
981
- * @param options - Migration configuration options to write to the config file.
982
- */
983
- setConfig: (options: Partial<migrate.config.Config> & {
984
- moduleSystem?: "commonjs" | "esm";
985
- }) => void;
986
- init(): Promise<void>;
987
- create(description: string): Promise<string>;
988
- up(db: mongooseRaw.mongo.Db, client: mongooseRaw.mongo.MongoClient): Promise<string[]>;
989
- down(db: mongooseRaw.mongo.Db, client: mongooseRaw.mongo.MongoClient): Promise<string[]>;
990
- status(db: mongooseRaw.mongo.Db): Promise<migrate.MigrationStatus[]>;
991
- database: typeof migrate.database;
992
- config: typeof migrate.config;
993
- };
994
- /**
995
- * Converts string values in a filter to regex patterns for case-insensitive search.
996
- * This function recursively processes a filter object and converts string values in specified fields
997
- * to MongoDB regex patterns that support accented character matching.
998
- *
999
- * @param filter - The filter object to process.
1000
- * @param fields - An array of field names to convert to regex patterns.
1001
- * @returns A new filter object with string values converted to regex patterns.
1002
- */
1003
- regexify<T>(filter?: T_QueryFilter<T>, fields?: (keyof T | string)[]): T_QueryFilter<T>;
1004
- /**
1005
- * Checks if a virtual options object has a dynamic ref function.
1006
- *
1007
- * @param options - The virtual options to check.
1008
- * @returns True if the options contain a dynamic ref function.
1009
- */
1010
- isDynamicVirtual<T, R extends string = string>(options?: T_VirtualOptions<T, R>): options is I_DynamicVirtualOptions<T, R>;
1011
- /**
1012
- * Generic utility function to get new records from the database
1013
- * @param controller - MongoController instance
1014
- * @param recordsToCheck - Array of records to check
1015
- * @param filterFn - Function to determine if a record already exists
1016
- * @returns Array of records that don't exist in the database
1017
- */
1018
- getNewRecords<T extends I_GenericDocument>(controller: MongoController<T>, recordsToCheck: T[], filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean): Promise<T[]>;
1019
- /**
1020
- * Generic utility function to get existing records that match the filter criteria
1021
- * @param controller - MongoController instance
1022
- * @param recordsToCheck - Array of records to check
1023
- * @param filterFn - Function to determine if a record exists
1024
- * @returns Array of existing records that match the filter criteria
1025
- */
1026
- getExistingRecords<T extends I_GenericDocument>(controller: MongoController<T>, recordsToCheck: T[], filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean): Promise<T_WithId<T>[]>;
1027
- };
1028
- /**
1029
- * Recursively applies nested populate options to populated documents.
1030
- * This function handles cases where a populated field needs further population.
1031
- *
1032
- * @template T - The document type
1033
- * @param mongoose - The Mongoose instance
1034
- * @param documents - The documents to apply nested populations to
1035
- * @param populateOptions - The populate options to apply
1036
- * @param virtualConfigs - Optional virtual configurations for model inference
1037
- * @param currentModel - The current model context (which model's schema to search for virtuals)
1038
- * @returns Promise with documents that have nested populations applied
1039
- */
1040
- export declare function applyNestedPopulate<T extends object>(mongoose: typeof mongooseRaw, documents: T[], populateOptions: T_Input_Populate, virtualConfigs?: I_DynamicVirtualConfig<unknown, string>[], currentModel?: any): Promise<T[]>;