@punks/backend-entity-manager 0.0.330 → 0.0.331
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/dist/cjs/index.js +27 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/extensions/authentication/handlers/user-invitation-send/types.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/extensions/authentication/handlers/user-password-reset-request/types.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/extensions/authentication/handlers/user-verify-request/types.d.ts +1 -0
- package/dist/esm/index.js +27 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/extensions/authentication/handlers/user-invitation-send/types.d.ts +1 -0
- package/dist/esm/types/platforms/nest/extensions/authentication/handlers/user-password-reset-request/types.d.ts +1 -0
- package/dist/esm/types/platforms/nest/extensions/authentication/handlers/user-verify-request/types.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type UserPasswordResetRequestInput<TUserContext extends IAuthUserContext>
|
|
|
8
8
|
callback: UserPasswordResetRequestCallbackTemplate;
|
|
9
9
|
languageCode: string;
|
|
10
10
|
context?: TUserContext;
|
|
11
|
+
emailTemplateId?: string;
|
|
11
12
|
};
|
|
12
13
|
export type UserPasswordResetRequestResult = {
|
|
13
14
|
success: boolean;
|
|
@@ -4,6 +4,7 @@ export type UserVerifyRequestInput<TUserContext extends IAuthUserContext> = {
|
|
|
4
4
|
callback: UserVerifyRequestCallbackTemplate;
|
|
5
5
|
languageCode: string;
|
|
6
6
|
context?: TUserContext;
|
|
7
|
+
emailTemplateId?: string;
|
|
7
8
|
};
|
|
8
9
|
export type UserVerifyRequestResult = {
|
|
9
10
|
success: boolean;
|
package/dist/esm/index.js
CHANGED
|
@@ -22695,16 +22695,21 @@ let UserPasswordResetRequestHandler = class UserPasswordResetRequestHandler {
|
|
|
22695
22695
|
success: false,
|
|
22696
22696
|
};
|
|
22697
22697
|
}
|
|
22698
|
-
await this.sendPasswordResetEmail(
|
|
22698
|
+
await this.sendPasswordResetEmail({
|
|
22699
|
+
user,
|
|
22700
|
+
callback: input.callback,
|
|
22701
|
+
languageCode: input.languageCode,
|
|
22702
|
+
emailTemplateId: input.emailTemplateId,
|
|
22703
|
+
});
|
|
22699
22704
|
return {
|
|
22700
22705
|
success: true,
|
|
22701
22706
|
};
|
|
22702
22707
|
}
|
|
22703
|
-
async sendPasswordResetEmail(user, callback, languageCode) {
|
|
22708
|
+
async sendPasswordResetEmail({ user, callback, languageCode, emailTemplateId, }) {
|
|
22704
22709
|
const token = await this.generatePasswordResetToken(user);
|
|
22705
22710
|
await this.emailService.sendTemplatedEmail({
|
|
22706
22711
|
to: [user.email],
|
|
22707
|
-
templateId: AuthenticationEmailTemplates.PasswordReset,
|
|
22712
|
+
templateId: emailTemplateId ?? AuthenticationEmailTemplates.PasswordReset,
|
|
22708
22713
|
languageCode,
|
|
22709
22714
|
payload: {
|
|
22710
22715
|
firstName: user.profile.firstName,
|
|
@@ -22805,16 +22810,21 @@ let UserVerifyRequestHandler = class UserVerifyRequestHandler {
|
|
|
22805
22810
|
success: false,
|
|
22806
22811
|
};
|
|
22807
22812
|
}
|
|
22808
|
-
await this.sendEmailVerifyEmail(
|
|
22813
|
+
await this.sendEmailVerifyEmail({
|
|
22814
|
+
user,
|
|
22815
|
+
callback: input.callback,
|
|
22816
|
+
languageId: input.languageCode,
|
|
22817
|
+
emailTemplateId: input.emailTemplateId,
|
|
22818
|
+
});
|
|
22809
22819
|
return {
|
|
22810
22820
|
success: true,
|
|
22811
22821
|
};
|
|
22812
22822
|
}
|
|
22813
|
-
async sendEmailVerifyEmail(user, callback, languageId) {
|
|
22823
|
+
async sendEmailVerifyEmail({ user, callback, languageId, emailTemplateId, }) {
|
|
22814
22824
|
const token = await this.generateEmailVerifyToken(user);
|
|
22815
22825
|
await this.emailService.sendTemplatedEmail({
|
|
22816
22826
|
to: [user.email],
|
|
22817
|
-
templateId: AuthenticationEmailTemplates.EmailVerify,
|
|
22827
|
+
templateId: emailTemplateId ?? AuthenticationEmailTemplates.EmailVerify,
|
|
22818
22828
|
payload: {
|
|
22819
22829
|
firstName: user.profile.firstName,
|
|
22820
22830
|
lastName: user.profile.lastName,
|
|
@@ -22966,16 +22976,21 @@ let UserInvitationSendHandler = class UserInvitationSendHandler {
|
|
|
22966
22976
|
if (!user) {
|
|
22967
22977
|
throw new Error(`User not found ${input.userId}`);
|
|
22968
22978
|
}
|
|
22969
|
-
await this.sendRegistrationEmail(
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22979
|
+
await this.sendRegistrationEmail({
|
|
22980
|
+
user,
|
|
22981
|
+
callback: {
|
|
22982
|
+
tokenPlaceholder: input.callback.tokenPlaceholder,
|
|
22983
|
+
urlTemplate: input.callback.urlTemplate,
|
|
22984
|
+
},
|
|
22985
|
+
languageId: input.languageId,
|
|
22986
|
+
emailTemplateId: input.emailTemplateId,
|
|
22987
|
+
});
|
|
22973
22988
|
}
|
|
22974
|
-
async sendRegistrationEmail(user, callback, languageId) {
|
|
22989
|
+
async sendRegistrationEmail({ user, callback, languageId, emailTemplateId, }) {
|
|
22975
22990
|
const token = await this.generateEmailVerifyToken(user);
|
|
22976
22991
|
await this.emailService.sendTemplatedEmail({
|
|
22977
22992
|
to: [user.email],
|
|
22978
|
-
templateId: AuthenticationEmailTemplates.Registration,
|
|
22993
|
+
templateId: emailTemplateId ?? AuthenticationEmailTemplates.Registration,
|
|
22979
22994
|
languageCode: languageId,
|
|
22980
22995
|
payload: {
|
|
22981
22996
|
firstName: user.profile.firstName,
|