@ozdao/prometheus-framework 0.2.71 → 0.2.73
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +8 -21
- package/dist/auth.server.mjs +8 -21
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +306 -48
- package/dist/events.server.mjs +306 -48
- package/dist/files.server.js +9 -9
- package/dist/files.server.mjs +9 -9
- package/dist/gallery.server.js +2 -2
- package/dist/gallery.server.mjs +2 -2
- package/dist/globals.server.js +1 -1
- package/dist/globals.server.mjs +1 -1
- package/dist/mailing-BX0q8DIs.js +77 -0
- package/dist/mailing-Cdp8NXhP.mjs +78 -0
- package/dist/main-C0wbYN41.mjs +13744 -0
- package/dist/main-vACUb_p5.js +91 -0
- package/dist/main.css +1 -1
- package/dist/node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.cjs +3 -0
- package/dist/node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.js +3174 -0
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/ownership.schema-BQmRnCsc.mjs +184 -0
- package/dist/ownership.schema-D13NqEgo.js +183 -0
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -1
- package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -0
- package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +53 -0
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +56 -57
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Loader/Loader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Loader/Loader.vue.js +51 -1
- package/dist/prometheus-framework/src/components/Loader/Loader.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Loader/Loader.vue2.js +1 -51
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -46
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +19 -20
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +81 -0
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +127 -83
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/router/events.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/router/events.js +8 -5
- package/dist/prometheus-framework/src/modules/events/store/tickets.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/tickets.js +24 -24
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/icons/entities/IconEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/entities/IconEvents.vue.js +21 -14
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +205 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +157 -72
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +65 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +79 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +34 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +27 -22
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +24 -20
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/sections/ProfileCompletion.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/sections/ProfileCompletion.vue.js +39 -27
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue.js +57 -0
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/users.server.js +5 -5
- package/dist/users.server.mjs +5 -5
- package/dist/web-BJSg7vH_.js +1 -0
- package/dist/web-DOXRo6XB.mjs +54 -0
- package/package.json +1 -1
- package/src/modules/users/users.server.js +0 -1
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
const require$$0 = require("dotenv");
|
3
|
+
const require$$1 = require("nodemailer");
|
4
|
+
const require$$2 = require("axios");
|
5
|
+
require$$0.config();
|
6
|
+
const nodemailer = require$$1;
|
7
|
+
const axios = require$$2;
|
8
|
+
async function sendEmail(to, subject, text, files = []) {
|
9
|
+
const transporter = nodemailer.createTransport({
|
10
|
+
host: process.env.SMTP_HOST,
|
11
|
+
port: process.env.SMTP_PORT,
|
12
|
+
secure: process.env.SMTP_SECURE === "true",
|
13
|
+
// Ensure the secure option is a boolean
|
14
|
+
auth: {
|
15
|
+
user: process.env.SMTP_USER,
|
16
|
+
pass: process.env.SMTP_PASSWORD
|
17
|
+
}
|
18
|
+
});
|
19
|
+
const attachments = files.map((file) => ({
|
20
|
+
filename: file.split("/").pop(),
|
21
|
+
// Extract filename from path
|
22
|
+
path: file
|
23
|
+
// Full path to the file
|
24
|
+
}));
|
25
|
+
const mailOptions = {
|
26
|
+
from: `${process.env.SMTP_NAME} <${process.env.SMTP_EMAIL}>`,
|
27
|
+
to,
|
28
|
+
subject,
|
29
|
+
text,
|
30
|
+
attachments
|
31
|
+
// Add attachments to mail options
|
32
|
+
};
|
33
|
+
try {
|
34
|
+
const info = await transporter.sendMail(mailOptions);
|
35
|
+
console.log("Email sent: " + info.response);
|
36
|
+
return true;
|
37
|
+
} catch (error) {
|
38
|
+
console.log(error);
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
async function sendSms(phone, message) {
|
43
|
+
const sessionUrl = `https://api.sms.to/sms/send?api_key=${process.env.SMS_API_KEY}&to=${phone}&message=${encodeURIComponent(message)}&sender_id=${encodeURIComponent(process.env.APP_NAME)}`;
|
44
|
+
console.log(`Phone:${phone} message:${message} session: ${sessionUrl}`);
|
45
|
+
try {
|
46
|
+
const response = await axios.get(sessionUrl);
|
47
|
+
console.log("SMS sent");
|
48
|
+
return true;
|
49
|
+
} catch (error) {
|
50
|
+
console.log(error);
|
51
|
+
return false;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
async function sendChatMessageTelegram(chatIds, text) {
|
55
|
+
const telegramToken = process.env.TELEGRAM_BOT_TOKEN;
|
56
|
+
const telegramUrl = `https://api.telegram.org/bot${telegramToken}/sendMessage`;
|
57
|
+
try {
|
58
|
+
for (const chatId of chatIds) {
|
59
|
+
await axios.post(telegramUrl, {
|
60
|
+
chat_id: chatId,
|
61
|
+
text
|
62
|
+
// reply_markup: inlineKeyboard
|
63
|
+
});
|
64
|
+
}
|
65
|
+
console.log("Telegram message sent");
|
66
|
+
return true;
|
67
|
+
} catch (error) {
|
68
|
+
console.log(error);
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
var mailing = {
|
73
|
+
sendEmail,
|
74
|
+
sendSms,
|
75
|
+
sendChatMessageTelegram
|
76
|
+
};
|
77
|
+
exports.mailing = mailing;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import require$$0 from "dotenv";
|
2
|
+
import require$$1 from "nodemailer";
|
3
|
+
import require$$2 from "axios";
|
4
|
+
require$$0.config();
|
5
|
+
const nodemailer = require$$1;
|
6
|
+
const axios = require$$2;
|
7
|
+
async function sendEmail(to, subject, text, files = []) {
|
8
|
+
const transporter = nodemailer.createTransport({
|
9
|
+
host: process.env.SMTP_HOST,
|
10
|
+
port: process.env.SMTP_PORT,
|
11
|
+
secure: process.env.SMTP_SECURE === "true",
|
12
|
+
// Ensure the secure option is a boolean
|
13
|
+
auth: {
|
14
|
+
user: process.env.SMTP_USER,
|
15
|
+
pass: process.env.SMTP_PASSWORD
|
16
|
+
}
|
17
|
+
});
|
18
|
+
const attachments = files.map((file) => ({
|
19
|
+
filename: file.split("/").pop(),
|
20
|
+
// Extract filename from path
|
21
|
+
path: file
|
22
|
+
// Full path to the file
|
23
|
+
}));
|
24
|
+
const mailOptions = {
|
25
|
+
from: `${process.env.SMTP_NAME} <${process.env.SMTP_EMAIL}>`,
|
26
|
+
to,
|
27
|
+
subject,
|
28
|
+
text,
|
29
|
+
attachments
|
30
|
+
// Add attachments to mail options
|
31
|
+
};
|
32
|
+
try {
|
33
|
+
const info = await transporter.sendMail(mailOptions);
|
34
|
+
console.log("Email sent: " + info.response);
|
35
|
+
return true;
|
36
|
+
} catch (error) {
|
37
|
+
console.log(error);
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
async function sendSms(phone, message) {
|
42
|
+
const sessionUrl = `https://api.sms.to/sms/send?api_key=${process.env.SMS_API_KEY}&to=${phone}&message=${encodeURIComponent(message)}&sender_id=${encodeURIComponent(process.env.APP_NAME)}`;
|
43
|
+
console.log(`Phone:${phone} message:${message} session: ${sessionUrl}`);
|
44
|
+
try {
|
45
|
+
const response = await axios.get(sessionUrl);
|
46
|
+
console.log("SMS sent");
|
47
|
+
return true;
|
48
|
+
} catch (error) {
|
49
|
+
console.log(error);
|
50
|
+
return false;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
async function sendChatMessageTelegram(chatIds, text) {
|
54
|
+
const telegramToken = process.env.TELEGRAM_BOT_TOKEN;
|
55
|
+
const telegramUrl = `https://api.telegram.org/bot${telegramToken}/sendMessage`;
|
56
|
+
try {
|
57
|
+
for (const chatId of chatIds) {
|
58
|
+
await axios.post(telegramUrl, {
|
59
|
+
chat_id: chatId,
|
60
|
+
text
|
61
|
+
// reply_markup: inlineKeyboard
|
62
|
+
});
|
63
|
+
}
|
64
|
+
console.log("Telegram message sent");
|
65
|
+
return true;
|
66
|
+
} catch (error) {
|
67
|
+
console.log(error);
|
68
|
+
return false;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
var mailing = {
|
72
|
+
sendEmail,
|
73
|
+
sendSms,
|
74
|
+
sendChatMessageTelegram
|
75
|
+
};
|
76
|
+
export {
|
77
|
+
mailing as m
|
78
|
+
};
|