@glideidentity/web-client-sdk 4.4.8-beta.1

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.
Files changed (136) hide show
  1. package/README.md +938 -0
  2. package/dist/adapters/angular/client.service.d.ts +7 -0
  3. package/dist/adapters/angular/client.service.js +30 -0
  4. package/dist/adapters/angular/index.d.ts +3 -0
  5. package/dist/adapters/angular/index.js +18 -0
  6. package/dist/adapters/angular/phone-auth.service.d.ts +38 -0
  7. package/dist/adapters/angular/phone-auth.service.js +130 -0
  8. package/dist/adapters/react/index.d.ts +9 -0
  9. package/dist/adapters/react/index.js +28 -0
  10. package/dist/adapters/react/useClient.d.ts +26 -0
  11. package/dist/adapters/react/useClient.js +121 -0
  12. package/dist/adapters/react/usePhoneAuth.d.ts +23 -0
  13. package/dist/adapters/react/usePhoneAuth.js +95 -0
  14. package/dist/adapters/vanilla/client.d.ts +8 -0
  15. package/dist/adapters/vanilla/client.js +33 -0
  16. package/dist/adapters/vanilla/index.d.ts +3 -0
  17. package/dist/adapters/vanilla/index.js +18 -0
  18. package/dist/adapters/vanilla/phone-auth.d.ts +46 -0
  19. package/dist/adapters/vanilla/phone-auth.js +138 -0
  20. package/dist/adapters/vue/index.d.ts +10 -0
  21. package/dist/adapters/vue/index.js +36 -0
  22. package/dist/adapters/vue/useClient.d.ts +115 -0
  23. package/dist/adapters/vue/useClient.js +131 -0
  24. package/dist/adapters/vue/usePhoneAuth.d.ts +94 -0
  25. package/dist/adapters/vue/usePhoneAuth.js +103 -0
  26. package/dist/browser/web-client-sdk.min.js +2 -0
  27. package/dist/browser/web-client-sdk.min.js.LICENSE.txt +1 -0
  28. package/dist/browser.d.ts +7 -0
  29. package/dist/browser.js +31 -0
  30. package/dist/core/client.d.ts +22 -0
  31. package/dist/core/client.js +77 -0
  32. package/dist/core/logger.d.ts +130 -0
  33. package/dist/core/logger.js +370 -0
  34. package/dist/core/phone-auth/api-types.d.ts +525 -0
  35. package/dist/core/phone-auth/api-types.js +215 -0
  36. package/dist/core/phone-auth/client.d.ts +187 -0
  37. package/dist/core/phone-auth/client.js +1353 -0
  38. package/dist/core/phone-auth/error-utils.d.ts +110 -0
  39. package/dist/core/phone-auth/error-utils.js +350 -0
  40. package/dist/core/phone-auth/index.d.ts +7 -0
  41. package/dist/core/phone-auth/index.js +47 -0
  42. package/dist/core/phone-auth/status-types.d.ts +107 -0
  43. package/dist/core/phone-auth/status-types.js +31 -0
  44. package/dist/core/phone-auth/strategies/desktop.d.ts +113 -0
  45. package/dist/core/phone-auth/strategies/desktop.js +502 -0
  46. package/dist/core/phone-auth/strategies/index.d.ts +11 -0
  47. package/dist/core/phone-auth/strategies/index.js +15 -0
  48. package/dist/core/phone-auth/strategies/link.d.ts +81 -0
  49. package/dist/core/phone-auth/strategies/link.js +265 -0
  50. package/dist/core/phone-auth/strategies/ts43.d.ts +32 -0
  51. package/dist/core/phone-auth/strategies/ts43.js +146 -0
  52. package/dist/core/phone-auth/strategies/types.d.ts +18 -0
  53. package/dist/core/phone-auth/strategies/types.js +6 -0
  54. package/dist/core/phone-auth/type-guards.d.ts +125 -0
  55. package/dist/core/phone-auth/type-guards.js +160 -0
  56. package/dist/core/phone-auth/types.d.ts +232 -0
  57. package/dist/core/phone-auth/types.js +93 -0
  58. package/dist/core/phone-auth/ui/mobile-debug-console.d.ts +25 -0
  59. package/dist/core/phone-auth/ui/mobile-debug-console.js +288 -0
  60. package/dist/core/phone-auth/ui/modal.d.ts +84 -0
  61. package/dist/core/phone-auth/ui/modal.js +574 -0
  62. package/dist/core/phone-auth/validation-utils.d.ts +66 -0
  63. package/dist/core/phone-auth/validation-utils.js +182 -0
  64. package/dist/core/types.d.ts +62 -0
  65. package/dist/core/types.js +2 -0
  66. package/dist/core/version.d.ts +1 -0
  67. package/dist/core/version.js +5 -0
  68. package/dist/esm/adapters/angular/client.service.d.ts +7 -0
  69. package/dist/esm/adapters/angular/client.service.js +27 -0
  70. package/dist/esm/adapters/angular/index.d.ts +3 -0
  71. package/dist/esm/adapters/angular/index.js +4 -0
  72. package/dist/esm/adapters/angular/phone-auth.service.d.ts +38 -0
  73. package/dist/esm/adapters/angular/phone-auth.service.js +127 -0
  74. package/dist/esm/adapters/react/index.d.ts +9 -0
  75. package/dist/esm/adapters/react/index.js +8 -0
  76. package/dist/esm/adapters/react/useClient.d.ts +26 -0
  77. package/dist/esm/adapters/react/useClient.js +116 -0
  78. package/dist/esm/adapters/react/usePhoneAuth.d.ts +23 -0
  79. package/dist/esm/adapters/react/usePhoneAuth.js +92 -0
  80. package/dist/esm/adapters/vanilla/client.d.ts +8 -0
  81. package/dist/esm/adapters/vanilla/client.js +29 -0
  82. package/dist/esm/adapters/vanilla/index.d.ts +3 -0
  83. package/dist/esm/adapters/vanilla/index.js +4 -0
  84. package/dist/esm/adapters/vanilla/phone-auth.d.ts +46 -0
  85. package/dist/esm/adapters/vanilla/phone-auth.js +134 -0
  86. package/dist/esm/adapters/vue/index.d.ts +10 -0
  87. package/dist/esm/adapters/vue/index.js +11 -0
  88. package/dist/esm/adapters/vue/useClient.d.ts +115 -0
  89. package/dist/esm/adapters/vue/useClient.js +127 -0
  90. package/dist/esm/adapters/vue/usePhoneAuth.d.ts +94 -0
  91. package/dist/esm/adapters/vue/usePhoneAuth.js +100 -0
  92. package/dist/esm/browser.d.ts +7 -0
  93. package/dist/esm/browser.js +11 -0
  94. package/dist/esm/core/client.d.ts +22 -0
  95. package/dist/esm/core/client.js +70 -0
  96. package/dist/esm/core/logger.d.ts +130 -0
  97. package/dist/esm/core/logger.js +359 -0
  98. package/dist/esm/core/phone-auth/api-types.d.ts +525 -0
  99. package/dist/esm/core/phone-auth/api-types.js +203 -0
  100. package/dist/esm/core/phone-auth/client.d.ts +187 -0
  101. package/dist/esm/core/phone-auth/client.js +1316 -0
  102. package/dist/esm/core/phone-auth/error-utils.d.ts +110 -0
  103. package/dist/esm/core/phone-auth/error-utils.js +338 -0
  104. package/dist/esm/core/phone-auth/index.d.ts +7 -0
  105. package/dist/esm/core/phone-auth/index.js +6 -0
  106. package/dist/esm/core/phone-auth/status-types.d.ts +107 -0
  107. package/dist/esm/core/phone-auth/status-types.js +26 -0
  108. package/dist/esm/core/phone-auth/strategies/desktop.d.ts +113 -0
  109. package/dist/esm/core/phone-auth/strategies/desktop.js +496 -0
  110. package/dist/esm/core/phone-auth/strategies/index.d.ts +11 -0
  111. package/dist/esm/core/phone-auth/strategies/index.js +7 -0
  112. package/dist/esm/core/phone-auth/strategies/link.d.ts +81 -0
  113. package/dist/esm/core/phone-auth/strategies/link.js +261 -0
  114. package/dist/esm/core/phone-auth/strategies/ts43.d.ts +32 -0
  115. package/dist/esm/core/phone-auth/strategies/ts43.js +142 -0
  116. package/dist/esm/core/phone-auth/strategies/types.d.ts +18 -0
  117. package/dist/esm/core/phone-auth/strategies/types.js +5 -0
  118. package/dist/esm/core/phone-auth/type-guards.d.ts +125 -0
  119. package/dist/esm/core/phone-auth/type-guards.js +150 -0
  120. package/dist/esm/core/phone-auth/types.d.ts +232 -0
  121. package/dist/esm/core/phone-auth/types.js +76 -0
  122. package/dist/esm/core/phone-auth/ui/mobile-debug-console.d.ts +25 -0
  123. package/dist/esm/core/phone-auth/ui/mobile-debug-console.js +284 -0
  124. package/dist/esm/core/phone-auth/ui/modal.d.ts +84 -0
  125. package/dist/esm/core/phone-auth/ui/modal.js +570 -0
  126. package/dist/esm/core/phone-auth/validation-utils.d.ts +66 -0
  127. package/dist/esm/core/phone-auth/validation-utils.js +174 -0
  128. package/dist/esm/core/types.d.ts +62 -0
  129. package/dist/esm/core/types.js +1 -0
  130. package/dist/esm/core/version.d.ts +1 -0
  131. package/dist/esm/core/version.js +2 -0
  132. package/dist/esm/index.d.ts +12 -0
  133. package/dist/esm/index.js +15 -0
  134. package/dist/index.d.ts +12 -0
  135. package/dist/index.js +52 -0
  136. package/package.json +92 -0
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Type Guards and Helper Functions for Phone Authentication
3
+ *
4
+ * These utilities help developers work with the SDK responses in a type-safe way
5
+ * without having to write their own type checking logic.
6
+ */
7
+ /**
8
+ * Type guard to check if the result is a HeadlessResult (headless mode)
9
+ * or a Credential (UI mode).
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const result = await invokeSecurePrompt(sdkRequest);
14
+ *
15
+ * if (isHeadlessResult(result)) {
16
+ * // TypeScript knows this is HeadlessResult
17
+ * console.log(result.strategy);
18
+ * await result.trigger();
19
+ * } else {
20
+ * // TypeScript knows this is a Credential
21
+ * const processedResult = await verifyPhoneNumberCredential(result, session);
22
+ * }
23
+ * ```
24
+ */
25
+ export function isHeadlessResult(result) {
26
+ return result &&
27
+ typeof result === 'object' &&
28
+ 'strategy' in result &&
29
+ 'trigger' in result &&
30
+ typeof result.trigger === 'function';
31
+ }
32
+ /**
33
+ * Type guard to check if the result is a Credential (UI mode response).
34
+ * A credential is either a string token or an object without HeadlessResult properties.
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * if (isCredential(result)) {
39
+ * // Process the credential directly
40
+ * const verified = await verifyPhoneNumberCredential(result, session);
41
+ * }
42
+ * ```
43
+ */
44
+ export function isCredential(result) {
45
+ if (!result)
46
+ return false;
47
+ // String credentials are valid
48
+ if (typeof result === 'string')
49
+ return true;
50
+ // Object credentials should NOT have HeadlessResult properties
51
+ if (typeof result === 'object') {
52
+ return !('strategy' in result) && !('trigger' in result);
53
+ }
54
+ return false;
55
+ }
56
+ /**
57
+ * Type guard to check if a HeadlessResult is using the Link strategy.
58
+ * Link strategy involves opening an app link (App Clip on iOS, app on Android).
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * if (isHeadlessResult(result) && isLinkStrategy(result)) {
63
+ * // Show custom button for opening app
64
+ * myButton.onclick = () => result.trigger();
65
+ * await result.pollingPromise;
66
+ * }
67
+ * ```
68
+ */
69
+ export function isLinkStrategy(result) {
70
+ return result.strategy === 'link';
71
+ }
72
+ /**
73
+ * Type guard to check if a HeadlessResult is using the TS43 strategy.
74
+ * TS43 strategy uses the browser's Digital Credentials API.
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * if (isHeadlessResult(result) && isTS43Strategy(result)) {
79
+ * // Invoke credential API immediately or on button click
80
+ * const credential = await result.trigger();
81
+ * }
82
+ * ```
83
+ */
84
+ export function isTS43Strategy(result) {
85
+ return result.strategy === 'ts43';
86
+ }
87
+ /**
88
+ * Type guard to check if a HeadlessResult is using the Desktop strategy.
89
+ * Desktop strategy involves QR codes for cross-device authentication.
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * if (isHeadlessResult(result) && isDesktopStrategy(result)) {
94
+ * // Show custom QR code UI
95
+ * displayQRCode(result.qrCodeUrl);
96
+ * await result.pollingPromise;
97
+ * }
98
+ * ```
99
+ */
100
+ export function isDesktopStrategy(result) {
101
+ return result.strategy === 'desktop';
102
+ }
103
+ /**
104
+ * Helper function to safely get the authentication strategy from any result.
105
+ * Returns undefined if the result is not a HeadlessResult.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const strategy = getStrategy(result);
110
+ * if (strategy === 'link') {
111
+ * // Handle link strategy
112
+ * }
113
+ * ```
114
+ */
115
+ export function getStrategy(result) {
116
+ if (isHeadlessResult(result)) {
117
+ return result.strategy;
118
+ }
119
+ return undefined;
120
+ }
121
+ /**
122
+ * Helper function to determine if a result requires polling.
123
+ * Link and Desktop strategies require polling, TS43 does not.
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * if (requiresPolling(result)) {
128
+ * await result.pollingPromise;
129
+ * }
130
+ * ```
131
+ */
132
+ export function requiresPolling(result) {
133
+ if (!isHeadlessResult(result))
134
+ return false;
135
+ return result.strategy === 'link' || result.strategy === 'desktop';
136
+ }
137
+ /**
138
+ * Helper function to determine if a result requires user interaction.
139
+ * All headless strategies require some form of user interaction.
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * if (requiresUserAction(result)) {
144
+ * showActionButton();
145
+ * }
146
+ * ```
147
+ */
148
+ export function requiresUserAction(result) {
149
+ return isHeadlessResult(result);
150
+ }
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Phone Authentication Types
3
+ *
4
+ * This file exports the types used by the Phone Auth SDK.
5
+ * All API types are imported from api-types.ts to ensure consistency.
6
+ * No backward compatibility - using clean API specification only.
7
+ */
8
+ export * from './api-types';
9
+ import type { PrepareRequest as APIPrepareRequest, GetPhoneNumberResponse, VerifyPhoneNumberResponse, UseCase as APIUseCase, AuthenticationStrategy as APIAuthStrategy } from './api-types';
10
+ export type PhoneAuthOptions = APIPrepareRequest;
11
+ export type PhoneAuthResult = GetPhoneNumberResponse | VerifyPhoneNumberResponse;
12
+ export type UseCaseType = APIUseCase;
13
+ export type AuthenticationStrategyType = APIAuthStrategy;
14
+ /**
15
+ * SDK-specific error codes from error-utils
16
+ */
17
+ import type { PhoneAuthErrorCode as ErrorCodeFromUtils } from './error-utils';
18
+ export type PhoneAuthErrorCode = ErrorCodeFromUtils;
19
+ /**
20
+ * SDK configuration callbacks
21
+ */
22
+ export interface PhoneAuthCallbacks {
23
+ /**
24
+ * Called when cross-device authentication is detected (e.g., QR code shown)
25
+ */
26
+ onCrossDeviceDetected?: () => void;
27
+ /**
28
+ * Called when a retry attempt is made
29
+ * @param attempt Current attempt number
30
+ * @param maxAttempts Maximum number of attempts
31
+ */
32
+ onRetryAttempt?: (attempt: number, maxAttempts: number) => void;
33
+ /**
34
+ * Called when authentication times out
35
+ */
36
+ onTimeout?: () => void;
37
+ /**
38
+ * Called when user cancels authentication
39
+ */
40
+ onCancel?: () => void;
41
+ /**
42
+ * Called when polling starts
43
+ */
44
+ onPollingStart?: () => void;
45
+ /**
46
+ * Called when polling stops
47
+ */
48
+ onPollingStop?: () => void;
49
+ }
50
+ /**
51
+ * SDK configuration options
52
+ */
53
+ export interface AuthConfig extends PhoneAuthCallbacks {
54
+ /**
55
+ * Custom endpoints for authentication flow
56
+ */
57
+ endpoints?: {
58
+ prepare?: string;
59
+ process?: string;
60
+ /** Desktop authentication status polling endpoint */
61
+ polling?: string;
62
+ };
63
+ /**
64
+ * Timeout for API calls in milliseconds
65
+ * @default 30000
66
+ */
67
+ timeout?: number;
68
+ /**
69
+ * Polling interval in milliseconds for status checks
70
+ * @default 2000
71
+ */
72
+ pollingInterval?: number;
73
+ /**
74
+ * Maximum polling attempts before timeout
75
+ * @default 150 (5 minutes with 2s interval)
76
+ */
77
+ maxPollingAttempts?: number;
78
+ /**
79
+ * Enable debug logging
80
+ * @default false
81
+ */
82
+ debug?: boolean;
83
+ /**
84
+ * Developer tools configuration for debugging
85
+ */
86
+ devtools?: {
87
+ /**
88
+ * Show mobile console overlay for on-device debugging
89
+ * Displays all console logs at the bottom of the screen
90
+ * @default false
91
+ */
92
+ showMobileConsole?: boolean;
93
+ };
94
+ }
95
+ /**
96
+ * SDK-enhanced error type with additional context
97
+ */
98
+ export interface AuthError {
99
+ code: PhoneAuthErrorCode;
100
+ message: string;
101
+ details?: any;
102
+ status?: number;
103
+ requestId?: string;
104
+ timestamp?: string;
105
+ traceId?: string;
106
+ spanId?: string;
107
+ service?: string;
108
+ retryAfter?: number;
109
+ browserError?: {
110
+ name: string;
111
+ message: string;
112
+ stack?: string;
113
+ code?: number;
114
+ };
115
+ context?: {
116
+ step?: 'prepare' | 'prompt' | 'process' | 'complete';
117
+ useCase?: string;
118
+ timestamp: string;
119
+ userAgent?: string;
120
+ url?: string;
121
+ [key: string]: any;
122
+ };
123
+ }
124
+ /**
125
+ * SDK authentication flow steps
126
+ */
127
+ export type AuthStep = 'idle' | 'requesting' | 'authenticating' | 'processing' | 'complete';
128
+ /**
129
+ * Browser error names
130
+ */
131
+ export declare const BrowserError: {
132
+ readonly NOT_ALLOWED: "NotAllowedError";
133
+ readonly NETWORK: "NetworkError";
134
+ readonly NOT_SUPPORTED: "NotSupportedError";
135
+ readonly SECURITY: "SecurityError";
136
+ readonly ABORT: "AbortError";
137
+ readonly TIMEOUT: "TimeoutError";
138
+ readonly INVALID_STATE: "InvalidStateError";
139
+ readonly DATA_CLONE: "DataCloneError";
140
+ readonly ENCODING: "EncodingError";
141
+ readonly NOT_READABLE: "NotReadableError";
142
+ readonly UNKNOWN: "UnknownError";
143
+ readonly TYPE: "TypeError";
144
+ readonly RANGE: "RangeError";
145
+ readonly SYNTAX: "SyntaxError";
146
+ };
147
+ export type BrowserErrorType = typeof BrowserError[keyof typeof BrowserError];
148
+ /**
149
+ * Browser error codes
150
+ */
151
+ export declare const BrowserErrorCode: {
152
+ readonly USER_CANCELLED_DC_API: 19;
153
+ readonly PERMISSION_DENIED: 1;
154
+ readonly POSITION_UNAVAILABLE: 2;
155
+ readonly TIMEOUT: 3;
156
+ readonly NOT_FOUND: 8;
157
+ readonly ABORT: 20;
158
+ readonly NETWORK: 19;
159
+ readonly SECURITY: 18;
160
+ };
161
+ export type BrowserErrorCodeType = typeof BrowserErrorCode[keyof typeof BrowserErrorCode];
162
+ /**
163
+ * Browser names for detection
164
+ */
165
+ export declare const BrowserName: {
166
+ readonly CHROME: "Chrome";
167
+ readonly EDGE: "Edge";
168
+ readonly SAFARI: "Safari";
169
+ readonly FIREFOX: "Firefox";
170
+ readonly OPERA: "Opera";
171
+ readonly BRAVE: "Brave";
172
+ readonly OTHER: "other";
173
+ };
174
+ export type BrowserNameType = typeof BrowserName[keyof typeof BrowserName];
175
+ /**
176
+ * Browser Digital Credential type (extends standard Credential)
177
+ */
178
+ export interface DigitalCredential extends Credential {
179
+ data: {
180
+ vp_token: {
181
+ [aggregatorId: string]: string | string[];
182
+ };
183
+ };
184
+ }
185
+ /**
186
+ * Browser credential request structure
187
+ */
188
+ export interface SecureCredentialRequest {
189
+ digital: {
190
+ requests: Array<{
191
+ protocol: string;
192
+ data: any;
193
+ }>;
194
+ };
195
+ }
196
+ /**
197
+ * Authentication status constants
198
+ * Maps to both client-side states and backend responses
199
+ */
200
+ export declare const AuthStatus: {
201
+ /** Authentication in progress */
202
+ readonly PENDING: "pending";
203
+ /** Authentication completed successfully */
204
+ readonly COMPLETED: "completed";
205
+ /** User cancelled authentication */
206
+ readonly CANCELLED: "cancelled";
207
+ /** Authentication failed or expired */
208
+ readonly FAILED: "failed";
209
+ /** Session expired (backend returns 410 Gone) */
210
+ readonly EXPIRED: "expired";
211
+ /** Session not found (backend returns 404) */
212
+ readonly NOT_FOUND: "not_found";
213
+ };
214
+ export type AuthStatusType = typeof AuthStatus[keyof typeof AuthStatus];
215
+ /**
216
+ * Controller for managing authentication sessions
217
+ * Allows cancellation and cleanup of ongoing authentication
218
+ */
219
+ export interface AuthController {
220
+ /**
221
+ * Cancel the ongoing authentication
222
+ */
223
+ cancel(): void;
224
+ /**
225
+ * The authentication promise
226
+ */
227
+ promise: Promise<any>;
228
+ /**
229
+ * Current status of the authentication
230
+ */
231
+ status: AuthStatusType;
232
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Phone Authentication Types
3
+ *
4
+ * This file exports the types used by the Phone Auth SDK.
5
+ * All API types are imported from api-types.ts to ensure consistency.
6
+ * No backward compatibility - using clean API specification only.
7
+ */
8
+ // ============================================================================
9
+ // RE-EXPORT ALL API TYPES
10
+ // ============================================================================
11
+ export * from './api-types';
12
+ // ============================================================================
13
+ // BROWSER-SPECIFIC TYPES
14
+ // ============================================================================
15
+ /**
16
+ * Browser error names
17
+ */
18
+ export const BrowserError = {
19
+ NOT_ALLOWED: 'NotAllowedError',
20
+ NETWORK: 'NetworkError',
21
+ NOT_SUPPORTED: 'NotSupportedError',
22
+ SECURITY: 'SecurityError',
23
+ ABORT: 'AbortError',
24
+ TIMEOUT: 'TimeoutError',
25
+ INVALID_STATE: 'InvalidStateError',
26
+ DATA_CLONE: 'DataCloneError',
27
+ ENCODING: 'EncodingError',
28
+ NOT_READABLE: 'NotReadableError',
29
+ UNKNOWN: 'UnknownError',
30
+ TYPE: 'TypeError',
31
+ RANGE: 'RangeError',
32
+ SYNTAX: 'SyntaxError'
33
+ };
34
+ /**
35
+ * Browser error codes
36
+ */
37
+ export const BrowserErrorCode = {
38
+ USER_CANCELLED_DC_API: 19,
39
+ PERMISSION_DENIED: 1,
40
+ POSITION_UNAVAILABLE: 2,
41
+ TIMEOUT: 3,
42
+ NOT_FOUND: 8,
43
+ ABORT: 20,
44
+ NETWORK: 19,
45
+ SECURITY: 18
46
+ };
47
+ /**
48
+ * Browser names for detection
49
+ */
50
+ export const BrowserName = {
51
+ CHROME: 'Chrome',
52
+ EDGE: 'Edge',
53
+ SAFARI: 'Safari',
54
+ FIREFOX: 'Firefox',
55
+ OPERA: 'Opera',
56
+ BRAVE: 'Brave',
57
+ OTHER: 'other'
58
+ };
59
+ /**
60
+ * Authentication status constants
61
+ * Maps to both client-side states and backend responses
62
+ */
63
+ export const AuthStatus = {
64
+ /** Authentication in progress */
65
+ PENDING: 'pending',
66
+ /** Authentication completed successfully */
67
+ COMPLETED: 'completed',
68
+ /** User cancelled authentication */
69
+ CANCELLED: 'cancelled',
70
+ /** Authentication failed or expired */
71
+ FAILED: 'failed',
72
+ /** Session expired (backend returns 410 Gone) */
73
+ EXPIRED: 'expired',
74
+ /** Session not found (backend returns 404) */
75
+ NOT_FOUND: 'not_found'
76
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Mobile Debug Console
3
+ * A lightweight console overlay for debugging on mobile devices where dev tools aren't available
4
+ */
5
+ export declare class MobileDebugConsole {
6
+ private static instance;
7
+ private logs;
8
+ private container;
9
+ private logsContainer;
10
+ private floatingToggle;
11
+ private isAtBottom;
12
+ private isVisible;
13
+ private originalConsole;
14
+ constructor();
15
+ static init(): MobileDebugConsole;
16
+ static destroy(): void;
17
+ private interceptConsole;
18
+ private addLog;
19
+ private updateDisplay;
20
+ private createUI;
21
+ private escapeHtml;
22
+ private toggle;
23
+ private clear;
24
+ private cleanup;
25
+ }