@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,160 @@
1
+ "use strict";
2
+ /**
3
+ * Type Guards and Helper Functions for Phone Authentication
4
+ *
5
+ * These utilities help developers work with the SDK responses in a type-safe way
6
+ * without having to write their own type checking logic.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.isHeadlessResult = isHeadlessResult;
10
+ exports.isCredential = isCredential;
11
+ exports.isLinkStrategy = isLinkStrategy;
12
+ exports.isTS43Strategy = isTS43Strategy;
13
+ exports.isDesktopStrategy = isDesktopStrategy;
14
+ exports.getStrategy = getStrategy;
15
+ exports.requiresPolling = requiresPolling;
16
+ exports.requiresUserAction = requiresUserAction;
17
+ /**
18
+ * Type guard to check if the result is a HeadlessResult (headless mode)
19
+ * or a Credential (UI mode).
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const result = await invokeSecurePrompt(sdkRequest);
24
+ *
25
+ * if (isHeadlessResult(result)) {
26
+ * // TypeScript knows this is HeadlessResult
27
+ * console.log(result.strategy);
28
+ * await result.trigger();
29
+ * } else {
30
+ * // TypeScript knows this is a Credential
31
+ * const processedResult = await verifyPhoneNumberCredential(result, session);
32
+ * }
33
+ * ```
34
+ */
35
+ function isHeadlessResult(result) {
36
+ return result &&
37
+ typeof result === 'object' &&
38
+ 'strategy' in result &&
39
+ 'trigger' in result &&
40
+ typeof result.trigger === 'function';
41
+ }
42
+ /**
43
+ * Type guard to check if the result is a Credential (UI mode response).
44
+ * A credential is either a string token or an object without HeadlessResult properties.
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * if (isCredential(result)) {
49
+ * // Process the credential directly
50
+ * const verified = await verifyPhoneNumberCredential(result, session);
51
+ * }
52
+ * ```
53
+ */
54
+ function isCredential(result) {
55
+ if (!result)
56
+ return false;
57
+ // String credentials are valid
58
+ if (typeof result === 'string')
59
+ return true;
60
+ // Object credentials should NOT have HeadlessResult properties
61
+ if (typeof result === 'object') {
62
+ return !('strategy' in result) && !('trigger' in result);
63
+ }
64
+ return false;
65
+ }
66
+ /**
67
+ * Type guard to check if a HeadlessResult is using the Link strategy.
68
+ * Link strategy involves opening an app link (App Clip on iOS, app on Android).
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * if (isHeadlessResult(result) && isLinkStrategy(result)) {
73
+ * // Show custom button for opening app
74
+ * myButton.onclick = () => result.trigger();
75
+ * await result.pollingPromise;
76
+ * }
77
+ * ```
78
+ */
79
+ function isLinkStrategy(result) {
80
+ return result.strategy === 'link';
81
+ }
82
+ /**
83
+ * Type guard to check if a HeadlessResult is using the TS43 strategy.
84
+ * TS43 strategy uses the browser's Digital Credentials API.
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * if (isHeadlessResult(result) && isTS43Strategy(result)) {
89
+ * // Invoke credential API immediately or on button click
90
+ * const credential = await result.trigger();
91
+ * }
92
+ * ```
93
+ */
94
+ function isTS43Strategy(result) {
95
+ return result.strategy === 'ts43';
96
+ }
97
+ /**
98
+ * Type guard to check if a HeadlessResult is using the Desktop strategy.
99
+ * Desktop strategy involves QR codes for cross-device authentication.
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * if (isHeadlessResult(result) && isDesktopStrategy(result)) {
104
+ * // Show custom QR code UI
105
+ * displayQRCode(result.qrCodeUrl);
106
+ * await result.pollingPromise;
107
+ * }
108
+ * ```
109
+ */
110
+ function isDesktopStrategy(result) {
111
+ return result.strategy === 'desktop';
112
+ }
113
+ /**
114
+ * Helper function to safely get the authentication strategy from any result.
115
+ * Returns undefined if the result is not a HeadlessResult.
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * const strategy = getStrategy(result);
120
+ * if (strategy === 'link') {
121
+ * // Handle link strategy
122
+ * }
123
+ * ```
124
+ */
125
+ function getStrategy(result) {
126
+ if (isHeadlessResult(result)) {
127
+ return result.strategy;
128
+ }
129
+ return undefined;
130
+ }
131
+ /**
132
+ * Helper function to determine if a result requires polling.
133
+ * Link and Desktop strategies require polling, TS43 does not.
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * if (requiresPolling(result)) {
138
+ * await result.pollingPromise;
139
+ * }
140
+ * ```
141
+ */
142
+ function requiresPolling(result) {
143
+ if (!isHeadlessResult(result))
144
+ return false;
145
+ return result.strategy === 'link' || result.strategy === 'desktop';
146
+ }
147
+ /**
148
+ * Helper function to determine if a result requires user interaction.
149
+ * All headless strategies require some form of user interaction.
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * if (requiresUserAction(result)) {
154
+ * showActionButton();
155
+ * }
156
+ * ```
157
+ */
158
+ function requiresUserAction(result) {
159
+ return isHeadlessResult(result);
160
+ }
@@ -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,93 @@
1
+ "use strict";
2
+ /**
3
+ * Phone Authentication Types
4
+ *
5
+ * This file exports the types used by the Phone Auth SDK.
6
+ * All API types are imported from api-types.ts to ensure consistency.
7
+ * No backward compatibility - using clean API specification only.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.AuthStatus = exports.BrowserName = exports.BrowserErrorCode = exports.BrowserError = void 0;
25
+ // ============================================================================
26
+ // RE-EXPORT ALL API TYPES
27
+ // ============================================================================
28
+ __exportStar(require("./api-types"), exports);
29
+ // ============================================================================
30
+ // BROWSER-SPECIFIC TYPES
31
+ // ============================================================================
32
+ /**
33
+ * Browser error names
34
+ */
35
+ exports.BrowserError = {
36
+ NOT_ALLOWED: 'NotAllowedError',
37
+ NETWORK: 'NetworkError',
38
+ NOT_SUPPORTED: 'NotSupportedError',
39
+ SECURITY: 'SecurityError',
40
+ ABORT: 'AbortError',
41
+ TIMEOUT: 'TimeoutError',
42
+ INVALID_STATE: 'InvalidStateError',
43
+ DATA_CLONE: 'DataCloneError',
44
+ ENCODING: 'EncodingError',
45
+ NOT_READABLE: 'NotReadableError',
46
+ UNKNOWN: 'UnknownError',
47
+ TYPE: 'TypeError',
48
+ RANGE: 'RangeError',
49
+ SYNTAX: 'SyntaxError'
50
+ };
51
+ /**
52
+ * Browser error codes
53
+ */
54
+ exports.BrowserErrorCode = {
55
+ USER_CANCELLED_DC_API: 19,
56
+ PERMISSION_DENIED: 1,
57
+ POSITION_UNAVAILABLE: 2,
58
+ TIMEOUT: 3,
59
+ NOT_FOUND: 8,
60
+ ABORT: 20,
61
+ NETWORK: 19,
62
+ SECURITY: 18
63
+ };
64
+ /**
65
+ * Browser names for detection
66
+ */
67
+ exports.BrowserName = {
68
+ CHROME: 'Chrome',
69
+ EDGE: 'Edge',
70
+ SAFARI: 'Safari',
71
+ FIREFOX: 'Firefox',
72
+ OPERA: 'Opera',
73
+ BRAVE: 'Brave',
74
+ OTHER: 'other'
75
+ };
76
+ /**
77
+ * Authentication status constants
78
+ * Maps to both client-side states and backend responses
79
+ */
80
+ exports.AuthStatus = {
81
+ /** Authentication in progress */
82
+ PENDING: 'pending',
83
+ /** Authentication completed successfully */
84
+ COMPLETED: 'completed',
85
+ /** User cancelled authentication */
86
+ CANCELLED: 'cancelled',
87
+ /** Authentication failed or expired */
88
+ FAILED: 'failed',
89
+ /** Session expired (backend returns 410 Gone) */
90
+ EXPIRED: 'expired',
91
+ /** Session not found (backend returns 404) */
92
+ NOT_FOUND: 'not_found'
93
+ };
@@ -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
+ }