@blackcode_sa/metaestetics-api 1.14.69 → 1.14.73

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.
@@ -14020,249 +14020,221 @@ var PatientInviteMailingService = class extends BaseMailingService {
14020
14020
  // src/admin/mailing/clinicWelcome/templates/welcome.template.ts
14021
14021
  var clinicWelcomeTemplate = `
14022
14022
  <!DOCTYPE html>
14023
- <html>
14023
+ <html lang="en">
14024
14024
  <head>
14025
- <meta charset="UTF-8">
14026
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
14027
- <title>Welcome to MetaEsthetics</title>
14028
- <style>
14029
- body {
14030
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
14031
- line-height: 1.6;
14032
- color: #333;
14033
- margin: 0;
14034
- padding: 0;
14035
- background-color: #f5f5f5;
14036
- }
14037
- .container {
14038
- max-width: 600px;
14039
- margin: 0 auto;
14040
- padding: 20px;
14041
- }
14042
- .header {
14043
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14044
- padding: 40px 20px;
14045
- text-align: center;
14046
- border-radius: 8px 8px 0 0;
14047
- }
14048
- .header h1 {
14049
- color: white;
14050
- margin: 0;
14051
- font-size: 28px;
14052
- font-weight: 600;
14053
- }
14054
- .header p {
14055
- color: rgba(255, 255, 255, 0.9);
14056
- margin: 10px 0 0 0;
14057
- font-size: 16px;
14058
- }
14059
- .content {
14060
- padding: 40px 30px;
14061
- background-color: #ffffff;
14062
- }
14063
- .greeting {
14064
- font-size: 18px;
14065
- color: #333;
14066
- margin-bottom: 20px;
14067
- }
14068
- .message {
14069
- font-size: 16px;
14070
- color: #555;
14071
- margin-bottom: 25px;
14072
- }
14073
- .highlight-box {
14074
- background: linear-gradient(135deg, #f6f9fc 0%, #eef2f7 100%);
14075
- border-left: 4px solid #667eea;
14076
- padding: 20px;
14077
- margin: 25px 0;
14078
- border-radius: 0 8px 8px 0;
14079
- }
14080
- .highlight-box h3 {
14081
- margin: 0 0 10px 0;
14082
- color: #333;
14083
- font-size: 16px;
14084
- }
14085
- .highlight-box p {
14086
- margin: 0;
14087
- color: #555;
14088
- }
14089
- .next-steps {
14090
- margin: 30px 0;
14091
- }
14092
- .next-steps h3 {
14093
- color: #333;
14094
- font-size: 18px;
14095
- margin-bottom: 15px;
14096
- }
14097
- .step {
14098
- display: flex;
14099
- align-items: flex-start;
14100
- margin-bottom: 15px;
14101
- }
14102
- .step-number {
14103
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14104
- color: white;
14105
- width: 28px;
14106
- height: 28px;
14107
- border-radius: 50%;
14108
- display: flex;
14109
- align-items: center;
14110
- justify-content: center;
14111
- font-weight: 600;
14112
- font-size: 14px;
14113
- margin-right: 12px;
14114
- flex-shrink: 0;
14115
- }
14116
- .step-content {
14117
- flex: 1;
14118
- padding-top: 3px;
14119
- }
14120
- .step-title {
14121
- font-weight: 600;
14122
- color: #333;
14123
- margin-bottom: 3px;
14124
- }
14125
- .step-description {
14126
- color: #666;
14127
- font-size: 14px;
14128
- }
14129
- .button-container {
14130
- text-align: center;
14131
- margin: 35px 0;
14132
- }
14133
- .button {
14134
- display: inline-block;
14135
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14136
- color: white;
14137
- text-decoration: none;
14138
- padding: 14px 32px;
14139
- border-radius: 6px;
14140
- font-weight: 600;
14141
- font-size: 16px;
14142
- transition: transform 0.2s;
14143
- }
14144
- .button:hover {
14145
- transform: translateY(-2px);
14146
- }
14147
- .support-box {
14148
- background-color: #f8f9fa;
14149
- padding: 20px;
14150
- border-radius: 8px;
14151
- margin-top: 30px;
14152
- text-align: center;
14153
- }
14154
- .support-box p {
14155
- margin: 0 0 10px 0;
14156
- color: #555;
14157
- }
14158
- .support-box a {
14159
- color: #667eea;
14160
- text-decoration: none;
14161
- font-weight: 500;
14162
- }
14163
- .footer {
14164
- padding: 30px;
14165
- text-align: center;
14166
- background-color: #f8f9fa;
14167
- border-radius: 0 0 8px 8px;
14168
- }
14169
- .footer p {
14170
- margin: 5px 0;
14171
- font-size: 13px;
14172
- color: #888;
14173
- }
14174
- .footer a {
14175
- color: #667eea;
14176
- text-decoration: none;
14177
- }
14178
- .social-links {
14179
- margin: 15px 0;
14180
- }
14181
- .social-links a {
14182
- display: inline-block;
14183
- margin: 0 8px;
14184
- color: #888;
14185
- text-decoration: none;
14186
- }
14187
- </style>
14025
+ <meta charset="UTF-8">
14026
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
14027
+ <title>Welcome to MetaEsthetics</title>
14028
+ <!--[if mso]>
14029
+ <noscript>
14030
+ <xml>
14031
+ <o:OfficeDocumentSettings>
14032
+ <o:PixelsPerInch>96</o:PixelsPerInch>
14033
+ </o:OfficeDocumentSettings>
14034
+ </xml>
14035
+ </noscript>
14036
+ <![endif]-->
14188
14037
  </head>
14189
- <body>
14190
- <div class="container">
14191
- <div class="header">
14192
- <h1>Welcome to MetaEsthetics!</h1>
14193
- <p>Your clinic registration is complete</p>
14194
- </div>
14195
- <div class="content">
14196
- <p class="greeting">Hello {{adminName}},</p>
14197
-
14198
- <p class="message">
14199
- Thank you for registering <strong>{{clinicGroupName}}</strong> with MetaEsthetics.
14200
- Your account has been successfully created and you're now ready to start managing
14201
- your aesthetic practice with our comprehensive platform.
14202
- </p>
14203
-
14204
- <div class="highlight-box">
14205
- <h3>Account Details</h3>
14206
- <p><strong>Clinic Group:</strong> {{clinicGroupName}}</p>
14207
- <p><strong>Admin Email:</strong> {{adminEmail}}</p>
14208
- <p><strong>Registration Date:</strong> {{registrationDate}}</p>
14209
- </div>
14038
+ <body style="margin: 0; padding: 0; background-color: #f8f6f5; font-family: Georgia, 'Times New Roman', serif;">
14039
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #f8f6f5;">
14040
+ <tr>
14041
+ <td align="center" style="padding: 40px 20px;">
14042
+ <table role="presentation" width="600" cellspacing="0" cellpadding="0" border="0" style="max-width: 600px; background-color: #ffffff; border-radius: 2px; box-shadow: 0 1px 3px rgba(103, 87, 74, 0.08);">
14210
14043
 
14211
- <div class="next-steps">
14212
- <h3>Get Started with MetaEsthetics</h3>
14044
+ <!-- Header -->
14045
+ <tr>
14046
+ <td style="padding: 48px 48px 32px 48px; border-bottom: 1px solid #f0ebe6;">
14047
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
14048
+ <tr>
14049
+ <td>
14050
+ <h1 style="margin: 0; font-size: 24px; font-weight: 400; color: #67574A; letter-spacing: 2px; text-transform: uppercase; font-family: Georgia, 'Times New Roman', serif;">MetaEsthetics</h1>
14051
+ </td>
14052
+ </tr>
14053
+ </table>
14054
+ </td>
14055
+ </tr>
14213
14056
 
14214
- <div class="step">
14215
- <div class="step-number">1</div>
14216
- <div class="step-content">
14217
- <div class="step-title">Complete Your Profile</div>
14218
- <div class="step-description">Add your clinic details, working hours, and upload photos to attract patients.</div>
14219
- </div>
14220
- </div>
14057
+ <!-- Welcome Banner -->
14058
+ <tr>
14059
+ <td style="padding: 0;">
14060
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #00BB38;">
14061
+ <tr>
14062
+ <td style="padding: 20px 48px;">
14063
+ <p style="margin: 0; font-size: 13px; font-weight: 600; color: #ffffff; letter-spacing: 1.5px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Welcome to MetaEsthetics</p>
14064
+ </td>
14065
+ </tr>
14066
+ </table>
14067
+ </td>
14068
+ </tr>
14221
14069
 
14222
- <div class="step">
14223
- <div class="step-number">2</div>
14224
- <div class="step-content">
14225
- <div class="step-title">Add Your Team</div>
14226
- <div class="step-description">Invite practitioners and staff members to join your clinic.</div>
14227
- </div>
14228
- </div>
14070
+ <!-- Main Content -->
14071
+ <tr>
14072
+ <td style="padding: 40px 48px;">
14229
14073
 
14230
- <div class="step">
14231
- <div class="step-number">3</div>
14232
- <div class="step-content">
14233
- <div class="step-title">Set Up Services</div>
14234
- <div class="step-description">Configure your procedures, pricing, and availability for bookings.</div>
14235
- </div>
14236
- </div>
14074
+ <!-- Greeting -->
14075
+ <p style="margin: 0 0 24px 0; font-size: 17px; color: #333333; line-height: 1.6; font-family: Georgia, 'Times New Roman', serif;">
14076
+ Dear {{adminName}},
14077
+ </p>
14237
14078
 
14238
- <div class="step">
14239
- <div class="step-number">4</div>
14240
- <div class="step-content">
14241
- <div class="step-title">Start Accepting Patients</div>
14242
- <div class="step-description">Begin managing appointments and growing your practice.</div>
14243
- </div>
14244
- </div>
14245
- </div>
14079
+ <p style="margin: 0 0 32px 0; font-size: 16px; color: #555555; line-height: 1.7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
14080
+ Thank you for registering <strong style="color: #67574A;">{{clinicGroupName}}</strong> with MetaEsthetics. Your account has been successfully created and you're now ready to start managing your aesthetic practice.
14081
+ </p>
14246
14082
 
14247
- <div class="button-container">
14248
- <a href="{{dashboardUrl}}" class="button">Go to Dashboard</a>
14249
- </div>
14083
+ <!-- Account Details Card -->
14084
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px; background-color: #faf9f7; border-left: 3px solid #00BB38;">
14085
+ <tr>
14086
+ <td style="padding: 24px;">
14087
+ <p style="margin: 0 0 16px 0; font-size: 12px; font-weight: 600; color: #868686; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Account Details</p>
14250
14088
 
14251
- <div class="support-box">
14252
- <p>Need help getting started?</p>
14253
- <p>Contact our support team at <a href="mailto:{{supportEmail}}">{{supportEmail}}</a></p>
14254
- </div>
14255
- </div>
14256
- <div class="footer">
14257
- <p>This is an automated message from MetaEsthetics.</p>
14258
- <p>&copy; {{currentYear}} MetaEsthetics. All rights reserved.</p>
14259
- <div class="social-links">
14260
- <a href="https://metaesthetics.net">Website</a> |
14261
- <a href="https://metaesthetics.net/privacy">Privacy Policy</a> |
14262
- <a href="https://metaesthetics.net/terms">Terms of Service</a>
14263
- </div>
14264
- </div>
14265
- </div>
14089
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
14090
+ <tr>
14091
+ <td style="padding-bottom: 12px;">
14092
+ <p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Clinic Group</p>
14093
+ <p style="margin: 0; font-size: 15px; color: #67574A; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{clinicGroupName}}</p>
14094
+ </td>
14095
+ </tr>
14096
+ <tr>
14097
+ <td style="padding-bottom: 12px;">
14098
+ <p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Admin Email</p>
14099
+ <p style="margin: 0; font-size: 15px; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{adminEmail}}</p>
14100
+ </td>
14101
+ </tr>
14102
+ <tr>
14103
+ <td>
14104
+ <p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Registration Date</p>
14105
+ <p style="margin: 0; font-size: 15px; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{registrationDate}}</p>
14106
+ </td>
14107
+ </tr>
14108
+ </table>
14109
+ </td>
14110
+ </tr>
14111
+ </table>
14112
+
14113
+ <!-- Divider -->
14114
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
14115
+ <tr>
14116
+ <td style="height: 1px; background-color: #e8e4df;"></td>
14117
+ </tr>
14118
+ </table>
14119
+
14120
+ <!-- Getting Started Section -->
14121
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
14122
+ <tr>
14123
+ <td>
14124
+ <p style="margin: 0 0 20px 0; font-size: 14px; font-weight: 600; color: #67574A; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Getting Started</p>
14125
+ </td>
14126
+ </tr>
14127
+ </table>
14128
+
14129
+ <!-- Step 1 -->
14130
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 16px;">
14131
+ <tr>
14132
+ <td style="padding: 16px 20px; background-color: #faf9f7; border-left: 3px solid #a48a76;">
14133
+ <p style="margin: 0 0 4px 0; font-size: 11px; font-weight: 600; color: #a48a76; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Step 1</p>
14134
+ <p style="margin: 0 0 4px 0; font-size: 15px; color: #333333; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Complete Your Profile</p>
14135
+ <p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Add your clinic details, working hours, and upload photos to attract patients.</p>
14136
+ </td>
14137
+ </tr>
14138
+ </table>
14139
+
14140
+ <!-- Step 2 -->
14141
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 16px;">
14142
+ <tr>
14143
+ <td style="padding: 16px 20px; background-color: #faf9f7; border-left: 3px solid #a48a76;">
14144
+ <p style="margin: 0 0 4px 0; font-size: 11px; font-weight: 600; color: #a48a76; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Step 2</p>
14145
+ <p style="margin: 0 0 4px 0; font-size: 15px; color: #333333; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Add Your Team</p>
14146
+ <p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Invite practitioners and staff members to join your clinic.</p>
14147
+ </td>
14148
+ </tr>
14149
+ </table>
14150
+
14151
+ <!-- Step 3 -->
14152
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 16px;">
14153
+ <tr>
14154
+ <td style="padding: 16px 20px; background-color: #faf9f7; border-left: 3px solid #a48a76;">
14155
+ <p style="margin: 0 0 4px 0; font-size: 11px; font-weight: 600; color: #a48a76; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Step 3</p>
14156
+ <p style="margin: 0 0 4px 0; font-size: 15px; color: #333333; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Set Up Services</p>
14157
+ <p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Configure your procedures, pricing, and availability for bookings.</p>
14158
+ </td>
14159
+ </tr>
14160
+ </table>
14161
+
14162
+ <!-- Step 4 -->
14163
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
14164
+ <tr>
14165
+ <td style="padding: 16px 20px; background-color: #f0faf4; border-left: 3px solid #00BB38;">
14166
+ <p style="margin: 0 0 4px 0; font-size: 11px; font-weight: 600; color: #00BB38; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Step 4</p>
14167
+ <p style="margin: 0 0 4px 0; font-size: 15px; color: #333333; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Start Accepting Patients</p>
14168
+ <p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Begin managing appointments and growing your practice.</p>
14169
+ </td>
14170
+ </tr>
14171
+ </table>
14172
+
14173
+ <!-- CTA Button -->
14174
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
14175
+ <tr>
14176
+ <td align="center">
14177
+ <a href="{{dashboardUrl}}" style="display: inline-block; background-color: #67574A; color: #ffffff; text-decoration: none; padding: 14px 32px; border-radius: 4px; font-size: 14px; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: 0.5px;">Go to Dashboard</a>
14178
+ </td>
14179
+ </tr>
14180
+ </table>
14181
+
14182
+ <!-- Divider -->
14183
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
14184
+ <tr>
14185
+ <td style="height: 1px; background-color: #e8e4df;"></td>
14186
+ </tr>
14187
+ </table>
14188
+
14189
+ <!-- Support Info -->
14190
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 24px;">
14191
+ <tr>
14192
+ <td style="padding: 20px 24px; background-color: #faf9f7; border-left: 3px solid #a48a76;">
14193
+ <p style="margin: 0 0 8px 0; font-size: 13px; font-weight: 600; color: #67574A; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Need Help?</p>
14194
+ <p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
14195
+ Our support team is here to help you get started. Contact us at <a href="mailto:{{supportEmail}}" style="color: #a48a76; text-decoration: none;">{{supportEmail}}</a>
14196
+ </p>
14197
+ </td>
14198
+ </tr>
14199
+ </table>
14200
+
14201
+ <!-- Thank You -->
14202
+ <p style="margin: 0; font-size: 14px; color: #868686; line-height: 1.7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
14203
+ Thank you for choosing MetaEsthetics. We look forward to supporting your practice.
14204
+ </p>
14205
+
14206
+ </td>
14207
+ </tr>
14208
+
14209
+ <!-- Footer -->
14210
+ <tr>
14211
+ <td style="padding: 32px 48px; background-color: #faf9f7; border-top: 1px solid #f0ebe6;">
14212
+ <table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
14213
+ <tr>
14214
+ <td>
14215
+ <p style="margin: 0 0 8px 0; font-size: 14px; font-weight: 500; color: #67574A; font-family: Georgia, 'Times New Roman', serif;">MetaEsthetics</p>
14216
+ <p style="margin: 0 0 16px 0; font-size: 13px; color: #868686; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Premium Aesthetic Services Platform</p>
14217
+ <p style="margin: 0; font-size: 11px; color: #aaaaaa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">This is an automated message from MetaEsthetics. Please do not reply directly to this email.</p>
14218
+ </td>
14219
+ </tr>
14220
+ </table>
14221
+ </td>
14222
+ </tr>
14223
+
14224
+ </table>
14225
+
14226
+ <!-- Copyright -->
14227
+ <table role="presentation" width="600" cellspacing="0" cellpadding="0" border="0" style="max-width: 600px;">
14228
+ <tr>
14229
+ <td style="padding: 24px 48px; text-align: center;">
14230
+ <p style="margin: 0; font-size: 11px; color: #aaaaaa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">&copy; {{currentYear}} MetaEsthetics. All rights reserved.</p>
14231
+ </td>
14232
+ </tr>
14233
+ </table>
14234
+
14235
+ </td>
14236
+ </tr>
14237
+ </table>
14266
14238
  </body>
14267
14239
  </html>
14268
14240
  `;
package/dist/index.d.mts CHANGED
@@ -8615,6 +8615,22 @@ declare class AuthService extends BaseService {
8615
8615
  * @returns The updated user profile.
8616
8616
  */
8617
8617
  linkGoogleAccount(idToken: string): Promise<User>;
8618
+ /**
8619
+ * Sign in with Apple ID token (for existing users only).
8620
+ * Mirrors signInWithGoogleIdToken — verifies the user exists before allowing sign-in.
8621
+ */
8622
+ signInWithAppleIdToken(idToken: string, rawNonce: string, appleUserInfo?: {
8623
+ fullName?: {
8624
+ givenName?: string;
8625
+ familyName?: string;
8626
+ };
8627
+ email?: string;
8628
+ }): Promise<User>;
8629
+ /**
8630
+ * Link an Apple account to the current user (anonymous → full account upgrade).
8631
+ * Mirrors linkGoogleAccount.
8632
+ */
8633
+ linkAppleAccount(idToken: string, rawNonce: string): Promise<User>;
8618
8634
  }
8619
8635
 
8620
8636
  /**
package/dist/index.d.ts CHANGED
@@ -8615,6 +8615,22 @@ declare class AuthService extends BaseService {
8615
8615
  * @returns The updated user profile.
8616
8616
  */
8617
8617
  linkGoogleAccount(idToken: string): Promise<User>;
8618
+ /**
8619
+ * Sign in with Apple ID token (for existing users only).
8620
+ * Mirrors signInWithGoogleIdToken — verifies the user exists before allowing sign-in.
8621
+ */
8622
+ signInWithAppleIdToken(idToken: string, rawNonce: string, appleUserInfo?: {
8623
+ fullName?: {
8624
+ givenName?: string;
8625
+ familyName?: string;
8626
+ };
8627
+ email?: string;
8628
+ }): Promise<User>;
8629
+ /**
8630
+ * Link an Apple account to the current user (anonymous → full account upgrade).
8631
+ * Mirrors linkGoogleAccount.
8632
+ */
8633
+ linkAppleAccount(idToken: string, rawNonce: string): Promise<User>;
8618
8634
  }
8619
8635
 
8620
8636
  /**
package/dist/index.js CHANGED
@@ -17040,6 +17040,66 @@ var AuthService = class extends BaseService {
17040
17040
  throw handleFirebaseError(error);
17041
17041
  }
17042
17042
  }
17043
+ /**
17044
+ * Sign in with Apple ID token (for existing users only).
17045
+ * Mirrors signInWithGoogleIdToken — verifies the user exists before allowing sign-in.
17046
+ */
17047
+ async signInWithAppleIdToken(idToken, rawNonce, appleUserInfo) {
17048
+ try {
17049
+ console.log("[AUTH] Signing in with Apple ID Token");
17050
+ const provider = new import_auth8.OAuthProvider("apple.com");
17051
+ const credential = provider.credential({ idToken, rawNonce });
17052
+ const { user: firebaseUser } = await (0, import_auth8.signInWithCredential)(this.auth, credential);
17053
+ console.log("[AUTH] Firebase user signed in via Apple:", firebaseUser.uid);
17054
+ const existingUser = await this.userService.getUserById(firebaseUser.uid);
17055
+ if (existingUser) {
17056
+ console.log("[AUTH] Existing user found, returning profile:", existingUser.uid);
17057
+ return existingUser;
17058
+ }
17059
+ console.log("[AUTH] No existing MetaEstetics user for Apple account \u2013 signing out.");
17060
+ await (0, import_auth8.signOut)(this.auth);
17061
+ throw new AuthError(
17062
+ 'No account found. Please complete registration by starting with "Get Started".',
17063
+ "AUTH/USER_NOT_FOUND",
17064
+ 404
17065
+ );
17066
+ } catch (error) {
17067
+ console.error("[AUTH] Error in signInWithAppleIdToken:", error);
17068
+ throw handleFirebaseError(error);
17069
+ }
17070
+ }
17071
+ /**
17072
+ * Link an Apple account to the current user (anonymous → full account upgrade).
17073
+ * Mirrors linkGoogleAccount.
17074
+ */
17075
+ async linkAppleAccount(idToken, rawNonce) {
17076
+ try {
17077
+ console.log("[AUTH] Linking Apple account with ID Token");
17078
+ const currentUser = this.auth.currentUser;
17079
+ if (!currentUser) {
17080
+ throw AUTH_ERRORS.NOT_AUTHENTICATED;
17081
+ }
17082
+ const wasAnonymous = currentUser.isAnonymous;
17083
+ console.log(`[AUTH] Current user is ${wasAnonymous ? "anonymous" : "not anonymous"}`);
17084
+ const provider = new import_auth8.OAuthProvider("apple.com");
17085
+ const credential = provider.credential({ idToken, rawNonce });
17086
+ const userCredential = await (0, import_auth8.linkWithCredential)(currentUser, credential);
17087
+ const linkedFirebaseUser = userCredential.user;
17088
+ console.log("[AUTH] Apple account linked successfully to user:", linkedFirebaseUser.uid);
17089
+ if (wasAnonymous) {
17090
+ console.log("[AUTH] Upgrading anonymous user profile");
17091
+ const email = linkedFirebaseUser.email || "";
17092
+ return await this.userService.upgradeAnonymousUser(
17093
+ linkedFirebaseUser.uid,
17094
+ email
17095
+ );
17096
+ }
17097
+ return await this.userService.getUserById(linkedFirebaseUser.uid);
17098
+ } catch (error) {
17099
+ console.error("[AUTH] Error in linkAppleAccount:", error);
17100
+ throw handleFirebaseError(error);
17101
+ }
17102
+ }
17043
17103
  };
17044
17104
 
17045
17105
  // src/services/calendar/calendar.v2.service.ts
package/dist/index.mjs CHANGED
@@ -7639,7 +7639,8 @@ import {
7639
7639
  verifyPasswordResetCode,
7640
7640
  confirmPasswordReset,
7641
7641
  fetchSignInMethodsForEmail as fetchSignInMethodsForEmail2,
7642
- signInWithCredential
7642
+ signInWithCredential,
7643
+ OAuthProvider
7643
7644
  } from "firebase/auth";
7644
7645
  import {
7645
7646
  collection as collection21,
@@ -17128,6 +17129,66 @@ var AuthService = class extends BaseService {
17128
17129
  throw handleFirebaseError(error);
17129
17130
  }
17130
17131
  }
17132
+ /**
17133
+ * Sign in with Apple ID token (for existing users only).
17134
+ * Mirrors signInWithGoogleIdToken — verifies the user exists before allowing sign-in.
17135
+ */
17136
+ async signInWithAppleIdToken(idToken, rawNonce, appleUserInfo) {
17137
+ try {
17138
+ console.log("[AUTH] Signing in with Apple ID Token");
17139
+ const provider = new OAuthProvider("apple.com");
17140
+ const credential = provider.credential({ idToken, rawNonce });
17141
+ const { user: firebaseUser } = await signInWithCredential(this.auth, credential);
17142
+ console.log("[AUTH] Firebase user signed in via Apple:", firebaseUser.uid);
17143
+ const existingUser = await this.userService.getUserById(firebaseUser.uid);
17144
+ if (existingUser) {
17145
+ console.log("[AUTH] Existing user found, returning profile:", existingUser.uid);
17146
+ return existingUser;
17147
+ }
17148
+ console.log("[AUTH] No existing MetaEstetics user for Apple account \u2013 signing out.");
17149
+ await firebaseSignOut(this.auth);
17150
+ throw new AuthError(
17151
+ 'No account found. Please complete registration by starting with "Get Started".',
17152
+ "AUTH/USER_NOT_FOUND",
17153
+ 404
17154
+ );
17155
+ } catch (error) {
17156
+ console.error("[AUTH] Error in signInWithAppleIdToken:", error);
17157
+ throw handleFirebaseError(error);
17158
+ }
17159
+ }
17160
+ /**
17161
+ * Link an Apple account to the current user (anonymous → full account upgrade).
17162
+ * Mirrors linkGoogleAccount.
17163
+ */
17164
+ async linkAppleAccount(idToken, rawNonce) {
17165
+ try {
17166
+ console.log("[AUTH] Linking Apple account with ID Token");
17167
+ const currentUser = this.auth.currentUser;
17168
+ if (!currentUser) {
17169
+ throw AUTH_ERRORS.NOT_AUTHENTICATED;
17170
+ }
17171
+ const wasAnonymous = currentUser.isAnonymous;
17172
+ console.log(`[AUTH] Current user is ${wasAnonymous ? "anonymous" : "not anonymous"}`);
17173
+ const provider = new OAuthProvider("apple.com");
17174
+ const credential = provider.credential({ idToken, rawNonce });
17175
+ const userCredential = await linkWithCredential(currentUser, credential);
17176
+ const linkedFirebaseUser = userCredential.user;
17177
+ console.log("[AUTH] Apple account linked successfully to user:", linkedFirebaseUser.uid);
17178
+ if (wasAnonymous) {
17179
+ console.log("[AUTH] Upgrading anonymous user profile");
17180
+ const email = linkedFirebaseUser.email || "";
17181
+ return await this.userService.upgradeAnonymousUser(
17182
+ linkedFirebaseUser.uid,
17183
+ email
17184
+ );
17185
+ }
17186
+ return await this.userService.getUserById(linkedFirebaseUser.uid);
17187
+ } catch (error) {
17188
+ console.error("[AUTH] Error in linkAppleAccount:", error);
17189
+ throw handleFirebaseError(error);
17190
+ }
17191
+ }
17131
17192
  };
17132
17193
 
17133
17194
  // src/services/calendar/calendar.v2.service.ts