mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-04-13 10:57:43 -04:00
added missing mails.sendRecordAuthAlert jsvm binding
This commit is contained in:
@@ -663,6 +663,7 @@ func mailsBinds(vm *goja.Runtime) {
|
||||
obj.Set("sendRecordVerification", mails.SendRecordVerification)
|
||||
obj.Set("sendRecordChangeEmail", mails.SendRecordChangeEmail)
|
||||
obj.Set("sendRecordOTP", mails.SendRecordOTP)
|
||||
obj.Set("sendRecordAuthAlert", mails.SendRecordAuthAlert)
|
||||
}
|
||||
|
||||
func securityBinds(vm *goja.Runtime) {
|
||||
|
||||
@@ -795,7 +795,7 @@ func TestMailsBindsCount(t *testing.T) {
|
||||
vm := goja.New()
|
||||
mailsBinds(vm)
|
||||
|
||||
testBindsCount(vm, "$mails", 4, t)
|
||||
testBindsCount(vm, "$mails", 5, t)
|
||||
}
|
||||
|
||||
func TestMailsBinds(t *testing.T) {
|
||||
@@ -833,6 +833,11 @@ func TestMailsBinds(t *testing.T) {
|
||||
if (!$app.testMailer.lastMessage().html.includes("test_otp_pass")) {
|
||||
throw new Error("Expected record OTP email, got:" + JSON.stringify($app.testMailer.lastMessage()))
|
||||
}
|
||||
|
||||
$mails.sendRecordAuthAlert($app, record, "test_alert_info");
|
||||
if (!$app.testMailer.lastMessage().html.includes("test_alert_info")) {
|
||||
throw new Error("Expected record OTP email, got:" + JSON.stringify($app.testMailer.lastMessage()))
|
||||
}
|
||||
`)
|
||||
if vmErr != nil {
|
||||
t.Fatal(vmErr)
|
||||
|
||||
11325
plugins/jsvm/internal/types/generated/types.d.ts
vendored
11325
plugins/jsvm/internal/types/generated/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -788,6 +788,7 @@ declare namespace $mails {
|
||||
let sendRecordVerification: mails.sendRecordVerification
|
||||
let sendRecordChangeEmail: mails.sendRecordChangeEmail
|
||||
let sendRecordOTP: mails.sendRecordOTP
|
||||
let sendRecordAuthAlert: mails.sendRecordAuthAlert
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user