miragedev-sdk 0.1.0

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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +393 -0
  3. package/dist/auth/biometric.cjs +85 -0
  4. package/dist/auth/biometric.d.cts +7 -0
  5. package/dist/auth/biometric.d.ts +7 -0
  6. package/dist/auth/biometric.js +81 -0
  7. package/dist/auth/client.cjs +44 -0
  8. package/dist/auth/client.d.cts +12 -0
  9. package/dist/auth/client.d.ts +12 -0
  10. package/dist/auth/client.js +40 -0
  11. package/dist/auth/index.cjs +17 -0
  12. package/dist/auth/index.d.cts +6 -0
  13. package/dist/auth/index.d.ts +6 -0
  14. package/dist/auth/index.js +4 -0
  15. package/dist/auth/middleware.cjs +37 -0
  16. package/dist/auth/middleware.d.cts +10 -0
  17. package/dist/auth/middleware.d.ts +10 -0
  18. package/dist/auth/middleware.js +35 -0
  19. package/dist/auth-BC8JI28z.d.cts +22 -0
  20. package/dist/auth-BC8JI28z.d.ts +22 -0
  21. package/dist/billing/client.cjs +43 -0
  22. package/dist/billing/client.d.cts +11 -0
  23. package/dist/billing/client.d.ts +11 -0
  24. package/dist/billing/client.js +40 -0
  25. package/dist/billing/index.cjs +139 -0
  26. package/dist/billing/index.d.cts +12 -0
  27. package/dist/billing/index.d.ts +12 -0
  28. package/dist/billing/index.js +130 -0
  29. package/dist/billing/mobile.cjs +81 -0
  30. package/dist/billing/mobile.d.cts +17 -0
  31. package/dist/billing/mobile.d.ts +17 -0
  32. package/dist/billing/mobile.js +74 -0
  33. package/dist/billing/webhook.cjs +84 -0
  34. package/dist/billing/webhook.d.cts +19 -0
  35. package/dist/billing/webhook.d.ts +19 -0
  36. package/dist/billing/webhook.js +78 -0
  37. package/dist/billing-Bv2V7KWF.d.cts +23 -0
  38. package/dist/billing-Bv2V7KWF.d.ts +23 -0
  39. package/dist/chunk-5YXI4Q2K.js +13813 -0
  40. package/dist/chunk-75ZPJI57.cjs +9 -0
  41. package/dist/chunk-BW4BLEIM.cjs +18 -0
  42. package/dist/chunk-DZDDLA4G.js +271 -0
  43. package/dist/chunk-E5YC2MHX.cjs +13816 -0
  44. package/dist/chunk-JUTTFY3W.js +16 -0
  45. package/dist/chunk-M26EDKMY.cjs +280 -0
  46. package/dist/chunk-M3DPIKWT.js +23 -0
  47. package/dist/chunk-MLKGABMK.js +7 -0
  48. package/dist/chunk-PHTUPKEM.cjs +26 -0
  49. package/dist/cli/commands/init.cjs +11 -0
  50. package/dist/cli/commands/init.d.cts +3 -0
  51. package/dist/cli/commands/init.d.ts +3 -0
  52. package/dist/cli/commands/init.js +2 -0
  53. package/dist/cli/index.cjs +11 -0
  54. package/dist/cli/index.d.cts +1 -0
  55. package/dist/cli/index.d.ts +1 -0
  56. package/dist/cli/index.js +9 -0
  57. package/dist/email/index.cjs +526 -0
  58. package/dist/email/index.d.cts +6 -0
  59. package/dist/email/index.d.ts +6 -0
  60. package/dist/email/index.js +523 -0
  61. package/dist/email-DZN1-bHa.d.cts +19 -0
  62. package/dist/email-DZN1-bHa.d.ts +19 -0
  63. package/dist/index.cjs +27 -0
  64. package/dist/index.d.cts +23 -0
  65. package/dist/index.d.ts +23 -0
  66. package/dist/index.js +21 -0
  67. package/dist/mobile/index.cjs +101 -0
  68. package/dist/mobile/index.d.cts +15 -0
  69. package/dist/mobile/index.d.ts +15 -0
  70. package/dist/mobile/index.js +96 -0
  71. package/dist/pwa/index.cjs +80 -0
  72. package/dist/pwa/index.d.cts +51 -0
  73. package/dist/pwa/index.d.ts +51 -0
  74. package/dist/pwa/index.js +76 -0
  75. package/package.json +140 -0
@@ -0,0 +1,526 @@
1
+ 'use strict';
2
+
3
+ var chunkE5YC2MHX_cjs = require('../chunk-E5YC2MHX.cjs');
4
+ var chunkBW4BLEIM_cjs = require('../chunk-BW4BLEIM.cjs');
5
+ require('../chunk-75ZPJI57.cjs');
6
+ var components = require('@react-email/components');
7
+ var resend = require('resend');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ var ResendProvider = class {
11
+ resend;
12
+ from;
13
+ constructor(apiKey, from) {
14
+ this.resend = new resend.Resend(apiKey);
15
+ this.from = from;
16
+ }
17
+ /**
18
+ * Sends an email using Resend
19
+ */
20
+ async sendEmail(options) {
21
+ try {
22
+ await this.resend.emails.send({
23
+ from: this.from,
24
+ to: options.to,
25
+ subject: options.subject,
26
+ html: options.html,
27
+ text: options.text
28
+ });
29
+ } catch (error) {
30
+ throw new chunkBW4BLEIM_cjs.MirageDevError(
31
+ "EMAIL_SEND_FAILED",
32
+ `Failed to send email: ${error.message}`,
33
+ error
34
+ );
35
+ }
36
+ }
37
+ };
38
+ var WelcomeEmail = ({
39
+ userName = "there",
40
+ actionUrl = "#"
41
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(components.Html, { children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx(components.Head, {}),
43
+ /* @__PURE__ */ jsxRuntime.jsx(components.Preview, { children: "Welcome to our platform!" }),
44
+ /* @__PURE__ */ jsxRuntime.jsx(components.Body, { style: main, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Container, { style: container, children: [
45
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Heading, { style: h1, children: [
46
+ "Welcome ",
47
+ userName,
48
+ "! \u{1F44B}"
49
+ ] }),
50
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text, children: "We're excited to have you on board. Let's get started with your journey." }),
51
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: buttonContainer, children: /* @__PURE__ */ jsxRuntime.jsx(components.Button, { style: button, href: actionUrl, children: "Get Started" }) }),
52
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: footer, children: "If you have any questions, feel free to reach out to our support team." })
53
+ ] }) })
54
+ ] });
55
+ var welcome_default = WelcomeEmail;
56
+ var main = {
57
+ backgroundColor: "#f6f9fc",
58
+ fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif'
59
+ };
60
+ var container = {
61
+ backgroundColor: "#ffffff",
62
+ margin: "0 auto",
63
+ padding: "20px 0 48px",
64
+ marginBottom: "64px",
65
+ maxWidth: "600px"
66
+ };
67
+ var h1 = {
68
+ color: "#333",
69
+ fontSize: "24px",
70
+ fontWeight: "bold",
71
+ margin: "40px 0",
72
+ padding: "0 24px"
73
+ };
74
+ var text = {
75
+ color: "#333",
76
+ fontSize: "16px",
77
+ lineHeight: "26px",
78
+ padding: "0 24px"
79
+ };
80
+ var buttonContainer = {
81
+ padding: "24px"
82
+ };
83
+ var button = {
84
+ backgroundColor: "#5469d4",
85
+ borderRadius: "4px",
86
+ color: "#fff",
87
+ fontSize: "16px",
88
+ fontWeight: "bold",
89
+ textDecoration: "none",
90
+ textAlign: "center",
91
+ display: "block",
92
+ padding: "12px 20px"
93
+ };
94
+ var footer = {
95
+ color: "#8898aa",
96
+ fontSize: "14px",
97
+ lineHeight: "24px",
98
+ padding: "0 24px"
99
+ };
100
+ var ResetPasswordEmail = ({
101
+ userName = "there",
102
+ resetUrl = "#"
103
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(components.Html, { children: [
104
+ /* @__PURE__ */ jsxRuntime.jsx(components.Head, {}),
105
+ /* @__PURE__ */ jsxRuntime.jsx(components.Preview, { children: "Reset your password" }),
106
+ /* @__PURE__ */ jsxRuntime.jsx(components.Body, { style: main2, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Container, { style: container2, children: [
107
+ /* @__PURE__ */ jsxRuntime.jsx(components.Heading, { style: h12, children: "Reset Your Password" }),
108
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text2, children: [
109
+ "Hi ",
110
+ userName,
111
+ ","
112
+ ] }),
113
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text2, children: "We received a request to reset your password. Click the button below to choose a new password." }),
114
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: buttonContainer2, children: /* @__PURE__ */ jsxRuntime.jsx(components.Button, { style: button2, href: resetUrl, children: "Reset Password" }) }),
115
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text2, children: "This link will expire in 1 hour for security reasons." }),
116
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: footer2, children: "If you didn't request a password reset, you can safely ignore this email." })
117
+ ] }) })
118
+ ] });
119
+ var reset_password_default = ResetPasswordEmail;
120
+ var main2 = {
121
+ backgroundColor: "#f6f9fc",
122
+ fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif'
123
+ };
124
+ var container2 = {
125
+ backgroundColor: "#ffffff",
126
+ margin: "0 auto",
127
+ padding: "20px 0 48px",
128
+ marginBottom: "64px",
129
+ maxWidth: "600px"
130
+ };
131
+ var h12 = {
132
+ color: "#333",
133
+ fontSize: "24px",
134
+ fontWeight: "bold",
135
+ margin: "40px 0",
136
+ padding: "0 24px"
137
+ };
138
+ var text2 = {
139
+ color: "#333",
140
+ fontSize: "16px",
141
+ lineHeight: "26px",
142
+ padding: "0 24px",
143
+ marginBottom: "16px"
144
+ };
145
+ var buttonContainer2 = {
146
+ padding: "24px"
147
+ };
148
+ var button2 = {
149
+ backgroundColor: "#5469d4",
150
+ borderRadius: "4px",
151
+ color: "#fff",
152
+ fontSize: "16px",
153
+ fontWeight: "bold",
154
+ textDecoration: "none",
155
+ textAlign: "center",
156
+ display: "block",
157
+ padding: "12px 20px"
158
+ };
159
+ var footer2 = {
160
+ color: "#8898aa",
161
+ fontSize: "14px",
162
+ lineHeight: "24px",
163
+ padding: "0 24px",
164
+ marginTop: "24px"
165
+ };
166
+ var SubscriptionCreatedEmail = ({
167
+ userName = "there",
168
+ planName = "Pro",
169
+ amount = "$10",
170
+ dashboardUrl = "#"
171
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(components.Html, { children: [
172
+ /* @__PURE__ */ jsxRuntime.jsx(components.Head, {}),
173
+ /* @__PURE__ */ jsxRuntime.jsx(components.Preview, { children: "Your subscription is active!" }),
174
+ /* @__PURE__ */ jsxRuntime.jsx(components.Body, { style: main3, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Container, { style: container3, children: [
175
+ /* @__PURE__ */ jsxRuntime.jsx(components.Heading, { style: h13, children: "\u{1F389} Subscription Active!" }),
176
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text3, children: [
177
+ "Hi ",
178
+ userName,
179
+ ","
180
+ ] }),
181
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text3, children: [
182
+ "Thank you for subscribing to our ",
183
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: planName }),
184
+ " plan!"
185
+ ] }),
186
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Section, { style: infoBox, children: [
187
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText, children: [
188
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Plan:" }),
189
+ " ",
190
+ planName
191
+ ] }),
192
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText, children: [
193
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Amount:" }),
194
+ " ",
195
+ amount,
196
+ "/month"
197
+ ] })
198
+ ] }),
199
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text3, children: "Your subscription is now active and you have access to all premium features." }),
200
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: buttonContainer3, children: /* @__PURE__ */ jsxRuntime.jsx(components.Button, { style: button3, href: dashboardUrl, children: "Go to Dashboard" }) }),
201
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: footer3, children: "You can manage your subscription anytime from your account settings." })
202
+ ] }) })
203
+ ] });
204
+ var subscription_created_default = SubscriptionCreatedEmail;
205
+ var main3 = {
206
+ backgroundColor: "#f6f9fc",
207
+ fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif'
208
+ };
209
+ var container3 = {
210
+ backgroundColor: "#ffffff",
211
+ margin: "0 auto",
212
+ padding: "20px 0 48px",
213
+ marginBottom: "64px",
214
+ maxWidth: "600px"
215
+ };
216
+ var h13 = {
217
+ color: "#333",
218
+ fontSize: "24px",
219
+ fontWeight: "bold",
220
+ margin: "40px 0",
221
+ padding: "0 24px"
222
+ };
223
+ var text3 = {
224
+ color: "#333",
225
+ fontSize: "16px",
226
+ lineHeight: "26px",
227
+ padding: "0 24px",
228
+ marginBottom: "16px"
229
+ };
230
+ var infoBox = {
231
+ backgroundColor: "#f6f9fc",
232
+ borderRadius: "4px",
233
+ padding: "16px 24px",
234
+ margin: "24px 24px"
235
+ };
236
+ var infoText = {
237
+ color: "#333",
238
+ fontSize: "14px",
239
+ lineHeight: "24px",
240
+ margin: "4px 0"
241
+ };
242
+ var buttonContainer3 = {
243
+ padding: "24px"
244
+ };
245
+ var button3 = {
246
+ backgroundColor: "#5469d4",
247
+ borderRadius: "4px",
248
+ color: "#fff",
249
+ fontSize: "16px",
250
+ fontWeight: "bold",
251
+ textDecoration: "none",
252
+ textAlign: "center",
253
+ display: "block",
254
+ padding: "12px 20px"
255
+ };
256
+ var footer3 = {
257
+ color: "#8898aa",
258
+ fontSize: "14px",
259
+ lineHeight: "24px",
260
+ padding: "0 24px"
261
+ };
262
+ var SubscriptionCanceledEmail = ({
263
+ userName = "there",
264
+ planName = "Pro",
265
+ endDate = "end of this billing period",
266
+ feedbackUrl = "#"
267
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(components.Html, { children: [
268
+ /* @__PURE__ */ jsxRuntime.jsx(components.Head, {}),
269
+ /* @__PURE__ */ jsxRuntime.jsx(components.Preview, { children: "Your subscription has been canceled" }),
270
+ /* @__PURE__ */ jsxRuntime.jsx(components.Body, { style: main4, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Container, { style: container4, children: [
271
+ /* @__PURE__ */ jsxRuntime.jsx(components.Heading, { style: h14, children: "Subscription Canceled" }),
272
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text4, children: [
273
+ "Hi ",
274
+ userName,
275
+ ","
276
+ ] }),
277
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text4, children: [
278
+ "We're sorry to see you go. Your ",
279
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: planName }),
280
+ " subscription has been canceled."
281
+ ] }),
282
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: infoBox2, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText2, children: [
283
+ "You'll continue to have access to premium features until ",
284
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: endDate }),
285
+ "."
286
+ ] }) }),
287
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text4, children: "We'd love to hear your feedback about why you canceled. Your input helps us improve." }),
288
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: buttonContainer4, children: /* @__PURE__ */ jsxRuntime.jsx(components.Button, { style: button4, href: feedbackUrl, children: "Share Feedback" }) }),
289
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: footer4, children: "Changed your mind? You can reactivate your subscription anytime from your account settings." })
290
+ ] }) })
291
+ ] });
292
+ var subscription_canceled_default = SubscriptionCanceledEmail;
293
+ var main4 = {
294
+ backgroundColor: "#f6f9fc",
295
+ fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif'
296
+ };
297
+ var container4 = {
298
+ backgroundColor: "#ffffff",
299
+ margin: "0 auto",
300
+ padding: "20px 0 48px",
301
+ marginBottom: "64px",
302
+ maxWidth: "600px"
303
+ };
304
+ var h14 = {
305
+ color: "#333",
306
+ fontSize: "24px",
307
+ fontWeight: "bold",
308
+ margin: "40px 0",
309
+ padding: "0 24px"
310
+ };
311
+ var text4 = {
312
+ color: "#333",
313
+ fontSize: "16px",
314
+ lineHeight: "26px",
315
+ padding: "0 24px",
316
+ marginBottom: "16px"
317
+ };
318
+ var infoBox2 = {
319
+ backgroundColor: "#fff4e6",
320
+ borderRadius: "4px",
321
+ padding: "16px 24px",
322
+ margin: "24px 24px",
323
+ borderLeft: "4px solid #ff9800"
324
+ };
325
+ var infoText2 = {
326
+ color: "#333",
327
+ fontSize: "14px",
328
+ lineHeight: "24px",
329
+ margin: "0"
330
+ };
331
+ var buttonContainer4 = {
332
+ padding: "24px"
333
+ };
334
+ var button4 = {
335
+ backgroundColor: "#5469d4",
336
+ borderRadius: "4px",
337
+ color: "#fff",
338
+ fontSize: "16px",
339
+ fontWeight: "bold",
340
+ textDecoration: "none",
341
+ textAlign: "center",
342
+ display: "block",
343
+ padding: "12px 20px"
344
+ };
345
+ var footer4 = {
346
+ color: "#8898aa",
347
+ fontSize: "14px",
348
+ lineHeight: "24px",
349
+ padding: "0 24px"
350
+ };
351
+ var InvoiceEmail = ({
352
+ userName = "there",
353
+ invoiceNumber = "#INV-0001",
354
+ amount = "$10.00",
355
+ date = (/* @__PURE__ */ new Date()).toLocaleDateString(),
356
+ downloadUrl = "#"
357
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(components.Html, { children: [
358
+ /* @__PURE__ */ jsxRuntime.jsx(components.Head, {}),
359
+ /* @__PURE__ */ jsxRuntime.jsx(components.Preview, { children: "Your invoice is ready" }),
360
+ /* @__PURE__ */ jsxRuntime.jsx(components.Body, { style: main5, children: /* @__PURE__ */ jsxRuntime.jsxs(components.Container, { style: container5, children: [
361
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Heading, { style: h15, children: [
362
+ "Invoice ",
363
+ invoiceNumber
364
+ ] }),
365
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: text5, children: [
366
+ "Hi ",
367
+ userName,
368
+ ","
369
+ ] }),
370
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: text5, children: "Thank you for your payment. Your invoice is now available." }),
371
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Section, { style: infoBox3, children: [
372
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText3, children: [
373
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Invoice:" }),
374
+ " ",
375
+ invoiceNumber
376
+ ] }),
377
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText3, children: [
378
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Date:" }),
379
+ " ",
380
+ date
381
+ ] }),
382
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText3, children: [
383
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Amount:" }),
384
+ " ",
385
+ amount
386
+ ] }),
387
+ /* @__PURE__ */ jsxRuntime.jsxs(components.Text, { style: infoText3, children: [
388
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Status:" }),
389
+ " Paid"
390
+ ] })
391
+ ] }),
392
+ /* @__PURE__ */ jsxRuntime.jsx(components.Section, { style: buttonContainer5, children: /* @__PURE__ */ jsxRuntime.jsx(components.Button, { style: button5, href: downloadUrl, children: "Download Invoice" }) }),
393
+ /* @__PURE__ */ jsxRuntime.jsx(components.Text, { style: footer5, children: "Keep this email for your records. If you have any questions about this invoice, please contact our support team." })
394
+ ] }) })
395
+ ] });
396
+ var invoice_default = InvoiceEmail;
397
+ var main5 = {
398
+ backgroundColor: "#f6f9fc",
399
+ fontFamily: '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif'
400
+ };
401
+ var container5 = {
402
+ backgroundColor: "#ffffff",
403
+ margin: "0 auto",
404
+ padding: "20px 0 48px",
405
+ marginBottom: "64px",
406
+ maxWidth: "600px"
407
+ };
408
+ var h15 = {
409
+ color: "#333",
410
+ fontSize: "24px",
411
+ fontWeight: "bold",
412
+ margin: "40px 0",
413
+ padding: "0 24px"
414
+ };
415
+ var text5 = {
416
+ color: "#333",
417
+ fontSize: "16px",
418
+ lineHeight: "26px",
419
+ padding: "0 24px",
420
+ marginBottom: "16px"
421
+ };
422
+ var infoBox3 = {
423
+ backgroundColor: "#f6f9fc",
424
+ borderRadius: "4px",
425
+ padding: "16px 24px",
426
+ margin: "24px 24px"
427
+ };
428
+ var infoText3 = {
429
+ color: "#333",
430
+ fontSize: "14px",
431
+ lineHeight: "24px",
432
+ margin: "4px 0"
433
+ };
434
+ var buttonContainer5 = {
435
+ padding: "24px"
436
+ };
437
+ var button5 = {
438
+ backgroundColor: "#5469d4",
439
+ borderRadius: "4px",
440
+ color: "#fff",
441
+ fontSize: "16px",
442
+ fontWeight: "bold",
443
+ textDecoration: "none",
444
+ textAlign: "center",
445
+ display: "block",
446
+ padding: "12px 20px"
447
+ };
448
+ var footer5 = {
449
+ color: "#8898aa",
450
+ fontSize: "14px",
451
+ lineHeight: "24px",
452
+ padding: "0 24px"
453
+ };
454
+
455
+ // src/email/index.ts
456
+ function getEmailProvider() {
457
+ const config = chunkE5YC2MHX_cjs.getConfig();
458
+ if (config.email.provider === "resend") {
459
+ return new ResendProvider(config.email.apiKey, config.email.from);
460
+ }
461
+ throw new Error(`Unsupported email provider: ${config.email.provider}`);
462
+ }
463
+ async function sendEmail(options) {
464
+ const provider = getEmailProvider();
465
+ return provider.sendEmail(options);
466
+ }
467
+ async function sendTemplateEmail(options) {
468
+ let component;
469
+ let subject;
470
+ switch (options.template) {
471
+ case "welcome":
472
+ component = welcome_default({
473
+ userName: options.data.userName,
474
+ actionUrl: options.data.actionUrl
475
+ });
476
+ subject = "Welcome!";
477
+ break;
478
+ case "reset-password":
479
+ component = reset_password_default({
480
+ userName: options.data.userName,
481
+ resetUrl: options.data.resetUrl
482
+ });
483
+ subject = "Reset Your Password";
484
+ break;
485
+ case "subscription-created":
486
+ component = subscription_created_default({
487
+ userName: options.data.userName,
488
+ planName: options.data.planName,
489
+ amount: options.data.amount,
490
+ dashboardUrl: options.data.dashboardUrl
491
+ });
492
+ subject = "Your Subscription is Active!";
493
+ break;
494
+ case "subscription-canceled":
495
+ component = subscription_canceled_default({
496
+ userName: options.data.userName,
497
+ planName: options.data.planName,
498
+ endDate: options.data.endDate,
499
+ feedbackUrl: options.data.feedbackUrl
500
+ });
501
+ subject = "Subscription Canceled";
502
+ break;
503
+ case "invoice":
504
+ component = invoice_default({
505
+ userName: options.data.userName,
506
+ invoiceNumber: options.data.invoiceNumber,
507
+ amount: options.data.amount,
508
+ date: options.data.date,
509
+ downloadUrl: options.data.downloadUrl
510
+ });
511
+ subject = `Invoice ${options.data.invoiceNumber || ""}`;
512
+ break;
513
+ default:
514
+ throw new Error(`Unknown template: ${options.template}`);
515
+ }
516
+ const html = await components.render(component);
517
+ const provider = getEmailProvider();
518
+ return provider.sendEmail({
519
+ to: options.to,
520
+ subject,
521
+ html
522
+ });
523
+ }
524
+
525
+ exports.sendEmail = sendEmail;
526
+ exports.sendTemplateEmail = sendTemplateEmail;
@@ -0,0 +1,6 @@
1
+ import { E as EmailOptions, T as TemplateEmailOptions } from '../email-DZN1-bHa.cjs';
2
+
3
+ declare function sendEmail(options: EmailOptions): Promise<void>;
4
+ declare function sendTemplateEmail(options: TemplateEmailOptions): Promise<void>;
5
+
6
+ export { sendEmail, sendTemplateEmail };
@@ -0,0 +1,6 @@
1
+ import { E as EmailOptions, T as TemplateEmailOptions } from '../email-DZN1-bHa.js';
2
+
3
+ declare function sendEmail(options: EmailOptions): Promise<void>;
4
+ declare function sendTemplateEmail(options: TemplateEmailOptions): Promise<void>;
5
+
6
+ export { sendEmail, sendTemplateEmail };