@openinc/parse-server-opendash 3.29.0 → 3.29.1
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/features/notifications/services/initEmailTransport.js +7 -2
- package/dist/functions/openinc-auth-email-confirmation-request.js +2 -2
- package/dist/functions/openinc-auth-login-passwordless.js +2 -2
- package/dist/functions/openinc-auth-password-reset-request.js +2 -2
- package/dist/functions/openinc-mail-test.js +2 -2
- package/dist/hooks/Notification.js +2 -1
- package/dist/hooks/_User.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -5
- package/package.json +1 -1
|
@@ -10,9 +10,10 @@ const path_1 = require("path");
|
|
|
10
10
|
const __1 = require("..");
|
|
11
11
|
const config_1 = require("../../config");
|
|
12
12
|
async function initEmailTransport() {
|
|
13
|
-
const emailState = __1.EmailState.getInstance();
|
|
14
13
|
try {
|
|
15
14
|
if (config_1.ConfigInstance.getInstance().getBoolean("SMTP_ENABLED")) {
|
|
15
|
+
const emailState = __1.EmailState.getInstance();
|
|
16
|
+
console.log("[@openinc/parse-server-opendash] Initializing email transport...");
|
|
16
17
|
const transportOptions = {
|
|
17
18
|
host: config_1.ConfigInstance.getInstance().get("SMTP_HOST"),
|
|
18
19
|
port: config_1.ConfigInstance.getInstance().getNumber("SMTP_PORT"),
|
|
@@ -27,7 +28,11 @@ async function initEmailTransport() {
|
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
const transport = nodemailer_1.default.createTransport(transportOptions);
|
|
30
|
-
|
|
31
|
+
if (config_1.ConfigInstance.getInstance().get("SMTP_USER") &&
|
|
32
|
+
config_1.ConfigInstance.getInstance().get("SMTP_PASS")) {
|
|
33
|
+
console.log("[@openinc/parse-server-opendash] Verifying SMTP transport...");
|
|
34
|
+
await transport.verify();
|
|
35
|
+
}
|
|
31
36
|
emailState.setTransport(transport);
|
|
32
37
|
const templateDir = (0, path_1.resolve)(process.cwd(), config_1.ConfigInstance.getInstance().get("EMAIL_TEMPLATE_DIR"));
|
|
33
38
|
emailState.setEmailTemplateDir(templateDir);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const notifications_1 = require("../features/notifications");
|
|
5
5
|
const transformLogin_1 = require("../helper/transformLogin");
|
|
6
6
|
const openinc_auth_common_1 = require("./openinc-auth.common");
|
|
7
7
|
async function init(name) {
|
|
@@ -14,7 +14,7 @@ async function init(name) {
|
|
|
14
14
|
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, "No user was found with the given email.");
|
|
15
15
|
}
|
|
16
16
|
const { url } = await (0, openinc_auth_common_1.createToken)("verify-email", user.id, request.params.url);
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, notifications_1.sendTemplateEmail)({
|
|
18
18
|
template: "openinc-auth-email-confirmation",
|
|
19
19
|
subject: "E-Mail Bestätigung / Email confirmation",
|
|
20
20
|
to: email,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const notifications_1 = require("../features/notifications");
|
|
5
5
|
const transformLogin_1 = require("../helper/transformLogin");
|
|
6
6
|
const openinc_auth_common_1 = require("./openinc-auth.common");
|
|
7
7
|
async function init(name) {
|
|
@@ -22,7 +22,7 @@ async function init(name) {
|
|
|
22
22
|
});
|
|
23
23
|
const url = urlTemplate.replace("{{token}}", sessionToken);
|
|
24
24
|
console.log(url);
|
|
25
|
-
await (0,
|
|
25
|
+
await (0, notifications_1.sendTemplateEmail)({
|
|
26
26
|
template: "openinc-auth-login-passwordless",
|
|
27
27
|
subject: "Passwordless Login",
|
|
28
28
|
to: email,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const notifications_1 = require("../features/notifications");
|
|
5
5
|
const transformLogin_1 = require("../helper/transformLogin");
|
|
6
6
|
const openinc_auth_common_1 = require("./openinc-auth.common");
|
|
7
7
|
async function init(name) {
|
|
@@ -14,7 +14,7 @@ async function init(name) {
|
|
|
14
14
|
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, "No user was found with the given email.");
|
|
15
15
|
}
|
|
16
16
|
const { url } = await (0, openinc_auth_common_1.createToken)("password-reset", user.id, request.params.url);
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, notifications_1.sendTemplateEmail)({
|
|
18
18
|
template: "openinc-auth-password-reset",
|
|
19
19
|
subject: "Passwort zurücksetzen / Password reset",
|
|
20
20
|
to: email,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
-
const
|
|
4
|
+
const notifications_1 = require("../features/notifications");
|
|
5
5
|
async function init(name) {
|
|
6
6
|
// sendTestEmail - Sends a test email
|
|
7
7
|
Parse.Cloud.define(name, async (request) => {
|
|
@@ -9,7 +9,7 @@ async function init(name) {
|
|
|
9
9
|
return { message: "Unauthorized" };
|
|
10
10
|
}
|
|
11
11
|
const { to } = request.params;
|
|
12
|
-
const mail = await (0,
|
|
12
|
+
const mail = await (0, notifications_1.sendSimpleEmail)(to, "open.INC Test Mail", "This is a test email from open.INC Stack.");
|
|
13
13
|
return mail;
|
|
14
14
|
}, {
|
|
15
15
|
requireUser: true,
|
|
@@ -7,6 +7,7 @@ exports.init = init;
|
|
|
7
7
|
const web_push_1 = __importDefault(require("web-push"));
|
|
8
8
|
const __1 = require("..");
|
|
9
9
|
const config_1 = require("../features/config");
|
|
10
|
+
const notifications_1 = require("../features/notifications");
|
|
10
11
|
const types_1 = require("../types");
|
|
11
12
|
async function init() {
|
|
12
13
|
(0, __1.beforeSaveHook)(types_1.Notification, async (request) => {
|
|
@@ -32,7 +33,7 @@ async function init() {
|
|
|
32
33
|
body += config_1.ConfigInstance.getInstance().get("APP_URL");
|
|
33
34
|
body += object.get("data")?.url;
|
|
34
35
|
}
|
|
35
|
-
await (0,
|
|
36
|
+
await (0, notifications_1.sendSimpleEmail)(email, title, body);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
// Handle Push
|
package/dist/hooks/_User.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.init = init;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
const config_1 = require("../features/config");
|
|
6
|
+
const notifications_1 = require("../features/notifications");
|
|
6
7
|
const settings_1 = require("../features/user/settings");
|
|
7
8
|
const transformLogin_1 = require("../helper/transformLogin");
|
|
8
9
|
const types_1 = require("../types");
|
|
@@ -111,7 +112,7 @@ async function init() {
|
|
|
111
112
|
.equalTo("tenantAdmin", true)
|
|
112
113
|
.findAll({ useMasterKey: true });
|
|
113
114
|
for (const admin of admins) {
|
|
114
|
-
await (0,
|
|
115
|
+
await (0, notifications_1.sendTemplateEmail)({
|
|
115
116
|
template: "openinc-auth-tenant-verification-request",
|
|
116
117
|
subject: "Ein neuer Nutzer muss verifiziert werden",
|
|
117
118
|
to: admin.get("email"),
|
|
@@ -126,7 +127,7 @@ async function init() {
|
|
|
126
127
|
object.get("tenantVerified") === true) {
|
|
127
128
|
const email = object.get("email");
|
|
128
129
|
verificationEmailCache[object.id] = true;
|
|
129
|
-
await (0,
|
|
130
|
+
await (0, notifications_1.sendTemplateEmail)({
|
|
130
131
|
template: "openinc-auth-tenant-verification",
|
|
131
132
|
subject: "Dein Account wurde verifiziert",
|
|
132
133
|
to: email,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Cloud as ParseCloud } from "parse";
|
|
2
2
|
import { Permission } from "./types";
|
|
3
|
-
export { sendSimpleEmail, sendTemplateEmail } from "./features/notifications";
|
|
4
3
|
/**
|
|
5
4
|
* Initializes the Cloud Code for open.DASH.
|
|
6
5
|
* This function performs various initialization tasks such as
|
|
@@ -194,3 +193,4 @@ export declare function autoloadCloudCode(path: string, regex?: RegExp): Promise
|
|
|
194
193
|
* @returns The updated or newly created permission.
|
|
195
194
|
*/
|
|
196
195
|
export declare function ensurePermission(key: string, acl?: Parse.ACL): Promise<Permission>;
|
|
196
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.sendTemplateEmail = exports.sendSimpleEmail = void 0;
|
|
7
6
|
exports.init = init;
|
|
8
7
|
exports.hasPermission = hasPermission;
|
|
9
8
|
exports.requirePermission = requirePermission;
|
|
@@ -48,12 +47,8 @@ dayjs_1.default.extend(weekday_1.default);
|
|
|
48
47
|
dayjs_1.default.extend(dayOfYear_1.default);
|
|
49
48
|
dayjs_1.default.extend(weekOfYear_1.default);
|
|
50
49
|
dayjs_1.default.extend(duration_1.default);
|
|
51
|
-
var notifications_2 = require("./features/notifications");
|
|
52
|
-
Object.defineProperty(exports, "sendSimpleEmail", { enumerable: true, get: function () { return notifications_2.sendSimpleEmail; } });
|
|
53
|
-
Object.defineProperty(exports, "sendTemplateEmail", { enumerable: true, get: function () { return notifications_2.sendTemplateEmail; } });
|
|
54
50
|
const PREFIX = "OD3_";
|
|
55
51
|
let config;
|
|
56
|
-
// const lang_deu = require("../i18n/deu.json");
|
|
57
52
|
let schema = {};
|
|
58
53
|
/**
|
|
59
54
|
* Initializes the Cloud Code for open.DASH.
|