@authon/js 0.5.0 → 0.6.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.
- package/dist/index.cjs +869 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +196 -1
- package/dist/index.d.ts +196 -1
- package/dist/index.js +868 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare class Authon {
|
|
|
32
32
|
private config;
|
|
33
33
|
private session;
|
|
34
34
|
private modal;
|
|
35
|
+
private profile;
|
|
35
36
|
private listeners;
|
|
36
37
|
private branding;
|
|
37
38
|
private providers;
|
|
@@ -43,6 +44,8 @@ declare class Authon {
|
|
|
43
44
|
getProviders(): Promise<OAuthProviderType[]>;
|
|
44
45
|
openSignIn(): Promise<void>;
|
|
45
46
|
openSignUp(): Promise<void>;
|
|
47
|
+
openProfile(): Promise<void>;
|
|
48
|
+
closeProfile(): void;
|
|
46
49
|
/** Update theme at runtime without destroying form state */
|
|
47
50
|
setTheme(theme: 'light' | 'dark' | 'auto'): void;
|
|
48
51
|
signInWithOAuth(provider: OAuthProviderType, options?: OAuthSignInOptions): Promise<void>;
|
|
@@ -176,6 +179,12 @@ declare const translations: {
|
|
|
176
179
|
readonly passkey: "Sign in with Passkey";
|
|
177
180
|
readonly securedBy: "Secured by";
|
|
178
181
|
readonly backToSignIn: "Back to sign in";
|
|
182
|
+
readonly profile: "Profile";
|
|
183
|
+
readonly editProfile: "Edit Profile";
|
|
184
|
+
readonly displayName: "Display Name";
|
|
185
|
+
readonly save: "Save";
|
|
186
|
+
readonly signOut: "Sign Out";
|
|
187
|
+
readonly sessions: "Active Sessions";
|
|
179
188
|
};
|
|
180
189
|
readonly ko: {
|
|
181
190
|
readonly welcomeBack: "다시 오신 걸 환영합니다";
|
|
@@ -194,6 +203,12 @@ declare const translations: {
|
|
|
194
203
|
readonly passkey: "패스키로 로그인";
|
|
195
204
|
readonly securedBy: "보안 제공";
|
|
196
205
|
readonly backToSignIn: "로그인으로 돌아가기";
|
|
206
|
+
readonly profile: "프로필";
|
|
207
|
+
readonly editProfile: "프로필 편집";
|
|
208
|
+
readonly displayName: "표시 이름";
|
|
209
|
+
readonly save: "저장";
|
|
210
|
+
readonly signOut: "로그아웃";
|
|
211
|
+
readonly sessions: "활성 세션";
|
|
197
212
|
};
|
|
198
213
|
readonly ja: {
|
|
199
214
|
readonly welcomeBack: "おかえりなさい";
|
|
@@ -212,6 +227,12 @@ declare const translations: {
|
|
|
212
227
|
readonly passkey: "パスキーでログイン";
|
|
213
228
|
readonly securedBy: "セキュリティ提供";
|
|
214
229
|
readonly backToSignIn: "ログインに戻る";
|
|
230
|
+
readonly profile: "プロフィール";
|
|
231
|
+
readonly editProfile: "プロフィール編集";
|
|
232
|
+
readonly displayName: "表示名";
|
|
233
|
+
readonly save: "保存";
|
|
234
|
+
readonly signOut: "サインアウト";
|
|
235
|
+
readonly sessions: "アクティブセッション";
|
|
215
236
|
};
|
|
216
237
|
readonly 'zh-CN': {
|
|
217
238
|
readonly welcomeBack: "欢迎回来";
|
|
@@ -230,6 +251,12 @@ declare const translations: {
|
|
|
230
251
|
readonly passkey: "使用通行密钥登录";
|
|
231
252
|
readonly securedBy: "安全保障";
|
|
232
253
|
readonly backToSignIn: "返回登录";
|
|
254
|
+
readonly profile: "个人资料";
|
|
255
|
+
readonly editProfile: "编辑资料";
|
|
256
|
+
readonly displayName: "显示名称";
|
|
257
|
+
readonly save: "保存";
|
|
258
|
+
readonly signOut: "退出登录";
|
|
259
|
+
readonly sessions: "活跃会话";
|
|
233
260
|
};
|
|
234
261
|
readonly 'zh-TW': {
|
|
235
262
|
readonly welcomeBack: "歡迎回來";
|
|
@@ -248,6 +275,12 @@ declare const translations: {
|
|
|
248
275
|
readonly passkey: "使用通行金鑰登入";
|
|
249
276
|
readonly securedBy: "安全保障";
|
|
250
277
|
readonly backToSignIn: "返回登入";
|
|
278
|
+
readonly profile: "個人資料";
|
|
279
|
+
readonly editProfile: "編輯資料";
|
|
280
|
+
readonly displayName: "顯示名稱";
|
|
281
|
+
readonly save: "儲存";
|
|
282
|
+
readonly signOut: "登出";
|
|
283
|
+
readonly sessions: "活躍工作階段";
|
|
251
284
|
};
|
|
252
285
|
readonly 'pt-BR': {
|
|
253
286
|
readonly welcomeBack: "Bem-vindo de volta";
|
|
@@ -266,6 +299,12 @@ declare const translations: {
|
|
|
266
299
|
readonly passkey: "Entrar com Passkey";
|
|
267
300
|
readonly securedBy: "Protegido por";
|
|
268
301
|
readonly backToSignIn: "Voltar ao login";
|
|
302
|
+
readonly profile: "Perfil";
|
|
303
|
+
readonly editProfile: "Editar perfil";
|
|
304
|
+
readonly displayName: "Nome de exibicao";
|
|
305
|
+
readonly save: "Salvar";
|
|
306
|
+
readonly signOut: "Sair";
|
|
307
|
+
readonly sessions: "Sessoes ativas";
|
|
269
308
|
};
|
|
270
309
|
readonly es: {
|
|
271
310
|
readonly welcomeBack: "Bienvenido de nuevo";
|
|
@@ -284,6 +323,12 @@ declare const translations: {
|
|
|
284
323
|
readonly passkey: "Iniciar con Passkey";
|
|
285
324
|
readonly securedBy: "Protegido por";
|
|
286
325
|
readonly backToSignIn: "Volver al inicio de sesion";
|
|
326
|
+
readonly profile: "Perfil";
|
|
327
|
+
readonly editProfile: "Editar perfil";
|
|
328
|
+
readonly displayName: "Nombre de visualizacion";
|
|
329
|
+
readonly save: "Guardar";
|
|
330
|
+
readonly signOut: "Cerrar sesion";
|
|
331
|
+
readonly sessions: "Sesiones activas";
|
|
287
332
|
};
|
|
288
333
|
readonly de: {
|
|
289
334
|
readonly welcomeBack: "Willkommen zuruck";
|
|
@@ -302,6 +347,12 @@ declare const translations: {
|
|
|
302
347
|
readonly passkey: "Mit Passkey anmelden";
|
|
303
348
|
readonly securedBy: "Gesichert durch";
|
|
304
349
|
readonly backToSignIn: "Zuruck zur Anmeldung";
|
|
350
|
+
readonly profile: "Profil";
|
|
351
|
+
readonly editProfile: "Profil bearbeiten";
|
|
352
|
+
readonly displayName: "Anzeigename";
|
|
353
|
+
readonly save: "Speichern";
|
|
354
|
+
readonly signOut: "Abmelden";
|
|
355
|
+
readonly sessions: "Aktive Sitzungen";
|
|
305
356
|
};
|
|
306
357
|
readonly fr: {
|
|
307
358
|
readonly welcomeBack: "Bon retour";
|
|
@@ -320,6 +371,12 @@ declare const translations: {
|
|
|
320
371
|
readonly passkey: "Se connecter avec Passkey";
|
|
321
372
|
readonly securedBy: "Securise par";
|
|
322
373
|
readonly backToSignIn: "Retour a la connexion";
|
|
374
|
+
readonly profile: "Profil";
|
|
375
|
+
readonly editProfile: "Modifier le profil";
|
|
376
|
+
readonly displayName: "Nom d'affichage";
|
|
377
|
+
readonly save: "Enregistrer";
|
|
378
|
+
readonly signOut: "Se deconnecter";
|
|
379
|
+
readonly sessions: "Sessions actives";
|
|
323
380
|
};
|
|
324
381
|
readonly hi: {
|
|
325
382
|
readonly welcomeBack: "वापसी पर स्वागत है";
|
|
@@ -338,6 +395,12 @@ declare const translations: {
|
|
|
338
395
|
readonly passkey: "पासकी से साइन इन";
|
|
339
396
|
readonly securedBy: "सुरक्षा प्रदाता";
|
|
340
397
|
readonly backToSignIn: "साइन इन पर वापस जाएं";
|
|
398
|
+
readonly profile: "प्रोफ़ाइल";
|
|
399
|
+
readonly editProfile: "प्रोफ़ाइल संपादित करें";
|
|
400
|
+
readonly displayName: "प्रदर्शन नाम";
|
|
401
|
+
readonly save: "सहेजें";
|
|
402
|
+
readonly signOut: "साइन आउट";
|
|
403
|
+
readonly sessions: "सक्रिय सत्र";
|
|
341
404
|
};
|
|
342
405
|
readonly tr: {
|
|
343
406
|
readonly welcomeBack: "Tekrar hos geldiniz";
|
|
@@ -356,6 +419,12 @@ declare const translations: {
|
|
|
356
419
|
readonly passkey: "Passkey ile giris yap";
|
|
357
420
|
readonly securedBy: "Guvenlik saglayici";
|
|
358
421
|
readonly backToSignIn: "Girise don";
|
|
422
|
+
readonly profile: "Profil";
|
|
423
|
+
readonly editProfile: "Profili duzenle";
|
|
424
|
+
readonly displayName: "Goruntu adi";
|
|
425
|
+
readonly save: "Kaydet";
|
|
426
|
+
readonly signOut: "Cikis yap";
|
|
427
|
+
readonly sessions: "Aktif oturumlar";
|
|
359
428
|
};
|
|
360
429
|
readonly id: {
|
|
361
430
|
readonly welcomeBack: "Selamat datang kembali";
|
|
@@ -374,6 +443,12 @@ declare const translations: {
|
|
|
374
443
|
readonly passkey: "Masuk dengan Passkey";
|
|
375
444
|
readonly securedBy: "Diamankan oleh";
|
|
376
445
|
readonly backToSignIn: "Kembali ke login";
|
|
446
|
+
readonly profile: "Profil";
|
|
447
|
+
readonly editProfile: "Edit profil";
|
|
448
|
+
readonly displayName: "Nama tampilan";
|
|
449
|
+
readonly save: "Simpan";
|
|
450
|
+
readonly signOut: "Keluar";
|
|
451
|
+
readonly sessions: "Sesi aktif";
|
|
377
452
|
};
|
|
378
453
|
readonly vi: {
|
|
379
454
|
readonly welcomeBack: "Chao mung tro lai";
|
|
@@ -392,6 +467,12 @@ declare const translations: {
|
|
|
392
467
|
readonly passkey: "Dang nhap voi Passkey";
|
|
393
468
|
readonly securedBy: "Bao mat boi";
|
|
394
469
|
readonly backToSignIn: "Quay lai dang nhap";
|
|
470
|
+
readonly profile: "Ho so";
|
|
471
|
+
readonly editProfile: "Chinh sua ho so";
|
|
472
|
+
readonly displayName: "Ten hien thi";
|
|
473
|
+
readonly save: "Luu";
|
|
474
|
+
readonly signOut: "Dang xuat";
|
|
475
|
+
readonly sessions: "Phien dang nhap hoat dong";
|
|
395
476
|
};
|
|
396
477
|
readonly th: {
|
|
397
478
|
readonly welcomeBack: "ยินดีต้อนรับกลับ";
|
|
@@ -410,6 +491,12 @@ declare const translations: {
|
|
|
410
491
|
readonly passkey: "เข้าสู่ระบบด้วย Passkey";
|
|
411
492
|
readonly securedBy: "รักษาความปลอดภัยโดย";
|
|
412
493
|
readonly backToSignIn: "กลับไปเข้าสู่ระบบ";
|
|
494
|
+
readonly profile: "โปรไฟล์";
|
|
495
|
+
readonly editProfile: "แก้ไขโปรไฟล์";
|
|
496
|
+
readonly displayName: "ชื่อที่แสดง";
|
|
497
|
+
readonly save: "บันทึก";
|
|
498
|
+
readonly signOut: "ออกจากระบบ";
|
|
499
|
+
readonly sessions: "เซสชันที่ใช้งานอยู่";
|
|
413
500
|
};
|
|
414
501
|
readonly ru: {
|
|
415
502
|
readonly welcomeBack: "С возвращением";
|
|
@@ -428,6 +515,12 @@ declare const translations: {
|
|
|
428
515
|
readonly passkey: "Войти с Passkey";
|
|
429
516
|
readonly securedBy: "Защищено";
|
|
430
517
|
readonly backToSignIn: "Вернуться к входу";
|
|
518
|
+
readonly profile: "Профиль";
|
|
519
|
+
readonly editProfile: "Редактировать профиль";
|
|
520
|
+
readonly displayName: "Отображаемое имя";
|
|
521
|
+
readonly save: "Сохранить";
|
|
522
|
+
readonly signOut: "Выйти";
|
|
523
|
+
readonly sessions: "Активные сеансы";
|
|
431
524
|
};
|
|
432
525
|
readonly it: {
|
|
433
526
|
readonly welcomeBack: "Bentornato";
|
|
@@ -446,6 +539,12 @@ declare const translations: {
|
|
|
446
539
|
readonly passkey: "Accedi con Passkey";
|
|
447
540
|
readonly securedBy: "Protetto da";
|
|
448
541
|
readonly backToSignIn: "Torna all'accesso";
|
|
542
|
+
readonly profile: "Profilo";
|
|
543
|
+
readonly editProfile: "Modifica profilo";
|
|
544
|
+
readonly displayName: "Nome visualizzato";
|
|
545
|
+
readonly save: "Salva";
|
|
546
|
+
readonly signOut: "Esci";
|
|
547
|
+
readonly sessions: "Sessioni attive";
|
|
449
548
|
};
|
|
450
549
|
readonly pl: {
|
|
451
550
|
readonly welcomeBack: "Witaj ponownie";
|
|
@@ -464,6 +563,12 @@ declare const translations: {
|
|
|
464
563
|
readonly passkey: "Zaloguj sie z Passkey";
|
|
465
564
|
readonly securedBy: "Zabezpieczone przez";
|
|
466
565
|
readonly backToSignIn: "Powrot do logowania";
|
|
566
|
+
readonly profile: "Profil";
|
|
567
|
+
readonly editProfile: "Edytuj profil";
|
|
568
|
+
readonly displayName: "Nazwa wyswietlana";
|
|
569
|
+
readonly save: "Zapisz";
|
|
570
|
+
readonly signOut: "Wyloguj sie";
|
|
571
|
+
readonly sessions: "Aktywne sesje";
|
|
467
572
|
};
|
|
468
573
|
readonly nl: {
|
|
469
574
|
readonly welcomeBack: "Welkom terug";
|
|
@@ -482,6 +587,12 @@ declare const translations: {
|
|
|
482
587
|
readonly passkey: "Inloggen met Passkey";
|
|
483
588
|
readonly securedBy: "Beveiligd door";
|
|
484
589
|
readonly backToSignIn: "Terug naar inloggen";
|
|
590
|
+
readonly profile: "Profiel";
|
|
591
|
+
readonly editProfile: "Profiel bewerken";
|
|
592
|
+
readonly displayName: "Weergavenaam";
|
|
593
|
+
readonly save: "Opslaan";
|
|
594
|
+
readonly signOut: "Uitloggen";
|
|
595
|
+
readonly sessions: "Actieve sessies";
|
|
485
596
|
};
|
|
486
597
|
readonly ar: {
|
|
487
598
|
readonly welcomeBack: "مرحبًا بعودتك";
|
|
@@ -500,6 +611,12 @@ declare const translations: {
|
|
|
500
611
|
readonly passkey: "تسجيل الدخول باستخدام Passkey";
|
|
501
612
|
readonly securedBy: "محمي بواسطة";
|
|
502
613
|
readonly backToSignIn: "العودة لتسجيل الدخول";
|
|
614
|
+
readonly profile: "الملف الشخصي";
|
|
615
|
+
readonly editProfile: "تعديل الملف الشخصي";
|
|
616
|
+
readonly displayName: "الاسم المعروض";
|
|
617
|
+
readonly save: "حفظ";
|
|
618
|
+
readonly signOut: "تسجيل الخروج";
|
|
619
|
+
readonly sessions: "الجلسات النشطة";
|
|
503
620
|
};
|
|
504
621
|
readonly sv: {
|
|
505
622
|
readonly welcomeBack: "Valkommen tillbaka";
|
|
@@ -518,6 +635,12 @@ declare const translations: {
|
|
|
518
635
|
readonly passkey: "Logga in med Passkey";
|
|
519
636
|
readonly securedBy: "Sakrad av";
|
|
520
637
|
readonly backToSignIn: "Tillbaka till inloggning";
|
|
638
|
+
readonly profile: "Profil";
|
|
639
|
+
readonly editProfile: "Redigera profil";
|
|
640
|
+
readonly displayName: "Visningsnamn";
|
|
641
|
+
readonly save: "Spara";
|
|
642
|
+
readonly signOut: "Logga ut";
|
|
643
|
+
readonly sessions: "Aktiva sessioner";
|
|
521
644
|
};
|
|
522
645
|
readonly uk: {
|
|
523
646
|
readonly welcomeBack: "З поверненням";
|
|
@@ -536,6 +659,12 @@ declare const translations: {
|
|
|
536
659
|
readonly passkey: "Увійти з Passkey";
|
|
537
660
|
readonly securedBy: "Захищено";
|
|
538
661
|
readonly backToSignIn: "Повернутися до входу";
|
|
662
|
+
readonly profile: "Профіль";
|
|
663
|
+
readonly editProfile: "Редагувати профіль";
|
|
664
|
+
readonly displayName: "Відображуване ім'я";
|
|
665
|
+
readonly save: "Зберегти";
|
|
666
|
+
readonly signOut: "Вийти";
|
|
667
|
+
readonly sessions: "Активні сеанси";
|
|
539
668
|
};
|
|
540
669
|
};
|
|
541
670
|
interface TranslationStrings {
|
|
@@ -555,7 +684,73 @@ interface TranslationStrings {
|
|
|
555
684
|
passkey: string;
|
|
556
685
|
securedBy: string;
|
|
557
686
|
backToSignIn: string;
|
|
687
|
+
profile: string;
|
|
688
|
+
editProfile: string;
|
|
689
|
+
displayName: string;
|
|
690
|
+
save: string;
|
|
691
|
+
signOut: string;
|
|
692
|
+
sessions: string;
|
|
558
693
|
}
|
|
559
694
|
declare function getStrings(locale: string): TranslationStrings;
|
|
560
695
|
|
|
561
|
-
|
|
696
|
+
declare class ProfileRenderer {
|
|
697
|
+
private shadowRoot;
|
|
698
|
+
private hostElement;
|
|
699
|
+
private containerElement;
|
|
700
|
+
private containerId;
|
|
701
|
+
private mode;
|
|
702
|
+
private theme;
|
|
703
|
+
private branding;
|
|
704
|
+
private themeObserver;
|
|
705
|
+
private mediaQueryListener;
|
|
706
|
+
private t;
|
|
707
|
+
private user;
|
|
708
|
+
private sessions;
|
|
709
|
+
private isEditMode;
|
|
710
|
+
private onSave;
|
|
711
|
+
private onSignOut;
|
|
712
|
+
private onRevokeSession;
|
|
713
|
+
private onClose;
|
|
714
|
+
private escHandler;
|
|
715
|
+
constructor(options: {
|
|
716
|
+
mode: 'popup' | 'embedded';
|
|
717
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
718
|
+
containerId?: string;
|
|
719
|
+
branding?: BrandingConfig;
|
|
720
|
+
locale?: string;
|
|
721
|
+
user: AuthonUser;
|
|
722
|
+
sessions?: SessionInfo[];
|
|
723
|
+
onSave: (data: {
|
|
724
|
+
displayName?: string;
|
|
725
|
+
avatarUrl?: string;
|
|
726
|
+
}) => Promise<void>;
|
|
727
|
+
onSignOut: () => Promise<void>;
|
|
728
|
+
onRevokeSession: (sessionId: string) => Promise<void>;
|
|
729
|
+
onClose: () => void;
|
|
730
|
+
});
|
|
731
|
+
private resolveContainerElement;
|
|
732
|
+
open(): void;
|
|
733
|
+
close(): void;
|
|
734
|
+
updateUser(user: AuthonUser): void;
|
|
735
|
+
updateSessions(sessions: SessionInfo[]): void;
|
|
736
|
+
setTheme(theme: 'light' | 'dark' | 'auto'): void;
|
|
737
|
+
showSaving(): void;
|
|
738
|
+
showSaveError(message: string): void;
|
|
739
|
+
private showInlineError;
|
|
740
|
+
private updateThemeCSS;
|
|
741
|
+
private startThemeObserver;
|
|
742
|
+
private stopThemeObserver;
|
|
743
|
+
private isDark;
|
|
744
|
+
private render;
|
|
745
|
+
private rerender;
|
|
746
|
+
private buildShell;
|
|
747
|
+
private buildInnerContent;
|
|
748
|
+
private buildViewContent;
|
|
749
|
+
private buildEditContent;
|
|
750
|
+
private buildCSS;
|
|
751
|
+
private attachEvents;
|
|
752
|
+
private attachBackdropEvent;
|
|
753
|
+
private attachInnerEvents;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export { Authon, type AuthonConfig, type AuthonEventType, type AuthonEvents, type AuthonLocale, AuthonMfaRequiredError, type OAuthFlowMode, type OAuthSignInOptions, ProfileRenderer, type ProviderButtonConfig, type TranslationStrings, generateQrSvg, getProviderButtonConfig, getStrings, translations };
|