@ozdao/prometheus-framework 0.2.70 → 0.2.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. package/dist/auth.server.js +8 -21
  2. package/dist/auth.server.mjs +8 -21
  3. package/dist/community.server.js +1 -1
  4. package/dist/community.server.mjs +1 -1
  5. package/dist/events.server.js +306 -48
  6. package/dist/events.server.mjs +306 -48
  7. package/dist/files.server.js +9 -9
  8. package/dist/files.server.mjs +9 -9
  9. package/dist/gallery.server.js +2 -2
  10. package/dist/gallery.server.mjs +2 -2
  11. package/dist/globals.server.js +1 -1
  12. package/dist/globals.server.mjs +1 -1
  13. package/dist/mailing-BX0q8DIs.js +77 -0
  14. package/dist/mailing-Cdp8NXhP.mjs +78 -0
  15. package/dist/main-C0wbYN41.mjs +13744 -0
  16. package/dist/main-vACUb_p5.js +91 -0
  17. package/dist/main.css +1 -1
  18. package/dist/node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.cjs +3 -0
  19. package/dist/node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.js +3174 -0
  20. package/dist/organizations.server.js +1 -1
  21. package/dist/organizations.server.mjs +1 -1
  22. package/dist/ownership.schema-BQmRnCsc.mjs +184 -0
  23. package/dist/ownership.schema-D13NqEgo.js +183 -0
  24. package/dist/products.server.js +1 -1
  25. package/dist/products.server.mjs +1 -1
  26. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
  28. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -1
  30. package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -0
  31. package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +53 -0
  32. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +56 -57
  34. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  36. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  38. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  40. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -1
  42. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +1 -4
  44. package/dist/prometheus-framework/src/components/Loader/Loader.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Loader/Loader.vue.js +51 -1
  46. package/dist/prometheus-framework/src/components/Loader/Loader.vue2.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Loader/Loader.vue2.js +1 -51
  48. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
  50. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +1 -1
  52. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
  54. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
  56. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -46
  58. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  60. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  64. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +19 -20
  70. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  78. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +3 -3
  80. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  84. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
  90. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  93. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  94. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  95. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  96. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -0
  99. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +81 -0
  100. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue2.cjs +1 -0
  101. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue2.js +1 -0
  102. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  106. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +127 -83
  108. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +1 -1
  110. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/events/router/events.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/events/router/events.js +8 -5
  118. package/dist/prometheus-framework/src/modules/events/store/tickets.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/events/store/tickets.js +24 -24
  120. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  122. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  128. package/dist/prometheus-framework/src/modules/icons/entities/IconEvents.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/icons/entities/IconEvents.vue.js +21 -14
  130. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  132. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  134. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  136. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -0
  137. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +205 -0
  138. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue2.cjs +1 -0
  139. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue2.js +1 -0
  140. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +157 -72
  142. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +65 -0
  144. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -0
  145. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +79 -0
  146. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -0
  147. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +34 -0
  148. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/orders/store/orders.js +27 -22
  150. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  154. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  156. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  160. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +4 -4
  162. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  164. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  166. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  168. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  170. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +1 -1
  172. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  174. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  176. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  178. package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
  179. package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.js +1 -1
  180. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  181. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  182. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  183. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  184. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  187. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  188. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  190. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  191. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  192. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  193. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  194. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
  195. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
  196. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  197. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
  198. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  199. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  200. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  201. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  202. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  203. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  204. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
  205. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
  206. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  207. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  208. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  209. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  210. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  211. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +24 -20
  212. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  213. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  214. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  215. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  216. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  217. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  218. package/dist/prometheus-framework/src/modules/users/components/sections/ProfileCompletion.vue.cjs +1 -1
  219. package/dist/prometheus-framework/src/modules/users/components/sections/ProfileCompletion.vue.js +39 -27
  220. package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue.cjs +1 -0
  221. package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue.js +57 -0
  222. package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue2.cjs +1 -0
  223. package/dist/prometheus-framework/src/modules/wallet/components/pages/Payments.vue2.js +1 -0
  224. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  225. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
  226. package/dist/prometheus-framework.cjs.js +1 -1
  227. package/dist/prometheus-framework.es.js +1 -1
  228. package/dist/style.css +1 -1
  229. package/dist/users.server.js +5 -5
  230. package/dist/users.server.mjs +5 -5
  231. package/dist/web-BJSg7vH_.js +1 -0
  232. package/dist/web-DOXRo6XB.mjs +54 -0
  233. package/package.json +1 -1
  234. 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
+ };