@rdlabo/ionic-angular-kit 21.5.1 → 21.5.3
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/README.md +39 -5
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs +2 -1
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit.mjs +48 -4
- package/fesm2022/rdlabo-ionic-angular-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rdlabo-ionic-angular-kit.d.ts +46 -4
package/package.json
CHANGED
|
@@ -1288,8 +1288,9 @@ interface KitHttpConfig {
|
|
|
1288
1288
|
* Optional; defaults to a no-op.
|
|
1289
1289
|
*
|
|
1290
1290
|
* @param request - The request that received the `401`.
|
|
1291
|
+
* @param error - The complete response, including any explicit authentication failure scope.
|
|
1291
1292
|
*/
|
|
1292
|
-
onUnauthorized?(request: HttpRequest<unknown
|
|
1293
|
+
onUnauthorized?(request: HttpRequest<unknown>, error: HttpErrorResponse): void;
|
|
1293
1294
|
/**
|
|
1294
1295
|
* Side effect to run on a `403` response (a permission error).
|
|
1295
1296
|
*
|
|
@@ -1297,8 +1298,9 @@ interface KitHttpConfig {
|
|
|
1297
1298
|
* Optional; defaults to a no-op.
|
|
1298
1299
|
*
|
|
1299
1300
|
* @param request - The request that received the `403`.
|
|
1301
|
+
* @param error - The complete permission-error response.
|
|
1300
1302
|
*/
|
|
1301
|
-
onForbidden?(request: HttpRequest<unknown
|
|
1303
|
+
onForbidden?(request: HttpRequest<unknown>, error: HttpErrorResponse): void;
|
|
1302
1304
|
/**
|
|
1303
1305
|
* UX hook for a genuine network / transport failure (status `0`) while the device reports itself
|
|
1304
1306
|
* connected — i.e. the server is unreachable rather than the phone being offline.
|
|
@@ -1368,6 +1370,17 @@ interface KitHttpConfig {
|
|
|
1368
1370
|
* @param error - The error thrown by `getAuthHeaders`.
|
|
1369
1371
|
*/
|
|
1370
1372
|
onAuthError?(request: HttpRequest<unknown>, error: unknown): void;
|
|
1373
|
+
/**
|
|
1374
|
+
* Called when {@link KitHttpConfig.isAuthAccessDenial} classifies a failure as
|
|
1375
|
+
* global identity loss and shared remote access is revoked.
|
|
1376
|
+
*
|
|
1377
|
+
* @remarks
|
|
1378
|
+
* This hook is status-independent so an explicitly tagged historical 403
|
|
1379
|
+
* identity response reaches the same cleanup as a new 401 identity response.
|
|
1380
|
+
* Status hooks still run afterward for response-specific UX. Optional and
|
|
1381
|
+
* backward compatible.
|
|
1382
|
+
*/
|
|
1383
|
+
onAuthAccessDenial?(request: HttpRequest<unknown>, error: unknown): void;
|
|
1371
1384
|
/**
|
|
1372
1385
|
* Classify whether an auth-related failure should revoke shared remote access.
|
|
1373
1386
|
*
|
|
@@ -1458,6 +1471,35 @@ declare const provideKitHttp: (configFactory: () => KitHttpConfig) => Environmen
|
|
|
1458
1471
|
*/
|
|
1459
1472
|
declare const kitAuthInterceptor: HttpInterceptorFn;
|
|
1460
1473
|
|
|
1474
|
+
/**
|
|
1475
|
+
* Shared lifecycle boundary carried by an authentication failure response.
|
|
1476
|
+
*
|
|
1477
|
+
* Only `identity` invalidates the application's global authenticated identity.
|
|
1478
|
+
* The other scopes retain it and let the owning feature handle recovery.
|
|
1479
|
+
*/
|
|
1480
|
+
declare const AUTH_FAILURE_SCOPES: {
|
|
1481
|
+
readonly identity: "identity";
|
|
1482
|
+
readonly reauthentication: "reauthentication";
|
|
1483
|
+
readonly credential: "credential";
|
|
1484
|
+
};
|
|
1485
|
+
type AuthFailureScope = (typeof AUTH_FAILURE_SCOPES)[keyof typeof AUTH_FAILURE_SCOPES];
|
|
1486
|
+
declare const AUTH_IDENTITY_INVALID_CODE = "AUTH_IDENTITY_INVALID";
|
|
1487
|
+
interface AuthFailureBody {
|
|
1488
|
+
statusCode: 401 | 403;
|
|
1489
|
+
message: string;
|
|
1490
|
+
code: string;
|
|
1491
|
+
authFailureScope: AuthFailureScope;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Reads the explicit auth-failure scope from an Angular `HttpErrorResponse` or
|
|
1495
|
+
* from a body-like value. Tagged historical 403 identity responses are
|
|
1496
|
+
* supported for installed-client compatibility. Untagged 401/403 responses
|
|
1497
|
+
* intentionally return `null`.
|
|
1498
|
+
*/
|
|
1499
|
+
declare const getAuthFailureScope: (error: unknown) => AuthFailureScope | null;
|
|
1500
|
+
/** True only for an explicitly tagged global identity failure. */
|
|
1501
|
+
declare const isIdentityAuthFailure: (error: unknown) => boolean;
|
|
1502
|
+
|
|
1461
1503
|
/** One WebSocket endpoint and its ordered subprotocol list. URLs must be unique within a target set. */
|
|
1462
1504
|
interface KitRealtimeSocketTarget {
|
|
1463
1505
|
url: string;
|
|
@@ -1764,5 +1806,5 @@ type ComponentPropsType<T> = {
|
|
|
1764
1806
|
[K in keyof T]: InputSignal<T[K]> | InputSignalWithTransform<T[K], any>;
|
|
1765
1807
|
};
|
|
1766
1808
|
|
|
1767
|
-
export { KIT_AUTH_BOOTSTRAP_REQUEST, KIT_AUTH_CONFIG, KIT_AUTH_RECOVERY_CONFIG, KIT_HTTP_CONFIG, KIT_LAST_AUTH_EMAIL_KEY, KIT_OVERLAY_CONFIG, KIT_REALTIME_CLIENT_ID, KIT_THEME_STORAGE_KEY, KitAuthAccessService, KitAuthInputDirective, KitAuthRecoveryService, KitLoadingController, KitMaintenanceController, KitOverlayController, KitRealtimeConnection, KitRealtimeLivenessWatchdog, KitReloadAlertController, KitStorageService, arrayConcatById, disableHandler, isExplicitAuthDenial, isMaintenanceError, kitAuthInterceptor, kitChangeEventDisabled, kitClearStoragePreservingKeys, kitCreateDidEnter, kitForgetEmail, kitImpact, kitIsValidEmail, kitKeyboardInit, kitPresentAuthFailedAlert, kitPresentLanguageActionSheet, kitRealtimeProtocols, kitRecallEmail, kitRememberEmail, kitRequireAuthorizedGuard, kitRequireConfirmingGuard, kitRequiredUnauthorizedGuard, mountViewModel, objectEqual, provideKitAuth, provideKitHttp, provideKitOverlay, toKitWebSocketUrl };
|
|
1768
|
-
export type { ComponentPropsType, KitAlertCloseOptions, KitAlertConfirmOptions, KitAuthAccessLease, KitAuthAccessMode, KitAuthConfig, KitAuthFailedAlertOptions, KitAuthGuardState, KitAuthInputMode, KitAuthRecoveryConfig, KitAuthRedirects, KitAuthState, KitClearableStore, KitClientRealtimeEvent, KitEmailStore, KitHttpConfig, KitKeyboardAdjust, KitLabels, KitLanguageActionSheetOptions, KitLanguageOption, KitMaintenanceOptions, KitModalPresentOptions, KitOverlayConfig, KitRealtimeConnectionOptions, KitRealtimeEvent, KitRealtimeSocketTarget, KitReloadAlertOptions, KitRemoteAccessRecovery, ModalMetadata, ReactiveHost, ViewModelHost };
|
|
1809
|
+
export { AUTH_FAILURE_SCOPES, AUTH_IDENTITY_INVALID_CODE, KIT_AUTH_BOOTSTRAP_REQUEST, KIT_AUTH_CONFIG, KIT_AUTH_RECOVERY_CONFIG, KIT_HTTP_CONFIG, KIT_LAST_AUTH_EMAIL_KEY, KIT_OVERLAY_CONFIG, KIT_REALTIME_CLIENT_ID, KIT_THEME_STORAGE_KEY, KitAuthAccessService, KitAuthInputDirective, KitAuthRecoveryService, KitLoadingController, KitMaintenanceController, KitOverlayController, KitRealtimeConnection, KitRealtimeLivenessWatchdog, KitReloadAlertController, KitStorageService, arrayConcatById, disableHandler, getAuthFailureScope, isExplicitAuthDenial, isIdentityAuthFailure, isMaintenanceError, kitAuthInterceptor, kitChangeEventDisabled, kitClearStoragePreservingKeys, kitCreateDidEnter, kitForgetEmail, kitImpact, kitIsValidEmail, kitKeyboardInit, kitPresentAuthFailedAlert, kitPresentLanguageActionSheet, kitRealtimeProtocols, kitRecallEmail, kitRememberEmail, kitRequireAuthorizedGuard, kitRequireConfirmingGuard, kitRequiredUnauthorizedGuard, mountViewModel, objectEqual, provideKitAuth, provideKitHttp, provideKitOverlay, toKitWebSocketUrl };
|
|
1810
|
+
export type { AuthFailureBody, AuthFailureScope, ComponentPropsType, KitAlertCloseOptions, KitAlertConfirmOptions, KitAuthAccessLease, KitAuthAccessMode, KitAuthConfig, KitAuthFailedAlertOptions, KitAuthGuardState, KitAuthInputMode, KitAuthRecoveryConfig, KitAuthRedirects, KitAuthState, KitClearableStore, KitClientRealtimeEvent, KitEmailStore, KitHttpConfig, KitKeyboardAdjust, KitLabels, KitLanguageActionSheetOptions, KitLanguageOption, KitMaintenanceOptions, KitModalPresentOptions, KitOverlayConfig, KitRealtimeConnectionOptions, KitRealtimeEvent, KitRealtimeSocketTarget, KitReloadAlertOptions, KitRemoteAccessRecovery, ModalMetadata, ReactiveHost, ViewModelHost };
|