@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.
- package/README.md +15 -0
- package/dist/audit/audit.model.d.ts +209 -0
- package/dist/audit/audit.model.d.ts.map +1 -0
- package/dist/audit/audit.service.d.ts +17 -0
- package/dist/audit/audit.service.d.ts.map +1 -0
- package/dist/audit/audit.types.d.ts +29 -0
- package/dist/audit/audit.types.d.ts.map +1 -0
- package/dist/audit/audit.utils.d.ts +50 -0
- package/dist/audit/audit.utils.d.ts.map +1 -0
- package/dist/audit/index.d.ts +5 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/filters/filter.utils.d.ts +112 -0
- package/dist/filters/filter.utils.d.ts.map +1 -0
- package/dist/filters/index.d.ts +16 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/index.js +199 -0
- package/dist/filters/index.js.map +10 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1847 -0
- package/dist/index.js.map +70 -0
- package/dist/integrity/index.d.ts +3 -0
- package/dist/integrity/index.d.ts.map +1 -0
- package/dist/integrity/integrity.registry.d.ts +38 -0
- package/dist/integrity/integrity.registry.d.ts.map +1 -0
- package/dist/integrity/integrity.types.d.ts +26 -0
- package/dist/integrity/integrity.types.d.ts.map +1 -0
- package/dist/migrations/cli.d.ts +28 -0
- package/dist/migrations/cli.d.ts.map +1 -0
- package/dist/migrations/disconnect.d.ts +8 -0
- package/dist/migrations/disconnect.d.ts.map +1 -0
- package/dist/migrations/index.d.ts +6 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/migrate.d.ts +47 -0
- package/dist/migrations/migrate.d.ts.map +1 -0
- package/dist/migrations/migration.model.d.ts +7 -0
- package/dist/migrations/migration.model.d.ts.map +1 -0
- package/dist/migrations/migration.runner.d.ts +47 -0
- package/dist/migrations/migration.runner.d.ts.map +1 -0
- package/dist/migrations/migration.types.d.ts +48 -0
- package/dist/migrations/migration.types.d.ts.map +1 -0
- package/dist/migrations/migration.utils.d.ts +40 -0
- package/dist/migrations/migration.utils.d.ts.map +1 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/pagination.d.ts +34 -0
- package/dist/models/pagination.d.ts.map +1 -0
- package/dist/models/postal-address.model.d.ts +64 -0
- package/dist/models/postal-address.model.d.ts.map +1 -0
- package/dist/mongoose.d.ts +3 -0
- package/dist/mongoose.d.ts.map +1 -0
- package/dist/plugins/consts.d.ts +6 -0
- package/dist/plugins/consts.d.ts.map +1 -0
- package/dist/plugins/errors.d.ts +3 -0
- package/dist/plugins/errors.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +15 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/pagination/index.d.ts +4 -0
- package/dist/plugins/pagination/index.d.ts.map +1 -0
- package/dist/plugins/pagination/types.d.ts +61 -0
- package/dist/plugins/pagination/types.d.ts.map +1 -0
- package/dist/plugins/pagination/utils.d.ts +24 -0
- package/dist/plugins/pagination/utils.d.ts.map +1 -0
- package/dist/plugins/shared/index.d.ts +3 -0
- package/dist/plugins/shared/index.d.ts.map +1 -0
- package/dist/plugins/shared/shared.d.ts +3 -0
- package/dist/plugins/shared/shared.d.ts.map +1 -0
- package/dist/plugins/soft-delete/index.d.ts +3 -0
- package/dist/plugins/soft-delete/index.d.ts.map +1 -0
- package/dist/plugins/soft-delete/soft-delete.d.ts +3 -0
- package/dist/plugins/soft-delete/soft-delete.d.ts.map +1 -0
- package/dist/services/crud.service.d.ts +88 -0
- package/dist/services/crud.service.d.ts.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/pagination.d.ts +72 -0
- package/dist/types/shared.d.ts +49 -0
- package/dist/types/soft-delete.d.ts +627 -0
- package/dist/utils/clear-database.d.ts +24 -0
- package/dist/utils/clear-database.d.ts.map +1 -0
- package/dist/utils/error.utils.d.ts +4 -0
- package/dist/utils/error.utils.d.ts.map +1 -0
- package/dist/utils/filter.utils.d.ts +40 -0
- package/dist/utils/filter.utils.d.ts.map +1 -0
- package/dist/utils/helpers.d.ts +72 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/mappers.d.ts +4 -0
- package/dist/utils/mappers.d.ts.map +1 -0
- package/dist/utils/models.d.ts +3 -0
- package/dist/utils/models.d.ts.map +1 -0
- package/dist/utils/mongo-utils.d.ts +45 -0
- package/dist/utils/mongo-utils.d.ts.map +1 -0
- package/dist/utils/object-id.utils.d.ts +16 -0
- package/dist/utils/object-id.utils.d.ts.map +1 -0
- package/dist/utils/pagination.utils.d.ts +6 -0
- package/dist/utils/pagination.utils.d.ts.map +1 -0
- package/dist/utils/schema.d.ts +2 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/sort.utils.d.ts +12 -0
- package/dist/utils/sort.utils.d.ts.map +1 -0
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/validation.types.d.ts +36 -0
- package/dist/validation/validation.types.d.ts.map +1 -0
- package/dist/validation/validation.utils.d.ts +6 -0
- package/dist/validation/validation.utils.d.ts.map +1 -0
- package/dist/validation/validators/email.validator.d.ts +8 -0
- package/dist/validation/validators/email.validator.d.ts.map +1 -0
- package/dist/validation/validators/future.validator.d.ts +8 -0
- package/dist/validation/validators/future.validator.d.ts.map +1 -0
- package/dist/validation/validators/guid.validator.d.ts +6 -0
- package/dist/validation/validators/guid.validator.d.ts.map +1 -0
- package/dist/validation/validators/index.d.ts +30 -0
- package/dist/validation/validators/index.d.ts.map +1 -0
- package/dist/validation/validators/ip.validator.d.ts +6 -0
- package/dist/validation/validators/ip.validator.d.ts.map +1 -0
- package/dist/validation/validators/ipv4.validator.d.ts +6 -0
- package/dist/validation/validators/ipv4.validator.d.ts.map +1 -0
- package/dist/validation/validators/ipv6.validator.d.ts +6 -0
- package/dist/validation/validators/ipv6.validator.d.ts.map +1 -0
- package/dist/validation/validators/mac.validator.d.ts +6 -0
- package/dist/validation/validators/mac.validator.d.ts.map +1 -0
- package/dist/validation/validators/max-length.validator.d.ts +6 -0
- package/dist/validation/validators/max-length.validator.d.ts.map +1 -0
- package/dist/validation/validators/max.validator.d.ts +6 -0
- package/dist/validation/validators/max.validator.d.ts.map +1 -0
- package/dist/validation/validators/min-length.validator.d.ts +6 -0
- package/dist/validation/validators/min-length.validator.d.ts.map +1 -0
- package/dist/validation/validators/min.validator.d.ts +6 -0
- package/dist/validation/validators/min.validator.d.ts.map +1 -0
- package/dist/validation/validators/negative.validator.d.ts +6 -0
- package/dist/validation/validators/negative.validator.d.ts.map +1 -0
- package/dist/validation/validators/not-blank.validator.d.ts +6 -0
- package/dist/validation/validators/not-blank.validator.d.ts.map +1 -0
- package/dist/validation/validators/not-empty.validator.d.ts +6 -0
- package/dist/validation/validators/not-empty.validator.d.ts.map +1 -0
- package/dist/validation/validators/object-id.validator.d.ts +6 -0
- package/dist/validation/validators/object-id.validator.d.ts.map +1 -0
- package/dist/validation/validators/past.validator.d.ts +8 -0
- package/dist/validation/validators/past.validator.d.ts.map +1 -0
- package/dist/validation/validators/pattern.validator.d.ts +6 -0
- package/dist/validation/validators/pattern.validator.d.ts.map +1 -0
- package/dist/validation/validators/phone.validator.d.ts +6 -0
- package/dist/validation/validators/phone.validator.d.ts.map +1 -0
- package/dist/validation/validators/positive.validator.d.ts +6 -0
- package/dist/validation/validators/positive.validator.d.ts.map +1 -0
- package/dist/validation/validators/range.validator.d.ts +6 -0
- package/dist/validation/validators/range.validator.d.ts.map +1 -0
- package/dist/validation/validators/required.validator.d.ts +6 -0
- package/dist/validation/validators/required.validator.d.ts.map +1 -0
- package/dist/validation/validators/size.validator.d.ts +6 -0
- package/dist/validation/validators/size.validator.d.ts.map +1 -0
- package/dist/validation/validators/ssn.validator.d.ts +6 -0
- package/dist/validation/validators/ssn.validator.d.ts.map +1 -0
- package/dist/validation/validators/street.validator.d.ts +6 -0
- package/dist/validation/validators/street.validator.d.ts.map +1 -0
- package/dist/validation/validators/time.validator.d.ts +6 -0
- package/dist/validation/validators/time.validator.d.ts.map +1 -0
- package/dist/validation/validators/url.validator.d.ts +8 -0
- package/dist/validation/validators/url.validator.d.ts.map +1 -0
- package/dist/validation/validators/uuid.validator.d.ts +6 -0
- package/dist/validation/validators/uuid.validator.d.ts.map +1 -0
- package/dist/validation/validators/zip-code.validator.d.ts +6 -0
- package/dist/validation/validators/zip-code.validator.d.ts.map +1 -0
- 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,EA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G,EAAE,GAAG,EAAE,GAAG,CAAC,EAC7C,KAAK,CAAC,EAAE,eAAe,EACvB,MAAM,GAAE,WAAW,CAAC,CAAC,CAAM,GACzB,OAAO,CAAC,WAAW,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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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,GACnB,MAAM,GACN,OAAO,GACP,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,aAAa,CAAC;AAEjB,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AAEvD,MAAM,WAAW,qBAAqB;IACrC,SAAS,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAA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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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,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,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"}
|