@edsis/angular 22.0.34 → 22.0.37
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/fesm2022/edsis-angular-block-shell.mjs +4 -4
- package/fesm2022/edsis-angular-block-shell.mjs.map +1 -1
- package/fesm2022/edsis-angular-module-auth.mjs +172 -31
- package/fesm2022/edsis-angular-module-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/edsis-angular-block-shell.d.ts +2 -2
- package/types/edsis-angular-module-auth.d.ts +55 -6
|
@@ -31,6 +31,10 @@ interface EdsisAuthMessages {
|
|
|
31
31
|
readonly oauthGoogleAria: string;
|
|
32
32
|
readonly oauthMicrosoftAria: string;
|
|
33
33
|
readonly oauthAppleAria: string;
|
|
34
|
+
readonly healthUnavailableTitle: string;
|
|
35
|
+
readonly healthUnavailableBody: string;
|
|
36
|
+
readonly healthRetry: string;
|
|
37
|
+
readonly healthChecking: string;
|
|
34
38
|
};
|
|
35
39
|
readonly logout: {
|
|
36
40
|
readonly title: string;
|
|
@@ -66,6 +70,18 @@ type EdsisAuthMessagesOverride = {
|
|
|
66
70
|
declare const EDSIS_AUTH_MESSAGES: InjectionToken<EdsisAuthMessages>;
|
|
67
71
|
declare function mergeEdsisAuthMessages(override?: EdsisAuthMessagesOverride): EdsisAuthMessages;
|
|
68
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Health-check backend auth di halaman login (opt-in).
|
|
75
|
+
* Sehat = HTTP 2xx dalam `timeoutMs`; body respons tidak diparse.
|
|
76
|
+
*/
|
|
77
|
+
interface EdsisAuthHealthCheckConfig {
|
|
78
|
+
/** Default `false` — tanpa flag, perilaku login tidak berubah. */
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
/** Default `${apiUrl}/health`. */
|
|
81
|
+
url?: string;
|
|
82
|
+
/** Default 4000. */
|
|
83
|
+
timeoutMs?: number;
|
|
84
|
+
}
|
|
69
85
|
interface EdsisAuthConfig {
|
|
70
86
|
apiUrl: string;
|
|
71
87
|
appUrl: string;
|
|
@@ -81,6 +97,12 @@ interface EdsisAuthConfig {
|
|
|
81
97
|
* `@edsis/theme/layout`), dijalankan setelah interceptor auth Edsis.
|
|
82
98
|
*/
|
|
83
99
|
httpInterceptors?: readonly HttpInterceptorFn[];
|
|
100
|
+
healthCheck?: EdsisAuthHealthCheckConfig;
|
|
101
|
+
}
|
|
102
|
+
interface ResolvedEdsisAuthHealthCheck {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
url: string;
|
|
105
|
+
timeoutMs: number;
|
|
84
106
|
}
|
|
85
107
|
interface ResolvedEdsisAuthConfig {
|
|
86
108
|
apiUrl: string;
|
|
@@ -90,6 +112,7 @@ interface ResolvedEdsisAuthConfig {
|
|
|
90
112
|
verifyPath: `/${string}`;
|
|
91
113
|
authenticatedHomePath: `/${string}`;
|
|
92
114
|
guestHomePath: `/${string}`;
|
|
115
|
+
healthCheck: ResolvedEdsisAuthHealthCheck;
|
|
93
116
|
}
|
|
94
117
|
declare const EDSIS_AUTH_CONFIG: InjectionToken<ResolvedEdsisAuthConfig>;
|
|
95
118
|
declare function resolveEdsisAuthConfig(config: EdsisAuthConfig): ResolvedEdsisAuthConfig;
|
|
@@ -111,12 +134,34 @@ declare class AuthShellPage {
|
|
|
111
134
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuthShellPage, "edsis-auth-shell-page", never, {}, {}, never, never, true, never>;
|
|
112
135
|
}
|
|
113
136
|
|
|
137
|
+
type AuthHealthStatus = 'idle' | 'checking' | 'healthy' | 'unhealthy';
|
|
138
|
+
/**
|
|
139
|
+
* Health-check backend auth untuk `AuthLoginPage` (internal, di-provide oleh
|
|
140
|
+
* `provideEdsisAuth`). Sehat = HTTP 2xx dalam `timeoutMs`; body tidak diparse.
|
|
141
|
+
* Tanpa polling — hanya on-load, pre-submit, dan Retry manual.
|
|
142
|
+
*/
|
|
143
|
+
declare class AuthHealthService {
|
|
144
|
+
private readonly http;
|
|
145
|
+
private readonly config;
|
|
146
|
+
private readonly _status;
|
|
147
|
+
readonly status: _angular_core.Signal<AuthHealthStatus>;
|
|
148
|
+
readonly isChecking: _angular_core.Signal<boolean>;
|
|
149
|
+
readonly isUnhealthy: _angular_core.Signal<boolean>;
|
|
150
|
+
private inFlight;
|
|
151
|
+
/** true jika sehat ATAU health-check dimatikan. Tak pernah throw. */
|
|
152
|
+
check(): Promise<boolean>;
|
|
153
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthHealthService, never>;
|
|
154
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuthHealthService>;
|
|
155
|
+
}
|
|
156
|
+
|
|
114
157
|
declare class AuthLoginPage {
|
|
115
158
|
private readonly destroyRef;
|
|
116
159
|
private readonly formBuilder;
|
|
160
|
+
private readonly injector;
|
|
117
161
|
private readonly authMagicLinkService;
|
|
118
162
|
private readonly authConfig;
|
|
119
163
|
protected readonly messages: _edsis_angular_module_auth.EdsisAuthMessages;
|
|
164
|
+
protected readonly health: AuthHealthService;
|
|
120
165
|
protected readonly form: _angular_forms.FormGroup<{
|
|
121
166
|
email: _angular_forms.FormControl<string>;
|
|
122
167
|
}>;
|
|
@@ -125,14 +170,18 @@ declare class AuthLoginPage {
|
|
|
125
170
|
protected readonly errorMessage: _angular_core.WritableSignal<string | null>;
|
|
126
171
|
protected readonly emailControl: _angular_forms.FormControl<string>;
|
|
127
172
|
protected readonly emailFeedbackId = "email-feedback";
|
|
173
|
+
protected readonly healthBannerId = "auth-health-banner";
|
|
174
|
+
private readonly retryButton;
|
|
128
175
|
private readonly emailControlState;
|
|
176
|
+
constructor();
|
|
129
177
|
protected readonly hasInlineError: _angular_core.Signal<boolean>;
|
|
130
178
|
protected readonly inlineErrorMessage: _angular_core.Signal<string | null>;
|
|
131
179
|
protected readonly feedbackMessage: _angular_core.Signal<string | null>;
|
|
132
|
-
protected readonly feedbackTone: _angular_core.Signal<"
|
|
133
|
-
protected readonly fieldTone: _angular_core.Signal<"
|
|
180
|
+
protected readonly feedbackTone: _angular_core.Signal<"error" | "success" | null>;
|
|
181
|
+
protected readonly fieldTone: _angular_core.Signal<"error" | "success" | "idle">;
|
|
134
182
|
protected readonly emailFieldClasses: _angular_core.Signal<"flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base!" | "flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base! border-destructive focus-within:border-destructive focus-within:ring-destructive/20" | "flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base! border-emerald-500 focus-within:border-emerald-500 focus-within:ring-emerald-500/20">;
|
|
135
|
-
protected
|
|
183
|
+
protected retryHealth(): void;
|
|
184
|
+
protected submit(): Promise<void>;
|
|
136
185
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthLoginPage, never>;
|
|
137
186
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuthLoginPage, "edsis-auth-login-page", never, {}, {}, never, never, true, never>;
|
|
138
187
|
}
|
|
@@ -146,7 +195,7 @@ declare class AuthLogoutPage implements OnInit {
|
|
|
146
195
|
protected readonly messages: _edsis_angular_module_auth.EdsisAuthMessages;
|
|
147
196
|
protected readonly guestHomePath: `/${string}`;
|
|
148
197
|
protected readonly authenticatedHomePath: `/${string}`;
|
|
149
|
-
protected readonly state: _angular_core.WritableSignal<"
|
|
198
|
+
protected readonly state: _angular_core.WritableSignal<"error" | "pending" | "success">;
|
|
150
199
|
protected readonly message: _angular_core.WritableSignal<string>;
|
|
151
200
|
ngOnInit(): void;
|
|
152
201
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthLogoutPage, never>;
|
|
@@ -168,7 +217,7 @@ declare class AuthVerifyPage {
|
|
|
168
217
|
private verifySubscription;
|
|
169
218
|
protected readonly guestHomePath: `/${string}`;
|
|
170
219
|
protected readonly authenticatedHomePath: `/${string}`;
|
|
171
|
-
protected readonly state: _angular_core.WritableSignal<"
|
|
220
|
+
protected readonly state: _angular_core.WritableSignal<"error" | "pending" | "success">;
|
|
172
221
|
protected readonly message: _angular_core.WritableSignal<string>;
|
|
173
222
|
protected readonly token: _angular_core.InputSignal<string | null | undefined>;
|
|
174
223
|
constructor();
|
|
@@ -208,4 +257,4 @@ declare function injectSessionRefresh(): Promise<boolean>;
|
|
|
208
257
|
declare function injectSessionClear(): void;
|
|
209
258
|
|
|
210
259
|
export { AUTH_SESSION_CHANGE_EVENT, AuthLoginPage, AuthLogoutPage, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_SKIP_AUTH, EDSIS_SKIP_SESSION_REFRESH, authRoutes, authenticatedGuard, clearStoredSession, edsisAuthInterceptor, guestOnlyGuard, hasStoredSession, homeRedirectGuard, injectSessionClear, injectSessionRefresh, injectSessionState, mergeEdsisAuthMessages, persistSession, provideEdsisAuth, readStoredAccessToken, readStoredSession, resolveEdsisAuthConfig, shouldClearSessionAfterRefreshFailure, startAuthSessionMonitor, validateStoredSession, ɵresetAuthSessionModuleState };
|
|
211
|
-
export type { EdsisAuthConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, ResolvedEdsisAuthConfig, StoredAuthSession };
|
|
260
|
+
export type { EdsisAuthConfig, EdsisAuthHealthCheckConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, ResolvedEdsisAuthConfig, ResolvedEdsisAuthHealthCheck, StoredAuthSession };
|