@nxgt/shared-mongo 1.0.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 (169) hide show
  1. package/README.md +15 -0
  2. package/dist/audit/audit.model.d.ts +209 -0
  3. package/dist/audit/audit.model.d.ts.map +1 -0
  4. package/dist/audit/audit.service.d.ts +17 -0
  5. package/dist/audit/audit.service.d.ts.map +1 -0
  6. package/dist/audit/audit.types.d.ts +29 -0
  7. package/dist/audit/audit.types.d.ts.map +1 -0
  8. package/dist/audit/audit.utils.d.ts +50 -0
  9. package/dist/audit/audit.utils.d.ts.map +1 -0
  10. package/dist/audit/index.d.ts +5 -0
  11. package/dist/audit/index.d.ts.map +1 -0
  12. package/dist/filters/filter.utils.d.ts +112 -0
  13. package/dist/filters/filter.utils.d.ts.map +1 -0
  14. package/dist/filters/index.d.ts +16 -0
  15. package/dist/filters/index.d.ts.map +1 -0
  16. package/dist/filters/index.js +199 -0
  17. package/dist/filters/index.js.map +10 -0
  18. package/dist/index.d.ts +14 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +1847 -0
  21. package/dist/index.js.map +70 -0
  22. package/dist/integrity/index.d.ts +3 -0
  23. package/dist/integrity/index.d.ts.map +1 -0
  24. package/dist/integrity/integrity.registry.d.ts +38 -0
  25. package/dist/integrity/integrity.registry.d.ts.map +1 -0
  26. package/dist/integrity/integrity.types.d.ts +26 -0
  27. package/dist/integrity/integrity.types.d.ts.map +1 -0
  28. package/dist/migrations/cli.d.ts +28 -0
  29. package/dist/migrations/cli.d.ts.map +1 -0
  30. package/dist/migrations/disconnect.d.ts +8 -0
  31. package/dist/migrations/disconnect.d.ts.map +1 -0
  32. package/dist/migrations/index.d.ts +6 -0
  33. package/dist/migrations/index.d.ts.map +1 -0
  34. package/dist/migrations/migrate.d.ts +47 -0
  35. package/dist/migrations/migrate.d.ts.map +1 -0
  36. package/dist/migrations/migration.model.d.ts +7 -0
  37. package/dist/migrations/migration.model.d.ts.map +1 -0
  38. package/dist/migrations/migration.runner.d.ts +47 -0
  39. package/dist/migrations/migration.runner.d.ts.map +1 -0
  40. package/dist/migrations/migration.types.d.ts +48 -0
  41. package/dist/migrations/migration.types.d.ts.map +1 -0
  42. package/dist/migrations/migration.utils.d.ts +40 -0
  43. package/dist/migrations/migration.utils.d.ts.map +1 -0
  44. package/dist/models/index.d.ts +3 -0
  45. package/dist/models/index.d.ts.map +1 -0
  46. package/dist/models/pagination.d.ts +34 -0
  47. package/dist/models/pagination.d.ts.map +1 -0
  48. package/dist/models/postal-address.model.d.ts +64 -0
  49. package/dist/models/postal-address.model.d.ts.map +1 -0
  50. package/dist/mongoose.d.ts +3 -0
  51. package/dist/mongoose.d.ts.map +1 -0
  52. package/dist/plugins/consts.d.ts +6 -0
  53. package/dist/plugins/consts.d.ts.map +1 -0
  54. package/dist/plugins/errors.d.ts +3 -0
  55. package/dist/plugins/errors.d.ts.map +1 -0
  56. package/dist/plugins/index.d.ts +15 -0
  57. package/dist/plugins/index.d.ts.map +1 -0
  58. package/dist/plugins/pagination/index.d.ts +4 -0
  59. package/dist/plugins/pagination/index.d.ts.map +1 -0
  60. package/dist/plugins/pagination/types.d.ts +61 -0
  61. package/dist/plugins/pagination/types.d.ts.map +1 -0
  62. package/dist/plugins/pagination/utils.d.ts +24 -0
  63. package/dist/plugins/pagination/utils.d.ts.map +1 -0
  64. package/dist/plugins/shared/index.d.ts +3 -0
  65. package/dist/plugins/shared/index.d.ts.map +1 -0
  66. package/dist/plugins/shared/shared.d.ts +3 -0
  67. package/dist/plugins/shared/shared.d.ts.map +1 -0
  68. package/dist/plugins/soft-delete/index.d.ts +3 -0
  69. package/dist/plugins/soft-delete/index.d.ts.map +1 -0
  70. package/dist/plugins/soft-delete/soft-delete.d.ts +3 -0
  71. package/dist/plugins/soft-delete/soft-delete.d.ts.map +1 -0
  72. package/dist/services/crud.service.d.ts +88 -0
  73. package/dist/services/crud.service.d.ts.map +1 -0
  74. package/dist/services/index.d.ts +2 -0
  75. package/dist/services/index.d.ts.map +1 -0
  76. package/dist/types/index.d.ts +4 -0
  77. package/dist/types/index.d.ts.map +1 -0
  78. package/dist/types/pagination.d.ts +72 -0
  79. package/dist/types/shared.d.ts +49 -0
  80. package/dist/types/soft-delete.d.ts +627 -0
  81. package/dist/utils/clear-database.d.ts +24 -0
  82. package/dist/utils/clear-database.d.ts.map +1 -0
  83. package/dist/utils/error.utils.d.ts +4 -0
  84. package/dist/utils/error.utils.d.ts.map +1 -0
  85. package/dist/utils/filter.utils.d.ts +40 -0
  86. package/dist/utils/filter.utils.d.ts.map +1 -0
  87. package/dist/utils/helpers.d.ts +72 -0
  88. package/dist/utils/helpers.d.ts.map +1 -0
  89. package/dist/utils/index.d.ts +12 -0
  90. package/dist/utils/index.d.ts.map +1 -0
  91. package/dist/utils/mappers.d.ts +4 -0
  92. package/dist/utils/mappers.d.ts.map +1 -0
  93. package/dist/utils/models.d.ts +3 -0
  94. package/dist/utils/models.d.ts.map +1 -0
  95. package/dist/utils/mongo-utils.d.ts +45 -0
  96. package/dist/utils/mongo-utils.d.ts.map +1 -0
  97. package/dist/utils/object-id.utils.d.ts +16 -0
  98. package/dist/utils/object-id.utils.d.ts.map +1 -0
  99. package/dist/utils/pagination.utils.d.ts +6 -0
  100. package/dist/utils/pagination.utils.d.ts.map +1 -0
  101. package/dist/utils/schema.d.ts +2 -0
  102. package/dist/utils/schema.d.ts.map +1 -0
  103. package/dist/utils/sort.utils.d.ts +12 -0
  104. package/dist/utils/sort.utils.d.ts.map +1 -0
  105. package/dist/validation/index.d.ts +2 -0
  106. package/dist/validation/index.d.ts.map +1 -0
  107. package/dist/validation/validation.types.d.ts +36 -0
  108. package/dist/validation/validation.types.d.ts.map +1 -0
  109. package/dist/validation/validation.utils.d.ts +6 -0
  110. package/dist/validation/validation.utils.d.ts.map +1 -0
  111. package/dist/validation/validators/email.validator.d.ts +8 -0
  112. package/dist/validation/validators/email.validator.d.ts.map +1 -0
  113. package/dist/validation/validators/future.validator.d.ts +8 -0
  114. package/dist/validation/validators/future.validator.d.ts.map +1 -0
  115. package/dist/validation/validators/guid.validator.d.ts +6 -0
  116. package/dist/validation/validators/guid.validator.d.ts.map +1 -0
  117. package/dist/validation/validators/index.d.ts +30 -0
  118. package/dist/validation/validators/index.d.ts.map +1 -0
  119. package/dist/validation/validators/ip.validator.d.ts +6 -0
  120. package/dist/validation/validators/ip.validator.d.ts.map +1 -0
  121. package/dist/validation/validators/ipv4.validator.d.ts +6 -0
  122. package/dist/validation/validators/ipv4.validator.d.ts.map +1 -0
  123. package/dist/validation/validators/ipv6.validator.d.ts +6 -0
  124. package/dist/validation/validators/ipv6.validator.d.ts.map +1 -0
  125. package/dist/validation/validators/mac.validator.d.ts +6 -0
  126. package/dist/validation/validators/mac.validator.d.ts.map +1 -0
  127. package/dist/validation/validators/max-length.validator.d.ts +6 -0
  128. package/dist/validation/validators/max-length.validator.d.ts.map +1 -0
  129. package/dist/validation/validators/max.validator.d.ts +6 -0
  130. package/dist/validation/validators/max.validator.d.ts.map +1 -0
  131. package/dist/validation/validators/min-length.validator.d.ts +6 -0
  132. package/dist/validation/validators/min-length.validator.d.ts.map +1 -0
  133. package/dist/validation/validators/min.validator.d.ts +6 -0
  134. package/dist/validation/validators/min.validator.d.ts.map +1 -0
  135. package/dist/validation/validators/negative.validator.d.ts +6 -0
  136. package/dist/validation/validators/negative.validator.d.ts.map +1 -0
  137. package/dist/validation/validators/not-blank.validator.d.ts +6 -0
  138. package/dist/validation/validators/not-blank.validator.d.ts.map +1 -0
  139. package/dist/validation/validators/not-empty.validator.d.ts +6 -0
  140. package/dist/validation/validators/not-empty.validator.d.ts.map +1 -0
  141. package/dist/validation/validators/object-id.validator.d.ts +6 -0
  142. package/dist/validation/validators/object-id.validator.d.ts.map +1 -0
  143. package/dist/validation/validators/past.validator.d.ts +8 -0
  144. package/dist/validation/validators/past.validator.d.ts.map +1 -0
  145. package/dist/validation/validators/pattern.validator.d.ts +6 -0
  146. package/dist/validation/validators/pattern.validator.d.ts.map +1 -0
  147. package/dist/validation/validators/phone.validator.d.ts +6 -0
  148. package/dist/validation/validators/phone.validator.d.ts.map +1 -0
  149. package/dist/validation/validators/positive.validator.d.ts +6 -0
  150. package/dist/validation/validators/positive.validator.d.ts.map +1 -0
  151. package/dist/validation/validators/range.validator.d.ts +6 -0
  152. package/dist/validation/validators/range.validator.d.ts.map +1 -0
  153. package/dist/validation/validators/required.validator.d.ts +6 -0
  154. package/dist/validation/validators/required.validator.d.ts.map +1 -0
  155. package/dist/validation/validators/size.validator.d.ts +6 -0
  156. package/dist/validation/validators/size.validator.d.ts.map +1 -0
  157. package/dist/validation/validators/ssn.validator.d.ts +6 -0
  158. package/dist/validation/validators/ssn.validator.d.ts.map +1 -0
  159. package/dist/validation/validators/street.validator.d.ts +6 -0
  160. package/dist/validation/validators/street.validator.d.ts.map +1 -0
  161. package/dist/validation/validators/time.validator.d.ts +6 -0
  162. package/dist/validation/validators/time.validator.d.ts.map +1 -0
  163. package/dist/validation/validators/url.validator.d.ts +8 -0
  164. package/dist/validation/validators/url.validator.d.ts.map +1 -0
  165. package/dist/validation/validators/uuid.validator.d.ts +6 -0
  166. package/dist/validation/validators/uuid.validator.d.ts.map +1 -0
  167. package/dist/validation/validators/zip-code.validator.d.ts +6 -0
  168. package/dist/validation/validators/zip-code.validator.d.ts.map +1 -0
  169. package/package.json +68 -0
@@ -0,0 +1,72 @@
1
+ import type { ListStringPatch } from '@nxgt/shared/models';
2
+ import type { Model, PipelineStage, QueryFilter, UpdateQuery } from 'mongoose';
3
+ import mongoose from 'mongoose';
4
+ import type { Populated } from './models';
5
+ /**
6
+ * (Re)creates `viewModel`'s namespace as a MongoDB view over `model`.
7
+ *
8
+ * The drop-then-create is retried because it races the view model's own
9
+ * `autoCreate`/`autoIndex`: Mongoose materialises the namespace as an ordinary
10
+ * collection when it initialises the model, and if that lands between the drop
11
+ * and the create, the create fails with `NamespaceExists` and the app is left
12
+ * querying an empty collection that will never return a row. It only shows up
13
+ * on a *fresh* database — an existing one already has the view — which is
14
+ * exactly when nobody is watching, so the result is verified rather than
15
+ * assumed, and a definitive failure is logged loudly instead of silently.
16
+ */
17
+ export declare function safeCreateView<T, R>(model: Model<T, any, any, any, any, any, any>, viewModel: Model<R, any, any, any, any, any, any>, pipeline?: PipelineStage[], attempts?: number): Promise<void>;
18
+ /**
19
+ * Resolves a list patch against the values a document already holds and
20
+ * returns the whole resulting list.
21
+ *
22
+ * Use this from `buildUpdateData`. Its sibling `buildListStringPatch` returns
23
+ * MongoDB update operators, which only mean anything to `findOneAndUpdate` —
24
+ * `MongoCrudService.update()` assigns onto a document and calls `save()`, where
25
+ * a key named `$addToSet` is an unknown property Mongoose drops without a
26
+ * word. An `add` then looked applied and changed nothing.
27
+ *
28
+ * Ids are validated against `model` exactly like the operator builder does, so
29
+ * an unknown id is dropped rather than stored.
30
+ *
31
+ * @param current - The list the document holds today; populated docs, raw ids or ObjectIds all work.
32
+ * @param model - The Mongoose model of the items in the list.
33
+ * @param value - The add / remove / replace patch, if the caller sent one.
34
+ * @param filter - Extra conditions the referenced items must satisfy.
35
+ * @returns The resulting list of ids, or undefined when there is nothing to change.
36
+ */
37
+ /**
38
+ * Applies a list patch to a plain list of strings.
39
+ *
40
+ * Synchronous, and therefore purely syntactic: unlike
41
+ * {@link resolveListStringPatch} it does not ask the database whether the ids
42
+ * exist, so an unknown id survives here where the async one drops it. Use this
43
+ * when the caller has already established what the ids are.
44
+ */
45
+ export declare function patchListString(list?: string[], patch?: ListStringPatch | null): string[];
46
+ /** {@link patchListString} over a path holding ObjectIds or populated docs. */
47
+ export declare function patchListObjectId(list?: mongoose.Types.ObjectId[] | Populated<any>[], patch?: ListStringPatch | null): mongoose.Types.ObjectId[];
48
+ export declare function resolveListStringPatch<T>(current: unknown, model: Model<T, any, any, any, any, any, any>, value?: ListStringPatch, filter?: QueryFilter<T>): Promise<string[] | undefined>;
49
+ /**
50
+ * Builds a MongoDB update query for adding, removing, or replacing items in a list of strings.
51
+ *
52
+ * Only usable through `findOneAndUpdate` and friends — see
53
+ * `resolveListStringPatch` for the document-assignment path.
54
+ *
55
+ * @param _source - The Mongoose model of the source document.
56
+ * @param path - The path of the list field to be updated.
57
+ * @param model - The Mongoose model of the items in the list.
58
+ * @param value - An object containing arrays of strings to add, remove, or replace.
59
+ * @param filter - An optional filter to apply when validating the existence of items to be added, removed, or replaced.
60
+ * @returns An update query object for MongoDB.
61
+ */
62
+ export declare function buildListStringPatch<T, S>(_source: Model<S, any, any, any, any, any, any>, path: keyof S, model: Model<T, any, any, any, any, any, any>, value?: ListStringPatch, filter?: QueryFilter<T>): Promise<UpdateQuery<S>>;
63
+ /**
64
+ * Builds a MongoDB update query for adding, removing, or replacing items in a list of strings.
65
+ *
66
+ * @param path - The path of the list field to be updated.
67
+ * @param value - An object containing arrays of strings to add, remove, or replace.
68
+ * @returns An update query object for MongoDB.
69
+ */
70
+ export declare function buildListStringPatchUpdate<T>(path: keyof T, value?: ListStringPatch): Promise<UpdateQuery<T>>;
71
+ export declare function checkVersion(modelVersion: number, version?: number): void;
72
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAI3D,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAY1C;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,CAAC,EACxC,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,E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AAW,CAAC,CAAC,CAAC,CAAC,CAgDzB;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EACjD,IAAI,EAAE,MAAM,CAAC,EACb,KAAK,CAAC,EAAE,eAAe,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAqBzB;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,QASlE"}
@@ -0,0 +1,12 @@
1
+ export * from './clear-database';
2
+ export * from './error.utils';
3
+ export * from './filter.utils';
4
+ export * from './helpers';
5
+ export * from './mappers';
6
+ export * from './models';
7
+ export * from './mongo-utils';
8
+ export * from './object-id.utils';
9
+ export * from './pagination.utils';
10
+ export * from './schema';
11
+ export * from './sort.utils';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Document } from 'mongoose';
2
+ export declare const toObject: <T>(doc: Document<T> | null, ...omitFields: string[]) => any;
3
+ export declare const toObjects: <T>(docs: Document<T>[], ...omitFields: string[]) => any[];
4
+ //# sourceMappingURL=mappers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../src/utils/mappers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,QAAQ,GAAI,CAAC,EACzB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,EACvB,GAAG,YAAY,MAAM,EAAE,QASvB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,YAAY,MAAM,EAAE,UACzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Document, ObjectId, PopulatedDoc } from 'mongoose';
2
+ export type Populated<T> = PopulatedDoc<Document<ObjectId> & T>;
3
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/utils/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { auditChanges } from '../audit';
2
+ import { applyPlugins } from '../plugins';
3
+ import { castError } from './error.utils';
4
+ export declare const MONGO_UTILS: {
5
+ timestamps: {
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ };
9
+ coreOptions: {
10
+ toObject: {
11
+ virtuals: boolean;
12
+ versionKey: boolean;
13
+ };
14
+ toJSON: {
15
+ virtuals: boolean;
16
+ versionKey: boolean;
17
+ };
18
+ timestamps: {
19
+ createdAt: string;
20
+ updatedAt: string;
21
+ };
22
+ versionKey: string;
23
+ optimisticConcurrency: boolean;
24
+ };
25
+ auditPipeline: {
26
+ $match: {
27
+ operationType: {
28
+ $in: string[];
29
+ };
30
+ };
31
+ }[];
32
+ safeCreateView<T, R>(model: import("mongoose").Model<T, any, any, any, any, any, any>, viewModel: import("mongoose").Model<R, any, any, any, any, any, any>, pipeline?: import("mongoose").PipelineStage[], attempts?: number): Promise<void>;
33
+ patchListString(list?: string[], patch?: import("@nxgt/shared").ListStringPatch | null): string[];
34
+ patchListObjectId(list?: import("mongoose").Types.ObjectId[] | import("./models").Populated<any>[], patch?: import("@nxgt/shared").ListStringPatch | null): import("mongoose").Types.ObjectId[];
35
+ resolveListStringPatch<T>(current: unknown, model: import("mongoose").Model<T, any, any, any, any, any, any>, value?: import("@nxgt/shared").ListStringPatch, filter?: import("mongoose").QueryFilter<T>): Promise<string[] | undefined>;
36
+ buildListStringPatch<T, S>(_source: import("mongoose").Model<S, any, any, any, any, any, any>, path: keyof S, model: import("mongoose").Model<T, any, any, any, any, any, any>, value?: import("@nxgt/shared").ListStringPatch, filter?: import("mongoose").QueryFilter<T>): Promise<import("mongoose").UpdateQuery<S>>;
37
+ buildListStringPatchUpdate<T>(path: keyof T, value?: import("@nxgt/shared").ListStringPatch): Promise<import("mongoose").UpdateQuery<T>>;
38
+ checkVersion(modelVersion: number, version?: number): void;
39
+ toObject: <T>(doc: import("mongoose").Document<T> | null, ...omitFields: string[]) => any;
40
+ toObjects: <T>(docs: import("mongoose").Document<T>[], ...omitFields: string[]) => any[];
41
+ applyPlugins: typeof applyPlugins;
42
+ castError: typeof castError;
43
+ auditChanges: typeof auditChanges;
44
+ };
45
+ //# sourceMappingURL=mongo-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-utils.d.ts","sourceRoot":"","sources":["../../src/utils/mongo-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK1C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eALT,CAAC,EAAG,0CACnB,EACA,uBAAyB;gBASsB,CAAC,EAAE,sCAAmB,EAAE,uBAEnE;;;;CAaH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Types } from 'mongoose';
2
+ export declare function objectIdString(): string;
3
+ export declare function toObjectId(id: string): Types.ObjectId;
4
+ export declare function toObjectIds(ids: string[]): Types.ObjectId[];
5
+ export declare function isValidObjectID(id: string | Types.ObjectId): boolean;
6
+ export declare function validObjectIds(ids?: string[] | null): string[] | undefined;
7
+ /**
8
+ * sellix-monorepo's name for {@link toObjectId}.
9
+ *
10
+ * It answered a `mongoose.mongo.ObjectId` (the BSON driver's class) where
11
+ * `toObjectId` answers a `Types.ObjectId` (Mongoose's own). The two are
12
+ * interchangeable everywhere either was used, so this is an alias rather than
13
+ * a second implementation.
14
+ */
15
+ export declare function objectIdFromString(id: string): Types.ObjectId;
16
+ //# sourceMappingURL=object-id.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-id.utils.d.ts","sourceRoot":"","sources":["../../src/utils/object-id.utils.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,kBAEpC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,oBAExC;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,WAE1D;AAED,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,wBAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,kBAE5C"}
@@ -0,0 +1,6 @@
1
+ import type { HydratedDocument } from 'mongoose';
2
+ import type { IConnection, NestedPaginationOptions } from '../models';
3
+ export declare function paginateList<T extends HydratedDocument<{
4
+ id: string;
5
+ }>>(docs: T[], options: NestedPaginationOptions): IConnection<T>;
6
+ //# sourceMappingURL=pagination.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.utils.d.ts","sourceRoot":"","sources":["../../src/utils/pagination.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGtE,wBAAgB,YAAY,CAAC,CAAC,SAAS,gBAAgB,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EACtE,IAAI,EAAE,CAAC,EAAE,EACT,OAAO,EAAE,uBAAuB,GAC9B,WAAW,CAAC,CAAC,CAAC,CAEhB"}
@@ -0,0 +1,2 @@
1
+ export type OmitFIelds = '__typename' | 'id' | 'createdDate' | 'lastModifiedDate' | 'version';
2
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GACnB,YAAY,GACZ,IAAI,GACJ,aAAa,GACb,kBAAkB,GAClB,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sort building lives in `@nxgt/shared`, one layer down, because it is plain
3
+ * object work with no Mongoose in it. Re-exported here because that is where
4
+ * sellix-monorepo imported it from.
5
+ *
6
+ * `SortOrder` is deliberately not re-exported: Mongoose exports a type of that
7
+ * name and this package re-exports Mongoose wholesale, so forwarding ours too
8
+ * makes the root ambiguous and `tsc` drops both. Import `SortOrder` from
9
+ * `@nxgt/shared`; `SortDirection` here is the same enum.
10
+ */
11
+ export { buildSort, SortDirection, type SortField } from '@nxgt/shared/helpers';
12
+ //# sourceMappingURL=sort.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.utils.d.ts","sourceRoot":"","sources":["../../src/utils/sort.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * as VALIDATORS from './validators';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
@@ -0,0 +1,36 @@
1
+ export type MessageType = string;
2
+ export type DateFields = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
3
+ export type ValidatorOptions<T> = T | [T, MessageType];
4
+ export interface IConstraintValidation {
5
+ minLength?: ValidatorOptions<number>;
6
+ maxLength?: ValidatorOptions<number>;
7
+ min?: ValidatorOptions<number>;
8
+ max?: ValidatorOptions<number>;
9
+ size?: ValidatorOptions<number>;
10
+ range?: ValidatorOptions<number>;
11
+ past?: ValidatorOptions<DateFields>;
12
+ future?: ValidatorOptions<DateFields>;
13
+ email?: ValidatorOptions<{
14
+ domains?: string[];
15
+ }>;
16
+ url?: ValidatorOptions<{
17
+ domains?: string[];
18
+ }>;
19
+ ip?: ValidatorOptions<{
20
+ startsWith?: string[];
21
+ endsWidth?: string[];
22
+ }>;
23
+ positive?: ValidatorOptions<true>;
24
+ negative?: ValidatorOptions<true>;
25
+ mac?: ValidatorOptions<true>;
26
+ ipv4?: ValidatorOptions<true>;
27
+ ipv6?: ValidatorOptions<true>;
28
+ ssn?: ValidatorOptions<true>;
29
+ uuid?: ValidatorOptions<true>;
30
+ guid?: ValidatorOptions<true>;
31
+ zipCode?: ValidatorOptions<true>;
32
+ street?: ValidatorOptions<true>;
33
+ phone?: ValidatorOptions<true>;
34
+ objectId?: ValidatorOptions<true>;
35
+ }
36
+ //# sourceMappingURL=validation.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.types.d.ts","sourceRoot":"","sources":["../../src/validation/validation.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,UAAU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AAC,CAAC;IAC9B,IAAI,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC9B,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;CAClC"}
@@ -0,0 +1,6 @@
1
+ import type { MessageType, ValidatorOptions } from './validation.types';
2
+ export declare function parseValidatorOptions<T>(args: ValidatorOptions<T>): {
3
+ value: T;
4
+ message?: (options?: object, defaultMessage?: MessageType) => (props: any) => string;
5
+ };
6
+ //# sourceMappingURL=validation.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.utils.d.ts","sourceRoot":"","sources":["../../src/validation/validation.utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAExE,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IACpE,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,CACT,OAAO,CAAC,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,WAAW,KACxB,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC;CAC5B,CAsBA"}
@@ -0,0 +1,8 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function email(args: ValidatorOptions<{
3
+ domains?: string[];
4
+ }>): {
5
+ message: ((props: any) => string) | undefined;
6
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
7
+ };
8
+ //# sourceMappingURL=email.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/email.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,KAAK,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;;;EAuBnE"}
@@ -0,0 +1,8 @@
1
+ import type { DateFields, ValidatorOptions } from '../validation.types';
2
+ export declare function future(args: ValidatorOptions<Partial<Record<DateFields, number>> & {
3
+ datetime?: boolean;
4
+ }>): {
5
+ message: ((props: any) => string) | undefined;
6
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
7
+ };
8
+ //# sourceMappingURL=future.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"future.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/future.validator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxE,wBAAgB,MAAM,CACrB,IAAI,EAAE,gBAAgB,CACrB,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAC5D;;;EA4BD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function guid(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=guid.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guid.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/guid.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWhD"}
@@ -0,0 +1,30 @@
1
+ import { email } from './email.validator';
2
+ import { future } from './future.validator';
3
+ import { guid } from './guid.validator';
4
+ import { ip } from './ip.validator';
5
+ import { ipv4 } from './ipv4.validator';
6
+ import { ipv6 } from './ipv6.validator';
7
+ import { mac } from './mac.validator';
8
+ import { max } from './max.validator';
9
+ import { maxLength } from './max-length.validator';
10
+ import { min } from './min.validator';
11
+ import { minLength } from './min-length.validator';
12
+ import { negative } from './negative.validator';
13
+ import { notBlank } from './not-blank.validator';
14
+ import { notEmpty } from './not-empty.validator';
15
+ import { objectId } from './object-id.validator';
16
+ import { past } from './past.validator';
17
+ import { pattern } from './pattern.validator';
18
+ import { phone } from './phone.validator';
19
+ import { positive } from './positive.validator';
20
+ import { range } from './range.validator';
21
+ import { required } from './required.validator';
22
+ import { size } from './size.validator';
23
+ import { ssn } from './ssn.validator';
24
+ import { street } from './street.validator';
25
+ import { time } from './time.validator';
26
+ import { url } from './url.validator';
27
+ import { uuid } from './uuid.validator';
28
+ import { zipCode } from './zip-code.validator';
29
+ export { email, future, guid, ip, ipv4, ipv6, mac, max, maxLength, min, minLength, negative, notBlank, notEmpty, objectId, past, pattern, phone, positive, range, required, size, ssn, street, time, url, uuid, zipCode, };
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM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B,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EACN,KAAK,EACL,MAAM,EACN,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,GAAG,EACH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,MAAM,EACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,OAAO,GACP,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function ip(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=ip.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/ip.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAW9C"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function ipv4(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=ipv4.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipv4.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/ipv4.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWhD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function ipv6(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=ipv6.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ipv6.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/ipv6.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWhD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function mac(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=mac.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mac.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/mac.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAW/C"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function maxLength(args: ValidatorOptions<number>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=max-length.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max-length.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/max-length.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;EAgBvD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function max(args: ValidatorOptions<number>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=max.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/max.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;EAWjD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function minLength(args: ValidatorOptions<number>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=min-length.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min-length.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/min-length.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;EAgBvD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function min(args: ValidatorOptions<number>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=min.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/min.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;EAWjD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function negative(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=negative.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"negative.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/negative.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EASpD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function notBlank(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=not-blank.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-blank.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/not-blank.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWpD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function notEmpty(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=not-empty.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-empty.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/not-empty.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAYpD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function objectId(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=object-id.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object-id.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/object-id.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAYpD"}
@@ -0,0 +1,8 @@
1
+ import type { DateFields, ValidatorOptions } from '../validation.types';
2
+ export declare function past(args: ValidatorOptions<Partial<Record<DateFields, number>> & {
3
+ datetime?: boolean;
4
+ }>): {
5
+ message: ((props: any) => string) | undefined;
6
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
7
+ };
8
+ //# sourceMappingURL=past.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"past.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/past.validator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGxE,wBAAgB,IAAI,CACnB,IAAI,EAAE,gBAAgB,CACrB,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAC5D;;;EA4BD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function pattern(args: ValidatorOptions<string>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=pattern.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pattern.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/pattern.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;EAYrD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function phone(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=phone.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/phone.validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,KAAK,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWjD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function positive(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=positive.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positive.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/positive.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EASpD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function range(args: ValidatorOptions<[number, number]>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=range.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/range.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,KAAK,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;EAuB7D"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function required(args: ValidatorOptions<true>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=required.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/required.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;EAWpD"}
@@ -0,0 +1,6 @@
1
+ import type { ValidatorOptions } from '../validation.types';
2
+ export declare function size(args: ValidatorOptions<[number, number]>): {
3
+ message: ((props: any) => string) | undefined;
4
+ validator(this: object | import("mongoose").Query<unknown, object, {}, unknown, "find", Record<string, never>>, value: any): boolean;
5
+ };
6
+ //# sourceMappingURL=size.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"size.validator.d.ts","sourceRoot":"","sources":["../../../src/validation/validators/size.validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;EAuB5D"}