@glideidentity/web-client-sdk 5.1.2 → 6.0.0-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.
- package/README.md +337 -526
- package/dist/browser/web-client-sdk.min.js +1 -1
- package/dist/cjs/adapters/index.js +15 -0
- package/dist/cjs/adapters/react.js +192 -0
- package/dist/cjs/adapters/vanilla.js +38 -0
- package/dist/cjs/adapters/vue.js +187 -0
- package/dist/cjs/browser.js +58 -0
- package/dist/cjs/client/http.js +159 -0
- package/dist/cjs/client/index.js +19 -0
- package/dist/cjs/client/logger.js +135 -0
- package/dist/cjs/client/phone-auth-client.js +439 -0
- package/dist/cjs/client/strategies/polling.js +177 -0
- package/dist/cjs/core/errors.js +204 -0
- package/dist/cjs/core/index.js +83 -0
- package/dist/cjs/core/type-guards.js +196 -0
- package/dist/cjs/core/types.js +25 -0
- package/dist/{core/phone-auth/validation-utils.js → cjs/core/validators.js} +70 -23
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/ui/index.js +11 -0
- package/dist/{core/phone-auth → cjs}/ui/mobile-debug-console.js +149 -78
- package/dist/cjs/ui/modal.js +1122 -0
- package/dist/esm/adapters/index.js +11 -0
- package/dist/esm/adapters/react.js +182 -0
- package/dist/esm/adapters/vanilla.js +29 -0
- package/dist/esm/adapters/vue.js +177 -0
- package/dist/esm/browser.js +30 -11
- package/dist/esm/client/http.js +156 -0
- package/dist/esm/client/index.js +11 -0
- package/dist/esm/client/logger.js +131 -0
- package/dist/esm/client/phone-auth-client.js +435 -0
- package/dist/esm/client/strategies/polling.js +174 -0
- package/dist/esm/core/errors.js +193 -0
- package/dist/esm/core/index.js +60 -0
- package/dist/esm/core/type-guards.js +181 -0
- package/dist/esm/core/types.js +22 -1
- package/dist/esm/core/{phone-auth/validation-utils.js → validators.js} +66 -21
- package/dist/esm/index.js +45 -17
- package/dist/esm/ui/index.js +5 -0
- package/dist/esm/{core/phone-auth/ui → ui}/mobile-debug-console.js +149 -78
- package/dist/esm/ui/modal.js +1117 -0
- package/dist/types/adapters/index.d.ts +10 -0
- package/dist/types/adapters/index.d.ts.map +1 -0
- package/dist/types/adapters/react.d.ts +70 -0
- package/dist/types/adapters/react.d.ts.map +1 -0
- package/dist/types/adapters/vanilla.d.ts +29 -0
- package/dist/types/adapters/vanilla.d.ts.map +1 -0
- package/dist/types/adapters/vue.d.ts +71 -0
- package/dist/types/adapters/vue.d.ts.map +1 -0
- package/dist/types/browser.d.ts +27 -0
- package/dist/types/browser.d.ts.map +1 -0
- package/dist/types/client/http.d.ts +41 -0
- package/dist/types/client/http.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +10 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/client/logger.d.ts +36 -0
- package/dist/types/client/logger.d.ts.map +1 -0
- package/dist/types/client/phone-auth-client.d.ts +91 -0
- package/dist/types/client/phone-auth-client.d.ts.map +1 -0
- package/dist/types/client/strategies/polling.d.ts +36 -0
- package/dist/types/client/strategies/polling.d.ts.map +1 -0
- package/dist/types/core/errors.d.ts +71 -0
- package/dist/types/core/errors.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +38 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/type-guards.d.ts +118 -0
- package/dist/types/core/type-guards.d.ts.map +1 -0
- package/dist/types/core/types.d.ts +534 -0
- package/dist/types/core/types.d.ts.map +1 -0
- package/dist/types/core/validators.d.ts +63 -0
- package/dist/types/core/validators.d.ts.map +1 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +6 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/{esm/core/phone-auth → types}/ui/mobile-debug-console.d.ts +1 -0
- package/dist/types/ui/mobile-debug-console.d.ts.map +1 -0
- package/dist/types/ui/modal.d.ts +87 -0
- package/dist/types/ui/modal.d.ts.map +1 -0
- package/package.json +48 -34
- package/dist/adapters/angular/client.service.d.ts +0 -7
- package/dist/adapters/angular/client.service.js +0 -30
- package/dist/adapters/angular/index.d.ts +0 -3
- package/dist/adapters/angular/index.js +0 -18
- package/dist/adapters/angular/phone-auth.service.d.ts +0 -38
- package/dist/adapters/angular/phone-auth.service.js +0 -130
- package/dist/adapters/react/index.d.ts +0 -9
- package/dist/adapters/react/index.js +0 -28
- package/dist/adapters/react/useClient.d.ts +0 -26
- package/dist/adapters/react/useClient.js +0 -121
- package/dist/adapters/react/usePhoneAuth.d.ts +0 -23
- package/dist/adapters/react/usePhoneAuth.js +0 -95
- package/dist/adapters/vanilla/client.d.ts +0 -8
- package/dist/adapters/vanilla/client.js +0 -33
- package/dist/adapters/vanilla/index.d.ts +0 -3
- package/dist/adapters/vanilla/index.js +0 -18
- package/dist/adapters/vanilla/phone-auth.d.ts +0 -46
- package/dist/adapters/vanilla/phone-auth.js +0 -138
- package/dist/adapters/vue/index.d.ts +0 -10
- package/dist/adapters/vue/index.js +0 -36
- package/dist/adapters/vue/useClient.d.ts +0 -115
- package/dist/adapters/vue/useClient.js +0 -131
- package/dist/adapters/vue/usePhoneAuth.d.ts +0 -94
- package/dist/adapters/vue/usePhoneAuth.js +0 -103
- package/dist/browser.d.ts +0 -7
- package/dist/browser.js +0 -31
- package/dist/core/client.d.ts +0 -22
- package/dist/core/client.js +0 -77
- package/dist/core/logger.d.ts +0 -130
- package/dist/core/logger.js +0 -370
- package/dist/core/phone-auth/api-types.d.ts +0 -593
- package/dist/core/phone-auth/api-types.js +0 -215
- package/dist/core/phone-auth/client.d.ts +0 -189
- package/dist/core/phone-auth/client.js +0 -1441
- package/dist/core/phone-auth/error-utils.d.ts +0 -110
- package/dist/core/phone-auth/error-utils.js +0 -350
- package/dist/core/phone-auth/index.d.ts +0 -7
- package/dist/core/phone-auth/index.js +0 -50
- package/dist/core/phone-auth/status-types.d.ts +0 -107
- package/dist/core/phone-auth/status-types.js +0 -31
- package/dist/core/phone-auth/strategies/desktop.d.ts +0 -122
- package/dist/core/phone-auth/strategies/desktop.js +0 -596
- package/dist/core/phone-auth/strategies/index.d.ts +0 -11
- package/dist/core/phone-auth/strategies/index.js +0 -15
- package/dist/core/phone-auth/strategies/link.d.ts +0 -89
- package/dist/core/phone-auth/strategies/link.js +0 -384
- package/dist/core/phone-auth/strategies/ts43.d.ts +0 -32
- package/dist/core/phone-auth/strategies/ts43.js +0 -151
- package/dist/core/phone-auth/strategies/types.d.ts +0 -18
- package/dist/core/phone-auth/strategies/types.js +0 -6
- package/dist/core/phone-auth/type-guards.d.ts +0 -143
- package/dist/core/phone-auth/type-guards.js +0 -198
- package/dist/core/phone-auth/types.d.ts +0 -237
- package/dist/core/phone-auth/types.js +0 -93
- package/dist/core/phone-auth/ui/mobile-debug-console.d.ts +0 -25
- package/dist/core/phone-auth/ui/modal.d.ts +0 -88
- package/dist/core/phone-auth/ui/modal.js +0 -598
- package/dist/core/phone-auth/validation-utils.d.ts +0 -44
- package/dist/core/types.d.ts +0 -62
- package/dist/core/types.js +0 -2
- package/dist/core/version.d.ts +0 -1
- package/dist/core/version.js +0 -5
- package/dist/esm/adapters/angular/client.service.d.ts +0 -7
- package/dist/esm/adapters/angular/client.service.js +0 -27
- package/dist/esm/adapters/angular/index.d.ts +0 -3
- package/dist/esm/adapters/angular/index.js +0 -4
- package/dist/esm/adapters/angular/phone-auth.service.d.ts +0 -38
- package/dist/esm/adapters/angular/phone-auth.service.js +0 -127
- package/dist/esm/adapters/react/index.d.ts +0 -9
- package/dist/esm/adapters/react/index.js +0 -8
- package/dist/esm/adapters/react/useClient.d.ts +0 -26
- package/dist/esm/adapters/react/useClient.js +0 -116
- package/dist/esm/adapters/react/usePhoneAuth.d.ts +0 -23
- package/dist/esm/adapters/react/usePhoneAuth.js +0 -92
- package/dist/esm/adapters/vanilla/client.d.ts +0 -8
- package/dist/esm/adapters/vanilla/client.js +0 -29
- package/dist/esm/adapters/vanilla/index.d.ts +0 -3
- package/dist/esm/adapters/vanilla/index.js +0 -4
- package/dist/esm/adapters/vanilla/phone-auth.d.ts +0 -46
- package/dist/esm/adapters/vanilla/phone-auth.js +0 -134
- package/dist/esm/adapters/vue/index.d.ts +0 -10
- package/dist/esm/adapters/vue/index.js +0 -11
- package/dist/esm/adapters/vue/useClient.d.ts +0 -115
- package/dist/esm/adapters/vue/useClient.js +0 -127
- package/dist/esm/adapters/vue/usePhoneAuth.d.ts +0 -94
- package/dist/esm/adapters/vue/usePhoneAuth.js +0 -100
- package/dist/esm/browser.d.ts +0 -7
- package/dist/esm/core/client.d.ts +0 -22
- package/dist/esm/core/client.js +0 -70
- package/dist/esm/core/logger.d.ts +0 -130
- package/dist/esm/core/logger.js +0 -359
- package/dist/esm/core/phone-auth/api-types.d.ts +0 -593
- package/dist/esm/core/phone-auth/api-types.js +0 -203
- package/dist/esm/core/phone-auth/client.d.ts +0 -189
- package/dist/esm/core/phone-auth/client.js +0 -1404
- package/dist/esm/core/phone-auth/error-utils.d.ts +0 -110
- package/dist/esm/core/phone-auth/error-utils.js +0 -338
- package/dist/esm/core/phone-auth/index.d.ts +0 -7
- package/dist/esm/core/phone-auth/index.js +0 -8
- package/dist/esm/core/phone-auth/status-types.d.ts +0 -107
- package/dist/esm/core/phone-auth/status-types.js +0 -26
- package/dist/esm/core/phone-auth/strategies/desktop.d.ts +0 -122
- package/dist/esm/core/phone-auth/strategies/desktop.js +0 -590
- package/dist/esm/core/phone-auth/strategies/index.d.ts +0 -11
- package/dist/esm/core/phone-auth/strategies/index.js +0 -7
- package/dist/esm/core/phone-auth/strategies/link.d.ts +0 -89
- package/dist/esm/core/phone-auth/strategies/link.js +0 -380
- package/dist/esm/core/phone-auth/strategies/ts43.d.ts +0 -32
- package/dist/esm/core/phone-auth/strategies/ts43.js +0 -147
- package/dist/esm/core/phone-auth/strategies/types.d.ts +0 -18
- package/dist/esm/core/phone-auth/strategies/types.js +0 -5
- package/dist/esm/core/phone-auth/type-guards.d.ts +0 -143
- package/dist/esm/core/phone-auth/type-guards.js +0 -185
- package/dist/esm/core/phone-auth/types.d.ts +0 -237
- package/dist/esm/core/phone-auth/types.js +0 -76
- package/dist/esm/core/phone-auth/ui/modal.d.ts +0 -88
- package/dist/esm/core/phone-auth/ui/modal.js +0 -594
- package/dist/esm/core/phone-auth/validation-utils.d.ts +0 -44
- package/dist/esm/core/types.d.ts +0 -62
- package/dist/esm/core/version.d.ts +0 -1
- package/dist/esm/core/version.js +0 -2
- package/dist/esm/index.d.ts +0 -12
- package/dist/index.d.ts +0 -12
- package/dist/index.js +0 -55
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SDKClient } from '../../core/client';
|
|
2
|
-
import type { ClientConfig } from '../../core/types';
|
|
3
|
-
import type { PhoneAuthResult, AuthError, PhoneAuthOptions } from '../../core/phone-auth';
|
|
4
|
-
export declare function useClient(config: ClientConfig): {
|
|
5
|
-
client: SDKClient;
|
|
6
|
-
isAuthenticated: boolean;
|
|
7
|
-
token: string | null;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
error: Error | null;
|
|
10
|
-
authenticate: (authUrl: string, options?: any) => Promise<never>;
|
|
11
|
-
useQuery: <T>(path: string) => {
|
|
12
|
-
data: T | null;
|
|
13
|
-
loading: boolean;
|
|
14
|
-
error: Error | null;
|
|
15
|
-
refetch: () => Promise<void>;
|
|
16
|
-
};
|
|
17
|
-
usePhoneAuth: () => {
|
|
18
|
-
result: PhoneAuthResult | null;
|
|
19
|
-
loading: boolean;
|
|
20
|
-
error: AuthError | null;
|
|
21
|
-
isSupported: boolean;
|
|
22
|
-
getPhoneNumber: (options?: Omit<PhoneAuthOptions, "useCase" | "phoneNumber">) => Promise<PhoneAuthResult>;
|
|
23
|
-
verifyPhoneNumber: (phoneNumber: string, options?: Omit<PhoneAuthOptions, "useCase" | "phoneNumber">) => Promise<PhoneAuthResult>;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export { useClient as useReactClient } from './useClient';
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.useReactClient = void 0;
|
|
13
|
-
exports.useClient = useClient;
|
|
14
|
-
const react_1 = require("react");
|
|
15
|
-
const client_1 = require("../../core/client");
|
|
16
|
-
function useClient(config) {
|
|
17
|
-
const [client] = (0, react_1.useState)(() => new client_1.SDKClient(config));
|
|
18
|
-
const [isAuthenticated, setIsAuthenticated] = (0, react_1.useState)(false);
|
|
19
|
-
const [token, setToken] = (0, react_1.useState)(null);
|
|
20
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
21
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
22
|
-
(0, react_1.useEffect)(() => {
|
|
23
|
-
let cleanupFn;
|
|
24
|
-
const setCleanup = (fn) => {
|
|
25
|
-
cleanupFn = fn;
|
|
26
|
-
};
|
|
27
|
-
return () => {
|
|
28
|
-
if (cleanupFn) {
|
|
29
|
-
cleanupFn();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}, []);
|
|
33
|
-
const authenticate = (authUrl, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
// Legacy authentication removed - use setToken directly
|
|
35
|
-
const error = new Error('authenticate method is deprecated. Use client.setToken() directly.');
|
|
36
|
-
setError(error);
|
|
37
|
-
setLoading(false);
|
|
38
|
-
throw error;
|
|
39
|
-
});
|
|
40
|
-
const useQuery = (path) => {
|
|
41
|
-
const [data, setData] = (0, react_1.useState)(null);
|
|
42
|
-
const [queryLoading, setQueryLoading] = (0, react_1.useState)(true);
|
|
43
|
-
const [queryError, setQueryError] = (0, react_1.useState)(null);
|
|
44
|
-
const fetchData = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
try {
|
|
46
|
-
const response = yield client.get(path);
|
|
47
|
-
setData(response.data);
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
setQueryError(err);
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
setQueryLoading(false);
|
|
54
|
-
}
|
|
55
|
-
}), [path]);
|
|
56
|
-
(0, react_1.useEffect)(() => {
|
|
57
|
-
fetchData();
|
|
58
|
-
}, [fetchData]);
|
|
59
|
-
return { data, loading: queryLoading, error: queryError, refetch: fetchData };
|
|
60
|
-
};
|
|
61
|
-
const usePhoneAuth = () => {
|
|
62
|
-
const [phoneAuthResult, setPhoneAuthResult] = (0, react_1.useState)(null);
|
|
63
|
-
const [phoneAuthLoading, setPhoneAuthLoading] = (0, react_1.useState)(false);
|
|
64
|
-
const [phoneAuthError, setPhoneAuthError] = (0, react_1.useState)(null);
|
|
65
|
-
const [isSupported] = (0, react_1.useState)(() => client.phoneAuth.isSupported());
|
|
66
|
-
const getPhoneNumber = (0, react_1.useCallback)((options) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
setPhoneAuthLoading(true);
|
|
68
|
-
setPhoneAuthError(null);
|
|
69
|
-
setPhoneAuthResult(null);
|
|
70
|
-
try {
|
|
71
|
-
const result = yield client.phoneAuth.getPhoneNumberComplete(options);
|
|
72
|
-
setPhoneAuthResult(result);
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
catch (err) {
|
|
76
|
-
setPhoneAuthError(err);
|
|
77
|
-
throw err;
|
|
78
|
-
}
|
|
79
|
-
finally {
|
|
80
|
-
setPhoneAuthLoading(false);
|
|
81
|
-
}
|
|
82
|
-
}), [client]);
|
|
83
|
-
const verifyPhoneNumber = (0, react_1.useCallback)((phoneNumber, options) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
setPhoneAuthLoading(true);
|
|
85
|
-
setPhoneAuthError(null);
|
|
86
|
-
setPhoneAuthResult(null);
|
|
87
|
-
try {
|
|
88
|
-
const result = yield client.phoneAuth.verifyPhoneNumberComplete(phoneNumber, options);
|
|
89
|
-
setPhoneAuthResult(result);
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
92
|
-
catch (err) {
|
|
93
|
-
setPhoneAuthError(err);
|
|
94
|
-
throw err;
|
|
95
|
-
}
|
|
96
|
-
finally {
|
|
97
|
-
setPhoneAuthLoading(false);
|
|
98
|
-
}
|
|
99
|
-
}), [client]);
|
|
100
|
-
return {
|
|
101
|
-
result: phoneAuthResult,
|
|
102
|
-
loading: phoneAuthLoading,
|
|
103
|
-
error: phoneAuthError,
|
|
104
|
-
isSupported,
|
|
105
|
-
getPhoneNumber,
|
|
106
|
-
verifyPhoneNumber
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
return {
|
|
110
|
-
client,
|
|
111
|
-
isAuthenticated,
|
|
112
|
-
token,
|
|
113
|
-
loading,
|
|
114
|
-
error,
|
|
115
|
-
authenticate,
|
|
116
|
-
useQuery,
|
|
117
|
-
usePhoneAuth,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
var useClient_1 = require("./useClient");
|
|
121
|
-
Object.defineProperty(exports, "useReactClient", { enumerable: true, get: function () { return useClient_1.useClient; } });
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PhoneAuthClient } from '../../core/phone-auth';
|
|
2
|
-
import type { AuthConfig, PhoneAuthResult, AuthError, AuthStep, PhoneAuthOptions } from '../../core/phone-auth';
|
|
3
|
-
export interface UsePhoneAuthOptions extends AuthConfig {
|
|
4
|
-
}
|
|
5
|
-
export declare function usePhoneAuth(config?: UsePhoneAuthOptions): {
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
error: AuthError | null;
|
|
8
|
-
result: PhoneAuthResult | null;
|
|
9
|
-
currentStep: AuthStep;
|
|
10
|
-
isSupported: boolean;
|
|
11
|
-
verify: (options: PhoneAuthOptions) => Promise<PhoneAuthResult>;
|
|
12
|
-
getPhoneNumber: (options?: Omit<PhoneAuthOptions, "use_case">) => Promise<PhoneAuthResult>;
|
|
13
|
-
verifyPhoneNumber: (phoneNumber: string, options?: Omit<PhoneAuthOptions, "use_case" | "phone_number">) => Promise<PhoneAuthResult>;
|
|
14
|
-
retryLastRequest: () => Promise<PhoneAuthResult>;
|
|
15
|
-
reset: () => void;
|
|
16
|
-
preparePhoneRequest: (options: PhoneAuthOptions) => Promise<import("../../core/phone-auth").PrepareResponse>;
|
|
17
|
-
invokeSecurePrompt: (prepareResponse: any) => Promise<{
|
|
18
|
-
[aggregator_id: string]: string | string[];
|
|
19
|
-
} | import("../../core/phone-auth").AuthCredential | import("../../core/phone-auth").AnyExtendedResponse>;
|
|
20
|
-
getPhoneNumberCredential: (credentialResponse: any, session: any) => Promise<import("../../core/phone-auth").GetPhoneNumberResponse>;
|
|
21
|
-
verifyPhoneNumberCredential: (credentialResponse: any, session: any) => Promise<import("../../core/phone-auth").VerifyPhoneNumberResponse>;
|
|
22
|
-
client: PhoneAuthClient;
|
|
23
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.usePhoneAuth = usePhoneAuth;
|
|
13
|
-
const react_1 = require("react");
|
|
14
|
-
const phone_auth_1 = require("../../core/phone-auth");
|
|
15
|
-
function usePhoneAuth(config = {}) {
|
|
16
|
-
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
17
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
18
|
-
const [result, setResult] = (0, react_1.useState)(null);
|
|
19
|
-
const [currentStep, setCurrentStep] = (0, react_1.useState)('idle');
|
|
20
|
-
const lastRequestRef = (0, react_1.useRef)(null);
|
|
21
|
-
// Create client instance with callbacks
|
|
22
|
-
const client = (0, react_1.useMemo)(() => new phone_auth_1.PhoneAuthClient(Object.assign(Object.assign({}, config), {
|
|
23
|
-
// Pass through callbacks if provided
|
|
24
|
-
onCrossDeviceDetected: config.onCrossDeviceDetected, onRetryAttempt: config.onRetryAttempt })), [JSON.stringify(config)]);
|
|
25
|
-
// Check browser support
|
|
26
|
-
const isSupported = (0, react_1.useMemo)(() => client.isSupported(), [client]);
|
|
27
|
-
// Verify method with silent retry support
|
|
28
|
-
const verify = (0, react_1.useCallback)((options) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
setIsLoading(true);
|
|
30
|
-
setError(null);
|
|
31
|
-
setResult(null);
|
|
32
|
-
setCurrentStep('requesting');
|
|
33
|
-
lastRequestRef.current = options;
|
|
34
|
-
try {
|
|
35
|
-
// Use the client's verify method which includes retry logic
|
|
36
|
-
const verificationResult = yield client.verify(options);
|
|
37
|
-
setResult(verificationResult);
|
|
38
|
-
setCurrentStep('complete');
|
|
39
|
-
return verificationResult;
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
// Error is only set after all retries are exhausted
|
|
43
|
-
const authError = err;
|
|
44
|
-
setError(authError);
|
|
45
|
-
setCurrentStep('idle');
|
|
46
|
-
throw authError;
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
setIsLoading(false);
|
|
50
|
-
}
|
|
51
|
-
}), [client]);
|
|
52
|
-
// Manual retry method
|
|
53
|
-
const retryLastRequest = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
if (!lastRequestRef.current) {
|
|
55
|
-
throw new Error('No previous request to retry');
|
|
56
|
-
}
|
|
57
|
-
return verify(lastRequestRef.current);
|
|
58
|
-
}), [verify]);
|
|
59
|
-
// Convenience methods
|
|
60
|
-
const getPhoneNumber = (0, react_1.useCallback)((options) => verify(Object.assign({ use_case: 'GetPhoneNumber' }, options)), [verify]);
|
|
61
|
-
const verifyPhoneNumber = (0, react_1.useCallback)((phoneNumber, options) => verify(Object.assign({ use_case: 'VerifyPhoneNumber', phone_number: phoneNumber }, options)), [verify]);
|
|
62
|
-
// Reset state
|
|
63
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
64
|
-
setIsLoading(false);
|
|
65
|
-
setError(null);
|
|
66
|
-
setResult(null);
|
|
67
|
-
setCurrentStep('idle');
|
|
68
|
-
}, []);
|
|
69
|
-
// Expose granular methods directly from client for better discoverability
|
|
70
|
-
const preparePhoneRequest = (0, react_1.useCallback)((options) => client.preparePhoneRequest(options), [client]);
|
|
71
|
-
const invokeSecurePrompt = (0, react_1.useCallback)((prepareResponse) => client.invokeSecurePrompt(prepareResponse), [client]);
|
|
72
|
-
const getPhoneNumberCredential = (0, react_1.useCallback)((credentialResponse, session) => client.getPhoneNumber(credentialResponse, session), [client]);
|
|
73
|
-
const verifyPhoneNumberCredential = (0, react_1.useCallback)((credentialResponse, session) => client.verifyPhoneNumber(credentialResponse, session), [client]);
|
|
74
|
-
return {
|
|
75
|
-
// State
|
|
76
|
-
isLoading,
|
|
77
|
-
error,
|
|
78
|
-
result,
|
|
79
|
-
currentStep,
|
|
80
|
-
isSupported,
|
|
81
|
-
// High-level methods
|
|
82
|
-
verify,
|
|
83
|
-
getPhoneNumber,
|
|
84
|
-
verifyPhoneNumber,
|
|
85
|
-
retryLastRequest,
|
|
86
|
-
reset,
|
|
87
|
-
// Granular methods (directly exposed for better discoverability)
|
|
88
|
-
preparePhoneRequest,
|
|
89
|
-
invokeSecurePrompt,
|
|
90
|
-
getPhoneNumberCredential,
|
|
91
|
-
verifyPhoneNumberCredential,
|
|
92
|
-
// Client instance (still available for advanced usage)
|
|
93
|
-
client
|
|
94
|
-
};
|
|
95
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ClientConfig, ClientResponse, RequestOptions } from '../../core/types';
|
|
2
|
-
export declare class VanillaClient {
|
|
3
|
-
private client;
|
|
4
|
-
constructor(config: ClientConfig);
|
|
5
|
-
authenticate(authUrl: string, options?: any): Promise<void>;
|
|
6
|
-
setToken(token: string): void;
|
|
7
|
-
get<T>(path: string, options?: RequestOptions): Promise<ClientResponse<T>>;
|
|
8
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.VanillaClient = void 0;
|
|
13
|
-
const client_1 = require("../../core/client");
|
|
14
|
-
class VanillaClient {
|
|
15
|
-
constructor(config) {
|
|
16
|
-
this.client = new client_1.SDKClient(config);
|
|
17
|
-
}
|
|
18
|
-
authenticate(authUrl, options) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
// Legacy authentication removed - use setToken directly
|
|
21
|
-
throw new Error('authenticate method is deprecated. Use client.setToken() directly.');
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
setToken(token) {
|
|
25
|
-
this.client.setToken(token);
|
|
26
|
-
}
|
|
27
|
-
get(path, options) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
return this.client.get(path, options);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.VanillaClient = VanillaClient;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { VanillaClient as ClientManager } from './client';
|
|
2
|
-
export { PhoneAuthManager } from './phone-auth';
|
|
3
|
-
export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isErrorCode, getRetryDelay, isRetryableError, serializeError, createErrorBreadcrumb } from '../../core/phone-auth';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createErrorBreadcrumb = exports.serializeError = exports.isRetryableError = exports.getRetryDelay = exports.isErrorCode = exports.getUserMessage = exports.isUserError = exports.isPhoneAuthError = exports.PhoneAuthErrorCode = exports.PhoneAuthManager = exports.ClientManager = void 0;
|
|
4
|
-
var client_1 = require("./client");
|
|
5
|
-
Object.defineProperty(exports, "ClientManager", { enumerable: true, get: function () { return client_1.VanillaClient; } });
|
|
6
|
-
var phone_auth_1 = require("./phone-auth");
|
|
7
|
-
Object.defineProperty(exports, "PhoneAuthManager", { enumerable: true, get: function () { return phone_auth_1.PhoneAuthManager; } });
|
|
8
|
-
// Export error utilities
|
|
9
|
-
var phone_auth_2 = require("../../core/phone-auth");
|
|
10
|
-
Object.defineProperty(exports, "PhoneAuthErrorCode", { enumerable: true, get: function () { return phone_auth_2.PhoneAuthErrorCode; } });
|
|
11
|
-
Object.defineProperty(exports, "isPhoneAuthError", { enumerable: true, get: function () { return phone_auth_2.isPhoneAuthError; } });
|
|
12
|
-
Object.defineProperty(exports, "isUserError", { enumerable: true, get: function () { return phone_auth_2.isUserError; } });
|
|
13
|
-
Object.defineProperty(exports, "getUserMessage", { enumerable: true, get: function () { return phone_auth_2.getUserMessage; } });
|
|
14
|
-
Object.defineProperty(exports, "isErrorCode", { enumerable: true, get: function () { return phone_auth_2.isErrorCode; } });
|
|
15
|
-
Object.defineProperty(exports, "getRetryDelay", { enumerable: true, get: function () { return phone_auth_2.getRetryDelay; } });
|
|
16
|
-
Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return phone_auth_2.isRetryableError; } });
|
|
17
|
-
Object.defineProperty(exports, "serializeError", { enumerable: true, get: function () { return phone_auth_2.serializeError; } });
|
|
18
|
-
Object.defineProperty(exports, "createErrorBreadcrumb", { enumerable: true, get: function () { return phone_auth_2.createErrorBreadcrumb; } });
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { AuthConfig, PhoneAuthResult, AuthError, AuthStep, PhoneAuthOptions } from '../../core/phone-auth';
|
|
2
|
-
export interface PhoneAuthState {
|
|
3
|
-
isLoading: boolean;
|
|
4
|
-
error: AuthError | null;
|
|
5
|
-
result: PhoneAuthResult | null;
|
|
6
|
-
currentStep: AuthStep;
|
|
7
|
-
isSupported: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class PhoneAuthManager {
|
|
10
|
-
private client;
|
|
11
|
-
private state;
|
|
12
|
-
private listeners;
|
|
13
|
-
constructor(config?: AuthConfig);
|
|
14
|
-
/**
|
|
15
|
-
* Get current state
|
|
16
|
-
*/
|
|
17
|
-
getState(): PhoneAuthState;
|
|
18
|
-
/**
|
|
19
|
-
* Subscribe to state changes
|
|
20
|
-
*/
|
|
21
|
-
subscribe(listener: (state: PhoneAuthState) => void): () => void;
|
|
22
|
-
/**
|
|
23
|
-
* Update state and notify listeners
|
|
24
|
-
*/
|
|
25
|
-
private updateState;
|
|
26
|
-
/**
|
|
27
|
-
* Verify phone number
|
|
28
|
-
*/
|
|
29
|
-
verify(options: PhoneAuthOptions): Promise<PhoneAuthResult>;
|
|
30
|
-
/**
|
|
31
|
-
* Get phone number
|
|
32
|
-
*/
|
|
33
|
-
getPhoneNumber(options?: Omit<PhoneAuthOptions, 'use_case' | 'phone_number'>): Promise<PhoneAuthResult>;
|
|
34
|
-
/**
|
|
35
|
-
* Verify specific phone number
|
|
36
|
-
*/
|
|
37
|
-
verifyPhoneNumber(phoneNumber: string, options?: Omit<PhoneAuthOptions, 'use_case' | 'phone_number'>): Promise<PhoneAuthResult>;
|
|
38
|
-
/**
|
|
39
|
-
* Reset state
|
|
40
|
-
*/
|
|
41
|
-
reset(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Check if browser supports secure phone authentication
|
|
44
|
-
*/
|
|
45
|
-
isSupported(): boolean;
|
|
46
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PhoneAuthManager = void 0;
|
|
13
|
-
const phone_auth_1 = require("../../core/phone-auth");
|
|
14
|
-
class PhoneAuthManager {
|
|
15
|
-
constructor(config = {}) {
|
|
16
|
-
this.listeners = [];
|
|
17
|
-
this.client = new phone_auth_1.PhoneAuthClient(config);
|
|
18
|
-
this.state = {
|
|
19
|
-
isLoading: false,
|
|
20
|
-
error: null,
|
|
21
|
-
result: null,
|
|
22
|
-
currentStep: 'idle',
|
|
23
|
-
isSupported: this.client.isSupported()
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get current state
|
|
28
|
-
*/
|
|
29
|
-
getState() {
|
|
30
|
-
return Object.assign({}, this.state);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Subscribe to state changes
|
|
34
|
-
*/
|
|
35
|
-
subscribe(listener) {
|
|
36
|
-
this.listeners.push(listener);
|
|
37
|
-
// Return unsubscribe function
|
|
38
|
-
return () => {
|
|
39
|
-
const index = this.listeners.indexOf(listener);
|
|
40
|
-
if (index !== -1) {
|
|
41
|
-
this.listeners.splice(index, 1);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Update state and notify listeners
|
|
47
|
-
*/
|
|
48
|
-
updateState(updates) {
|
|
49
|
-
this.state = Object.assign(Object.assign({}, this.state), updates);
|
|
50
|
-
this.listeners.forEach(listener => listener(this.getState()));
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Verify phone number
|
|
54
|
-
*/
|
|
55
|
-
verify(options) {
|
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
this.updateState({
|
|
58
|
-
isLoading: true,
|
|
59
|
-
error: null,
|
|
60
|
-
result: null,
|
|
61
|
-
currentStep: 'requesting'
|
|
62
|
-
});
|
|
63
|
-
try {
|
|
64
|
-
// Step 1: Prepare request
|
|
65
|
-
const preparedRequest = yield this.client.preparePhoneRequest(options);
|
|
66
|
-
// Step 2: Show authenticating state
|
|
67
|
-
this.updateState({ currentStep: 'authenticating' });
|
|
68
|
-
const credentialResponse = yield this.client.invokeSecurePrompt(preparedRequest);
|
|
69
|
-
// Step 3: Process response through appropriate endpoint
|
|
70
|
-
this.updateState({ currentStep: 'processing' });
|
|
71
|
-
// Cast to credential type - adapters never use headless mode
|
|
72
|
-
const credential = credentialResponse;
|
|
73
|
-
const processedResult = options.use_case === 'GetPhoneNumber'
|
|
74
|
-
? yield this.client.getPhoneNumber(credential, preparedRequest.session)
|
|
75
|
-
: yield this.client.verifyPhoneNumber(credential, preparedRequest.session);
|
|
76
|
-
// Create final result
|
|
77
|
-
const isVerifyResponse = 'verified' in processedResult;
|
|
78
|
-
const result = processedResult;
|
|
79
|
-
this.updateState({
|
|
80
|
-
result,
|
|
81
|
-
currentStep: 'complete',
|
|
82
|
-
isLoading: false
|
|
83
|
-
});
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
// Enhance error with context
|
|
88
|
-
const authError = error;
|
|
89
|
-
const enhancedError = Object.assign(Object.assign({}, authError), { context: authError.context || {
|
|
90
|
-
useCase: options.use_case,
|
|
91
|
-
timestamp: new Date().toISOString(),
|
|
92
|
-
userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : undefined,
|
|
93
|
-
url: typeof window !== 'undefined' ? window.location.href : undefined
|
|
94
|
-
} });
|
|
95
|
-
this.updateState({
|
|
96
|
-
error: enhancedError,
|
|
97
|
-
currentStep: 'idle',
|
|
98
|
-
isLoading: false
|
|
99
|
-
});
|
|
100
|
-
throw enhancedError;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get phone number
|
|
106
|
-
*/
|
|
107
|
-
getPhoneNumber(options) {
|
|
108
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
return this.verify(Object.assign({ use_case: 'GetPhoneNumber' }, options));
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Verify specific phone number
|
|
114
|
-
*/
|
|
115
|
-
verifyPhoneNumber(phoneNumber, options) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
return this.verify(Object.assign({ use_case: 'VerifyPhoneNumber', phone_number: phoneNumber }, options));
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Reset state
|
|
122
|
-
*/
|
|
123
|
-
reset() {
|
|
124
|
-
this.updateState({
|
|
125
|
-
isLoading: false,
|
|
126
|
-
error: null,
|
|
127
|
-
result: null,
|
|
128
|
-
currentStep: 'idle'
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Check if browser supports secure phone authentication
|
|
133
|
-
*/
|
|
134
|
-
isSupported() {
|
|
135
|
-
return this.state.isSupported;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.PhoneAuthManager = PhoneAuthManager;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { usePhoneAuth } from './usePhoneAuth';
|
|
2
|
-
export { useClient } from './useClient';
|
|
3
|
-
export { SDKClient } from '../../core/client';
|
|
4
|
-
export { PhoneAuthClient } from '../../core/phone-auth';
|
|
5
|
-
export type { ClientConfig, ClientResponse, RequestOptions } from '../../core/types';
|
|
6
|
-
export type { AuthConfig as PhoneAuthConfig, PhoneAuthOptions, PhoneAuthResult, AuthError, AuthStep } from '../../core/phone-auth';
|
|
7
|
-
export { PhoneAuthErrorCode, isPhoneAuthError, isUserError, getUserMessage, isErrorCode, getRetryDelay, isRetryableError, serializeError, createErrorBreadcrumb } from '../../core/phone-auth';
|
|
8
|
-
export type { PhoneAuthCallbacks, PLMN, SessionInfo, PrepareRequest, PrepareResponse, GetPhoneNumberRequest, GetPhoneNumberResponse, VerifyPhoneNumberRequest, VerifyPhoneNumberResponse, SecureCredentialRequest, SecureCredentialResponse, DigitalCredential, TS43Data, LinkData, ClientInfo, BrowserErrorType, BrowserErrorCodeType, BrowserNameType } from '../../core/phone-auth/types';
|
|
9
|
-
export { USE_CASE as UseCase, AUTHENTICATION_STRATEGY as AuthenticationStrategy, BrowserError, BrowserErrorCode, BrowserName } from '../../core/phone-auth/types';
|
|
10
|
-
export { USE_CASE, ERROR_CODE, ERROR_MESSAGES, ERROR_STATUS_CODES } from '../../core/phone-auth/api-types';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERROR_STATUS_CODES = exports.ERROR_MESSAGES = exports.ERROR_CODE = exports.USE_CASE = exports.BrowserName = exports.BrowserErrorCode = exports.BrowserError = exports.AuthenticationStrategy = exports.UseCase = exports.createErrorBreadcrumb = exports.serializeError = exports.isRetryableError = exports.getRetryDelay = exports.isErrorCode = exports.getUserMessage = exports.isUserError = exports.isPhoneAuthError = exports.PhoneAuthErrorCode = exports.PhoneAuthClient = exports.SDKClient = exports.useClient = exports.usePhoneAuth = void 0;
|
|
4
|
-
var usePhoneAuth_1 = require("./usePhoneAuth");
|
|
5
|
-
Object.defineProperty(exports, "usePhoneAuth", { enumerable: true, get: function () { return usePhoneAuth_1.usePhoneAuth; } });
|
|
6
|
-
var useClient_1 = require("./useClient");
|
|
7
|
-
Object.defineProperty(exports, "useClient", { enumerable: true, get: function () { return useClient_1.useClient; } });
|
|
8
|
-
var client_1 = require("../../core/client");
|
|
9
|
-
Object.defineProperty(exports, "SDKClient", { enumerable: true, get: function () { return client_1.SDKClient; } });
|
|
10
|
-
var phone_auth_1 = require("../../core/phone-auth");
|
|
11
|
-
Object.defineProperty(exports, "PhoneAuthClient", { enumerable: true, get: function () { return phone_auth_1.PhoneAuthClient; } });
|
|
12
|
-
// API response types are already exported via core/phone-auth/types
|
|
13
|
-
// Export error utilities
|
|
14
|
-
var phone_auth_2 = require("../../core/phone-auth");
|
|
15
|
-
Object.defineProperty(exports, "PhoneAuthErrorCode", { enumerable: true, get: function () { return phone_auth_2.PhoneAuthErrorCode; } });
|
|
16
|
-
Object.defineProperty(exports, "isPhoneAuthError", { enumerable: true, get: function () { return phone_auth_2.isPhoneAuthError; } });
|
|
17
|
-
Object.defineProperty(exports, "isUserError", { enumerable: true, get: function () { return phone_auth_2.isUserError; } });
|
|
18
|
-
Object.defineProperty(exports, "getUserMessage", { enumerable: true, get: function () { return phone_auth_2.getUserMessage; } });
|
|
19
|
-
Object.defineProperty(exports, "isErrorCode", { enumerable: true, get: function () { return phone_auth_2.isErrorCode; } });
|
|
20
|
-
Object.defineProperty(exports, "getRetryDelay", { enumerable: true, get: function () { return phone_auth_2.getRetryDelay; } });
|
|
21
|
-
Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return phone_auth_2.isRetryableError; } });
|
|
22
|
-
Object.defineProperty(exports, "serializeError", { enumerable: true, get: function () { return phone_auth_2.serializeError; } });
|
|
23
|
-
Object.defineProperty(exports, "createErrorBreadcrumb", { enumerable: true, get: function () { return phone_auth_2.createErrorBreadcrumb; } });
|
|
24
|
-
// Export constants for use case and strategy
|
|
25
|
-
var types_1 = require("../../core/phone-auth/types");
|
|
26
|
-
Object.defineProperty(exports, "UseCase", { enumerable: true, get: function () { return types_1.USE_CASE; } });
|
|
27
|
-
Object.defineProperty(exports, "AuthenticationStrategy", { enumerable: true, get: function () { return types_1.AUTHENTICATION_STRATEGY; } });
|
|
28
|
-
Object.defineProperty(exports, "BrowserError", { enumerable: true, get: function () { return types_1.BrowserError; } });
|
|
29
|
-
Object.defineProperty(exports, "BrowserErrorCode", { enumerable: true, get: function () { return types_1.BrowserErrorCode; } });
|
|
30
|
-
Object.defineProperty(exports, "BrowserName", { enumerable: true, get: function () { return types_1.BrowserName; } });
|
|
31
|
-
// Export API constants from api-types
|
|
32
|
-
var api_types_1 = require("../../core/phone-auth/api-types");
|
|
33
|
-
Object.defineProperty(exports, "USE_CASE", { enumerable: true, get: function () { return api_types_1.USE_CASE; } });
|
|
34
|
-
Object.defineProperty(exports, "ERROR_CODE", { enumerable: true, get: function () { return api_types_1.ERROR_CODE; } });
|
|
35
|
-
Object.defineProperty(exports, "ERROR_MESSAGES", { enumerable: true, get: function () { return api_types_1.ERROR_MESSAGES; } });
|
|
36
|
-
Object.defineProperty(exports, "ERROR_STATUS_CODES", { enumerable: true, get: function () { return api_types_1.ERROR_STATUS_CODES; } });
|