@tapni/auth 1.0.60 → 1.0.66

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 (53) hide show
  1. package/dist/.vite/manifest.json +69 -0
  2. package/dist/Apps-BGr6XXC1.js +109 -0
  3. package/dist/CustomApp-CUbr7Yc0.js +83 -0
  4. package/dist/QR-C-hIeHAf.js +41 -0
  5. package/dist/TapniAuth.es.js +4 -0
  6. package/dist/TapniAuth.umd.js +167 -0
  7. package/dist/install-NW33kPfJ.js +20276 -0
  8. package/dist/style.css +1 -0
  9. package/dist/web-LIfHmYL2.js +54 -0
  10. package/dist/web-UrTMimK1.js +86 -0
  11. package/dist/web-XbruGdlD.js +121 -0
  12. package/package.json +5 -4
  13. package/src/App.vue +78 -5
  14. package/src/index.js +4 -0
  15. package/src/services/Api.js +3 -3
  16. package/src/store/auth.js +23 -19
  17. package/src/store/constants.js +2 -2
  18. package/src/store/locales/cn.js +33 -31
  19. package/src/store/locales/de.js +38 -36
  20. package/src/store/locales/en.js +454 -513
  21. package/src/store/locales/es.js +34 -32
  22. package/src/store/locales/fr.js +33 -31
  23. package/src/store/locales/it.js +34 -32
  24. package/src/store/locales/ja.js +488 -0
  25. package/src/store/locales/kr.js +34 -32
  26. package/src/store/locales/lang.js +8 -0
  27. package/src/store/locales/pt.js +488 -0
  28. package/src/store/locales/sr.js +37 -35
  29. package/src/store/locales/tr.js +40 -38
  30. package/src/views/Account.vue +14 -2
  31. package/src/views/Billing.vue +216 -40
  32. package/src/views/General.vue +152 -168
  33. package/src/views/Welcome.vue +85 -66
  34. package/dist/assets/Apps-CKx0f5Af.js +0 -1
  35. package/dist/assets/Apps-DRNQ66T5.css +0 -1
  36. package/dist/assets/Billing-COZeuzks.css +0 -1
  37. package/dist/assets/Billing-DeyPG-Ex.js +0 -1
  38. package/dist/assets/CustomApp-CdW5ai3X.js +0 -1
  39. package/dist/assets/CustomApp-EflPiIBk.css +0 -1
  40. package/dist/assets/Inter-ZO3WBJgw.ttf +0 -0
  41. package/dist/assets/QR-BHMtz3S1.js +0 -1
  42. package/dist/assets/fontawesome-webfont-CQDK8MU3.ttf +0 -0
  43. package/dist/assets/fontawesome-webfont-DXgy9qkh.svg +0 -2671
  44. package/dist/assets/fontawesome-webfont-G5YE5S7X.eot +0 -0
  45. package/dist/assets/index-B_ObVKmg.js +0 -181
  46. package/dist/assets/index-BrLpR8cl.css +0 -1
  47. package/dist/assets/web-3Qzt-sO-.js +0 -5
  48. package/dist/assets/web-6FVF6yWZ.js +0 -1
  49. package/dist/assets/web-CxYA3Bo_.js +0 -1
  50. package/dist/assets/web-DDe4YMsR.js +0 -1
  51. package/dist/assets/web-TwvPD64h.js +0 -1
  52. package/dist/assets/web-xLTxXG_s.js +0 -1
  53. package/dist/index.html +0 -39
@@ -9,6 +9,8 @@ export default {
9
9
  serbian: 'Sırpça',
10
10
  turkish: 'Çince',
11
11
  chinese: 'Kineski',
12
+ japanese: 'Japonca',
13
+ portuguese: 'Portekizce',
12
14
  app_language: 'Dil seçin',
13
15
  profile_preview: 'Profil Önizlemesi',
14
16
  edit_profile: 'Profili Düzenle',
@@ -23,9 +25,9 @@ export default {
23
25
  exchange_contact: 'Değişim İletişim',
24
26
  add_details: 'Daha fazlasını ekle',
25
27
  show_details: 'Daha fazlasını göster',
26
- download_contact: "İletişim Kartını İndir",
27
- stay_in_touch: "İle iletişim kurun",
28
- no_thanks: "Hayır, teşekkürler",
28
+ download_contact: 'İletişim Kartını İndir',
29
+ stay_in_touch: 'İle iletişim kurun',
30
+ no_thanks: 'Hayır, teşekkürler',
29
31
  connect_join: "Tapni'ye katıl",
30
32
  connect_with: 'ile bağlanın',
31
33
  connect_required_fields: 'İki iletişim alanından biri sağlanmalıdır',
@@ -167,7 +169,7 @@ export default {
167
169
  update_username: 'Kullanıcı adını güncelle',
168
170
  new_username: 'Yeni kullanıcı adınızı girin',
169
171
  username_check: 'Lütfen uygun bir kullanıcı adı girin',
170
- username_is_free: "Kullanıcı adınız kullanılabilir",
172
+ username_is_free: 'Kullanıcı adınız kullanılabilir',
171
173
  anonymous: 'Anonim',
172
174
  connected: 'Bağlı',
173
175
  exchanged: 'Değiş tokuş',
@@ -366,9 +368,9 @@ export default {
366
368
  accept_request: 'İsteği kabul et',
367
369
  close: 'Kapat',
368
370
  request_accepted: 'İstek başarıyla kabul edildi',
369
- companyEmail: "Şirket e-postası",
370
- companyPhone: "Şirket telefon numarası",
371
- addBusinessInformations: "İş bilgilerini ekle",
371
+ companyEmail: 'Şirket e-postası',
372
+ companyPhone: 'Şirket telefon numarası',
373
+ addBusinessInformations: 'İş bilgilerini ekle',
372
374
  resetFilter: 'Sıfırla',
373
375
  selectMarkers: 'İşaretleyicileri Seçin',
374
376
  filterConnectionsHeader: 'Filtre Bağlantıları',
@@ -444,36 +446,36 @@ export default {
444
446
  choose_other_login_methods: 'Diğer giriş yöntemlerini seçin',
445
447
  no_sso_logins: 'Şirketiniz SSO girişini kullanmıyor, lütfen yöneticinizle iletişime geçin',
446
448
 
447
- mfa: "Çok Faktörlü Kimlik Doğrulama",
448
- otp_title: "Devam etmek için MFA kodunu girin",
449
- otp_code: "MFA Kodu",
450
- otp_subtitle: "Kimlik doğrulama uygulamasındaki kodu girin",
451
- otp_p1: "MFA ile ilgili sorun yaşıyorsanız, <br> bize ulaşın:",
452
- change_language: "Dili Değiştir",
453
- welcome_account: "Hesap Merkezine Hoş Geldiniz",
454
- security: "Güvenlik",
455
- security_p: "Kimlik doğrulama seçeneklerinizi & hesap durumunuzu yönetin",
456
- general: "Genel",
457
- general_p: "Kişisel bilgilerinizi & diğer tercihlerinizi yönetin",
458
- billing: "Faturalama",
459
- billing_p: "Aboneliklerinizi & ödeme profillerinizi yönetin",
460
- apps: "Uygulamalar",
461
- apps_p: "Aktif uygulamalarınızı görüntüleyin & diğerlerini keşfedin",
462
- apps_my: "Uygulamalarım",
463
- mfa_auth: "2 Faktörlü Doğrulama",
464
- mfa_auth_enabled: "Hesabınız MFA ile korunuyor.",
465
- mfa_auth_p: "Hesabınızı çok faktörlü doğrulama (MFA) ile koruyun",
466
- mfa_auth_qr: "Yukarıdaki QR kodunu tarayın ya da gizli anahtarı doğrulama uygulamanıza girin.",
467
- change_password: "Şifreyi Değiştir",
468
- active_account: "Aktif Hesap",
469
- active_account_p: "Kapatılırsa hesabınız yeniden açılana dek geçici olarak devre dışı kalır.",
470
- delete_account: "Hesabı Sil",
471
- delete_account_p: "Hesabı Sil",
472
- permanent_delete: "Kalıcı Silme",
473
- permanent_delete_p: "Hesabınızı silerseniz tüm verileriniz kalıcı olarak silinir. Geri alınamaz. Emin değilseniz hesabı geçici olarak devre dışı bırakın.",
474
- personal_details: "Kişisel Bilgiler",
475
- app_language_p: "Uygulamayı tercih ettiğiniz dile çevirin",
476
- app_region: "Bölge",
477
- app_region_p: "Kişiselleştirilmiş faturalama ve destek için bölgenizi seçin"
449
+ mfa: 'Çok Faktörlü Kimlik Doğrulama',
450
+ otp_title: 'Devam etmek için MFA kodunu girin',
451
+ otp_code: 'MFA Kodu',
452
+ otp_subtitle: 'Kimlik doğrulama uygulamasındaki kodu girin',
453
+ otp_p1: 'MFA ile ilgili sorun yaşıyorsanız, <br> bize ulaşın:',
454
+ change_language: 'Dili Değiştir',
455
+ welcome_account: 'Hesap Merkezine Hoş Geldiniz',
456
+ security: 'Güvenlik',
457
+ security_p: 'Kimlik doğrulama seçeneklerinizi & hesap durumunuzu yönetin',
458
+ general: 'Genel',
459
+ general_p: 'Kişisel bilgilerinizi & diğer tercihlerinizi yönetin',
460
+ billing: 'Faturalama',
461
+ billing_p: 'Aboneliklerinizi & ödeme profillerinizi yönetin',
462
+ apps: 'Uygulamalar',
463
+ apps_p: 'Aktif uygulamalarınızı görüntüleyin & diğerlerini keşfedin',
464
+ apps_my: 'Uygulamalarım',
465
+ mfa_auth: '2 Faktörlü Doğrulama',
466
+ mfa_auth_enabled: 'Hesabınız MFA ile korunuyor.',
467
+ mfa_auth_p: 'Hesabınızı çok faktörlü doğrulama (MFA) ile koruyun',
468
+ mfa_auth_qr: 'Yukarıdaki QR kodunu tarayın ya da gizli anahtarı doğrulama uygulamanıza girin.',
469
+ change_password: 'Şifreyi Değiştir',
470
+ active_account: 'Aktif Hesap',
471
+ active_account_p: 'Kapatılırsa hesabınız yeniden açılana dek geçici olarak devre dışı kalır.',
472
+ delete_account: 'Hesabı Sil',
473
+ delete_account_p: 'Hesabı Sil',
474
+ permanent_delete: 'Kalıcı Silme',
475
+ permanent_delete_p: 'Hesabınızı silerseniz tüm verileriniz kalıcı olarak silinir. Geri alınamaz. Emin değilseniz hesabı geçici olarak devre dışı bırakın.',
476
+ personal_details: 'Kişisel Bilgiler',
477
+ app_language_p: 'Uygulamayı tercih ettiğiniz dile çevirin',
478
+ app_region: 'Bölge',
479
+ app_region_p: 'Kişiselleştirilmiş faturalama ve destek için bölgenizi seçin'
478
480
  }
479
481
  };
@@ -139,7 +139,19 @@
139
139
  </div>
140
140
  </router-link>
141
141
 
142
- <router-link v-if="false" to="/billing" class="settingRow">
142
+ <div v-if="isModal" class="settingRow" @click="$emit('update:viewProp', 'AuthBilling')">
143
+ <div class="firstRow">
144
+ <img
145
+ :src="getIcon('billing-card-black.svg')"
146
+ class="withBackground"
147
+ />
148
+ <h4>{{ssoLang[appLanguage].billing }}</h4>
149
+
150
+ <img :src="getIcon('arrow-gray-right.svg')" />
151
+ </div>
152
+ </div>
153
+
154
+ <router-link v-else to="/billing" class="settingRow">
143
155
  <div class="firstRow">
144
156
  <img
145
157
  :src="getIcon('billing-card-black.svg')"
@@ -204,7 +216,7 @@ export default {
204
216
  if (!this.isLoggedIn) {
205
217
  return this.$router.push('/');
206
218
  }
207
- this.getAccountSettings();
219
+ await this.getAccountSettings();
208
220
  },
209
221
  methods: {
210
222
  continueTo (realm) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="page-login content-boxed content-boxed-padding">
2
+ <div class="page-login content-boxed content-boxed-padding tapni-auth-billing">
3
3
  <a v-if="isModal" @click="close" class="color-black pull-right pointer" style="margin-top: 0px; position: absolute; right: -20px; text-align: right;">
4
4
  <i class="font-17 color-black">
5
5
  <img src="https://cdn.tapni.co/icons/down-arrow.png" class="responsive-image" style="width: 35%;"/>
@@ -7,7 +7,16 @@
7
7
  </a>
8
8
  <div class="subheaderContainer full-top">
9
9
  <!-- Back Button -->
10
- <router-link v-if="!isModal" to="/account" class="button gray-button pointer left-button">
10
+ <div v-if="isModal" class="pointer left-button" @click="$emit('update:viewProp', 'AuthAccount')">
11
+ <img
12
+ :src="getIcon('arrow-gray-right.svg')"
13
+ height="20"
14
+ width="20"
15
+ class="btn-icon"
16
+ style="rotate: 180deg;"
17
+ />
18
+ </div>
19
+ <router-link v-else to="/account" class="button gray-button pointer left-button">
11
20
  <img
12
21
  :src="getIcon('arrow-gray-right.svg')"
13
22
  height="20"
@@ -27,23 +36,98 @@
27
36
  <p class="center-text">{{ssoLang[appLanguage].billing_p }}</p>
28
37
 
29
38
  <div class="full-top">
30
- <h3 v-if="false" class="full-top bold small-bottom">{{ssoLang[appLanguage].apps_my}}</h3>
39
+ <!-- No subscriptions message -->
40
+ <div v-if="subscriptions.length === 0" class="no-subscriptions center-text full-top">
41
+ <p class="gray-text">There are no active subscriptions at this point.</p>
42
+ </div>
31
43
 
32
- {{account.billing}}
44
+ <!-- Subscriptions list -->
45
+ <div v-else>
46
+ <div v-for="sub in subscriptions" :key="sub.subscriptionId" class="subscription-card half-bottom">
47
+ <div class="subscription-header">
48
+ <div class="subscription-info">
49
+ <h3 class="subscription-name">{{ sub.subscriptionName }}</h3>
50
+ <span class="subscription-status" :class="getStatusClass(sub.status)">
51
+ {{ getStatusText(sub.status) }}
52
+ </span>
53
+ </div>
54
+ </div>
33
55
 
34
- <div v-for="sub in subscriptions" :key="sub.id" class="settingRow half-bottom">
35
- <div class="firstRow">
36
- <img
37
- :src="getIcon(app.t_apps_icon)"
38
- class="withBackground"
39
- />
40
- <h4>{{ sub.t_subscriptions_name }}</h4>
56
+ <div class="subscription-details">
57
+ <div class="detail-row">
58
+ <span class="detail-label">Amount:</span>
59
+ <span class="detail-value">{{ formatCurrency(sub.amount, sub.currency) }}</span>
60
+ </div>
61
+ <div class="detail-row">
62
+ <span class="detail-label">Billing:</span>
63
+ <span class="detail-value">{{ formatInterval(sub.interval) }}</span>
64
+ </div>
65
+ <div class="detail-row">
66
+ <span class="detail-label">Licenses:</span>
67
+ <span class="detail-value">{{ sub.licenses }}</span>
68
+ </div>
69
+ <div v-if="sub.isTrial" class="detail-row">
70
+ <span class="detail-label">Trial Ends:</span>
71
+ <span class="detail-value">{{ formatDate(sub.trialEnd) }}</span>
72
+ </div>
73
+ <div v-else-if="sub.endDate" class="detail-row">
74
+ <span class="detail-label">Next Billing:</span>
75
+ <span class="detail-value">{{ formatDate(sub.endDate) }}</span>
76
+ </div>
77
+ </div>
41
78
 
42
- <img :src="getIcon('arrow-gray-right.svg')" />
79
+ <div class="subscription-actions" v-if="sub.status !== 'canceled'">
80
+ <button
81
+ @click="openCancelModal(sub)"
82
+ class="cancel-button"
83
+ :disabled="loading"
84
+ >
85
+ {{ loading ? 'Processing...' : 'Cancel Subscription' }}
86
+ </button>
87
+ </div>
43
88
  </div>
44
89
  </div>
45
90
  </div>
46
91
  </div>
92
+
93
+ <!-- Cancel Confirmation Modal -->
94
+ <div v-if="showCancelModal" class="modal-overlay" @click.self="closeCancelModal">
95
+ <div class="modal-content">
96
+ <div class="modal-header">
97
+ <h3>Cancel Subscription</h3>
98
+ <button @click="closeCancelModal" class="close-button">&times;</button>
99
+ </div>
100
+
101
+ <div class="modal-body">
102
+ <p class="modal-text">
103
+ Are you sure you want to cancel your subscription to <b>{{ selectedSubscription?.subscriptionName }}</b>?
104
+ </p>
105
+
106
+ <div class="feedback-section">
107
+ <label class="feedback-label">We'd love to know why you're canceling (optional):</label>
108
+ <textarea
109
+ v-model="cancelFeedback"
110
+ class="feedback-textarea"
111
+ placeholder="Your feedback helps us improve our service..."
112
+ rows="4"
113
+ ></textarea>
114
+ </div>
115
+ </div>
116
+
117
+ <div class="modal-footer">
118
+ <button @click="closeCancelModal" class="button-secondary">
119
+ Keep Subscription
120
+ </button>
121
+ <button
122
+ @click="confirmCancel"
123
+ class="button-danger"
124
+ :disabled="loading"
125
+ >
126
+ {{ loading ? 'Canceling...' : 'Confirm Cancellation' }}
127
+ </button>
128
+ </div>
129
+ </div>
130
+ </div>
47
131
  </div>
48
132
  </template>
49
133
 
@@ -51,7 +135,7 @@
51
135
  <script>
52
136
  import AuthMixin from "../mixins/auth.mixin";
53
137
  import {EventBus} from "@/store/event-bus.js";
54
- import AuthService from "@/services/AuthService.js";
138
+ import api from "@/services/Api.js";
55
139
 
56
140
  export default {
57
141
  name: "AuthBilling",
@@ -65,44 +149,136 @@ export default {
65
149
  data () {
66
150
  return {
67
151
  loading: false,
68
- subscriptions: []
152
+ subscriptions: [],
153
+ showCancelModal: false,
154
+ selectedSubscription: null,
155
+ cancelFeedback: ''
69
156
  }
70
157
  },
71
158
  async mounted() {
72
159
  if (!this.isLoggedIn) this.$router.push('/login');
73
-
74
-
75
- const response = await AuthService.getRecords({
76
- objectId: '6dc545ea-2e2f-4720-b4fe-c5ebdd8af066',
77
- query: {
78
- where: {
79
- account: this.account.id,
80
- },
81
- fields: ['t_subscriptions_name', 't_subscriptions_desc', 't_subscriptions_type', 't_subscriptions_active', 't_subscriptions_app'],
82
- relations: {
83
- t_subscriptions_app: {
84
- fields: [
85
- "t_apps_name",
86
- "t_apps_icon",
87
- "t_apps_url"
88
- ],
89
- relations: {},
90
- }
91
- }
92
- }
93
- })
94
- this.subscriptions = response.data.records;
160
+ await this.getAccountSettings();
161
+ this.loadSubscriptions();
95
162
  },
96
163
  methods: {
97
164
  close () {
98
165
  EventBus.$emit('ssoEvent', {name: 'toggleAuthModal', data: true})
99
166
  },
167
+ loadSubscriptions() {
168
+ // Extract subscriptions from account.billing
169
+ if (this.account.billing) {
170
+ const billing = this.account.billing;
171
+ const subs = [];
172
+
173
+ // Loop through billing object to find subscription objects
174
+ for (const key in billing) {
175
+ if (key !== 'region' && key !== 'currency' && key !== 'paymentProfiles' && typeof billing[key] === 'object' && billing[key].subscriptionId) {
176
+ subs.push(billing[key]);
177
+ }
178
+ }
179
+
180
+ this.subscriptions = subs;
181
+ }
182
+ },
183
+ formatCurrency(amount, currency) {
184
+ const currencySymbols = {
185
+ 'EUR': '€',
186
+ 'USD': '$',
187
+ 'GBP': '£'
188
+ };
189
+ const symbol = currencySymbols[currency?.toUpperCase()] || currency || '';
190
+ return `${symbol}${amount?.toFixed(2) || '0.00'}`;
191
+ },
192
+ formatInterval(interval) {
193
+ return interval ? `per ${interval}` : '';
194
+ },
195
+ formatDate(timestamp) {
196
+ if (!timestamp) return '';
197
+ const date = new Date(timestamp * 1000);
198
+ return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
199
+ },
200
+ getStatusText(status) {
201
+ const statusMap = {
202
+ 'trialing': 'Trial',
203
+ 'active': 'Active',
204
+ 'past_due': 'Past Due',
205
+ 'canceled': 'Canceled',
206
+ 'unpaid': 'Unpaid'
207
+ };
208
+ return statusMap[status] || status;
209
+ },
210
+ getStatusClass(status) {
211
+ return `status-${status}`;
212
+ },
213
+ openCancelModal(subscription) {
214
+ this.selectedSubscription = subscription;
215
+ this.showCancelModal = true;
216
+ this.cancelFeedback = '';
217
+ },
218
+ closeCancelModal() {
219
+ this.showCancelModal = false;
220
+ this.selectedSubscription = null;
221
+ this.cancelFeedback = '';
222
+ },
223
+ async confirmCancel() {
224
+ if (!this.selectedSubscription) return;
225
+
226
+ // Check if this is a RevenueCat in-app purchase subscription
227
+ if (this.selectedSubscription.paymentGateway === 'revenuecat') {
228
+ // Fire event to redirect user to RevenueCat management URL
229
+ EventBus.$emit('ssoEvent', {
230
+ name: 'subscriptionCancelled',
231
+ data: {
232
+ subscriptionId: this.selectedSubscription.subscriptionId,
233
+ paymentGateway: this.selectedSubscription.paymentGateway,
234
+ feedback: this.cancelFeedback
235
+ }
236
+ });
237
+
238
+ // Close the modal
239
+ this.closeCancelModal();
240
+ return;
241
+ }
242
+
243
+ // For other payment gateways (like Stripe), proceed with API cancellation
244
+ this.loading = true;
245
+
246
+ try {
247
+ // Send cancel request to backend
248
+ const response = await api(false, 'v2').post('checkout/cancel/' + this.selectedSubscription.subscriptionId, {
249
+ feedback: this.cancelFeedback
250
+ });
251
+
252
+ if (response.data.success) {
253
+ // Show success message
254
+ EventBus.$emit('showToast', {
255
+ type: 'success',
256
+ message: 'Subscription canceled successfully'
257
+ });
258
+
259
+ // Refresh account settings to get updated billing info
260
+ await this.getAccountSettings();
261
+ this.loadSubscriptions();
262
+
263
+ // Close modal
264
+ this.closeCancelModal();
265
+ } else {
266
+ throw new Error(response.data.message || 'Failed to cancel subscription');
267
+ }
268
+ } catch (error) {
269
+ console.error('Error canceling subscription:', error);
270
+ EventBus.$emit('showToast', {
271
+ type: 'error',
272
+ message: error.response?.data?.message || 'Failed to cancel subscription. Please try again.'
273
+ });
274
+ } finally {
275
+ this.loading = false;
276
+ }
277
+ }
100
278
  }
101
279
  };
102
280
  </script>
103
281
 
104
- <style scoped>
105
- .withBackground {
106
- height: 50px;
107
- }
282
+ <style>
283
+
108
284
  </style>