@progalaxyelabs/ngx-stonescriptphp-client 1.3.0 → 1.4.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
|
@@ -131,6 +131,24 @@ declare class MyEnvironmentModel {
|
|
|
131
131
|
* @default { mode: 'cookie', refreshEndpoint: '/auth/refresh', useCsrf: true }
|
|
132
132
|
*/
|
|
133
133
|
auth?: AuthConfig;
|
|
134
|
+
/**
|
|
135
|
+
* Branding configuration for auth components
|
|
136
|
+
* Allows platforms to customize login/register pages without creating wrappers
|
|
137
|
+
*/
|
|
138
|
+
branding?: {
|
|
139
|
+
/** Application name displayed on auth pages */
|
|
140
|
+
appName: string;
|
|
141
|
+
/** URL to logo image */
|
|
142
|
+
logo?: string;
|
|
143
|
+
/** Primary brand color (hex) */
|
|
144
|
+
primaryColor?: string;
|
|
145
|
+
/** Gradient start color (hex) */
|
|
146
|
+
gradientStart?: string;
|
|
147
|
+
/** Gradient end color (hex) */
|
|
148
|
+
gradientEnd?: string;
|
|
149
|
+
/** Subtitle text displayed on auth pages */
|
|
150
|
+
subtitle?: string;
|
|
151
|
+
};
|
|
134
152
|
}
|
|
135
153
|
|
|
136
154
|
/**
|
|
@@ -216,9 +234,22 @@ declare class AuthService {
|
|
|
216
234
|
private tokens;
|
|
217
235
|
private signinStatus;
|
|
218
236
|
private environment;
|
|
237
|
+
private readonly USER_STORAGE_KEY;
|
|
219
238
|
private userSubject;
|
|
220
239
|
user$: Observable<User | null>;
|
|
221
240
|
constructor(tokens: TokenService, signinStatus: SigninStatusService, environment: MyEnvironmentModel);
|
|
241
|
+
/**
|
|
242
|
+
* Restore user from localStorage
|
|
243
|
+
*/
|
|
244
|
+
private restoreUser;
|
|
245
|
+
/**
|
|
246
|
+
* Save user to localStorage
|
|
247
|
+
*/
|
|
248
|
+
private saveUser;
|
|
249
|
+
/**
|
|
250
|
+
* Update user subject and persist to localStorage
|
|
251
|
+
*/
|
|
252
|
+
private updateUser;
|
|
222
253
|
/**
|
|
223
254
|
* Login with email and password
|
|
224
255
|
*/
|
|
@@ -377,6 +408,27 @@ declare class AuthService {
|
|
|
377
408
|
* @deprecated Check if user exists by calling /api/auth/check-email endpoint
|
|
378
409
|
*/
|
|
379
410
|
getUserProfile(email: string): Promise<User | null>;
|
|
411
|
+
/**
|
|
412
|
+
* Check if user has completed onboarding (has a tenant)
|
|
413
|
+
*/
|
|
414
|
+
checkOnboardingStatus(identityId: string): Promise<{
|
|
415
|
+
onboarded: boolean;
|
|
416
|
+
tenant_slug?: string;
|
|
417
|
+
tenant_name?: string;
|
|
418
|
+
role?: string;
|
|
419
|
+
}>;
|
|
420
|
+
/**
|
|
421
|
+
* Complete tenant onboarding (create tenant with country + org name)
|
|
422
|
+
*/
|
|
423
|
+
completeTenantOnboarding(countryCode: string, tenantName: string): Promise<{
|
|
424
|
+
tenant: {
|
|
425
|
+
id: string;
|
|
426
|
+
slug: string;
|
|
427
|
+
name: string;
|
|
428
|
+
};
|
|
429
|
+
access_token: string;
|
|
430
|
+
refresh_token: string;
|
|
431
|
+
}>;
|
|
380
432
|
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
|
|
381
433
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
382
434
|
}
|
|
@@ -394,46 +446,6 @@ declare class NgxStoneScriptPhpClientModule {
|
|
|
394
446
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxStoneScriptPhpClientModule>;
|
|
395
447
|
}
|
|
396
448
|
|
|
397
|
-
declare class LoginDialogComponent implements OnInit {
|
|
398
|
-
private auth;
|
|
399
|
-
/**
|
|
400
|
-
* REQUIRED: Which authentication providers to show in this dialog
|
|
401
|
-
* @example ['google', 'linkedin', 'emailPassword']
|
|
402
|
-
*/
|
|
403
|
-
providers: AuthProvider[];
|
|
404
|
-
email: string;
|
|
405
|
-
password: string;
|
|
406
|
-
error: string;
|
|
407
|
-
loading: boolean;
|
|
408
|
-
oauthProviders: AuthProvider[];
|
|
409
|
-
constructor(auth: AuthService);
|
|
410
|
-
ngOnInit(): void;
|
|
411
|
-
isProviderEnabled(provider: AuthProvider): boolean;
|
|
412
|
-
getProviderLabel(provider: AuthProvider): string;
|
|
413
|
-
getProviderIcon(provider: AuthProvider): string | undefined;
|
|
414
|
-
onEmailLogin(): Promise<void>;
|
|
415
|
-
onOAuthLogin(provider: AuthProvider): Promise<void>;
|
|
416
|
-
onRegisterClick(event: Event): void;
|
|
417
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LoginDialogComponent, never>;
|
|
418
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LoginDialogComponent, "lib-login-dialog", never, { "providers": { "alias": "providers"; "required": false; }; }, {}, never, never, true, never>;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
declare class RegisterComponent {
|
|
422
|
-
private auth;
|
|
423
|
-
displayName: string;
|
|
424
|
-
email: string;
|
|
425
|
-
password: string;
|
|
426
|
-
confirmPassword: string;
|
|
427
|
-
error: string;
|
|
428
|
-
success: string;
|
|
429
|
-
loading: boolean;
|
|
430
|
-
constructor(auth: AuthService);
|
|
431
|
-
onRegister(): Promise<void>;
|
|
432
|
-
onLoginClick(event: Event): void;
|
|
433
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RegisterComponent, never>;
|
|
434
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RegisterComponent, "lib-register", never, {}, {}, never, never, true, never>;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
449
|
interface TenantMembership {
|
|
438
450
|
tenant_id: string;
|
|
439
451
|
slug: string;
|
|
@@ -453,6 +465,7 @@ declare class TenantLoginComponent implements OnInit {
|
|
|
453
465
|
providers: AuthProvider[];
|
|
454
466
|
showTenantSelector: boolean;
|
|
455
467
|
autoSelectSingleTenant: boolean;
|
|
468
|
+
prefillEmail?: string;
|
|
456
469
|
allowTenantCreation: boolean;
|
|
457
470
|
tenantSelectorTitle: string;
|
|
458
471
|
tenantSelectorDescription: string;
|
|
@@ -467,6 +480,7 @@ declare class TenantLoginComponent implements OnInit {
|
|
|
467
480
|
password: string;
|
|
468
481
|
error: string;
|
|
469
482
|
loading: boolean;
|
|
483
|
+
showPassword: boolean;
|
|
470
484
|
useOAuth: boolean;
|
|
471
485
|
oauthProviders: AuthProvider[];
|
|
472
486
|
showingTenantSelector: boolean;
|
|
@@ -489,7 +503,78 @@ declare class TenantLoginComponent implements OnInit {
|
|
|
489
503
|
formatLastAccessed(dateStr: string): string;
|
|
490
504
|
onCreateTenantClick(event: Event): void;
|
|
491
505
|
static ɵfac: i0.ɵɵFactoryDeclaration<TenantLoginComponent, never>;
|
|
492
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TenantLoginComponent, "lib-tenant-login", never, { "title": { "alias": "title"; "required": false; }; "providers": { "alias": "providers"; "required": false; }; "showTenantSelector": { "alias": "showTenantSelector"; "required": false; }; "autoSelectSingleTenant": { "alias": "autoSelectSingleTenant"; "required": false; }; "allowTenantCreation": { "alias": "allowTenantCreation"; "required": false; }; "tenantSelectorTitle": { "alias": "tenantSelectorTitle"; "required": false; }; "tenantSelectorDescription": { "alias": "tenantSelectorDescription"; "required": false; }; "continueButtonText": { "alias": "continueButtonText"; "required": false; }; "registerLinkText": { "alias": "registerLinkText"; "required": false; }; "registerLinkAction": { "alias": "registerLinkAction"; "required": false; }; "createTenantLinkText": { "alias": "createTenantLinkText"; "required": false; }; "createTenantLinkAction": { "alias": "createTenantLinkAction"; "required": false; }; }, { "tenantSelected": "tenantSelected"; "createTenant": "createTenant"; }, never, never, true, never>;
|
|
506
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TenantLoginComponent, "lib-tenant-login", never, { "title": { "alias": "title"; "required": false; }; "providers": { "alias": "providers"; "required": false; }; "showTenantSelector": { "alias": "showTenantSelector"; "required": false; }; "autoSelectSingleTenant": { "alias": "autoSelectSingleTenant"; "required": false; }; "prefillEmail": { "alias": "prefillEmail"; "required": false; }; "allowTenantCreation": { "alias": "allowTenantCreation"; "required": false; }; "tenantSelectorTitle": { "alias": "tenantSelectorTitle"; "required": false; }; "tenantSelectorDescription": { "alias": "tenantSelectorDescription"; "required": false; }; "continueButtonText": { "alias": "continueButtonText"; "required": false; }; "registerLinkText": { "alias": "registerLinkText"; "required": false; }; "registerLinkAction": { "alias": "registerLinkAction"; "required": false; }; "createTenantLinkText": { "alias": "createTenantLinkText"; "required": false; }; "createTenantLinkAction": { "alias": "createTenantLinkAction"; "required": false; }; }, { "tenantSelected": "tenantSelected"; "createTenant": "createTenant"; }, never, never, true, never>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
declare class AuthPageComponent implements OnInit {
|
|
510
|
+
private environment;
|
|
511
|
+
providers: AuthProvider[];
|
|
512
|
+
authenticated: EventEmitter<TenantSelectedEvent>;
|
|
513
|
+
mode: 'login' | 'register';
|
|
514
|
+
appName: string;
|
|
515
|
+
logo?: string;
|
|
516
|
+
subtitle?: string;
|
|
517
|
+
gradientStyle: string;
|
|
518
|
+
constructor(environment: MyEnvironmentModel);
|
|
519
|
+
ngOnInit(): void;
|
|
520
|
+
onAuthenticated(event: TenantSelectedEvent): void;
|
|
521
|
+
/**
|
|
522
|
+
* Adjust color brightness (simple implementation)
|
|
523
|
+
* @param color Hex color (e.g., '#667eea')
|
|
524
|
+
* @param percent Percentage to darken (negative) or lighten (positive)
|
|
525
|
+
*/
|
|
526
|
+
private adjustColor;
|
|
527
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthPageComponent, never>;
|
|
528
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AuthPageComponent, "lib-auth-page", never, { "providers": { "alias": "providers"; "required": false; }; }, { "authenticated": "authenticated"; }, never, never, true, never>;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
declare class LoginDialogComponent implements OnInit {
|
|
532
|
+
private auth;
|
|
533
|
+
/**
|
|
534
|
+
* REQUIRED: Which authentication providers to show in this dialog
|
|
535
|
+
* @example ['google', 'linkedin', 'emailPassword']
|
|
536
|
+
*/
|
|
537
|
+
providers: AuthProvider[];
|
|
538
|
+
email: string;
|
|
539
|
+
password: string;
|
|
540
|
+
error: string;
|
|
541
|
+
loading: boolean;
|
|
542
|
+
showPassword: boolean;
|
|
543
|
+
oauthProviders: AuthProvider[];
|
|
544
|
+
constructor(auth: AuthService);
|
|
545
|
+
ngOnInit(): void;
|
|
546
|
+
isProviderEnabled(provider: AuthProvider): boolean;
|
|
547
|
+
getProviderLabel(provider: AuthProvider): string;
|
|
548
|
+
getProviderIcon(provider: AuthProvider): string | undefined;
|
|
549
|
+
onEmailLogin(): Promise<void>;
|
|
550
|
+
onOAuthLogin(provider: AuthProvider): Promise<void>;
|
|
551
|
+
onRegisterClick(event: Event): void;
|
|
552
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginDialogComponent, never>;
|
|
553
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoginDialogComponent, "lib-login-dialog", never, { "providers": { "alias": "providers"; "required": false; }; }, {}, never, never, true, never>;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
declare class RegisterComponent {
|
|
557
|
+
private auth;
|
|
558
|
+
private environment;
|
|
559
|
+
navigateToLogin: EventEmitter<string>;
|
|
560
|
+
displayName: string;
|
|
561
|
+
email: string;
|
|
562
|
+
password: string;
|
|
563
|
+
confirmPassword: string;
|
|
564
|
+
error: string;
|
|
565
|
+
success: string;
|
|
566
|
+
loading: boolean;
|
|
567
|
+
showAccountLinkPrompt: boolean;
|
|
568
|
+
existingEmail: string;
|
|
569
|
+
showPassword: boolean;
|
|
570
|
+
showConfirmPassword: boolean;
|
|
571
|
+
constructor(auth: AuthService, environment: MyEnvironmentModel);
|
|
572
|
+
onRegister(): Promise<void>;
|
|
573
|
+
onLoginClick(event: Event): void;
|
|
574
|
+
linkExistingAccount(): void;
|
|
575
|
+
cancelLinking(): void;
|
|
576
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RegisterComponent, never>;
|
|
577
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RegisterComponent, "lib-register", never, {}, { "navigateToLogin": "navigateToLogin"; }, never, never, true, never>;
|
|
493
578
|
}
|
|
494
579
|
|
|
495
580
|
interface TenantCreatedEvent {
|
|
@@ -540,6 +625,8 @@ declare class TenantRegisterComponent implements OnInit {
|
|
|
540
625
|
slugError: string;
|
|
541
626
|
useEmailPassword: boolean;
|
|
542
627
|
oauthProviders: AuthProvider[];
|
|
628
|
+
showPassword: boolean;
|
|
629
|
+
showConfirmPassword: boolean;
|
|
543
630
|
constructor(auth: AuthService);
|
|
544
631
|
ngOnInit(): void;
|
|
545
632
|
isProviderEnabled(provider: AuthProvider): boolean;
|
|
@@ -632,5 +719,5 @@ declare class TenantRegisterDialogComponent {
|
|
|
632
719
|
static ɵcmp: i0.ɵɵComponentDeclaration<TenantRegisterDialogComponent, "lib-tenant-register-dialog", never, {}, {}, never, never, true, never>;
|
|
633
720
|
}
|
|
634
721
|
|
|
635
|
-
export { ApiConnectionService, ApiResponse, AuthService, CsrfService, DbService, LoginDialogComponent, MyEnvironmentModel, NgxStoneScriptPhpClientModule, RegisterComponent, SigninStatusService, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus };
|
|
722
|
+
export { ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, LoginDialogComponent, MyEnvironmentModel, NgxStoneScriptPhpClientModule, RegisterComponent, SigninStatusService, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus };
|
|
636
723
|
export type { AuthConfig, AuthMode, AuthProvider, AuthResult, TenantCreatedEvent, TenantMembership, TenantSelectedEvent, User };
|