@progalaxyelabs/ngx-stonescriptphp-client 1.22.1 → 1.23.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/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, EnvironmentProviders, OnInit, EventEmitter } from '@angular/core';
|
|
2
|
+
import { InjectionToken, EnvironmentProviders, OnInit, OnDestroy, QueryList, ElementRef, EventEmitter } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
type AuthMode = 'cookie' | 'body' | 'none';
|
|
@@ -196,10 +196,22 @@ interface User {
|
|
|
196
196
|
user_id?: number;
|
|
197
197
|
id?: string;
|
|
198
198
|
email: string;
|
|
199
|
+
phone?: string;
|
|
199
200
|
display_name: string;
|
|
200
201
|
photo_url?: string;
|
|
201
202
|
is_email_verified: boolean;
|
|
202
203
|
}
|
|
204
|
+
interface OtpSendResponse {
|
|
205
|
+
success: boolean;
|
|
206
|
+
identifier_type: 'email' | 'phone';
|
|
207
|
+
masked_identifier: string;
|
|
208
|
+
expires_in: number;
|
|
209
|
+
resend_after: number;
|
|
210
|
+
}
|
|
211
|
+
interface OtpVerifyResponse {
|
|
212
|
+
success: boolean;
|
|
213
|
+
verified_token: string;
|
|
214
|
+
}
|
|
203
215
|
interface AuthResult {
|
|
204
216
|
success: boolean;
|
|
205
217
|
message?: string;
|
|
@@ -304,6 +316,14 @@ interface AuthPlugin {
|
|
|
304
316
|
exists: boolean;
|
|
305
317
|
user?: any;
|
|
306
318
|
}>;
|
|
319
|
+
/** Send OTP to email or phone identifier */
|
|
320
|
+
sendOtp?(identifier: string): Promise<OtpSendResponse>;
|
|
321
|
+
/** Verify OTP code and receive a verified_token */
|
|
322
|
+
verifyOtp?(identifier: string, code: string): Promise<OtpVerifyResponse>;
|
|
323
|
+
/** Login with a verified_token (obtained from verifyOtp) */
|
|
324
|
+
identityLogin?(verifiedToken: string): Promise<AuthResult>;
|
|
325
|
+
/** Register a new identity with a verified_token (for new users) */
|
|
326
|
+
identityRegister?(verifiedToken: string, displayName: string): Promise<AuthResult>;
|
|
307
327
|
switchServer?(serverName: string): void;
|
|
308
328
|
getAvailableServers?(): string[];
|
|
309
329
|
getActiveServer?(): string | null;
|
|
@@ -458,6 +478,10 @@ declare class ProgalaxyElabsAuth implements AuthPlugin {
|
|
|
458
478
|
exists: boolean;
|
|
459
479
|
user?: any;
|
|
460
480
|
}>;
|
|
481
|
+
sendOtp(identifier: string): Promise<OtpSendResponse>;
|
|
482
|
+
verifyOtp(identifier: string, code: string): Promise<OtpVerifyResponse>;
|
|
483
|
+
identityLogin(verifiedToken: string): Promise<AuthResult>;
|
|
484
|
+
identityRegister(verifiedToken: string, displayName: string): Promise<AuthResult>;
|
|
461
485
|
loginWithProvider(provider: string): Promise<AuthResult>;
|
|
462
486
|
private handleLoginResponse;
|
|
463
487
|
private toUser;
|
|
@@ -572,6 +596,10 @@ declare class AuthService {
|
|
|
572
596
|
refresh(): Promise<boolean>;
|
|
573
597
|
isAuthenticated(): boolean;
|
|
574
598
|
getCurrentUser(): User | null;
|
|
599
|
+
sendOtp(identifier: string): Promise<OtpSendResponse>;
|
|
600
|
+
verifyOtp(identifier: string, code: string): Promise<OtpVerifyResponse>;
|
|
601
|
+
identityLogin(verifiedToken: string): Promise<AuthResult>;
|
|
602
|
+
identityRegister(verifiedToken: string, displayName: string): Promise<AuthResult>;
|
|
575
603
|
getTenantMemberships(serverName?: string): Promise<{
|
|
576
604
|
memberships: TenantMembership[];
|
|
577
605
|
}>;
|
|
@@ -901,6 +929,7 @@ declare class ProviderRegistryService {
|
|
|
901
929
|
static ɵprov: i0.ɵɵInjectableDeclaration<ProviderRegistryService>;
|
|
902
930
|
}
|
|
903
931
|
|
|
932
|
+
type OtpStep = 'identifier' | 'code' | 'register';
|
|
904
933
|
interface TenantSelectedEvent {
|
|
905
934
|
tenantId: string;
|
|
906
935
|
tenantSlug: string;
|
|
@@ -912,13 +941,15 @@ interface OnboardingNeededEvent {
|
|
|
912
941
|
is_new_identity: boolean;
|
|
913
942
|
identity: {
|
|
914
943
|
email: string;
|
|
944
|
+
phone?: string;
|
|
915
945
|
display_name?: string;
|
|
916
946
|
picture?: string;
|
|
917
947
|
};
|
|
918
948
|
}
|
|
919
|
-
declare class TenantLoginComponent implements OnInit {
|
|
949
|
+
declare class TenantLoginComponent implements OnInit, OnDestroy {
|
|
920
950
|
private auth;
|
|
921
951
|
private providerRegistry;
|
|
952
|
+
otpInputs: QueryList<ElementRef<HTMLInputElement>>;
|
|
922
953
|
title: string;
|
|
923
954
|
providers: AuthProvider[];
|
|
924
955
|
showTenantSelector: boolean;
|
|
@@ -942,12 +973,26 @@ declare class TenantLoginComponent implements OnInit {
|
|
|
942
973
|
showPassword: boolean;
|
|
943
974
|
useOAuth: boolean;
|
|
944
975
|
oauthProviders: AuthProvider[];
|
|
976
|
+
effectiveOauthProviders: AuthProvider[];
|
|
977
|
+
otpActive: boolean;
|
|
978
|
+
otpStep: OtpStep;
|
|
979
|
+
otpIdentifier: string;
|
|
980
|
+
otpIdentifierHint: string;
|
|
981
|
+
otpNormalizedIdentifier: string;
|
|
982
|
+
otpMaskedIdentifier: string;
|
|
983
|
+
otpDigits: string[];
|
|
984
|
+
otpVerifiedToken: string;
|
|
985
|
+
otpDisplayName: string;
|
|
986
|
+
otpResendCountdown: number;
|
|
987
|
+
private otpResendTimer;
|
|
988
|
+
private isAndroidWebView;
|
|
945
989
|
showingTenantSelector: boolean;
|
|
946
990
|
memberships: TenantMembership[];
|
|
947
991
|
selectedTenantId: string | null;
|
|
948
992
|
userName: string;
|
|
949
993
|
constructor(auth: AuthService, providerRegistry: ProviderRegistryService);
|
|
950
994
|
ngOnInit(): void;
|
|
995
|
+
ngOnDestroy(): void;
|
|
951
996
|
isProviderEnabled(provider: AuthProvider): boolean;
|
|
952
997
|
getProviderLabel(provider: AuthProvider): string;
|
|
953
998
|
getProviderIcon(provider: AuthProvider): string | undefined;
|
|
@@ -960,6 +1005,27 @@ declare class TenantLoginComponent implements OnInit {
|
|
|
960
1005
|
selectTenantItem(tenantId: string): void;
|
|
961
1006
|
onContinueWithTenant(): Promise<void>;
|
|
962
1007
|
selectAndContinue(membership: TenantMembership): Promise<void>;
|
|
1008
|
+
/** Detect identifier type from input and show hint */
|
|
1009
|
+
onOtpIdentifierChange(): void;
|
|
1010
|
+
/** Send OTP to the entered identifier */
|
|
1011
|
+
onOtpSend(): Promise<void>;
|
|
1012
|
+
/** Verify the entered OTP code */
|
|
1013
|
+
onOtpVerify(): Promise<void>;
|
|
1014
|
+
/** Register a new identity after OTP verification */
|
|
1015
|
+
onOtpRegister(): Promise<void>;
|
|
1016
|
+
/** Resend the OTP */
|
|
1017
|
+
onOtpResend(event: Event): void;
|
|
1018
|
+
/** Go back to identifier entry */
|
|
1019
|
+
onOtpBack(event: Event): void;
|
|
1020
|
+
onOtpDigitInput(event: Event, index: number): void;
|
|
1021
|
+
onOtpDigitKeydown(event: KeyboardEvent, index: number): void;
|
|
1022
|
+
onOtpPaste(event: ClipboardEvent): void;
|
|
1023
|
+
get otpCode(): string;
|
|
1024
|
+
private detectIdentifierType;
|
|
1025
|
+
private focusOtpInput;
|
|
1026
|
+
private startResendCountdown;
|
|
1027
|
+
private clearResendTimer;
|
|
1028
|
+
formatCountdown(seconds: number): string;
|
|
963
1029
|
formatRole(role: string): string;
|
|
964
1030
|
formatLastAccessed(dateStr: string): string;
|
|
965
1031
|
onCreateTenantClick(event: Event): void;
|
|
@@ -1230,4 +1296,4 @@ declare class TenantRegisterDialogComponent {
|
|
|
1230
1296
|
}
|
|
1231
1297
|
|
|
1232
1298
|
export { AUTH_PLUGIN, ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, FilesService, LogService, LoginDialogComponent, MonthYearPickerComponent, MyEnvironmentModel, ProgalaxyElabsAuth, ProviderRegistryService, RegisterComponent, SigninStatusService, StoneScriptPHPAuth, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus, provideNgxStoneScriptPhpClient };
|
|
1233
|
-
export type { AuthConfig, AuthMode, AuthPlugin, AuthProvider, AuthResponseMap, AuthResult, AuthServerConfig, BuiltInProvider, FileDeleteResponse, FileListResponse, FileMetadata, FileUploadResponse, FileUploadResult, MonthYear, OAuthProviderConfig, OnboardingNeededEvent, ProgalaxyElabsAuthConfig, StoneScriptPHPAuthConfig, TenantCreatedEvent, TenantMembership, TenantRegisterRequestEvent, TenantSelectedEvent, User };
|
|
1299
|
+
export type { AuthConfig, AuthMode, AuthPlugin, AuthProvider, AuthResponseMap, AuthResult, AuthServerConfig, BuiltInProvider, FileDeleteResponse, FileListResponse, FileMetadata, FileUploadResponse, FileUploadResult, MonthYear, OAuthProviderConfig, OnboardingNeededEvent, OtpSendResponse, OtpStep, OtpVerifyResponse, ProgalaxyElabsAuthConfig, StoneScriptPHPAuthConfig, TenantCreatedEvent, TenantMembership, TenantRegisterRequestEvent, TenantSelectedEvent, User };
|