@edsis/angular 22.0.71 → 22.0.73

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.
@@ -44,6 +44,9 @@ interface EdsisAuthMessages {
44
44
  readonly signInAria: string;
45
45
  /** Status di halaman login selama full-page redirect ke Google berlangsung. */
46
46
  readonly googleRedirecting: string;
47
+ readonly nativeSignInInProgress: string;
48
+ readonly nativeSignInUnavailable: string;
49
+ readonly nativeSignInFailed: string;
47
50
  readonly googleExchangeInProgress: string;
48
51
  readonly exchangeInProgressAria: string;
49
52
  readonly googleStateMismatch: string;
@@ -120,8 +123,15 @@ interface EdsisAuthGoogleOauthConfig {
120
123
  */
121
124
  clientId: string;
122
125
  }
126
+ interface EdsisAuthNativeGoogleConfig {
127
+ /** Default `true` saat blok konfigurasi ini diberikan. */
128
+ enabled?: boolean;
129
+ /** Harus path same-origin. Default `/api`. */
130
+ apiUrl?: `/${string}`;
131
+ }
123
132
  interface EdsisAuthOauthConfig {
124
133
  google?: EdsisAuthGoogleOauthConfig;
134
+ nativeGoogle?: EdsisAuthNativeGoogleConfig;
125
135
  }
126
136
  interface EdsisAuthConfig {
127
137
  apiUrl: string;
@@ -159,6 +169,10 @@ interface ResolvedEdsisAuthGoogleOauth {
159
169
  interface ResolvedEdsisAuthOauth {
160
170
  /** `null` saat Google Sign-In tidak dikonfigurasi (perilaku placeholder lama). */
161
171
  google: ResolvedEdsisAuthGoogleOauth | null;
172
+ /** Flow native tablet; selalu memakai endpoint same-origin. */
173
+ nativeGoogle: {
174
+ readonly apiUrl: `/${string}`;
175
+ } | null;
162
176
  }
163
177
  interface ResolvedEdsisAuthConfig {
164
178
  apiUrl: string;
@@ -179,14 +193,6 @@ declare function provideEdsisAuth(config: EdsisAuthConfig): EnvironmentProviders
179
193
  interface AuthUser extends PersistentAuthUser {
180
194
  readonly role?: string;
181
195
  }
182
- interface EdsisDesktopBridge {
183
- setNotificationBadge(unreadCount: number): Promise<void>;
184
- }
185
- declare global {
186
- interface Window {
187
- EDSIS_DESKTOP?: EdsisDesktopBridge;
188
- }
189
- }
190
196
  /** Native desktop features are optional; browser consumers have no bridge. */
191
197
  declare function setAuthNotificationBadge(unreadCount: number): Promise<void>;
192
198
  /**
@@ -198,16 +204,20 @@ declare class AuthService {
198
204
  private readonly http;
199
205
  private readonly config;
200
206
  private readonly router;
207
+ private readonly runtime;
208
+ private readonly nativeGoogleAdapter;
201
209
  private readonly accessTokenState;
202
210
  private readonly userState;
203
211
  private refreshInFlight;
204
- private initialized;
212
+ private initialization;
205
213
  readonly accessToken: _angular_core.Signal<string>;
206
214
  readonly user: _angular_core.Signal<AuthUser | null>;
207
215
  readonly isAuthenticated: _angular_core.Signal<boolean>;
208
216
  get apiUrl(): string;
217
+ get sessionApiUrl(): string;
209
218
  /** Restores an existing cookie session. A missing/expired cookie is normal. */
210
219
  initialize(): Promise<void>;
220
+ private restoreSession;
211
221
  /** One shared refresh operation for initializer and concurrent 401 retries. */
212
222
  refresh(): Promise<boolean>;
213
223
  loadCurrentUser(): Promise<AuthUser | null>;
@@ -217,6 +227,7 @@ declare class AuthService {
217
227
  acceptTokenResponse(response: unknown): void;
218
228
  redirectToLogin(): void;
219
229
  private applyTokenResponse;
230
+ private clearNativeGoogleSession;
220
231
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthService, never>;
221
232
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuthService>;
222
233
  }
@@ -228,6 +239,43 @@ declare const guestOnlyGuard: CanActivateFn;
228
239
  declare const EDSIS_SKIP_AUTH: HttpContextToken<boolean>;
229
240
  declare const edsisAuthInterceptor: HttpInterceptorFn;
230
241
 
242
+ type NativeGooglePlatform = 'ios' | 'android';
243
+ interface NativeGoogleSignInResult {
244
+ readonly platform: NativeGooglePlatform;
245
+ readonly idToken: string;
246
+ readonly clientInstanceId: string;
247
+ }
248
+ interface EdsisNativeGoogleAuthAdapter {
249
+ signInWithGoogle(input: {
250
+ readonly nonce: string;
251
+ }): Promise<NativeGoogleSignInResult>;
252
+ signOutFromGoogle(): Promise<void>;
253
+ }
254
+ declare const EDSIS_NATIVE_GOOGLE_AUTH_ADAPTER: InjectionToken<EdsisNativeGoogleAuthAdapter>;
255
+ declare class TauriNativeGoogleAuthAdapter implements EdsisNativeGoogleAuthAdapter {
256
+ signInWithGoogle(input: {
257
+ readonly nonce: string;
258
+ }): Promise<NativeGoogleSignInResult>;
259
+ signOutFromGoogle(): Promise<void>;
260
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TauriNativeGoogleAuthAdapter, never>;
261
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<TauriNativeGoogleAuthAdapter>;
262
+ }
263
+ declare function isNativeGoogleSignInResult(value: unknown): value is NativeGoogleSignInResult;
264
+
265
+ declare class NativeGoogleAuthService {
266
+ private readonly http;
267
+ private readonly auth;
268
+ private readonly config;
269
+ private readonly runtime;
270
+ private readonly adapter;
271
+ readonly requiresNativeGoogle: _angular_core.Signal<boolean>;
272
+ readonly isAvailable: _angular_core.Signal<boolean>;
273
+ signIn(): Promise<void>;
274
+ private exchangeNativeToken;
275
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NativeGoogleAuthService, never>;
276
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<NativeGoogleAuthService>;
277
+ }
278
+
231
279
  declare const GOOGLE_OAUTH_STATE_STORAGE_KEY = "auth-google-state";
232
280
  declare const GOOGLE_OAUTH_AUTHORIZE_URL = "https://accounts.google.com/o/oauth2/v2/auth";
233
281
  interface GoogleAuthorizeUrlOptions {
@@ -304,10 +352,18 @@ declare class AuthLoginPage {
304
352
  private readonly injector;
305
353
  private readonly authMagicLinkService;
306
354
  private readonly authConfig;
355
+ private readonly nativeGoogle;
356
+ private readonly router;
307
357
  protected readonly messages: _edsis_angular_module_auth.EdsisAuthMessages;
308
358
  protected readonly health: AuthHealthService;
309
359
  protected readonly googleOauth: _edsis_angular_module_auth.ResolvedEdsisAuthGoogleOauth | null;
310
360
  protected readonly isGoogleRedirecting: _angular_core.WritableSignal<boolean>;
361
+ protected readonly googleErrorMessage: _angular_core.WritableSignal<string | null>;
362
+ protected readonly requiresNativeGoogle: _angular_core.Signal<boolean>;
363
+ protected readonly isNativeGoogle: _angular_core.Signal<boolean>;
364
+ protected readonly googleSignInAvailable: _angular_core.Signal<boolean>;
365
+ protected readonly googleFeedbackMessage: _angular_core.Signal<string | null>;
366
+ protected readonly googleProgressMessage: _angular_core.Signal<string>;
311
367
  protected readonly form: _angular_forms.FormGroup<{
312
368
  email: _angular_forms.FormControl<string>;
313
369
  }>;
@@ -328,6 +384,7 @@ declare class AuthLoginPage {
328
384
  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">;
329
385
  protected retryHealth(): void;
330
386
  protected signInWithGoogle(): void;
387
+ private signInWithNativeGoogle;
331
388
  protected redirectTo(url: string): void;
332
389
  protected submit(): Promise<void>;
333
390
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthLoginPage, never>;
@@ -375,5 +432,5 @@ declare class AuthVerifyPage {
375
432
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuthVerifyPage, "edsis-auth-verify-page", never, { "token": { "alias": "token"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
376
433
  }
377
434
 
378
- export { AuthGoogleCallbackPage, AuthLoginPage, AuthLogoutPage, AuthService, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_SKIP_AUTH, GOOGLE_OAUTH_AUTHORIZE_URL, GOOGLE_OAUTH_CALLBACK_ROUTE_PATH, GOOGLE_OAUTH_STATE_STORAGE_KEY, authRoutes, authenticatedGuard, buildGoogleAuthorizeUrl, consumeGoogleOauthState, createGoogleOauthState, edsisAuthInterceptor, guestOnlyGuard, homeRedirectGuard, mergeEdsisAuthMessages, provideEdsisAuth, resolveEdsisAuthConfig, setAuthNotificationBadge, storeGoogleOauthState };
379
- export type { AuthUser, EdsisAuthConfig, EdsisAuthGoogleOauthConfig, EdsisAuthHealthCheckConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, EdsisAuthOauthConfig, GoogleAuthorizeUrlOptions, ResolvedEdsisAuthConfig, ResolvedEdsisAuthGoogleOauth, ResolvedEdsisAuthHealthCheck, ResolvedEdsisAuthOauth };
435
+ export { AuthGoogleCallbackPage, AuthLoginPage, AuthLogoutPage, AuthService, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_NATIVE_GOOGLE_AUTH_ADAPTER, EDSIS_SKIP_AUTH, GOOGLE_OAUTH_AUTHORIZE_URL, GOOGLE_OAUTH_CALLBACK_ROUTE_PATH, GOOGLE_OAUTH_STATE_STORAGE_KEY, NativeGoogleAuthService, TauriNativeGoogleAuthAdapter, authRoutes, authenticatedGuard, buildGoogleAuthorizeUrl, consumeGoogleOauthState, createGoogleOauthState, edsisAuthInterceptor, guestOnlyGuard, homeRedirectGuard, isNativeGoogleSignInResult, mergeEdsisAuthMessages, provideEdsisAuth, resolveEdsisAuthConfig, setAuthNotificationBadge, storeGoogleOauthState };
436
+ export type { AuthUser, EdsisAuthConfig, EdsisAuthGoogleOauthConfig, EdsisAuthHealthCheckConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, EdsisAuthNativeGoogleConfig, EdsisAuthOauthConfig, EdsisNativeGoogleAuthAdapter, GoogleAuthorizeUrlOptions, NativeGooglePlatform, NativeGoogleSignInResult, ResolvedEdsisAuthConfig, ResolvedEdsisAuthGoogleOauth, ResolvedEdsisAuthHealthCheck, ResolvedEdsisAuthOauth };
@@ -0,0 +1,118 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, EnvironmentProviders } from '@angular/core';
3
+
4
+ declare const EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION: 1;
5
+ declare const EDSIS_RUNTIME_SCHEMA_VERSION: 2;
6
+ declare const EDSIS_RUNTIME_PLATFORMS: readonly ["windows", "macos", "linux", "ios", "android", "web"];
7
+ declare const EDSIS_DEVICE_TYPES: readonly ["browser", "windows", "macos", "android", "ipados"];
8
+ declare const EDSIS_RUNTIME_CAPABILITIES: readonly ["window-controls", "window-layout", "app-menu", "tray", "notification-badge", "native-notification", "dialog", "clipboard-text", "open-url", "network-diagnostics", "google-native-sign-in"];
9
+ type EdsisRuntimePlatform = (typeof EDSIS_RUNTIME_PLATFORMS)[number];
10
+ type EdsisDeviceType = (typeof EDSIS_DEVICE_TYPES)[number];
11
+ type EdsisRuntimeCapability = (typeof EDSIS_RUNTIME_CAPABILITIES)[number];
12
+ type EdsisRuntimeEnvironment = 'production' | 'development' | 'local';
13
+ type EdsisRuntimeHost = 'tauri' | 'browser';
14
+ type EdsisDeviceFamily = 'desktop' | 'tablet' | 'responsive';
15
+ type EdsisUiProfile = 'desktop' | 'tablet' | 'responsive';
16
+ interface EdsisRuntimeContextBase {
17
+ readonly host: EdsisRuntimeHost;
18
+ readonly environment: EdsisRuntimeEnvironment;
19
+ readonly platform: EdsisRuntimePlatform;
20
+ readonly deviceFamily: EdsisDeviceFamily;
21
+ readonly uiProfile: EdsisUiProfile;
22
+ readonly app: {
23
+ readonly identifier: string;
24
+ readonly name: string;
25
+ readonly version: string;
26
+ readonly arch: string;
27
+ readonly debug: boolean;
28
+ };
29
+ readonly capabilities: readonly EdsisRuntimeCapability[];
30
+ }
31
+ /** Legacy wire payload accepted during the schema V2 migration. */
32
+ interface EdsisRuntimeContextV1 extends EdsisRuntimeContextBase {
33
+ readonly schemaVersion: 1;
34
+ }
35
+ /** Canonical runtime payload returned to Angular consumers. */
36
+ interface EdsisRuntimeContextV2 extends EdsisRuntimeContextBase {
37
+ readonly schemaVersion: 2;
38
+ readonly deviceType: EdsisDeviceType;
39
+ }
40
+ type EdsisRuntimeContext = EdsisRuntimeContextV2;
41
+ type EdsisRuntimeWireContext = EdsisRuntimeContextV1 | EdsisRuntimeContextV2;
42
+ declare function isEdsisRuntimeContextV1(value: unknown): value is EdsisRuntimeContextV1;
43
+ declare function isEdsisRuntimeContextV2(value: unknown): value is EdsisRuntimeContextV2;
44
+ /** Validate either supported wire schema and normalize it to the immutable V2 contract. */
45
+ declare function normalizeEdsisRuntimeContext(value: unknown): EdsisRuntimeContextV2 | null;
46
+ declare function freezeEdsisRuntimeContext<T extends EdsisRuntimeWireContext>(context: T): T;
47
+ declare function createBrowserRuntimeContext(environment: EdsisRuntimeEnvironment): EdsisRuntimeContextV2;
48
+
49
+ type EdsisWindowControlAction = 'close' | 'minimize' | 'toggle-maximize';
50
+ declare class NativeHostService {
51
+ private readonly runtime;
52
+ supports(capability: EdsisRuntimeCapability): boolean;
53
+ emitWindowControl(action: EdsisWindowControlAction): Promise<void>;
54
+ startDragging(): Promise<void>;
55
+ setNotificationBadge(unreadCount: number): Promise<void>;
56
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NativeHostService, never>;
57
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<NativeHostService>;
58
+ }
59
+ /** Browser-safe compatibility helper for callers outside Angular injection. */
60
+ declare function setNativeNotificationBadge(unreadCount: number): Promise<void>;
61
+
62
+ interface EdsisRuntimeConfig {
63
+ readonly browserEnvironment?: EdsisRuntimeEnvironment;
64
+ readonly eventTimeoutMs?: number;
65
+ }
66
+ interface ResolvedEdsisRuntimeConfig {
67
+ readonly browserEnvironment: EdsisRuntimeEnvironment;
68
+ readonly eventTimeoutMs: number;
69
+ }
70
+ declare const EDSIS_RUNTIME_CONFIG: InjectionToken<ResolvedEdsisRuntimeConfig>;
71
+
72
+ declare const EDSIS_RUNTIME_READY_EVENT: "edsis:runtime-ready";
73
+ declare global {
74
+ interface Window {
75
+ readonly EDSIS_RUNTIME?: unknown;
76
+ }
77
+ }
78
+ declare class RuntimeContextService {
79
+ private readonly documentRef;
80
+ private readonly config;
81
+ private readonly contextState;
82
+ private initialization;
83
+ readonly context: _angular_core.Signal<EdsisRuntimeContextV2>;
84
+ readonly deviceType: _angular_core.Signal<"windows" | "macos" | "android" | "browser" | "ipados">;
85
+ readonly isDesktopShell: _angular_core.Signal<boolean>;
86
+ readonly isTabletShell: _angular_core.Signal<boolean>;
87
+ readonly isIPadOS: _angular_core.Signal<boolean>;
88
+ readonly isAndroidTablet: _angular_core.Signal<boolean>;
89
+ initialize(): Promise<void>;
90
+ supports(capability: EdsisRuntimeCapability): boolean;
91
+ private resolveContext;
92
+ private applyContext;
93
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RuntimeContextService, never>;
94
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<RuntimeContextService>;
95
+ }
96
+
97
+ declare function provideEdsisRuntime(config?: EdsisRuntimeConfig): EnvironmentProviders;
98
+
99
+ declare const EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH = 600;
100
+ type TabletViewportBlockReason = 'portrait' | 'too-narrow' | null;
101
+ declare class TabletViewportService {
102
+ private readonly documentRef;
103
+ private readonly widthState;
104
+ private readonly heightState;
105
+ private initialized;
106
+ readonly width: _angular_core.Signal<number>;
107
+ readonly height: _angular_core.Signal<number>;
108
+ readonly isLandscape: _angular_core.Signal<boolean>;
109
+ readonly meetsMinimumWidth: _angular_core.Signal<boolean>;
110
+ readonly blockReason: _angular_core.Signal<TabletViewportBlockReason>;
111
+ readonly isSupported: _angular_core.Signal<boolean>;
112
+ initialize(): void;
113
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TabletViewportService, never>;
114
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<TabletViewportService>;
115
+ }
116
+
117
+ export { EDSIS_DEVICE_TYPES, EDSIS_RUNTIME_CAPABILITIES, EDSIS_RUNTIME_CONFIG, EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION, EDSIS_RUNTIME_PLATFORMS, EDSIS_RUNTIME_READY_EVENT, EDSIS_RUNTIME_SCHEMA_VERSION, EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH, NativeHostService, RuntimeContextService, TabletViewportService, createBrowserRuntimeContext, freezeEdsisRuntimeContext, isEdsisRuntimeContextV1, isEdsisRuntimeContextV2, normalizeEdsisRuntimeContext, provideEdsisRuntime, setNativeNotificationBadge };
118
+ export type { EdsisDeviceFamily, EdsisDeviceType, EdsisRuntimeCapability, EdsisRuntimeConfig, EdsisRuntimeContext, EdsisRuntimeContextV1, EdsisRuntimeContextV2, EdsisRuntimeEnvironment, EdsisRuntimeHost, EdsisRuntimePlatform, EdsisRuntimeWireContext, EdsisUiProfile, EdsisWindowControlAction, ResolvedEdsisRuntimeConfig, TabletViewportBlockReason };