@duvdu-v1/duvdu 1.1.355 → 1.1.360
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/errors/pdf-generation-error.d.ts +9 -0
- package/build/errors/pdf-generation-error.js +15 -0
- package/build/guards/isEmailVerified.guard.d.ts +2 -0
- package/build/guards/isEmailVerified.guard.js +15 -0
- package/build/guards/isPhoneNumberVerified.guard.d.ts +2 -0
- package/build/guards/isPhoneNumberVerified.guard.js +15 -0
- package/build/index.d.ts +7 -1
- package/build/index.js +7 -1
- package/build/mailer/mailer.interface.d.ts +68 -0
- package/build/mailer/mailer.interface.js +12 -0
- package/build/mailer/mailer.service.d.ts +10 -0
- package/build/mailer/mailer.service.js +149 -0
- package/build/mailer/strategies/resend.strategy.d.ts +6 -0
- package/build/mailer/strategies/resend.strategy.js +48 -0
- package/build/mailer/strategies/smtp.strategy.d.ts +6 -0
- package/build/mailer/strategies/smtp.strategy.js +50 -0
- package/build/mailer/templates/layouts/main.hbs +103 -0
- package/build/mailer/templates/partials/footer.hbs +4 -0
- package/build/mailer/templates/partials/header.hbs +4 -0
- package/build/mailer/templates/views/account-update.hbs +20 -0
- package/build/mailer/templates/views/complaint-escalation.hbs +23 -0
- package/build/mailer/templates/views/invoice.hbs +29 -0
- package/build/mailer/templates/views/new-user.hbs +23 -0
- package/build/mailer/templates/views/organization-user-created.hbs +25 -0
- package/build/mailer/templates/views/reset-password.hbs +14 -0
- package/build/mailer/templates/views/verify-email.hbs +14 -0
- package/build/mailer/templates/views/welcome.hbs +22 -0
- package/build/middlewares/auth.middleware.js +2 -1
- package/build/middlewares/optional-auth.middleware.js +2 -1
- package/build/models/User.model.d.ts +2 -2
- package/build/models/User.model.js +23 -16
- package/build/models/contracts.model.d.ts +7 -0
- package/build/models/contracts.model.js +7 -0
- package/build/models/settings.model.d.ts +6 -0
- package/build/models/settings.model.js +6 -0
- package/build/services/pdf-templates/layouts/main.hbs +91 -0
- package/build/services/pdf-templates/partials/footer.hbs +4 -0
- package/build/services/pdf-templates/partials/header.hbs +4 -0
- package/build/services/pdf-templates/views/invoice.hbs +60 -0
- package/build/services/pdfGenerator.service.d.ts +16 -0
- package/build/services/pdfGenerator.service.js +198 -0
- package/build/services/rank.service.d.ts +2 -2
- package/build/types/JwtPayload.d.ts +2 -1
- package/build/types/User.d.ts +18 -7
- package/build/types/User.js +4 -0
- package/build/types/model-names.d.ts +1 -0
- package/build/types/model-names.js +1 -0
- package/build/types/pdf.types.d.ts +30 -0
- package/build/types/pdf.types.js +7 -0
- package/build/types/systemRoles.d.ts +1 -2
- package/build/types/systemRoles.js +3 -2
- package/build/utils/{bucket.d.ts → bucket-wasabi.d.ts} +10 -9
- package/build/utils/{bucket.js → bucket-wasabi.js} +102 -124
- package/build/utils/mask.d.ts +5 -0
- package/build/utils/mask.js +49 -0
- package/package.json +10 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
2
|
import { Iuser } from '../types/User';
|
|
3
3
|
export type UserDocument = Document & Iuser;
|
|
4
|
-
export declare const updateRankForUser: (userId: string) => Promise<(Document<unknown, {}, Iuser, {}, {}> & Iuser & {
|
|
4
|
+
export declare const updateRankForUser: (userId: string) => Promise<(Document<unknown, {}, Iuser, {}, {}> & Iuser & Required<{
|
|
5
5
|
_id: import("mongoose").Types.ObjectId;
|
|
6
|
-
} & {
|
|
6
|
+
}> & {
|
|
7
7
|
__v: number;
|
|
8
8
|
}) | undefined>;
|
|
9
9
|
export declare const updateUsersAfterRankDeletion: (deletedRankTitle: string) => Promise<void>;
|
package/build/types/User.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from 'mongoose';
|
|
1
|
+
import { Document, Types } from 'mongoose';
|
|
2
2
|
import { Icategory } from './Category';
|
|
3
3
|
import { Irole } from './Role';
|
|
4
4
|
export declare enum VerificationReason {
|
|
@@ -6,13 +6,18 @@ export declare enum VerificationReason {
|
|
|
6
6
|
updateOldPhoneNumberVerified = "update-old-phone-number-verified",
|
|
7
7
|
updateNewPhoneNumber = "update-new-phone-number",
|
|
8
8
|
verifyUpdatedPhoneNumber = "verify-updated-phone-number",
|
|
9
|
+
updateOldEmail = "update-old-email",
|
|
10
|
+
updateOldEmailVerified = "update-old-email-verified",
|
|
11
|
+
updateNewEmail = "update-new-email",
|
|
9
12
|
forgetPassword = "forget-password",
|
|
10
13
|
forgetPasswordVerified = "forget-password-verified",
|
|
11
14
|
signup = "signup",
|
|
15
|
+
verifyPhoneNumber = "verify-phone-number",
|
|
12
16
|
completeSginUp = "complete-sginup",
|
|
13
17
|
CompleteSginUpVerfied = "complete-sginup-verified"
|
|
14
18
|
}
|
|
15
19
|
export interface Iuser {
|
|
20
|
+
_id: Types.ObjectId;
|
|
16
21
|
id: string;
|
|
17
22
|
googleId?: string;
|
|
18
23
|
appleId?: string;
|
|
@@ -24,12 +29,7 @@ export interface Iuser {
|
|
|
24
29
|
};
|
|
25
30
|
username: string;
|
|
26
31
|
password?: string;
|
|
27
|
-
verificationCode
|
|
28
|
-
code?: string;
|
|
29
|
-
expireAt?: string;
|
|
30
|
-
reason?: VerificationReason;
|
|
31
|
-
};
|
|
32
|
-
isVerified: boolean;
|
|
32
|
+
verificationCode: IverificationCode;
|
|
33
33
|
refreshTokens?: {
|
|
34
34
|
deviceId: string;
|
|
35
35
|
token: string;
|
|
@@ -46,6 +46,8 @@ export interface Iuser {
|
|
|
46
46
|
about?: string;
|
|
47
47
|
isOnline: boolean;
|
|
48
48
|
isAvaliableToInstantProjects: boolean;
|
|
49
|
+
isEmailVerified: boolean;
|
|
50
|
+
isPhoneNumberVerified: boolean;
|
|
49
51
|
pricePerHour: number;
|
|
50
52
|
role: Types.ObjectId | Irole;
|
|
51
53
|
hasVerificationBadge: boolean;
|
|
@@ -87,3 +89,12 @@ export interface Iuser {
|
|
|
87
89
|
isDeleted: boolean;
|
|
88
90
|
hasFreeTime: boolean;
|
|
89
91
|
}
|
|
92
|
+
export interface IverificationCode extends Document {
|
|
93
|
+
id: string;
|
|
94
|
+
expireAt: Date | null;
|
|
95
|
+
reason: VerificationReason | null;
|
|
96
|
+
code: string | null;
|
|
97
|
+
isVerified: boolean;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
}
|
package/build/types/User.js
CHANGED
|
@@ -7,9 +7,13 @@ var VerificationReason;
|
|
|
7
7
|
VerificationReason["updateOldPhoneNumberVerified"] = "update-old-phone-number-verified";
|
|
8
8
|
VerificationReason["updateNewPhoneNumber"] = "update-new-phone-number";
|
|
9
9
|
VerificationReason["verifyUpdatedPhoneNumber"] = "verify-updated-phone-number";
|
|
10
|
+
VerificationReason["updateOldEmail"] = "update-old-email";
|
|
11
|
+
VerificationReason["updateOldEmailVerified"] = "update-old-email-verified";
|
|
12
|
+
VerificationReason["updateNewEmail"] = "update-new-email";
|
|
10
13
|
VerificationReason["forgetPassword"] = "forget-password";
|
|
11
14
|
VerificationReason["forgetPasswordVerified"] = "forget-password-verified";
|
|
12
15
|
VerificationReason["signup"] = "signup";
|
|
16
|
+
VerificationReason["verifyPhoneNumber"] = "verify-phone-number";
|
|
13
17
|
VerificationReason["completeSginUp"] = "complete-sginup";
|
|
14
18
|
VerificationReason["CompleteSginUpVerfied"] = "complete-sginup-verified";
|
|
15
19
|
})(VerificationReason || (exports.VerificationReason = VerificationReason = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum PdfType {
|
|
2
|
+
INVOICE = "invoice"
|
|
3
|
+
}
|
|
4
|
+
export interface PartyDetails {
|
|
5
|
+
name?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FeeItem {
|
|
10
|
+
label: string;
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
export interface InvoiceBreakdown {
|
|
14
|
+
base: number;
|
|
15
|
+
vat: number;
|
|
16
|
+
fees: FeeItem[];
|
|
17
|
+
}
|
|
18
|
+
export interface InvoiceContext {
|
|
19
|
+
transactionId: string;
|
|
20
|
+
date: Date | string;
|
|
21
|
+
currency?: string;
|
|
22
|
+
breakdown: InvoiceBreakdown;
|
|
23
|
+
total: number;
|
|
24
|
+
sp?: PartyDetails;
|
|
25
|
+
client?: PartyDetails;
|
|
26
|
+
recipient?: 'client' | 'sp';
|
|
27
|
+
}
|
|
28
|
+
export interface PdfContextMap {
|
|
29
|
+
[PdfType.INVOICE]: InvoiceContext;
|
|
30
|
+
}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SystemRoles = void 0;
|
|
4
4
|
var SystemRoles;
|
|
5
5
|
(function (SystemRoles) {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// verified = 'verified',
|
|
7
|
+
// unverified = 'unverified',
|
|
8
|
+
SystemRoles["user"] = "user";
|
|
8
9
|
SystemRoles["admin"] = "admin";
|
|
9
10
|
})(SystemRoles || (exports.SystemRoles = SystemRoles = {}));
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
private
|
|
3
|
-
private
|
|
4
|
-
private
|
|
5
|
-
|
|
1
|
+
declare class BucketWasabi {
|
|
2
|
+
private _s3;
|
|
3
|
+
private _rekognition;
|
|
4
|
+
private get s3();
|
|
5
|
+
private get rekognition();
|
|
6
|
+
private get bucketName();
|
|
6
7
|
saveBucketFiles(folder: string, ...files: Express.Multer.File[]): Promise<void>;
|
|
7
8
|
private uploadSmallFile;
|
|
8
9
|
removeBucketFiles(...filePaths: string[]): Promise<void>;
|
|
9
10
|
private getContentType;
|
|
11
|
+
getPresignedUrl(fileKey: string): Promise<string>;
|
|
12
|
+
private getImageBytes;
|
|
10
13
|
validateFace(imageKey: string): Promise<{
|
|
11
14
|
isValid: boolean;
|
|
12
15
|
error?: {
|
|
@@ -18,10 +21,6 @@ export declare class Bucket {
|
|
|
18
21
|
private performAntiSpoofingChecks;
|
|
19
22
|
private validateEyesForLiveness;
|
|
20
23
|
private validatePoseForLiveness;
|
|
21
|
-
/**
|
|
22
|
-
* Comprehensive face validation with advanced liveness detection
|
|
23
|
-
* This method provides additional verification by analyzing multiple image properties
|
|
24
|
-
*/
|
|
25
24
|
validateFaceWithAdvancedLiveness(imageKey: string): Promise<{
|
|
26
25
|
isValid: boolean;
|
|
27
26
|
livenessScore: number;
|
|
@@ -36,3 +35,5 @@ export declare class Bucket {
|
|
|
36
35
|
};
|
|
37
36
|
}>;
|
|
38
37
|
}
|
|
38
|
+
export declare const bucketWasabi: BucketWasabi;
|
|
39
|
+
export {};
|