@clerk/shared 4.0.0-canary.v20260108183840 → 4.0.0-canary.v20260108210350
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/dist/runtime/alternativePhoneCode.d.mts +1 -1
- package/dist/runtime/alternativePhoneCode.d.ts +1 -1
- package/dist/runtime/apiUrlFromPublishableKey.d.mts +1 -1
- package/dist/runtime/authorization-errors.d.mts +1 -1
- package/dist/runtime/authorization-errors.d.ts +1 -1
- package/dist/runtime/authorization.d.mts +1 -1
- package/dist/runtime/authorization.d.ts +1 -1
- package/dist/runtime/clerkEventBus.d.mts +1 -1
- package/dist/runtime/clerkEventBus.d.ts +1 -1
- package/dist/runtime/color.d.mts +1 -1
- package/dist/runtime/color.d.ts +1 -1
- package/dist/runtime/deriveState.d.mts +1 -1
- package/dist/runtime/deriveState.d.ts +1 -1
- package/dist/runtime/error.d.mts +1 -2
- package/dist/runtime/error.d.ts +1 -2
- package/dist/runtime/{handleValueOrFn-BIJDEdVJ.d.ts → handleValueOrFn-4-yw9hYF.d.ts} +1 -1
- package/dist/runtime/{handleValueOrFn-BIJDEdVJ.d.ts.map → handleValueOrFn-4-yw9hYF.d.ts.map} +1 -1
- package/dist/runtime/{handleValueOrFn-DCe6q2n8.d.mts → handleValueOrFn-BcXGw100.d.mts} +1 -1
- package/dist/runtime/{handleValueOrFn-DCe6q2n8.d.mts.map → handleValueOrFn-BcXGw100.d.mts.map} +1 -1
- package/dist/runtime/handleValueOrFn.d.mts +1 -1
- package/dist/runtime/handleValueOrFn.d.ts +1 -1
- package/dist/runtime/{index-k_uFz3GY.d.ts → index-BG5qxJEu.d.ts} +293 -25
- package/dist/runtime/index-BG5qxJEu.d.ts.map +1 -0
- package/dist/runtime/{index-DkxJKdK7.d.mts → index-D2EaVwjc.d.mts} +293 -25
- package/dist/runtime/index-D2EaVwjc.d.mts.map +1 -0
- package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/componentGuards.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/componentGuards.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/injectedWeb3EthProviders.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/injectedWeb3EthProviders.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passkeys.d.mts +1 -2
- package/dist/runtime/internal/clerk-js/passkeys.d.mts.map +1 -1
- package/dist/runtime/internal/clerk-js/passkeys.d.ts +1 -2
- package/dist/runtime/internal/clerk-js/passkeys.d.ts.map +1 -1
- package/dist/runtime/internal/clerk-js/passwords/complexity.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/complexity.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/password.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/password.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/strength.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/passwords/strength.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/queryParams.d.mts +1 -2
- package/dist/runtime/internal/clerk-js/queryParams.d.mts.map +1 -1
- package/dist/runtime/internal/clerk-js/queryParams.d.ts +1 -2
- package/dist/runtime/internal/clerk-js/queryParams.d.ts.map +1 -1
- package/dist/runtime/internal/clerk-js/redirectUrls.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/redirectUrls.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/sessionTasks.d.mts +2 -2
- package/dist/runtime/internal/clerk-js/sessionTasks.d.ts +2 -2
- package/dist/runtime/internal/clerk-js/url.d.mts +2 -2
- package/dist/runtime/internal/clerk-js/url.d.ts +2 -2
- package/dist/runtime/internal/clerk-js/user.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/user.d.ts +1 -1
- package/dist/runtime/internal/clerk-js/web3.d.mts +1 -1
- package/dist/runtime/internal/clerk-js/web3.d.ts +1 -1
- package/dist/runtime/jwtPayloadParser.d.mts +1 -1
- package/dist/runtime/jwtPayloadParser.d.ts +1 -1
- package/dist/runtime/keys.d.mts +1 -1
- package/dist/runtime/keys.d.ts +1 -1
- package/dist/runtime/loadClerkJsScript.d.mts +1 -1
- package/dist/runtime/loadClerkJsScript.d.ts +1 -1
- package/dist/runtime/loadClerkJsScript.js +2 -2
- package/dist/runtime/loadClerkJsScript.mjs +2 -2
- package/dist/runtime/oauth.d.mts +1 -1
- package/dist/runtime/oauth.d.ts +1 -1
- package/dist/runtime/organization.d.mts +1 -1
- package/dist/runtime/organization.d.ts +1 -1
- package/dist/runtime/pathMatcher.d.mts +1 -1
- package/dist/runtime/pathMatcher.d.ts +1 -1
- package/dist/runtime/react/index.d.mts +1 -2
- package/dist/runtime/react/index.d.mts.map +1 -1
- package/dist/runtime/react/index.d.ts +1 -2
- package/dist/runtime/react/index.d.ts.map +1 -1
- package/dist/runtime/router.d.mts +1 -1
- package/dist/runtime/router.d.ts +1 -1
- package/dist/runtime/router.d.ts.map +1 -1
- package/dist/runtime/saml.d.mts +1 -1
- package/dist/runtime/saml.d.ts +1 -1
- package/dist/runtime/telemetry.d.mts +1 -1
- package/dist/runtime/telemetry.d.ts +1 -1
- package/dist/runtime/types/index.d.mts +2 -2
- package/dist/runtime/types/index.d.ts +2 -2
- package/dist/runtime/ui/index.d.mts +1 -1
- package/dist/runtime/ui/index.d.ts +1 -1
- package/dist/runtime/{url-B_oh3SHa.d.mts → url-C-GZOwH1.d.mts} +2 -2
- package/dist/runtime/{url-B_oh3SHa.d.mts.map → url-C-GZOwH1.d.mts.map} +1 -1
- package/dist/runtime/{url-aTuqh4yD.d.ts → url-ChpiEV28.d.ts} +2 -2
- package/dist/runtime/{url-aTuqh4yD.d.ts.map → url-ChpiEV28.d.ts.map} +1 -1
- package/dist/runtime/utils/index.d.mts +1 -1
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/{versionSelector-CaW2zMsO.js → versionSelector-B7bOxwEq.js} +2 -2
- package/dist/runtime/{versionSelector-CaW2zMsO.js.map → versionSelector-B7bOxwEq.js.map} +1 -1
- package/dist/runtime/{versionSelector-DhOQUbHG.mjs → versionSelector-BkoZ5LSz.mjs} +2 -2
- package/dist/runtime/{versionSelector-DhOQUbHG.mjs.map → versionSelector-BkoZ5LSz.mjs.map} +1 -1
- package/dist/runtime/versionSelector.js +1 -1
- package/dist/runtime/versionSelector.mjs +1 -1
- package/dist/runtime/web3.d.mts +1 -1
- package/dist/runtime/web3.d.ts +1 -1
- package/dist/types/index.d.mts +67 -11
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.d.ts +67 -11
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/runtime/error-B_zIwdD8.d.ts +0 -217
- package/dist/runtime/error-B_zIwdD8.d.ts.map +0 -1
- package/dist/runtime/error-Cfwl1XbZ.d.mts +0 -217
- package/dist/runtime/error-Cfwl1XbZ.d.mts.map +0 -1
- package/dist/runtime/index-DkxJKdK7.d.mts.map +0 -1
- package/dist/runtime/index-k_uFz3GY.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { Gf as ClerkAPIError, Vf as ClerkAPIResponseError, hl as ClerkAPIErrorJSON, ml as ClerkAPIError$1, zf as ClerkRuntimeError } from "./index-k_uFz3GY.js";
|
|
2
|
-
|
|
3
|
-
//#region src/errors/parseError.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Parses an array of ClerkAPIErrorJSON objects into an array of ClerkAPIError objects.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
declare function parseErrors(data?: ClerkAPIErrorJSON[]): ClerkAPIError$1[];
|
|
11
|
-
/**
|
|
12
|
-
* Parses a ClerkAPIErrorJSON object into a ClerkAPIError object.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use `ClerkAPIError` class instead
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
declare function parseError(error: ClerkAPIErrorJSON): ClerkAPIError$1;
|
|
19
|
-
/**
|
|
20
|
-
* Converts a ClerkAPIError object into a ClerkAPIErrorJSON object.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
declare function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON;
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/errors/missingExpiredTokenError.d.ts
|
|
27
|
-
/**
|
|
28
|
-
* Error class representing a missing expired token error from the API.
|
|
29
|
-
* This error occurs when the server requires an expired token to mint a new session token.
|
|
30
|
-
*
|
|
31
|
-
* Use the static `is` method to check if a ClerkAPIResponseError matches this error type.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* if (MissingExpiredTokenError.is(error)) {
|
|
36
|
-
* // Handle the missing expired token error
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
declare class MissingExpiredTokenError extends ClerkAPIResponseError {
|
|
41
|
-
static kind: string;
|
|
42
|
-
static readonly ERROR_CODE: "missing_expired_token";
|
|
43
|
-
static readonly STATUS: 422;
|
|
44
|
-
/**
|
|
45
|
-
* Type guard to check if an error is a MissingExpiredTokenError.
|
|
46
|
-
* This checks the error's properties (status and error code) rather than instanceof,
|
|
47
|
-
* allowing it to work with ClerkAPIResponseError instances thrown from the API layer.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* try {
|
|
52
|
-
* await someApiCall();
|
|
53
|
-
* } catch (e) {
|
|
54
|
-
* if (MissingExpiredTokenError.is(e)) {
|
|
55
|
-
* // e is typed as ClerkAPIResponseError with the specific error properties
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
static is(err: unknown): err is ClerkAPIResponseError;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/errors/errorThrower.d.ts
|
|
64
|
-
declare const DefaultMessages: Readonly<{
|
|
65
|
-
InvalidProxyUrlErrorMessage: "The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})";
|
|
66
|
-
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})";
|
|
67
|
-
MissingPublishableKeyErrorMessage: "Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.";
|
|
68
|
-
MissingSecretKeyErrorMessage: "Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.";
|
|
69
|
-
MissingClerkProvider: "{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider";
|
|
70
|
-
}>;
|
|
71
|
-
type MessageKeys = keyof typeof DefaultMessages;
|
|
72
|
-
type Messages = Record<MessageKeys, string>;
|
|
73
|
-
type CustomMessages = Partial<Messages>;
|
|
74
|
-
type ErrorThrowerOptions = {
|
|
75
|
-
packageName: string;
|
|
76
|
-
customMessages?: CustomMessages;
|
|
77
|
-
};
|
|
78
|
-
interface ErrorThrower {
|
|
79
|
-
setPackageName(options: ErrorThrowerOptions): ErrorThrower;
|
|
80
|
-
setMessages(options: ErrorThrowerOptions): ErrorThrower;
|
|
81
|
-
throwInvalidPublishableKeyError(params: {
|
|
82
|
-
key?: string;
|
|
83
|
-
}): never;
|
|
84
|
-
throwInvalidProxyUrl(params: {
|
|
85
|
-
url?: string;
|
|
86
|
-
}): never;
|
|
87
|
-
throwMissingPublishableKeyError(): never;
|
|
88
|
-
throwMissingSecretKeyError(): never;
|
|
89
|
-
throwMissingClerkProviderError(params: {
|
|
90
|
-
source?: string;
|
|
91
|
-
}): never;
|
|
92
|
-
throw(message: string): never;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Builds an error thrower.
|
|
96
|
-
*
|
|
97
|
-
* @internal
|
|
98
|
-
*/
|
|
99
|
-
declare function buildErrorThrower({
|
|
100
|
-
packageName,
|
|
101
|
-
customMessages
|
|
102
|
-
}: ErrorThrowerOptions): ErrorThrower;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/errors/emailLinkError.d.ts
|
|
105
|
-
declare class EmailLinkError extends Error {
|
|
106
|
-
code: string;
|
|
107
|
-
constructor(code: string);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Use `EmailLinkErrorCodeStatus` instead.
|
|
111
|
-
*
|
|
112
|
-
* @internal
|
|
113
|
-
*/
|
|
114
|
-
declare const EmailLinkErrorCode: {
|
|
115
|
-
Expired: string;
|
|
116
|
-
Failed: string;
|
|
117
|
-
ClientMismatch: string;
|
|
118
|
-
};
|
|
119
|
-
declare const EmailLinkErrorCodeStatus: {
|
|
120
|
-
readonly Expired: "expired";
|
|
121
|
-
readonly Failed: "failed";
|
|
122
|
-
readonly ClientMismatch: "client_mismatch";
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/errors/metamaskError.d.ts
|
|
126
|
-
interface MetamaskError extends Error {
|
|
127
|
-
code: 4001 | 32602 | 32603;
|
|
128
|
-
message: string;
|
|
129
|
-
data?: unknown;
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/errors/webAuthNError.d.ts
|
|
133
|
-
type ClerkWebAuthnErrorCode = 'passkey_not_supported' | 'passkey_pa_not_supported' | 'passkey_invalid_rpID_or_domain' | 'passkey_already_exists' | 'passkey_operation_aborted' | 'passkey_retrieval_cancelled' | 'passkey_retrieval_failed' | 'passkey_registration_cancelled' | 'passkey_registration_failed';
|
|
134
|
-
declare class ClerkWebAuthnError extends ClerkRuntimeError {
|
|
135
|
-
/**
|
|
136
|
-
* A unique code identifying the error, can be used for localization.
|
|
137
|
-
*/
|
|
138
|
-
code: ClerkWebAuthnErrorCode;
|
|
139
|
-
constructor(message: string, {
|
|
140
|
-
code
|
|
141
|
-
}: {
|
|
142
|
-
code: ClerkWebAuthnErrorCode;
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/errors/helpers.d.ts
|
|
147
|
-
/**
|
|
148
|
-
* Checks if the provided error object is an unauthorized error.
|
|
149
|
-
*
|
|
150
|
-
* @internal
|
|
151
|
-
*
|
|
152
|
-
* @deprecated This is no longer used, and will be removed in the next major version.
|
|
153
|
-
*/
|
|
154
|
-
declare function isUnauthorizedError(e: any): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Checks if the provided error object is a captcha error.
|
|
157
|
-
*
|
|
158
|
-
* @internal
|
|
159
|
-
*/
|
|
160
|
-
declare function isCaptchaError(e: ClerkAPIResponseError): boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Checks if the provided error is a 4xx error.
|
|
163
|
-
*
|
|
164
|
-
* @internal
|
|
165
|
-
*/
|
|
166
|
-
declare function is4xxError(e: any): boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Checks if the provided error is a network error.
|
|
169
|
-
*
|
|
170
|
-
* @internal
|
|
171
|
-
*/
|
|
172
|
-
declare function isNetworkError(e: any): boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Checks if the provided error is either a ClerkAPIResponseError, a ClerkRuntimeError, or a MetamaskError.
|
|
175
|
-
*
|
|
176
|
-
* @internal
|
|
177
|
-
*/
|
|
178
|
-
declare function isKnownError(error: any): error is ClerkAPIResponseError | ClerkRuntimeError | MetamaskError;
|
|
179
|
-
/**
|
|
180
|
-
* Checks if the provided error is a Clerk runtime error indicating a reverification was cancelled.
|
|
181
|
-
*
|
|
182
|
-
* @internal
|
|
183
|
-
*/
|
|
184
|
-
declare function isReverificationCancelledError(err: any): boolean;
|
|
185
|
-
/**
|
|
186
|
-
* Checks if the provided error is a Metamask error.
|
|
187
|
-
*
|
|
188
|
-
* @internal
|
|
189
|
-
*/
|
|
190
|
-
declare function isMetamaskError(err: any): err is MetamaskError;
|
|
191
|
-
/**
|
|
192
|
-
* Checks if the provided error is clerk api response error indicating a user is locked.
|
|
193
|
-
*
|
|
194
|
-
* @internal
|
|
195
|
-
*/
|
|
196
|
-
declare function isUserLockedError(err: any): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Checks if the provided error is a clerk api response error indicating a password was pwned.
|
|
199
|
-
*
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
declare function isPasswordPwnedError(err: any): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Checks if the provided error is a clerk api response error indicating a password was compromised.
|
|
205
|
-
*
|
|
206
|
-
* @internal
|
|
207
|
-
*/
|
|
208
|
-
declare function isPasswordCompromisedError(err: any): boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Checks if the provided error is an EmailLinkError.
|
|
211
|
-
*
|
|
212
|
-
* @internal
|
|
213
|
-
*/
|
|
214
|
-
declare function isEmailLinkError(err: Error): err is EmailLinkError;
|
|
215
|
-
//#endregion
|
|
216
|
-
export { parseErrors as C, parseError as S, ErrorThrower as _, isMetamaskError as a, MissingExpiredTokenError as b, isPasswordPwnedError as c, isUserLockedError as d, ClerkWebAuthnError as f, EmailLinkErrorCodeStatus as g, EmailLinkErrorCode as h, isKnownError as i, isReverificationCancelledError as l, EmailLinkError as m, isCaptchaError as n, isNetworkError as o, MetamaskError as p, isEmailLinkError as r, isPasswordCompromisedError as s, is4xxError as t, isUnauthorizedError as u, ErrorThrowerOptions as v, errorToJSON as x, buildErrorThrower as y };
|
|
217
|
-
//# sourceMappingURL=error-B_zIwdD8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-B_zIwdD8.d.ts","names":[],"sources":["../../src/errors/parseError.ts","../../src/errors/missingExpiredTokenError.ts","../../src/errors/errorThr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;;;;ACRjC,iBAoEA,iBAAA,CApEmB,GAAA,EAAA,GAAA,CAAA,EAAA,OAAA;AAWnC;AASA;AAUA;AAWA;;AAA2E,iBAoC3D,oBAAA,CApC2D,GAAA,EAAA,GAAA,CAAA,EAAA,OAAA;;;AAS3E;AASA;AASA;AASgB,iBASA,0BAAA,CAToB,GAAA,EAAA,GAAA,CAAA,EAAA,OAAA;AASpC;AASA;;;;iBAAgB,gBAAA,MAAsB,eAAe"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { Gf as ClerkAPIError, Vf as ClerkAPIResponseError, hl as ClerkAPIErrorJSON, ml as ClerkAPIError$1, zf as ClerkRuntimeError } from "./index-DkxJKdK7.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/errors/parseError.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Parses an array of ClerkAPIErrorJSON objects into an array of ClerkAPIError objects.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
declare function parseErrors(data?: ClerkAPIErrorJSON[]): ClerkAPIError$1[];
|
|
11
|
-
/**
|
|
12
|
-
* Parses a ClerkAPIErrorJSON object into a ClerkAPIError object.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use `ClerkAPIError` class instead
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
declare function parseError(error: ClerkAPIErrorJSON): ClerkAPIError$1;
|
|
19
|
-
/**
|
|
20
|
-
* Converts a ClerkAPIError object into a ClerkAPIErrorJSON object.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
declare function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON;
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/errors/missingExpiredTokenError.d.ts
|
|
27
|
-
/**
|
|
28
|
-
* Error class representing a missing expired token error from the API.
|
|
29
|
-
* This error occurs when the server requires an expired token to mint a new session token.
|
|
30
|
-
*
|
|
31
|
-
* Use the static `is` method to check if a ClerkAPIResponseError matches this error type.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* if (MissingExpiredTokenError.is(error)) {
|
|
36
|
-
* // Handle the missing expired token error
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
declare class MissingExpiredTokenError extends ClerkAPIResponseError {
|
|
41
|
-
static kind: string;
|
|
42
|
-
static readonly ERROR_CODE: "missing_expired_token";
|
|
43
|
-
static readonly STATUS: 422;
|
|
44
|
-
/**
|
|
45
|
-
* Type guard to check if an error is a MissingExpiredTokenError.
|
|
46
|
-
* This checks the error's properties (status and error code) rather than instanceof,
|
|
47
|
-
* allowing it to work with ClerkAPIResponseError instances thrown from the API layer.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* try {
|
|
52
|
-
* await someApiCall();
|
|
53
|
-
* } catch (e) {
|
|
54
|
-
* if (MissingExpiredTokenError.is(e)) {
|
|
55
|
-
* // e is typed as ClerkAPIResponseError with the specific error properties
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
static is(err: unknown): err is ClerkAPIResponseError;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/errors/errorThrower.d.ts
|
|
64
|
-
declare const DefaultMessages: Readonly<{
|
|
65
|
-
InvalidProxyUrlErrorMessage: "The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})";
|
|
66
|
-
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})";
|
|
67
|
-
MissingPublishableKeyErrorMessage: "Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.";
|
|
68
|
-
MissingSecretKeyErrorMessage: "Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.";
|
|
69
|
-
MissingClerkProvider: "{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider";
|
|
70
|
-
}>;
|
|
71
|
-
type MessageKeys = keyof typeof DefaultMessages;
|
|
72
|
-
type Messages = Record<MessageKeys, string>;
|
|
73
|
-
type CustomMessages = Partial<Messages>;
|
|
74
|
-
type ErrorThrowerOptions = {
|
|
75
|
-
packageName: string;
|
|
76
|
-
customMessages?: CustomMessages;
|
|
77
|
-
};
|
|
78
|
-
interface ErrorThrower {
|
|
79
|
-
setPackageName(options: ErrorThrowerOptions): ErrorThrower;
|
|
80
|
-
setMessages(options: ErrorThrowerOptions): ErrorThrower;
|
|
81
|
-
throwInvalidPublishableKeyError(params: {
|
|
82
|
-
key?: string;
|
|
83
|
-
}): never;
|
|
84
|
-
throwInvalidProxyUrl(params: {
|
|
85
|
-
url?: string;
|
|
86
|
-
}): never;
|
|
87
|
-
throwMissingPublishableKeyError(): never;
|
|
88
|
-
throwMissingSecretKeyError(): never;
|
|
89
|
-
throwMissingClerkProviderError(params: {
|
|
90
|
-
source?: string;
|
|
91
|
-
}): never;
|
|
92
|
-
throw(message: string): never;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Builds an error thrower.
|
|
96
|
-
*
|
|
97
|
-
* @internal
|
|
98
|
-
*/
|
|
99
|
-
declare function buildErrorThrower({
|
|
100
|
-
packageName,
|
|
101
|
-
customMessages
|
|
102
|
-
}: ErrorThrowerOptions): ErrorThrower;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/errors/emailLinkError.d.ts
|
|
105
|
-
declare class EmailLinkError extends Error {
|
|
106
|
-
code: string;
|
|
107
|
-
constructor(code: string);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Use `EmailLinkErrorCodeStatus` instead.
|
|
111
|
-
*
|
|
112
|
-
* @internal
|
|
113
|
-
*/
|
|
114
|
-
declare const EmailLinkErrorCode: {
|
|
115
|
-
Expired: string;
|
|
116
|
-
Failed: string;
|
|
117
|
-
ClientMismatch: string;
|
|
118
|
-
};
|
|
119
|
-
declare const EmailLinkErrorCodeStatus: {
|
|
120
|
-
readonly Expired: "expired";
|
|
121
|
-
readonly Failed: "failed";
|
|
122
|
-
readonly ClientMismatch: "client_mismatch";
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/errors/metamaskError.d.ts
|
|
126
|
-
interface MetamaskError extends Error {
|
|
127
|
-
code: 4001 | 32602 | 32603;
|
|
128
|
-
message: string;
|
|
129
|
-
data?: unknown;
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/errors/webAuthNError.d.ts
|
|
133
|
-
type ClerkWebAuthnErrorCode = 'passkey_not_supported' | 'passkey_pa_not_supported' | 'passkey_invalid_rpID_or_domain' | 'passkey_already_exists' | 'passkey_operation_aborted' | 'passkey_retrieval_cancelled' | 'passkey_retrieval_failed' | 'passkey_registration_cancelled' | 'passkey_registration_failed';
|
|
134
|
-
declare class ClerkWebAuthnError extends ClerkRuntimeError {
|
|
135
|
-
/**
|
|
136
|
-
* A unique code identifying the error, can be used for localization.
|
|
137
|
-
*/
|
|
138
|
-
code: ClerkWebAuthnErrorCode;
|
|
139
|
-
constructor(message: string, {
|
|
140
|
-
code
|
|
141
|
-
}: {
|
|
142
|
-
code: ClerkWebAuthnErrorCode;
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/errors/helpers.d.ts
|
|
147
|
-
/**
|
|
148
|
-
* Checks if the provided error object is an unauthorized error.
|
|
149
|
-
*
|
|
150
|
-
* @internal
|
|
151
|
-
*
|
|
152
|
-
* @deprecated This is no longer used, and will be removed in the next major version.
|
|
153
|
-
*/
|
|
154
|
-
declare function isUnauthorizedError(e: any): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Checks if the provided error object is a captcha error.
|
|
157
|
-
*
|
|
158
|
-
* @internal
|
|
159
|
-
*/
|
|
160
|
-
declare function isCaptchaError(e: ClerkAPIResponseError): boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Checks if the provided error is a 4xx error.
|
|
163
|
-
*
|
|
164
|
-
* @internal
|
|
165
|
-
*/
|
|
166
|
-
declare function is4xxError(e: any): boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Checks if the provided error is a network error.
|
|
169
|
-
*
|
|
170
|
-
* @internal
|
|
171
|
-
*/
|
|
172
|
-
declare function isNetworkError(e: any): boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Checks if the provided error is either a ClerkAPIResponseError, a ClerkRuntimeError, or a MetamaskError.
|
|
175
|
-
*
|
|
176
|
-
* @internal
|
|
177
|
-
*/
|
|
178
|
-
declare function isKnownError(error: any): error is ClerkAPIResponseError | ClerkRuntimeError | MetamaskError;
|
|
179
|
-
/**
|
|
180
|
-
* Checks if the provided error is a Clerk runtime error indicating a reverification was cancelled.
|
|
181
|
-
*
|
|
182
|
-
* @internal
|
|
183
|
-
*/
|
|
184
|
-
declare function isReverificationCancelledError(err: any): boolean;
|
|
185
|
-
/**
|
|
186
|
-
* Checks if the provided error is a Metamask error.
|
|
187
|
-
*
|
|
188
|
-
* @internal
|
|
189
|
-
*/
|
|
190
|
-
declare function isMetamaskError(err: any): err is MetamaskError;
|
|
191
|
-
/**
|
|
192
|
-
* Checks if the provided error is clerk api response error indicating a user is locked.
|
|
193
|
-
*
|
|
194
|
-
* @internal
|
|
195
|
-
*/
|
|
196
|
-
declare function isUserLockedError(err: any): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Checks if the provided error is a clerk api response error indicating a password was pwned.
|
|
199
|
-
*
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
declare function isPasswordPwnedError(err: any): boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Checks if the provided error is a clerk api response error indicating a password was compromised.
|
|
205
|
-
*
|
|
206
|
-
* @internal
|
|
207
|
-
*/
|
|
208
|
-
declare function isPasswordCompromisedError(err: any): boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Checks if the provided error is an EmailLinkError.
|
|
211
|
-
*
|
|
212
|
-
* @internal
|
|
213
|
-
*/
|
|
214
|
-
declare function isEmailLinkError(err: Error): err is EmailLinkError;
|
|
215
|
-
//#endregion
|
|
216
|
-
export { parseErrors as C, parseError as S, ErrorThrower as _, isMetamaskError as a, MissingExpiredTokenError as b, isPasswordPwnedError as c, isUserLockedError as d, ClerkWebAuthnError as f, EmailLinkErrorCodeStatus as g, EmailLinkErrorCode as h, isKnownError as i, isReverificationCancelledError as l, EmailLinkError as m, isCaptchaError as n, isNetworkError as o, MetamaskError as p, isEmailLinkError as r, isPasswordCompromisedError as s, is4xxError as t, isUnauthorizedError as u, ErrorThrowerOptions as v, errorToJSON as x, buildErrorThrower as y };
|
|
217
|
-
//# sourceMappingURL=error-Cfwl1XbZ.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-Cfwl1XbZ.d.mts","names":[],"sources":["../../src/errors/parseError.ts","../../src/errors/missingExpiredTokenError.ts","../../src/errors/errorThrower.ts","../../src/errors/emailLinkError.ts","../../src/errors/metamaskError.ts","../../src/errors/webAuthNError.ts","../../src/errors/helpers.ts"],"sourcesContent":[],"mappings":";;;;;AAQA;AAWA;AASA;;iBApBgB,WAAA,QAAkB,sBAA2B;;ACO7D;;;;;ACfqB;AAUhB,iBFSW,UAAA,CETO,KAAA,EFSW,iBETZ,CAAA,EFSgC,eEThC;AAAA;AAItB;AAKA;;;AAGuB,iBFMP,WAAA,CENO,KAAA,EFMY,aENZ,GAAA,IAAA,CAAA,EFMmC,iBENnC;;;;;AFdvB;AAWA;AASA;;;;ACbA;;;;;ACPK,cDOQ,wBAAA,SAAiC,qBAAA,CCPC;EAE1C,OAAA,IAAQ,EAAA,MAAA;EAER,gBAAA,UAAc,EAAA,uBAAU;EAEjB,gBAAA,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