@aldb2b/common 1.0.41 → 1.0.42
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/build/db/CustomModel.d.ts +4 -4
- package/build/db/CustomModel.js +7 -7
- package/build/db/MongooseBase.d.ts +34 -34
- package/build/db/MongooseBase.js +264 -259
- package/build/db/MongooseBase.js.map +1 -1
- package/build/db/mongoose-find-options.d.ts +12 -12
- package/build/db/mongoose-find-options.js +67 -67
- package/build/decorators/get-user-decorator.d.ts +1 -1
- package/build/decorators/get-user-decorator.js +12 -12
- package/build/events/attendee-contact.interface.d.ts +10 -10
- package/build/events/attendee-contact.interface.js +2 -2
- package/build/events/authorize-user.interface.d.ts +12 -12
- package/build/events/authorize-user.interface.js +2 -2
- package/build/events/campaign-users.interface.d.ts +11 -11
- package/build/events/campaign-users.interface.js +2 -2
- package/build/events/compute-calendar.interface.d.ts +14 -14
- package/build/events/compute-calendar.interface.js +2 -2
- package/build/events/edit-lit-users.interface.d.ts +10 -10
- package/build/events/edit-lit-users.interface.js +2 -2
- package/build/events/email-specs.interface.d.ts +18 -18
- package/build/events/email-specs.interface.js +2 -2
- package/build/events/get-companies.interface.d.ts +10 -10
- package/build/events/get-companies.interface.js +2 -2
- package/build/events/get-event.interface.d.ts +10 -10
- package/build/events/get-event.interface.js +2 -2
- package/build/events/get-unavailable-by-user.interface.d.ts +10 -12
- package/build/events/get-unavailable-by-user.interface.js +2 -2
- package/build/events/groups-by-company.interface.d.ts +12 -12
- package/build/events/groups-by-company.interface.js +2 -2
- package/build/events/meeting-request-created.interface.d.ts +20 -20
- package/build/events/meeting-request-created.interface.js +2 -2
- package/build/events/subjects.d.ts +13 -13
- package/build/events/subjects.js +17 -17
- package/build/index.d.ts +47 -47
- package/build/index.js +59 -59
- package/build/interceptors/response.interceptor.d.ts +6 -6
- package/build/interceptors/response.interceptor.js +30 -30
- package/build/interceptors/serialize.interceptor.d.ts +12 -12
- package/build/interceptors/serialize.interceptor.js +24 -24
- package/build/middlewares/app.middleware.d.ts +6 -6
- package/build/middlewares/app.middleware.js +29 -29
- package/build/middlewares/authorizer.middleware.d.ts +9 -9
- package/build/middlewares/authorizer.middleware.js +87 -87
- package/build/tsconfig.tsbuildinfo +4927 -4927
- package/build/types/download-presigned-url.interface.d.ts +4 -4
- package/build/types/download-presigned-url.interface.js +2 -2
- package/build/types/header-user.interface.d.ts +7 -7
- package/build/types/header-user.interface.js +2 -2
- package/build/types/meeting-request-token.interface.d.ts +6 -6
- package/build/types/meeting-request-token.interface.js +2 -2
- package/build/types/meeting-type.enum.d.ts +4 -4
- package/build/types/meeting-type.enum.js +8 -8
- package/build/types/read-result.interface.d.ts +5 -5
- package/build/types/read-result.interface.js +2 -2
- package/build/types/update-input-data.interface.d.ts +9 -9
- package/build/types/update-input-data.interface.js +2 -2
- package/build/types/upload-presigned-url.interface.d.ts +4 -4
- package/build/types/upload-presigned-url.interface.js +2 -2
- package/build/types/user-role.enum.d.ts +7 -7
- package/build/types/user-role.enum.js +11 -11
- package/build/types/user-type.enum.d.ts +5 -5
- package/build/types/user-type.enum.js +9 -9
- package/build/utils/create-default-directories.d.ts +1 -1
- package/build/utils/create-default-directories.js +23 -23
- package/build/utils/equal-array-object.d.ts +1 -1
- package/build/utils/equal-array-object.js +9 -9
- package/build/utils/equal-object.d.ts +1 -1
- package/build/utils/equal-object.js +8 -8
- package/build/utils/parse-query.d.ts +1 -1
- package/build/utils/parse-query.js +30 -30
- package/build/utils/projection.d.ts +1 -1
- package/build/utils/projection.js +25 -25
- package/build/validators/conditional-required.d.ts +2 -2
- package/build/validators/conditional-required.js +23 -23
- package/build/validators/date-validator.d.ts +2 -2
- package/build/validators/date-validator.js +20 -20
- package/build/validators/responses/customizeArrayResponse.d.ts +3 -3
- package/build/validators/responses/customizeArrayResponse.js +23 -23
- package/build/validators/responses/error.d.ts +2 -2
- package/build/validators/responses/error.interface.d.ts +4 -4
- package/build/validators/responses/error.interface.js +2 -2
- package/build/validators/responses/error.js +26 -26
- package/build/validators/responses/response-option.interface.d.ts +7 -7
- package/build/validators/responses/response-option.interface.js +2 -2
- package/build/validators/responses/succes-result.interface.d.ts +10 -10
- package/build/validators/responses/succes-result.interface.js +2 -2
- package/build/validators/responses/success.d.ts +3 -3
- package/build/validators/responses/success.interface.d.ts +4 -4
- package/build/validators/responses/success.interface.js +2 -2
- package/build/validators/responses/success.js +14 -14
- package/build/validators/validateNewItem.d.ts +1 -1
- package/build/validators/validateNewItem.js +22 -22
- package/build/validators/validateProjection.d.ts +1 -1
- package/build/validators/validateProjection.js +32 -32
- package/build/validators/validateProjectionResult.d.ts +1 -1
- package/build/validators/validateProjectionResult.js +36 -36
- package/build/validators/validateUpdateItem.d.ts +1 -1
- package/build/validators/validateUpdateItem.js +22 -22
- package/package.json +34 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface DownloadPresignedURL {
|
|
2
|
-
file: string;
|
|
3
|
-
downloadURL: string;
|
|
4
|
-
}
|
|
1
|
+
export interface DownloadPresignedURL {
|
|
2
|
+
file: string;
|
|
3
|
+
downloadURL: string;
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=download-presigned-url.interface.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface HeaderUser {
|
|
2
|
-
id: string;
|
|
3
|
-
email: string;
|
|
4
|
-
role: string;
|
|
5
|
-
type: string;
|
|
6
|
-
company?: string;
|
|
7
|
-
}
|
|
1
|
+
export interface HeaderUser {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
role: string;
|
|
5
|
+
type: string;
|
|
6
|
+
company?: string;
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=header-user.interface.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface MeetingRequestToken {
|
|
2
|
-
stepId: string;
|
|
3
|
-
userId: string;
|
|
4
|
-
type: string;
|
|
5
|
-
meetingRequestDate?: string;
|
|
6
|
-
}
|
|
1
|
+
export interface MeetingRequestToken {
|
|
2
|
+
stepId: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
type: string;
|
|
5
|
+
meetingRequestDate?: string;
|
|
6
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=meeting-request-token.interface.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum MeetingType {
|
|
2
|
-
IN_PERSON = "In-person",
|
|
3
|
-
VIRTUAL = "Virtual"
|
|
4
|
-
}
|
|
1
|
+
export declare enum MeetingType {
|
|
2
|
+
IN_PERSON = "In-person",
|
|
3
|
+
VIRTUAL = "Virtual"
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MeetingType = void 0;
|
|
4
|
-
var MeetingType;
|
|
5
|
-
(function (MeetingType) {
|
|
6
|
-
MeetingType["IN_PERSON"] = "In-person";
|
|
7
|
-
MeetingType["VIRTUAL"] = "Virtual";
|
|
8
|
-
})(MeetingType = exports.MeetingType || (exports.MeetingType = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeetingType = void 0;
|
|
4
|
+
var MeetingType;
|
|
5
|
+
(function (MeetingType) {
|
|
6
|
+
MeetingType["IN_PERSON"] = "In-person";
|
|
7
|
+
MeetingType["VIRTUAL"] = "Virtual";
|
|
8
|
+
})(MeetingType = exports.MeetingType || (exports.MeetingType = {}));
|
|
9
9
|
//# sourceMappingURL=meeting-type.enum.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface ReadResult {
|
|
2
|
-
data?: object[];
|
|
3
|
-
hasTotal?: boolean;
|
|
4
|
-
total?: number;
|
|
5
|
-
}
|
|
1
|
+
export interface ReadResult {
|
|
2
|
+
data?: object[];
|
|
3
|
+
hasTotal?: boolean;
|
|
4
|
+
total?: number;
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=read-result.interface.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface UpdateInputData {
|
|
2
|
-
query: object;
|
|
3
|
-
data: object;
|
|
4
|
-
necessaryProjectionArray?: string[];
|
|
5
|
-
$set?: string;
|
|
6
|
-
$unset?: string;
|
|
7
|
-
$pull?: string;
|
|
8
|
-
$push?: string;
|
|
9
|
-
}
|
|
1
|
+
export interface UpdateInputData {
|
|
2
|
+
query: object;
|
|
3
|
+
data: object;
|
|
4
|
+
necessaryProjectionArray?: string[];
|
|
5
|
+
$set?: string;
|
|
6
|
+
$unset?: string;
|
|
7
|
+
$pull?: string;
|
|
8
|
+
$push?: string;
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=update-input-data.interface.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface UploadPresignedURL {
|
|
2
|
-
file: string;
|
|
3
|
-
uploadURL: string;
|
|
4
|
-
}
|
|
1
|
+
export interface UploadPresignedURL {
|
|
2
|
+
file: string;
|
|
3
|
+
uploadURL: string;
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=upload-presigned-url.interface.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare enum UserRole {
|
|
2
|
-
ADMIN = "Admin",
|
|
3
|
-
MANAGER = "Manager",
|
|
4
|
-
OPERATION = "Operation",
|
|
5
|
-
ONGROUND = "Onground",
|
|
6
|
-
USER = "User"
|
|
7
|
-
}
|
|
1
|
+
export declare enum UserRole {
|
|
2
|
+
ADMIN = "Admin",
|
|
3
|
+
MANAGER = "Manager",
|
|
4
|
+
OPERATION = "Operation",
|
|
5
|
+
ONGROUND = "Onground",
|
|
6
|
+
USER = "User"
|
|
7
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserRole = void 0;
|
|
4
|
-
var UserRole;
|
|
5
|
-
(function (UserRole) {
|
|
6
|
-
UserRole["ADMIN"] = "Admin";
|
|
7
|
-
UserRole["MANAGER"] = "Manager";
|
|
8
|
-
UserRole["OPERATION"] = "Operation";
|
|
9
|
-
UserRole["ONGROUND"] = "Onground";
|
|
10
|
-
UserRole["USER"] = "User";
|
|
11
|
-
})(UserRole = exports.UserRole || (exports.UserRole = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRole = void 0;
|
|
4
|
+
var UserRole;
|
|
5
|
+
(function (UserRole) {
|
|
6
|
+
UserRole["ADMIN"] = "Admin";
|
|
7
|
+
UserRole["MANAGER"] = "Manager";
|
|
8
|
+
UserRole["OPERATION"] = "Operation";
|
|
9
|
+
UserRole["ONGROUND"] = "Onground";
|
|
10
|
+
UserRole["USER"] = "User";
|
|
11
|
+
})(UserRole = exports.UserRole || (exports.UserRole = {}));
|
|
12
12
|
//# sourceMappingURL=user-role.enum.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare enum UserType {
|
|
2
|
-
ADMIN = "Admin",
|
|
3
|
-
ORGANIZER = "Organizer",
|
|
4
|
-
USER = "User"
|
|
5
|
-
}
|
|
1
|
+
export declare enum UserType {
|
|
2
|
+
ADMIN = "Admin",
|
|
3
|
+
ORGANIZER = "Organizer",
|
|
4
|
+
USER = "User"
|
|
5
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserType = void 0;
|
|
4
|
-
var UserType;
|
|
5
|
-
(function (UserType) {
|
|
6
|
-
UserType["ADMIN"] = "Admin";
|
|
7
|
-
UserType["ORGANIZER"] = "Organizer";
|
|
8
|
-
UserType["USER"] = "User";
|
|
9
|
-
})(UserType = exports.UserType || (exports.UserType = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserType = void 0;
|
|
4
|
+
var UserType;
|
|
5
|
+
(function (UserType) {
|
|
6
|
+
UserType["ADMIN"] = "Admin";
|
|
7
|
+
UserType["ORGANIZER"] = "Organizer";
|
|
8
|
+
UserType["USER"] = "User";
|
|
9
|
+
})(UserType = exports.UserType || (exports.UserType = {}));
|
|
10
10
|
//# sourceMappingURL=user-type.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createDefaultDirectories: (requiredDirs: any) => void;
|
|
1
|
+
export declare const createDefaultDirectories: (requiredDirs: any) => void;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createDefaultDirectories = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const createDefaultDirectories = (requiredDirs) => {
|
|
6
|
-
const initialDirectory = './uploads';
|
|
7
|
-
if (!fs.existsSync(initialDirectory)) {
|
|
8
|
-
fs.mkdirSync(initialDirectory);
|
|
9
|
-
}
|
|
10
|
-
const createFiles = (requiredDirs, initialRoute) => {
|
|
11
|
-
requiredDirs.forEach(file => {
|
|
12
|
-
let finalRoute = `${initialRoute}/${file.name}`;
|
|
13
|
-
if (!fs.existsSync(finalRoute)) {
|
|
14
|
-
fs.mkdirSync(finalRoute);
|
|
15
|
-
}
|
|
16
|
-
if (file.subDirs.length) {
|
|
17
|
-
createFiles(file.subDirs, finalRoute);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
createFiles(requiredDirs, initialDirectory);
|
|
22
|
-
};
|
|
23
|
-
exports.createDefaultDirectories = createDefaultDirectories;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDefaultDirectories = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const createDefaultDirectories = (requiredDirs) => {
|
|
6
|
+
const initialDirectory = './uploads';
|
|
7
|
+
if (!fs.existsSync(initialDirectory)) {
|
|
8
|
+
fs.mkdirSync(initialDirectory);
|
|
9
|
+
}
|
|
10
|
+
const createFiles = (requiredDirs, initialRoute) => {
|
|
11
|
+
requiredDirs.forEach(file => {
|
|
12
|
+
let finalRoute = `${initialRoute}/${file.name}`;
|
|
13
|
+
if (!fs.existsSync(finalRoute)) {
|
|
14
|
+
fs.mkdirSync(finalRoute);
|
|
15
|
+
}
|
|
16
|
+
if (file.subDirs.length) {
|
|
17
|
+
createFiles(file.subDirs, finalRoute);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
createFiles(requiredDirs, initialDirectory);
|
|
22
|
+
};
|
|
23
|
+
exports.createDefaultDirectories = createDefaultDirectories;
|
|
24
24
|
//# sourceMappingURL=create-default-directories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function equalArrayObject(arr1: object[], arr2: object[]): boolean;
|
|
1
|
+
export declare function equalArrayObject(arr1: object[], arr2: object[]): boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.equalArrayObject = void 0;
|
|
4
|
-
const equal_object_1 = require("./equal-object");
|
|
5
|
-
function equalArrayObject(arr1, arr2) {
|
|
6
|
-
return (arr1.length === arr2.length &&
|
|
7
|
-
arr1.every((o, idx) => equal_object_1.equalObject(o, arr2[idx])));
|
|
8
|
-
}
|
|
9
|
-
exports.equalArrayObject = equalArrayObject;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.equalArrayObject = void 0;
|
|
4
|
+
const equal_object_1 = require("./equal-object");
|
|
5
|
+
function equalArrayObject(arr1, arr2) {
|
|
6
|
+
return (arr1.length === arr2.length &&
|
|
7
|
+
arr1.every((o, idx) => equal_object_1.equalObject(o, arr2[idx])));
|
|
8
|
+
}
|
|
9
|
+
exports.equalArrayObject = equalArrayObject;
|
|
10
10
|
//# sourceMappingURL=equal-array-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function equalObject(obj1: object, obj2: object): boolean;
|
|
1
|
+
export declare function equalObject(obj1: object, obj2: object): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.equalObject = void 0;
|
|
4
|
-
function equalObject(obj1, obj2) {
|
|
5
|
-
return (Object.keys(obj1).length === Object.keys(obj2).length &&
|
|
6
|
-
Object.keys(obj1).every((p) => obj1[p] === obj2[p]));
|
|
7
|
-
}
|
|
8
|
-
exports.equalObject = equalObject;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.equalObject = void 0;
|
|
4
|
+
function equalObject(obj1, obj2) {
|
|
5
|
+
return (Object.keys(obj1).length === Object.keys(obj2).length &&
|
|
6
|
+
Object.keys(obj1).every((p) => obj1[p] === obj2[p]));
|
|
7
|
+
}
|
|
8
|
+
exports.equalObject = equalObject;
|
|
9
9
|
//# sourceMappingURL=equal-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function parseQuery(filterDto: any): any;
|
|
1
|
+
export declare function parseQuery(filterDto: any): any;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseQuery = void 0;
|
|
4
|
-
function parseQuery(filterDto) {
|
|
5
|
-
if (typeof filterDto === 'object' && (filterDto === null || filterDto === void 0 ? void 0 : filterDto.order)) {
|
|
6
|
-
const newDto = JSON.parse(filterDto.order);
|
|
7
|
-
filterDto.order = newDto;
|
|
8
|
-
}
|
|
9
|
-
if (filterDto === null || filterDto === void 0 ? void 0 : filterDto.join) {
|
|
10
|
-
const newDto = JSON.parse(filterDto.join);
|
|
11
|
-
filterDto.join = newDto;
|
|
12
|
-
}
|
|
13
|
-
if ((filterDto === null || filterDto === void 0 ? void 0 : filterDto.where) && typeof filterDto.where === 'string') {
|
|
14
|
-
const newDto = JSON.parse(filterDto.where);
|
|
15
|
-
filterDto.where = newDto;
|
|
16
|
-
}
|
|
17
|
-
if ((filterDto === null || filterDto === void 0 ? void 0 : filterDto.where) && Array.isArray(filterDto.where)) {
|
|
18
|
-
const newWhere = filterDto.where.map((item) => {
|
|
19
|
-
if (typeof item === 'string') {
|
|
20
|
-
JSON.parse(item);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return item;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
filterDto.where = newWhere;
|
|
27
|
-
}
|
|
28
|
-
return filterDto;
|
|
29
|
-
}
|
|
30
|
-
exports.parseQuery = parseQuery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuery = void 0;
|
|
4
|
+
function parseQuery(filterDto) {
|
|
5
|
+
if (typeof filterDto === 'object' && (filterDto === null || filterDto === void 0 ? void 0 : filterDto.order)) {
|
|
6
|
+
const newDto = JSON.parse(filterDto.order);
|
|
7
|
+
filterDto.order = newDto;
|
|
8
|
+
}
|
|
9
|
+
if (filterDto === null || filterDto === void 0 ? void 0 : filterDto.join) {
|
|
10
|
+
const newDto = JSON.parse(filterDto.join);
|
|
11
|
+
filterDto.join = newDto;
|
|
12
|
+
}
|
|
13
|
+
if ((filterDto === null || filterDto === void 0 ? void 0 : filterDto.where) && typeof filterDto.where === 'string') {
|
|
14
|
+
const newDto = JSON.parse(filterDto.where);
|
|
15
|
+
filterDto.where = newDto;
|
|
16
|
+
}
|
|
17
|
+
if ((filterDto === null || filterDto === void 0 ? void 0 : filterDto.where) && Array.isArray(filterDto.where)) {
|
|
18
|
+
const newWhere = filterDto.where.map((item) => {
|
|
19
|
+
if (typeof item === 'string') {
|
|
20
|
+
JSON.parse(item);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return item;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
filterDto.where = newWhere;
|
|
27
|
+
}
|
|
28
|
+
return filterDto;
|
|
29
|
+
}
|
|
30
|
+
exports.parseQuery = parseQuery;
|
|
31
31
|
//# sourceMappingURL=parse-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function projection(allProjectionFieldArray: string[], necessaryProjectionArray: string[]): {};
|
|
1
|
+
export declare function projection(allProjectionFieldArray: string[], necessaryProjectionArray: string[]): {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.projection = void 0;
|
|
4
|
-
function projection(allProjectionFieldArray, necessaryProjectionArray) {
|
|
5
|
-
try {
|
|
6
|
-
const projection = {};
|
|
7
|
-
let returnAll = true;
|
|
8
|
-
Array.isArray(necessaryProjectionArray) &&
|
|
9
|
-
necessaryProjectionArray.length &&
|
|
10
|
-
necessaryProjectionArray.map((key) => {
|
|
11
|
-
if (allProjectionFieldArray.includes(key)) {
|
|
12
|
-
returnAll = false;
|
|
13
|
-
projection[key] = true;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
if (returnAll) {
|
|
17
|
-
allProjectionFieldArray.map((key) => (projection[key] = true));
|
|
18
|
-
}
|
|
19
|
-
return projection;
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
throw err;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.projection = projection;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projection = void 0;
|
|
4
|
+
function projection(allProjectionFieldArray, necessaryProjectionArray) {
|
|
5
|
+
try {
|
|
6
|
+
const projection = {};
|
|
7
|
+
let returnAll = true;
|
|
8
|
+
Array.isArray(necessaryProjectionArray) &&
|
|
9
|
+
necessaryProjectionArray.length &&
|
|
10
|
+
necessaryProjectionArray.map((key) => {
|
|
11
|
+
if (allProjectionFieldArray.includes(key)) {
|
|
12
|
+
returnAll = false;
|
|
13
|
+
projection[key] = true;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (returnAll) {
|
|
17
|
+
allProjectionFieldArray.map((key) => (projection[key] = true));
|
|
18
|
+
}
|
|
19
|
+
return projection;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.projection = projection;
|
|
26
26
|
//# sourceMappingURL=projection.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationOptions } from 'class-validator';
|
|
2
|
-
export declare function ConditionalRequired(property: string, validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
1
|
+
import { ValidationOptions } from 'class-validator';
|
|
2
|
+
export declare function ConditionalRequired(property: string, validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConditionalRequired = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
function ConditionalRequired(property, validationOptions) {
|
|
6
|
-
return function (object, propertyName) {
|
|
7
|
-
class_validator_1.registerDecorator({
|
|
8
|
-
name: 'conditionalRequired',
|
|
9
|
-
target: object.constructor,
|
|
10
|
-
propertyName: propertyName,
|
|
11
|
-
constraints: [property],
|
|
12
|
-
options: validationOptions,
|
|
13
|
-
validator: {
|
|
14
|
-
validate(value, args) {
|
|
15
|
-
const [relatedPropertyName] = args.constraints;
|
|
16
|
-
const relatedValue = args.object[relatedPropertyName];
|
|
17
|
-
return !(!value && relatedValue);
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.ConditionalRequired = ConditionalRequired;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionalRequired = void 0;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
function ConditionalRequired(property, validationOptions) {
|
|
6
|
+
return function (object, propertyName) {
|
|
7
|
+
class_validator_1.registerDecorator({
|
|
8
|
+
name: 'conditionalRequired',
|
|
9
|
+
target: object.constructor,
|
|
10
|
+
propertyName: propertyName,
|
|
11
|
+
constraints: [property],
|
|
12
|
+
options: validationOptions,
|
|
13
|
+
validator: {
|
|
14
|
+
validate(value, args) {
|
|
15
|
+
const [relatedPropertyName] = args.constraints;
|
|
16
|
+
const relatedValue = args.object[relatedPropertyName];
|
|
17
|
+
return !(!value && relatedValue);
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.ConditionalRequired = ConditionalRequired;
|
|
24
24
|
//# sourceMappingURL=conditional-required.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationOptions } from 'class-validator';
|
|
2
|
-
export declare function DateValidator(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
1
|
+
import { ValidationOptions } from 'class-validator';
|
|
2
|
+
export declare function DateValidator(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateValidator = void 0;
|
|
4
|
-
const class_validator_1 = require("class-validator");
|
|
5
|
-
function DateValidator(validationOptions) {
|
|
6
|
-
return function (object, propertyName) {
|
|
7
|
-
class_validator_1.registerDecorator({
|
|
8
|
-
name: 'dateValidator',
|
|
9
|
-
target: object.constructor,
|
|
10
|
-
propertyName: propertyName,
|
|
11
|
-
options: validationOptions,
|
|
12
|
-
validator: {
|
|
13
|
-
validate(value) {
|
|
14
|
-
return new Date(value) > new Date();
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.DateValidator = DateValidator;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateValidator = void 0;
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
function DateValidator(validationOptions) {
|
|
6
|
+
return function (object, propertyName) {
|
|
7
|
+
class_validator_1.registerDecorator({
|
|
8
|
+
name: 'dateValidator',
|
|
9
|
+
target: object.constructor,
|
|
10
|
+
propertyName: propertyName,
|
|
11
|
+
options: validationOptions,
|
|
12
|
+
validator: {
|
|
13
|
+
validate(value) {
|
|
14
|
+
return new Date(value) > new Date();
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.DateValidator = DateValidator;
|
|
21
21
|
//# sourceMappingURL=date-validator.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ResponseOption } from './response-option.interface';
|
|
2
|
-
import { SuccessResult } from './succes-result.interface';
|
|
3
|
-
export declare const customizeArrayResponse: (data?: unknown[], { hasTotal, total, skip, limit, sort, }?: ResponseOption) => SuccessResult;
|
|
1
|
+
import { ResponseOption } from './response-option.interface';
|
|
2
|
+
import { SuccessResult } from './succes-result.interface';
|
|
3
|
+
export declare const customizeArrayResponse: (data?: unknown[], { hasTotal, total, skip, limit, sort, }?: ResponseOption) => SuccessResult;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customizeArrayResponse = void 0;
|
|
4
|
-
const customizeArrayResponse = (data = [], { hasTotal = false, total = 0, skip = null, limit = null, sort = null, } = {}) => {
|
|
5
|
-
const result = {
|
|
6
|
-
data: data,
|
|
7
|
-
count: data.length ? data.length : 0,
|
|
8
|
-
};
|
|
9
|
-
if (hasTotal) {
|
|
10
|
-
result.total = total >= data.length ? total : data.length;
|
|
11
|
-
}
|
|
12
|
-
if (skip || limit) {
|
|
13
|
-
result.hasStaticRange = true;
|
|
14
|
-
result.skip = skip;
|
|
15
|
-
result.limit = limit;
|
|
16
|
-
}
|
|
17
|
-
if (sort) {
|
|
18
|
-
result.customSort = true;
|
|
19
|
-
result.sort = sort;
|
|
20
|
-
}
|
|
21
|
-
return result;
|
|
22
|
-
};
|
|
23
|
-
exports.customizeArrayResponse = customizeArrayResponse;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customizeArrayResponse = void 0;
|
|
4
|
+
const customizeArrayResponse = (data = [], { hasTotal = false, total = 0, skip = null, limit = null, sort = null, } = {}) => {
|
|
5
|
+
const result = {
|
|
6
|
+
data: data,
|
|
7
|
+
count: data.length ? data.length : 0,
|
|
8
|
+
};
|
|
9
|
+
if (hasTotal) {
|
|
10
|
+
result.total = total >= data.length ? total : data.length;
|
|
11
|
+
}
|
|
12
|
+
if (skip || limit) {
|
|
13
|
+
result.hasStaticRange = true;
|
|
14
|
+
result.skip = skip;
|
|
15
|
+
result.limit = limit;
|
|
16
|
+
}
|
|
17
|
+
if (sort) {
|
|
18
|
+
result.customSort = true;
|
|
19
|
+
result.sort = sort;
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
exports.customizeArrayResponse = customizeArrayResponse;
|
|
24
24
|
//# sourceMappingURL=customizeArrayResponse.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ErrorResponse } from './error.interface';
|
|
2
|
-
export declare function error(err: any): ErrorResponse;
|
|
1
|
+
import { ErrorResponse } from './error.interface';
|
|
2
|
+
export declare function error(err: any): ErrorResponse;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface ErrorResponse {
|
|
2
|
-
success: boolean;
|
|
3
|
-
error: object;
|
|
4
|
-
}
|
|
1
|
+
export interface ErrorResponse {
|
|
2
|
+
success: boolean;
|
|
3
|
+
error: object;
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=error.interface.js.map
|