@clerk/shared 4.32.0-snapshot.v20260904162929 → 4.32.0
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/_chunks/{error-C-B61RHn.js → error-CdWUgmMd.js} +4 -4
- package/dist/_chunks/error-CdWUgmMd.js.map +1 -0
- package/dist/_chunks/{error-CYyD2kei.mjs → error-wrUdW78M.mjs} +4 -4
- package/dist/_chunks/error-wrUdW78M.mjs.map +1 -0
- package/dist/error.js +1 -1
- package/dist/error.mjs +1 -1
- package/dist/errors/errorThrower.d.mts +3 -3
- package/dist/errors/errorThrower.d.ts +3 -3
- package/dist/errors/errorThrower.js +3 -3
- package/dist/internal/clerk-js/componentGuards.d.mts +2 -1
- package/dist/internal/clerk-js/componentGuards.d.ts +2 -1
- package/dist/internal/clerk-js/componentGuards.js +4 -0
- package/dist/internal/clerk-js/componentGuards.js.map +1 -1
- package/dist/internal/clerk-js/componentGuards.mjs +4 -1
- package/dist/internal/clerk-js/componentGuards.mjs.map +1 -1
- package/dist/internal/clerk-js/passkeys.js +1 -1
- package/dist/internal/clerk-js/passkeys.mjs +1 -1
- package/dist/internal/clerk-js/protectCheck.js +1 -1
- package/dist/internal/clerk-js/protectCheck.mjs +1 -1
- package/dist/internal/clerk-js/warnings.d.mts +3 -2
- package/dist/internal/clerk-js/warnings.d.ts +3 -2
- package/dist/internal/clerk-js/warnings.js +2 -1
- package/dist/internal/clerk-js/warnings.js.map +1 -1
- package/dist/internal/clerk-js/warnings.mjs +2 -1
- package/dist/internal/clerk-js/warnings.mjs.map +1 -1
- package/dist/internal/clerk-js/web3.js +1 -1
- package/dist/internal/clerk-js/web3.mjs +1 -1
- package/dist/keys.d.mts +1 -6
- package/dist/keys.d.ts +1 -6
- package/dist/keys.js +2 -8
- package/dist/keys.js.map +1 -1
- package/dist/keys.mjs +3 -8
- package/dist/keys.mjs.map +1 -1
- package/dist/loadClerkJsScript.js +2 -2
- package/dist/loadClerkJsScript.js.map +1 -1
- package/dist/loadClerkJsScript.mjs +2 -2
- package/dist/loadClerkJsScript.mjs.map +1 -1
- package/dist/react/hooks/index.d.mts +2 -0
- package/dist/react/hooks/index.d.ts +2 -0
- package/dist/react/hooks/index.js +2 -0
- package/dist/react/hooks/useClerk.d.mts +1 -1
- package/dist/react/hooks/useClerk.d.ts +1 -1
- package/dist/react/hooks/useClerk.js +1 -1
- package/dist/react/hooks/useOAuthDeviceVerification.types.d.mts +31 -2
- package/dist/react/hooks/useOAuthDeviceVerification.types.d.ts +31 -2
- package/dist/react/hooks/useOrganization.d.mts +1 -1
- package/dist/react/hooks/useOrganization.d.ts +1 -1
- package/dist/react/hooks/useOrganizationDirectorySync.d.mts +27 -0
- package/dist/react/hooks/useOrganizationDirectorySync.d.ts +27 -0
- package/dist/react/hooks/useOrganizationDirectorySync.js +89 -0
- package/dist/react/hooks/useOrganizationDirectorySync.shared.js +49 -0
- package/dist/react/hooks/useOrganizationDirectorySyncUsers.d.mts +53 -0
- package/dist/react/hooks/useOrganizationDirectorySyncUsers.d.ts +53 -0
- package/dist/react/hooks/useOrganizationDirectorySyncUsers.js +71 -0
- package/dist/react/hooks/useOrganizationEnterpriseConnectionTestRuns.js +7 -5
- package/dist/react/hooks/useOrganizationList.d.mts +1 -1
- package/dist/react/hooks/useOrganizationList.d.ts +1 -1
- package/dist/react/hooks/useReverification.d.mts +1 -1
- package/dist/react/hooks/useReverification.d.ts +1 -1
- package/dist/react/index.d.mts +3 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +199 -8
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +198 -9
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/stable-keys.js +5 -1
- package/dist/types/billing.d.mts +1 -1
- package/dist/types/billing.d.ts +1 -1
- package/dist/types/clerk.d.mts +19 -3
- package/dist/types/clerk.d.ts +19 -3
- package/dist/types/directorySync.d.mts +123 -0
- package/dist/types/directorySync.d.ts +123 -0
- package/dist/types/elementIds.d.mts +2 -2
- package/dist/types/elementIds.d.ts +2 -2
- package/dist/types/hooks.d.mts +11 -11
- package/dist/types/hooks.d.ts +11 -11
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/localization.d.mts +108 -0
- package/dist/types/localization.d.ts +108 -0
- package/dist/types/oauthApplication.d.mts +76 -3
- package/dist/types/oauthApplication.d.ts +76 -3
- package/dist/types/organization.d.mts +11 -1
- package/dist/types/organization.d.ts +11 -1
- package/dist/types/organizationDomain.d.mts +3 -3
- package/dist/types/organizationDomain.d.ts +3 -3
- package/dist/types/signIn.d.mts +2 -0
- package/dist/types/signIn.d.ts +2 -0
- package/dist/types/signInFuture.d.mts +19 -7
- package/dist/types/signInFuture.d.ts +19 -7
- package/dist/types/signUpFuture.d.mts +5 -5
- package/dist/types/signUpFuture.d.ts +5 -5
- package/dist/types/user.d.mts +1 -1
- package/dist/types/user.d.ts +1 -1
- package/dist/types/userSettings.d.mts +2 -1
- package/dist/types/userSettings.d.ts +2 -1
- package/dist/versionSelector.js +1 -1
- package/dist/versionSelector.js.map +1 -1
- package/dist/versionSelector.mjs +1 -1
- package/dist/versionSelector.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/_chunks/error-C-B61RHn.js.map +0 -1
- package/dist/_chunks/error-CYyD2kei.mjs.map +0 -1
|
@@ -224,21 +224,21 @@ npx clerk@latest init
|
|
|
224
224
|
|
|
225
225
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
226
226
|
|
|
227
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com
|
|
227
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.`,
|
|
228
228
|
MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run:
|
|
229
229
|
|
|
230
230
|
npx clerk@latest init
|
|
231
231
|
|
|
232
232
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
233
233
|
|
|
234
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
234
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
235
235
|
MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run:
|
|
236
236
|
|
|
237
237
|
npx clerk@latest init
|
|
238
238
|
|
|
239
239
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
240
240
|
|
|
241
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
241
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
242
242
|
MissingClerkProvider: `{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`
|
|
243
243
|
});
|
|
244
244
|
/**
|
|
@@ -646,4 +646,4 @@ Object.defineProperty(exports, 'parseErrors', {
|
|
|
646
646
|
return parseErrors;
|
|
647
647
|
}
|
|
648
648
|
});
|
|
649
|
-
//# sourceMappingURL=error-
|
|
649
|
+
//# sourceMappingURL=error-CdWUgmMd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-CdWUgmMd.js","names":["createErrorTypeGuard","ClerkError","createErrorTypeGuard","ClerkRuntimeError","isClerkRuntimeError","ClerkRuntimeError","isClerkRuntimeError"],"sources":["../../src/errors/clerkApiError.ts","../../src/errors/parseError.ts","../../src/errors/clerkApiResponseError.ts","../../src/errors/missingExpiredTokenError.ts","../../src/errors/clerkOfflineError.ts","../../src/errors/errorThrower.ts","../../src/errors/emailLinkError.ts","../../src/errors/webAuthNError.ts","../../src/errors/helpers.ts","../../src/errors/globalHookError.ts"],"sourcesContent":["import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types';\nimport { createErrorTypeGuard } from './createErrorTypeGuard';\n\nexport type ClerkAPIErrorMeta = Record<string, unknown>;\n\n/**\n * This error contains the specific error message, code, and any additional metadata that was returned by the Clerk API.\n */\nexport class ClerkAPIError<Meta extends ClerkAPIErrorMeta = any> implements ClerkAPIErrorInterface {\n static kind = 'ClerkAPIError';\n readonly code: string;\n readonly message: string;\n readonly longMessage: string | undefined;\n readonly meta: Meta;\n\n constructor(json: ClerkAPIErrorJSON) {\n const parsedError = {\n code: json.code,\n message: json.message,\n longMessage: json.long_message,\n meta: {\n paramName: json.meta?.param_name,\n sessionId: json.meta?.session_id,\n emailAddresses: json.meta?.email_addresses,\n identifiers: json.meta?.identifiers,\n zxcvbn: json.meta?.zxcvbn,\n plan: json.meta?.plan,\n isPlanUpgradePossible: json.meta?.is_plan_upgrade_possible,\n seatsQuantityToAdd: json.meta?.seats_quantity_to_add,\n seatsQuantity: json.meta?.seats_quantity,\n } as unknown as Meta,\n };\n this.code = parsedError.code;\n this.message = parsedError.message;\n this.longMessage = parsedError.longMessage;\n this.meta = parsedError.meta;\n }\n}\n\n/**\n * Type guard to check if a value is a ClerkAPIError instance.\n */\nexport const isClerkAPIError = createErrorTypeGuard(ClerkAPIError);\n","import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types';\nimport { ClerkAPIError } from './clerkApiError';\n\n/**\n * Parses an array of ClerkAPIErrorJSON objects into an array of ClerkAPIError objects.\n *\n * @internal\n */\nexport function parseErrors(data: ClerkAPIErrorJSON[] = []): ClerkAPIErrorInterface[] {\n return data.length > 0 ? data.map(e => new ClerkAPIError(e)) : [];\n}\n\n/**\n * Parses a ClerkAPIErrorJSON object into a ClerkAPIError object.\n *\n * @deprecated Use `ClerkAPIError` class instead\n *\n * @internal\n */\nexport function parseError(error: ClerkAPIErrorJSON): ClerkAPIErrorInterface {\n return new ClerkAPIError(error);\n}\n\n/**\n * Converts a ClerkAPIError object into a ClerkAPIErrorJSON object.\n *\n * @internal\n */\nexport function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON {\n return {\n code: error?.code || '',\n message: error?.message || '',\n long_message: error?.longMessage,\n meta: {\n param_name: error?.meta?.paramName,\n session_id: error?.meta?.sessionId,\n email_addresses: error?.meta?.emailAddresses,\n identifiers: error?.meta?.identifiers,\n zxcvbn: error?.meta?.zxcvbn,\n plan: error?.meta?.plan,\n is_plan_upgrade_possible: error?.meta?.isPlanUpgradePossible,\n seats_quantity_to_add: error?.meta?.seatsQuantityToAdd,\n seats_quantity: error?.meta?.seatsQuantity,\n },\n };\n}\n","import type { ClerkAPIErrorJSON, ClerkAPIResponseError as ClerkAPIResponseErrorInterface } from '../types';\nimport { ClerkAPIError } from './clerkApiError';\nimport type { ClerkErrorParams } from './clerkError';\nimport { ClerkError } from './clerkError';\nimport { createErrorTypeGuard } from './createErrorTypeGuard';\n\ninterface ClerkAPIResponseOptions extends Omit<ClerkErrorParams, 'message' | 'code'> {\n data: ClerkAPIErrorJSON[];\n status: number;\n clerkTraceId?: string;\n retryAfter?: number;\n}\n\nexport class ClerkAPIResponseError extends ClerkError implements ClerkAPIResponseErrorInterface {\n static kind = 'ClerkAPIResponseError';\n status: number;\n clerkTraceId?: string;\n retryAfter?: number;\n errors: ClerkAPIError[];\n\n constructor(message: string, options: ClerkAPIResponseOptions) {\n const { data: errorsJson, status, clerkTraceId, retryAfter } = options;\n super({ ...options, message, code: 'api_response_error' });\n Object.setPrototypeOf(this, ClerkAPIResponseError.prototype);\n this.status = status;\n this.clerkTraceId = clerkTraceId;\n this.retryAfter = retryAfter;\n this.errors = (errorsJson || []).map(e => new ClerkAPIError(e));\n }\n\n public toString() {\n let message = `[${this.name}]\\nMessage:${this.message}\\nStatus:${this.status}\\nSerialized errors: ${this.errors.map(\n e => JSON.stringify(e),\n )}`;\n\n if (this.clerkTraceId) {\n message += `\\nClerk Trace ID: ${this.clerkTraceId}`;\n }\n\n return message;\n }\n\n // Override formatMessage to keep it unformatted for backward compatibility\n protected static override formatMessage(name: string, msg: string, _: string, __: string | undefined) {\n return msg;\n }\n}\n\n/**\n * Type guard to check if an error is a ClerkAPIResponseError.\n * Can be called as a standalone function or as a method on an error object.\n *\n * @example\n * // As a standalone function\n * if (isClerkAPIResponseError(error)) { ... }\n *\n * // As a method (when attached to error object)\n * if (error.isClerkAPIResponseError()) { ... }\n */\nexport const isClerkAPIResponseError = createErrorTypeGuard(ClerkAPIResponseError);\n","import { ClerkAPIResponseError, isClerkAPIResponseError } from './clerkApiResponseError';\n\n/**\n * Error class representing a missing expired token error from the API.\n * This error occurs when the server requires an expired token to mint a new session token.\n *\n * Use the static `is` method to check if a ClerkAPIResponseError matches this error type.\n *\n * @example\n * ```typescript\n * if (MissingExpiredTokenError.is(error)) {\n * // Handle the missing expired token error\n * }\n * ```\n */\nexport class MissingExpiredTokenError extends ClerkAPIResponseError {\n static kind = 'MissingExpiredTokenError';\n static readonly ERROR_CODE = 'missing_expired_token' as const;\n static readonly STATUS = 422 as const;\n\n /**\n * Type guard to check if an error is a MissingExpiredTokenError.\n * This checks the error's properties (status and error code) rather than instanceof,\n * allowing it to work with ClerkAPIResponseError instances thrown from the API layer.\n *\n * @example\n * ```typescript\n * try {\n * await someApiCall();\n * } catch (e) {\n * if (MissingExpiredTokenError.is(e)) {\n * // e is typed as ClerkAPIResponseError with the specific error properties\n * }\n * }\n * ```\n */\n static is(err: unknown): err is ClerkAPIResponseError {\n return (\n isClerkAPIResponseError(err) &&\n err.status === MissingExpiredTokenError.STATUS &&\n err.errors.length > 0 &&\n err.errors[0].code === MissingExpiredTokenError.ERROR_CODE\n );\n }\n}\n","import { ClerkRuntimeError, isClerkRuntimeError } from './clerkRuntimeError';\n\n/**\n * Error thrown when a network request fails due to the client being offline.\n *\n * This error is thrown instead of returning `null` to make it explicit that\n * the failure was due to network conditions, not authentication state.\n *\n * @example\n * ```typescript\n * try {\n * const token = await session.getToken();\n * } catch (error) {\n * if (ClerkOfflineError.is(error)) {\n * // Handle offline scenario\n * showOfflineScreen();\n * }\n * }\n * ```\n */\nexport class ClerkOfflineError extends ClerkRuntimeError {\n static kind = 'ClerkOfflineError';\n static readonly ERROR_CODE = 'clerk_offline' as const;\n\n constructor(message: string) {\n super(message, { code: ClerkOfflineError.ERROR_CODE });\n Object.setPrototypeOf(this, ClerkOfflineError.prototype);\n }\n\n /**\n * Type guard to check if an error is a ClerkOfflineError.\n * This checks both instanceof and the error code to support cross-bundle/cross-realm errors\n *\n * @example\n * ```typescript\n * try {\n * const token = await session.getToken();\n * } catch (error) {\n * if (ClerkOfflineError.is(error)) {\n * // error is typed as ClerkOfflineError\n * console.log('User is offline');\n * }\n * }\n * ```\n */\n static is(error: unknown): error is ClerkOfflineError {\n if (error === null || error === undefined) {\n return false;\n }\n return (\n error instanceof ClerkOfflineError || (isClerkRuntimeError(error) && error.code === ClerkOfflineError.ERROR_CODE)\n );\n }\n}\n","const DefaultMessages = Object.freeze({\n 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}})`,\n InvalidPublishableKeyErrorMessage: `The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys (\\`--instance prod\\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.`,\n MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \\`npx clerk@latest deploy\\`, or \\`npx clerk@latest env pull --instance prod\\` to use an existing one.`,\n MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \\`npx clerk@latest deploy\\`, or \\`npx clerk@latest env pull --instance prod\\` to use an existing one.`,\n MissingClerkProvider: `{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`,\n});\n\ntype MessageKeys = keyof typeof DefaultMessages;\n\ntype Messages = Record<MessageKeys, string>;\n\ntype CustomMessages = Partial<Messages>;\n\nexport type ErrorThrowerOptions = {\n packageName: string;\n customMessages?: CustomMessages;\n};\n\nexport interface ErrorThrower {\n setPackageName(options: ErrorThrowerOptions): ErrorThrower;\n\n setMessages(options: ErrorThrowerOptions): ErrorThrower;\n\n throwInvalidPublishableKeyError(params: { key?: string }): never;\n\n throwInvalidProxyUrl(params: { url?: string }): never;\n\n throwMissingPublishableKeyError(): never;\n\n throwMissingSecretKeyError(): never;\n\n throwMissingClerkProviderError(params: { source?: string }): never;\n\n throw(message: string): never;\n}\n\n/**\n * Builds an error thrower.\n *\n * @internal\n */\nexport function buildErrorThrower({ packageName, customMessages }: ErrorThrowerOptions): ErrorThrower {\n let pkg = packageName;\n\n /**\n * Builds a message from a raw message and replacements.\n *\n * @internal\n */\n function buildMessage(rawMessage: string, replacements?: Record<string, string | number>) {\n if (!replacements) {\n return `${pkg}: ${rawMessage}`;\n }\n\n let msg = rawMessage;\n const matches = rawMessage.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);\n\n for (const match of matches) {\n const replacement = (replacements[match[1]] || '').toString();\n msg = msg.replace(`{{${match[1]}}}`, replacement);\n }\n\n return `${pkg}: ${msg}`;\n }\n\n const messages = {\n ...DefaultMessages,\n ...customMessages,\n };\n\n return {\n setPackageName({ packageName }: ErrorThrowerOptions): ErrorThrower {\n if (typeof packageName === 'string') {\n pkg = packageName;\n }\n return this;\n },\n\n setMessages({ customMessages }: ErrorThrowerOptions): ErrorThrower {\n Object.assign(messages, customMessages || {});\n return this;\n },\n\n throwInvalidPublishableKeyError(params: { key?: string }): never {\n throw new Error(buildMessage(messages.InvalidPublishableKeyErrorMessage, params));\n },\n\n throwInvalidProxyUrl(params: { url?: string }): never {\n throw new Error(buildMessage(messages.InvalidProxyUrlErrorMessage, params));\n },\n\n throwMissingPublishableKeyError(): never {\n throw new Error(buildMessage(messages.MissingPublishableKeyErrorMessage));\n },\n\n throwMissingSecretKeyError(): never {\n throw new Error(buildMessage(messages.MissingSecretKeyErrorMessage));\n },\n\n throwMissingClerkProviderError(params: { source?: string }): never {\n throw new Error(buildMessage(messages.MissingClerkProvider, params));\n },\n\n throw(message: string): never {\n throw new Error(buildMessage(message));\n },\n };\n}\n","export class EmailLinkError extends Error {\n code: string;\n\n constructor(code: string) {\n super(code);\n this.code = code;\n this.name = 'EmailLinkError' as const;\n Object.setPrototypeOf(this, EmailLinkError.prototype);\n }\n}\n\n/**\n * @deprecated Use `EmailLinkErrorCodeStatus` instead.\n *\n * @internal\n */\nexport const EmailLinkErrorCode = {\n Expired: 'expired',\n Failed: 'failed',\n ClientMismatch: 'client_mismatch',\n};\n\nexport const EmailLinkErrorCodeStatus = {\n Expired: 'expired',\n Failed: 'failed',\n ClientMismatch: 'client_mismatch',\n} as const;\n","import type { ClerkErrorParams } from './clerkError';\nimport { ClerkRuntimeError } from './clerkRuntimeError';\n\ntype ClerkWebAuthnErrorCode =\n // Generic\n | 'passkey_not_supported'\n | 'passkey_pa_not_supported'\n | 'passkey_invalid_rpID_or_domain'\n | 'passkey_already_exists'\n | 'passkey_operation_aborted'\n // Retrieval\n | 'passkey_retrieval_cancelled'\n | 'passkey_retrieval_failed'\n // Registration\n | 'passkey_registration_cancelled'\n | 'passkey_registration_failed';\n\ntype ClerkWebAuthnErrorOptions = Omit<ClerkErrorParams, 'message' | 'code'> & { code: ClerkWebAuthnErrorCode };\n\nexport class ClerkWebAuthnError extends ClerkRuntimeError {\n /**\n * A unique code identifying the error, can be used for localization.\n */\n code: ClerkWebAuthnErrorCode;\n\n constructor(message: string, options: ClerkWebAuthnErrorOptions) {\n super(message, options);\n this.code = options.code;\n }\n}\n","import type { ClerkAPIResponseError } from './clerkApiResponseError';\nimport { isClerkAPIResponseError } from './clerkApiResponseError';\nimport type { ClerkRuntimeError } from './clerkRuntimeError';\nimport { isClerkRuntimeError } from './clerkRuntimeError';\nimport type { EmailLinkError } from './emailLinkError';\nimport type { MetamaskError } from './metamaskError';\n\n/**\n * Checks if the provided error object is an unauthorized error.\n *\n * @internal\n *\n * @deprecated This is no longer used, and will be removed in the next major version.\n */\nexport function isUnauthorizedError(e: any): boolean {\n const status = e?.status;\n const code = e?.errors?.[0]?.code;\n return code === 'authentication_invalid' && status === 401;\n}\n\n/**\n * Checks if the provided error object is a captcha error.\n *\n * @internal\n */\nexport function isCaptchaError(e: ClerkAPIResponseError): boolean {\n return ['captcha_invalid', 'captcha_not_enabled', 'captcha_missing_token'].includes(e.errors[0].code);\n}\n\n/**\n * Checks if the provided error is a 4xx error.\n *\n * @internal\n */\nexport function is4xxError(e: any): boolean {\n const status = e?.status;\n return !!status && status >= 400 && status < 500;\n}\n\n/**\n * Checks if the provided error is a 429 (Too Many Requests) error.\n *\n * @internal\n */\nexport function is429Error(e: any): boolean {\n return e?.status === 429;\n}\n\nconst unauthenticated403ErrorCodes = new Set(['user_banned', 'user_deactivated']);\n\n/**\n * Checks if the provided error indicates the user's session is no longer valid\n * and should trigger the unauthenticated flow (e.g. sign-out / redirect to sign-in).\n *\n * Only matches explicit authentication failure status codes:\n * - 401: session is invalid or expired\n * - 422: invalid session state (e.g. missing_expired_token)\n * - 403: terminal user state (e.g. user_banned, user_deactivated)\n *\n * 404 is intentionally excluded despite being returned for \"session not found\",\n * because it's also returned for unrelated resources (org not found, JWT template\n * not found) and shares the same `resource_not_found` error code, making it\n * impossible to distinguish. Session-not-found 401s are already handled directly\n * by Base._fetch.\n *\n * @internal\n */\nexport function isUnauthenticatedError(e: any): boolean {\n const status = e?.status;\n const hasTerminalUserErrorCode =\n Array.isArray(e?.errors) && e.errors.some((error: any) => unauthenticated403ErrorCodes.has(error?.code));\n\n return status === 401 || status === 422 || (status === 403 && hasTerminalUserErrorCode);\n}\n\n/**\n * Checks if the provided error is a network error.\n *\n * @internal\n */\nexport function isNetworkError(e: any): boolean {\n // TODO: revise during error handling epic\n const message = (`${e.message}${e.name}` || '').toLowerCase().replace(/\\s+/g, '');\n return message.includes('networkerror');\n}\n\n/**\n * Checks if the provided error is either a ClerkAPIResponseError, a ClerkRuntimeError, or a MetamaskError.\n */\nexport function isKnownError(error: any): error is ClerkAPIResponseError | ClerkRuntimeError | MetamaskError {\n return isClerkAPIResponseError(error) || isMetamaskError(error) || isClerkRuntimeError(error);\n}\n\n/**\n * Checks if the provided error is a Clerk runtime error indicating a reverification was cancelled.\n */\nexport function isReverificationCancelledError(err: any) {\n return isClerkRuntimeError(err) && err.code === 'reverification_cancelled';\n}\n\n/**\n * Checks if the provided error is a Metamask error.\n */\nexport function isMetamaskError(err: any): err is MetamaskError {\n return 'code' in err && [4001, 32602, 32603].includes(err.code) && 'message' in err;\n}\n\n/**\n * Checks if the provided error is clerk api response error indicating a user is locked.\n */\nexport function isUserLockedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'user_locked';\n}\n\n/**\n * Checks if the provided error is a clerk api response error indicating a password was pwned.\n *\n * @internal\n */\nexport function isPasswordPwnedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'form_password_pwned';\n}\n\n/**\n * Checks if the provided error is a clerk api response error indicating a password was compromised.\n *\n * @internal\n */\nexport function isPasswordCompromisedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'form_password_compromised';\n}\n\n/**\n * Checks if the provided error is an EmailLinkError.\n */\nexport function isEmailLinkError(err: Error): err is EmailLinkError {\n return err.name === 'EmailLinkError';\n}\n","import { isClerkAPIResponseError } from './clerkApiResponseError';\nimport type { ClerkError } from './clerkError';\nimport { isClerkRuntimeError } from './clerkRuntimeError';\n\n/**\n * Creates a ClerkGlobalHookError object from a ClerkError instance.\n * It's a wrapper for all the different instances of Clerk errors that can\n * be returned when using Clerk hooks.\n */\nexport function createClerkGlobalHookError(error: ClerkError) {\n const predicates = {\n isClerkAPIResponseError,\n isClerkRuntimeError,\n } as const;\n\n for (const [name, fn] of Object.entries(predicates)) {\n Object.assign(error, { [name]: fn });\n }\n\n return error as ClerkError & typeof predicates;\n}\n\nexport type ClerkGlobalHookError = ReturnType<typeof createClerkGlobalHookError>;\n"],"mappings":";;;;;;AAQA,IAAa,gBAAb,MAAmG;CACjG,OAAO,OAAO;CACd,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,MAAyB;EACnC,MAAM,cAAc;GAClB,MAAM,KAAK;GACX,SAAS,KAAK;GACd,aAAa,KAAK;GAClB,MAAM;IACJ,WAAW,KAAK,MAAM;IACtB,WAAW,KAAK,MAAM;IACtB,gBAAgB,KAAK,MAAM;IAC3B,aAAa,KAAK,MAAM;IACxB,QAAQ,KAAK,MAAM;IACnB,MAAM,KAAK,MAAM;IACjB,uBAAuB,KAAK,MAAM;IAClC,oBAAoB,KAAK,MAAM;IAC/B,eAAe,KAAK,MAAM;GAC5B;EACF;EACA,KAAK,OAAO,Y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,OAAO,UAAU,OAAO;EAAC;EAAM;EAAO;CAAK,CAAC,CAAC,SAAS,IAAI,IAAI,KAAK,aAAa;AAClF;;;;AAKA,SAAgB,kBAAkB,KAAU;CAC1C,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;;;AAOA,SAAgB,qBAAqB,KAAU;CAC7C,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;;;AAOA,SAAgB,2BAA2B,KAAU;CACnD,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;AAKA,SAAgB,iBAAiB,KAAmC;CAClE,OAAO,IAAI,SAAS;AACtB;;;;;;;;;AChIA,SAAgB,2BAA2B,OAAmB;CAC5D,MAAM,aAAa;EACjB;EACA;CACF;CAEA,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,GAAG,OAAO,GAAG,CAAC;CAGrC,OAAO;AACT"}
|
|
@@ -224,21 +224,21 @@ npx clerk@latest init
|
|
|
224
224
|
|
|
225
225
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
226
226
|
|
|
227
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com
|
|
227
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.`,
|
|
228
228
|
MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run:
|
|
229
229
|
|
|
230
230
|
npx clerk@latest init
|
|
231
231
|
|
|
232
232
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
233
233
|
|
|
234
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
234
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
235
235
|
MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run:
|
|
236
236
|
|
|
237
237
|
npx clerk@latest init
|
|
238
238
|
|
|
239
239
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
240
240
|
|
|
241
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
241
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
242
242
|
MissingClerkProvider: `{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`
|
|
243
243
|
});
|
|
244
244
|
/**
|
|
@@ -479,4 +479,4 @@ function createClerkGlobalHookError(error) {
|
|
|
479
479
|
|
|
480
480
|
//#endregion
|
|
481
481
|
export { isClerkAPIResponseError as C, ClerkAPIError as D, parseErrors as E, isClerkAPIError as O, ClerkAPIResponseError as S, parseError as T, EmailLinkErrorCode as _, isEmailLinkError as a, ClerkOfflineError as b, isNetworkError as c, isReverificationCancelledError as d, isUnauthenticatedError as f, EmailLinkError as g, ClerkWebAuthnError as h, isCaptchaError as i, isPasswordCompromisedError as l, isUserLockedError as m, is429Error as n, isKnownError as o, isUnauthorizedError as p, is4xxError as r, isMetamaskError as s, createClerkGlobalHookError as t, isPasswordPwnedError as u, EmailLinkErrorCodeStatus as v, errorToJSON as w, MissingExpiredTokenError as x, buildErrorThrower as y };
|
|
482
|
-
//# sourceMappingURL=error-
|
|
482
|
+
//# sourceMappingURL=error-wrUdW78M.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-wrUdW78M.mjs","names":[],"sources":["../../src/errors/clerkApiError.ts","../../src/errors/parseError.ts","../../src/errors/clerkApiResponseError.ts","../../src/errors/missingExpiredTokenError.ts","../../src/errors/clerkOfflineError.ts","../../src/errors/errorThrower.ts","../../src/errors/emailLinkError.ts","../../src/errors/webAuthNError.ts","../../src/errors/helpers.ts","../../src/errors/globalHookError.ts"],"sourcesContent":["import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types';\nimport { createErrorTypeGuard } from './createErrorTypeGuard';\n\nexport type ClerkAPIErrorMeta = Record<string, unknown>;\n\n/**\n * This error contains the specific error message, code, and any additional metadata that was returned by the Clerk API.\n */\nexport class ClerkAPIError<Meta extends ClerkAPIErrorMeta = any> implements ClerkAPIErrorInterface {\n static kind = 'ClerkAPIError';\n readonly code: string;\n readonly message: string;\n readonly longMessage: string | undefined;\n readonly meta: Meta;\n\n constructor(json: ClerkAPIErrorJSON) {\n const parsedError = {\n code: json.code,\n message: json.message,\n longMessage: json.long_message,\n meta: {\n paramName: json.meta?.param_name,\n sessionId: json.meta?.session_id,\n emailAddresses: json.meta?.email_addresses,\n identifiers: json.meta?.identifiers,\n zxcvbn: json.meta?.zxcvbn,\n plan: json.meta?.plan,\n isPlanUpgradePossible: json.meta?.is_plan_upgrade_possible,\n seatsQuantityToAdd: json.meta?.seats_quantity_to_add,\n seatsQuantity: json.meta?.seats_quantity,\n } as unknown as Meta,\n };\n this.code = parsedError.code;\n this.message = parsedError.message;\n this.longMessage = parsedError.longMessage;\n this.meta = parsedError.meta;\n }\n}\n\n/**\n * Type guard to check if a value is a ClerkAPIError instance.\n */\nexport const isClerkAPIError = createErrorTypeGuard(ClerkAPIError);\n","import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types';\nimport { ClerkAPIError } from './clerkApiError';\n\n/**\n * Parses an array of ClerkAPIErrorJSON objects into an array of ClerkAPIError objects.\n *\n * @internal\n */\nexport function parseErrors(data: ClerkAPIErrorJSON[] = []): ClerkAPIErrorInterface[] {\n return data.length > 0 ? data.map(e => new ClerkAPIError(e)) : [];\n}\n\n/**\n * Parses a ClerkAPIErrorJSON object into a ClerkAPIError object.\n *\n * @deprecated Use `ClerkAPIError` class instead\n *\n * @internal\n */\nexport function parseError(error: ClerkAPIErrorJSON): ClerkAPIErrorInterface {\n return new ClerkAPIError(error);\n}\n\n/**\n * Converts a ClerkAPIError object into a ClerkAPIErrorJSON object.\n *\n * @internal\n */\nexport function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON {\n return {\n code: error?.code || '',\n message: error?.message || '',\n long_message: error?.longMessage,\n meta: {\n param_name: error?.meta?.paramName,\n session_id: error?.meta?.sessionId,\n email_addresses: error?.meta?.emailAddresses,\n identifiers: error?.meta?.identifiers,\n zxcvbn: error?.meta?.zxcvbn,\n plan: error?.meta?.plan,\n is_plan_upgrade_possible: error?.meta?.isPlanUpgradePossible,\n seats_quantity_to_add: error?.meta?.seatsQuantityToAdd,\n seats_quantity: error?.meta?.seatsQuantity,\n },\n };\n}\n","import type { ClerkAPIErrorJSON, ClerkAPIResponseError as ClerkAPIResponseErrorInterface } from '../types';\nimport { ClerkAPIError } from './clerkApiError';\nimport type { ClerkErrorParams } from './clerkError';\nimport { ClerkError } from './clerkError';\nimport { createErrorTypeGuard } from './createErrorTypeGuard';\n\ninterface ClerkAPIResponseOptions extends Omit<ClerkErrorParams, 'message' | 'code'> {\n data: ClerkAPIErrorJSON[];\n status: number;\n clerkTraceId?: string;\n retryAfter?: number;\n}\n\nexport class ClerkAPIResponseError extends ClerkError implements ClerkAPIResponseErrorInterface {\n static kind = 'ClerkAPIResponseError';\n status: number;\n clerkTraceId?: string;\n retryAfter?: number;\n errors: ClerkAPIError[];\n\n constructor(message: string, options: ClerkAPIResponseOptions) {\n const { data: errorsJson, status, clerkTraceId, retryAfter } = options;\n super({ ...options, message, code: 'api_response_error' });\n Object.setPrototypeOf(this, ClerkAPIResponseError.prototype);\n this.status = status;\n this.clerkTraceId = clerkTraceId;\n this.retryAfter = retryAfter;\n this.errors = (errorsJson || []).map(e => new ClerkAPIError(e));\n }\n\n public toString() {\n let message = `[${this.name}]\\nMessage:${this.message}\\nStatus:${this.status}\\nSerialized errors: ${this.errors.map(\n e => JSON.stringify(e),\n )}`;\n\n if (this.clerkTraceId) {\n message += `\\nClerk Trace ID: ${this.clerkTraceId}`;\n }\n\n return message;\n }\n\n // Override formatMessage to keep it unformatted for backward compatibility\n protected static override formatMessage(name: string, msg: string, _: string, __: string | undefined) {\n return msg;\n }\n}\n\n/**\n * Type guard to check if an error is a ClerkAPIResponseError.\n * Can be called as a standalone function or as a method on an error object.\n *\n * @example\n * // As a standalone function\n * if (isClerkAPIResponseError(error)) { ... }\n *\n * // As a method (when attached to error object)\n * if (error.isClerkAPIResponseError()) { ... }\n */\nexport const isClerkAPIResponseError = createErrorTypeGuard(ClerkAPIResponseError);\n","import { ClerkAPIResponseError, isClerkAPIResponseError } from './clerkApiResponseError';\n\n/**\n * Error class representing a missing expired token error from the API.\n * This error occurs when the server requires an expired token to mint a new session token.\n *\n * Use the static `is` method to check if a ClerkAPIResponseError matches this error type.\n *\n * @example\n * ```typescript\n * if (MissingExpiredTokenError.is(error)) {\n * // Handle the missing expired token error\n * }\n * ```\n */\nexport class MissingExpiredTokenError extends ClerkAPIResponseError {\n static kind = 'MissingExpiredTokenError';\n static readonly ERROR_CODE = 'missing_expired_token' as const;\n static readonly STATUS = 422 as const;\n\n /**\n * Type guard to check if an error is a MissingExpiredTokenError.\n * This checks the error's properties (status and error code) rather than instanceof,\n * allowing it to work with ClerkAPIResponseError instances thrown from the API layer.\n *\n * @example\n * ```typescript\n * try {\n * await someApiCall();\n * } catch (e) {\n * if (MissingExpiredTokenError.is(e)) {\n * // e is typed as ClerkAPIResponseError with the specific error properties\n * }\n * }\n * ```\n */\n static is(err: unknown): err is ClerkAPIResponseError {\n return (\n isClerkAPIResponseError(err) &&\n err.status === MissingExpiredTokenError.STATUS &&\n err.errors.length > 0 &&\n err.errors[0].code === MissingExpiredTokenError.ERROR_CODE\n );\n }\n}\n","import { ClerkRuntimeError, isClerkRuntimeError } from './clerkRuntimeError';\n\n/**\n * Error thrown when a network request fails due to the client being offline.\n *\n * This error is thrown instead of returning `null` to make it explicit that\n * the failure was due to network conditions, not authentication state.\n *\n * @example\n * ```typescript\n * try {\n * const token = await session.getToken();\n * } catch (error) {\n * if (ClerkOfflineError.is(error)) {\n * // Handle offline scenario\n * showOfflineScreen();\n * }\n * }\n * ```\n */\nexport class ClerkOfflineError extends ClerkRuntimeError {\n static kind = 'ClerkOfflineError';\n static readonly ERROR_CODE = 'clerk_offline' as const;\n\n constructor(message: string) {\n super(message, { code: ClerkOfflineError.ERROR_CODE });\n Object.setPrototypeOf(this, ClerkOfflineError.prototype);\n }\n\n /**\n * Type guard to check if an error is a ClerkOfflineError.\n * This checks both instanceof and the error code to support cross-bundle/cross-realm errors\n *\n * @example\n * ```typescript\n * try {\n * const token = await session.getToken();\n * } catch (error) {\n * if (ClerkOfflineError.is(error)) {\n * // error is typed as ClerkOfflineError\n * console.log('User is offline');\n * }\n * }\n * ```\n */\n static is(error: unknown): error is ClerkOfflineError {\n if (error === null || error === undefined) {\n return false;\n }\n return (\n error instanceof ClerkOfflineError || (isClerkRuntimeError(error) && error.code === ClerkOfflineError.ERROR_CODE)\n );\n }\n}\n","const DefaultMessages = Object.freeze({\n 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}})`,\n InvalidPublishableKeyErrorMessage: `The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys (\\`--instance prod\\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.`,\n MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \\`npx clerk@latest deploy\\`, or \\`npx clerk@latest env pull --instance prod\\` to use an existing one.`,\n MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n\\`npx clerk@latest init\\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run \\`npx clerk@latest env pull\\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \\`npx clerk@latest deploy\\`, or \\`npx clerk@latest env pull --instance prod\\` to use an existing one.`,\n MissingClerkProvider: `{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`,\n});\n\ntype MessageKeys = keyof typeof DefaultMessages;\n\ntype Messages = Record<MessageKeys, string>;\n\ntype CustomMessages = Partial<Messages>;\n\nexport type ErrorThrowerOptions = {\n packageName: string;\n customMessages?: CustomMessages;\n};\n\nexport interface ErrorThrower {\n setPackageName(options: ErrorThrowerOptions): ErrorThrower;\n\n setMessages(options: ErrorThrowerOptions): ErrorThrower;\n\n throwInvalidPublishableKeyError(params: { key?: string }): never;\n\n throwInvalidProxyUrl(params: { url?: string }): never;\n\n throwMissingPublishableKeyError(): never;\n\n throwMissingSecretKeyError(): never;\n\n throwMissingClerkProviderError(params: { source?: string }): never;\n\n throw(message: string): never;\n}\n\n/**\n * Builds an error thrower.\n *\n * @internal\n */\nexport function buildErrorThrower({ packageName, customMessages }: ErrorThrowerOptions): ErrorThrower {\n let pkg = packageName;\n\n /**\n * Builds a message from a raw message and replacements.\n *\n * @internal\n */\n function buildMessage(rawMessage: string, replacements?: Record<string, string | number>) {\n if (!replacements) {\n return `${pkg}: ${rawMessage}`;\n }\n\n let msg = rawMessage;\n const matches = rawMessage.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);\n\n for (const match of matches) {\n const replacement = (replacements[match[1]] || '').toString();\n msg = msg.replace(`{{${match[1]}}}`, replacement);\n }\n\n return `${pkg}: ${msg}`;\n }\n\n const messages = {\n ...DefaultMessages,\n ...customMessages,\n };\n\n return {\n setPackageName({ packageName }: ErrorThrowerOptions): ErrorThrower {\n if (typeof packageName === 'string') {\n pkg = packageName;\n }\n return this;\n },\n\n setMessages({ customMessages }: ErrorThrowerOptions): ErrorThrower {\n Object.assign(messages, customMessages || {});\n return this;\n },\n\n throwInvalidPublishableKeyError(params: { key?: string }): never {\n throw new Error(buildMessage(messages.InvalidPublishableKeyErrorMessage, params));\n },\n\n throwInvalidProxyUrl(params: { url?: string }): never {\n throw new Error(buildMessage(messages.InvalidProxyUrlErrorMessage, params));\n },\n\n throwMissingPublishableKeyError(): never {\n throw new Error(buildMessage(messages.MissingPublishableKeyErrorMessage));\n },\n\n throwMissingSecretKeyError(): never {\n throw new Error(buildMessage(messages.MissingSecretKeyErrorMessage));\n },\n\n throwMissingClerkProviderError(params: { source?: string }): never {\n throw new Error(buildMessage(messages.MissingClerkProvider, params));\n },\n\n throw(message: string): never {\n throw new Error(buildMessage(message));\n },\n };\n}\n","export class EmailLinkError extends Error {\n code: string;\n\n constructor(code: string) {\n super(code);\n this.code = code;\n this.name = 'EmailLinkError' as const;\n Object.setPrototypeOf(this, EmailLinkError.prototype);\n }\n}\n\n/**\n * @deprecated Use `EmailLinkErrorCodeStatus` instead.\n *\n * @internal\n */\nexport const EmailLinkErrorCode = {\n Expired: 'expired',\n Failed: 'failed',\n ClientMismatch: 'client_mismatch',\n};\n\nexport const EmailLinkErrorCodeStatus = {\n Expired: 'expired',\n Failed: 'failed',\n ClientMismatch: 'client_mismatch',\n} as const;\n","import type { ClerkErrorParams } from './clerkError';\nimport { ClerkRuntimeError } from './clerkRuntimeError';\n\ntype ClerkWebAuthnErrorCode =\n // Generic\n | 'passkey_not_supported'\n | 'passkey_pa_not_supported'\n | 'passkey_invalid_rpID_or_domain'\n | 'passkey_already_exists'\n | 'passkey_operation_aborted'\n // Retrieval\n | 'passkey_retrieval_cancelled'\n | 'passkey_retrieval_failed'\n // Registration\n | 'passkey_registration_cancelled'\n | 'passkey_registration_failed';\n\ntype ClerkWebAuthnErrorOptions = Omit<ClerkErrorParams, 'message' | 'code'> & { code: ClerkWebAuthnErrorCode };\n\nexport class ClerkWebAuthnError extends ClerkRuntimeError {\n /**\n * A unique code identifying the error, can be used for localization.\n */\n code: ClerkWebAuthnErrorCode;\n\n constructor(message: string, options: ClerkWebAuthnErrorOptions) {\n super(message, options);\n this.code = options.code;\n }\n}\n","import type { ClerkAPIResponseError } from './clerkApiResponseError';\nimport { isClerkAPIResponseError } from './clerkApiResponseError';\nimport type { ClerkRuntimeError } from './clerkRuntimeError';\nimport { isClerkRuntimeError } from './clerkRuntimeError';\nimport type { EmailLinkError } from './emailLinkError';\nimport type { MetamaskError } from './metamaskError';\n\n/**\n * Checks if the provided error object is an unauthorized error.\n *\n * @internal\n *\n * @deprecated This is no longer used, and will be removed in the next major version.\n */\nexport function isUnauthorizedError(e: any): boolean {\n const status = e?.status;\n const code = e?.errors?.[0]?.code;\n return code === 'authentication_invalid' && status === 401;\n}\n\n/**\n * Checks if the provided error object is a captcha error.\n *\n * @internal\n */\nexport function isCaptchaError(e: ClerkAPIResponseError): boolean {\n return ['captcha_invalid', 'captcha_not_enabled', 'captcha_missing_token'].includes(e.errors[0].code);\n}\n\n/**\n * Checks if the provided error is a 4xx error.\n *\n * @internal\n */\nexport function is4xxError(e: any): boolean {\n const status = e?.status;\n return !!status && status >= 400 && status < 500;\n}\n\n/**\n * Checks if the provided error is a 429 (Too Many Requests) error.\n *\n * @internal\n */\nexport function is429Error(e: any): boolean {\n return e?.status === 429;\n}\n\nconst unauthenticated403ErrorCodes = new Set(['user_banned', 'user_deactivated']);\n\n/**\n * Checks if the provided error indicates the user's session is no longer valid\n * and should trigger the unauthenticated flow (e.g. sign-out / redirect to sign-in).\n *\n * Only matches explicit authentication failure status codes:\n * - 401: session is invalid or expired\n * - 422: invalid session state (e.g. missing_expired_token)\n * - 403: terminal user state (e.g. user_banned, user_deactivated)\n *\n * 404 is intentionally excluded despite being returned for \"session not found\",\n * because it's also returned for unrelated resources (org not found, JWT template\n * not found) and shares the same `resource_not_found` error code, making it\n * impossible to distinguish. Session-not-found 401s are already handled directly\n * by Base._fetch.\n *\n * @internal\n */\nexport function isUnauthenticatedError(e: any): boolean {\n const status = e?.status;\n const hasTerminalUserErrorCode =\n Array.isArray(e?.errors) && e.errors.some((error: any) => unauthenticated403ErrorCodes.has(error?.code));\n\n return status === 401 || status === 422 || (status === 403 && hasTerminalUserErrorCode);\n}\n\n/**\n * Checks if the provided error is a network error.\n *\n * @internal\n */\nexport function isNetworkError(e: any): boolean {\n // TODO: revise during error handling epic\n const message = (`${e.message}${e.name}` || '').toLowerCase().replace(/\\s+/g, '');\n return message.includes('networkerror');\n}\n\n/**\n * Checks if the provided error is either a ClerkAPIResponseError, a ClerkRuntimeError, or a MetamaskError.\n */\nexport function isKnownError(error: any): error is ClerkAPIResponseError | ClerkRuntimeError | MetamaskError {\n return isClerkAPIResponseError(error) || isMetamaskError(error) || isClerkRuntimeError(error);\n}\n\n/**\n * Checks if the provided error is a Clerk runtime error indicating a reverification was cancelled.\n */\nexport function isReverificationCancelledError(err: any) {\n return isClerkRuntimeError(err) && err.code === 'reverification_cancelled';\n}\n\n/**\n * Checks if the provided error is a Metamask error.\n */\nexport function isMetamaskError(err: any): err is MetamaskError {\n return 'code' in err && [4001, 32602, 32603].includes(err.code) && 'message' in err;\n}\n\n/**\n * Checks if the provided error is clerk api response error indicating a user is locked.\n */\nexport function isUserLockedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'user_locked';\n}\n\n/**\n * Checks if the provided error is a clerk api response error indicating a password was pwned.\n *\n * @internal\n */\nexport function isPasswordPwnedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'form_password_pwned';\n}\n\n/**\n * Checks if the provided error is a clerk api response error indicating a password was compromised.\n *\n * @internal\n */\nexport function isPasswordCompromisedError(err: any) {\n return isClerkAPIResponseError(err) && err.errors?.[0]?.code === 'form_password_compromised';\n}\n\n/**\n * Checks if the provided error is an EmailLinkError.\n */\nexport function isEmailLinkError(err: Error): err is EmailLinkError {\n return err.name === 'EmailLinkError';\n}\n","import { isClerkAPIResponseError } from './clerkApiResponseError';\nimport type { ClerkError } from './clerkError';\nimport { isClerkRuntimeError } from './clerkRuntimeError';\n\n/**\n * Creates a ClerkGlobalHookError object from a ClerkError instance.\n * It's a wrapper for all the different instances of Clerk errors that can\n * be returned when using Clerk hooks.\n */\nexport function createClerkGlobalHookError(error: ClerkError) {\n const predicates = {\n isClerkAPIResponseError,\n isClerkRuntimeError,\n } as const;\n\n for (const [name, fn] of Object.entries(predicates)) {\n Object.assign(error, { [name]: fn });\n }\n\n return error as ClerkError & typeof predicates;\n}\n\nexport type ClerkGlobalHookError = ReturnType<typeof createClerkGlobalHookError>;\n"],"mappings":";;;;;;AAQA,IAAa,gBAAb,MAAmG;CACjG,OAAO,OAAO;CACd,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,MAAyB;EACnC,MAAM,cAAc;GAClB,MAAM,KAAK;GACX,SAAS,KAAK;GACd,aAAa,KAAK;GAClB,MAAM;IACJ,WAAW,KAAK,MAAM;IACtB,WAAW,KAAK,MAAM;IACtB,gBAAgB,KAAK,MAAM;IAC3B,aAAa,KAAK,MAAM;IACxB,QAAQ,KAAK,MAAM;IACnB,MAAM,KA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gB,+BAA+B,KAAU;CACvD,OAAO,oBAAoB,GAAG,KAAK,IAAI,SAAS;AAClD;;;;AAKA,SAAgB,gBAAgB,KAAgC;CAC9D,OAAO,UAAU,OAAO;EAAC;EAAM;EAAO;CAAK,CAAC,CAAC,SAAS,IAAI,IAAI,KAAK,aAAa;AAClF;;;;AAKA,SAAgB,kBAAkB,KAAU;CAC1C,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;;;AAOA,SAAgB,qBAAqB,KAAU;CAC7C,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;;;AAOA,SAAgB,2BAA2B,KAAU;CACnD,OAAO,wBAAwB,GAAG,KAAK,IAAI,SAAS,EAAE,EAAE,SAAS;AACnE;;;;AAKA,SAAgB,iBAAiB,KAAmC;CAClE,OAAO,IAAI,SAAS;AACtB;;;;;;;;;AChIA,SAAgB,2BAA2B,OAAmB;CAC5D,MAAM,aAAa;EACjB;EACA;CACF;CAEA,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,GAAG,OAAO,GAAG,CAAC;CAGrC,OAAO;AACT"}
|
package/dist/error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_clerkRuntimeError = require('./_chunks/clerkRuntimeError-CYZdTZ_x.js');
|
|
3
|
-
const require_error = require('./_chunks/error-
|
|
3
|
+
const require_error = require('./_chunks/error-CdWUgmMd.js');
|
|
4
4
|
|
|
5
5
|
exports.ClerkAPIError = require_error.ClerkAPIError;
|
|
6
6
|
exports.ClerkAPIResponseError = require_error.ClerkAPIResponseError;
|
package/dist/error.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as isClerkError, n as isClerkRuntimeError, r as ClerkError, t as ClerkRuntimeError } from "./_chunks/clerkRuntimeError-DlesLWqO.mjs";
|
|
2
|
-
import { C as isClerkAPIResponseError, D as ClerkAPIError, E as parseErrors, O as isClerkAPIError, S as ClerkAPIResponseError, T as parseError, _ as EmailLinkErrorCode, a as isEmailLinkError, b as ClerkOfflineError, c as isNetworkError, d as isReverificationCancelledError, f as isUnauthenticatedError, g as EmailLinkError, h as ClerkWebAuthnError, i as isCaptchaError, l as isPasswordCompromisedError, m as isUserLockedError, n as is429Error, o as isKnownError, p as isUnauthorizedError, r as is4xxError, s as isMetamaskError, t as createClerkGlobalHookError, u as isPasswordPwnedError, v as EmailLinkErrorCodeStatus, w as errorToJSON, x as MissingExpiredTokenError, y as buildErrorThrower } from "./_chunks/error-
|
|
2
|
+
import { C as isClerkAPIResponseError, D as ClerkAPIError, E as parseErrors, O as isClerkAPIError, S as ClerkAPIResponseError, T as parseError, _ as EmailLinkErrorCode, a as isEmailLinkError, b as ClerkOfflineError, c as isNetworkError, d as isReverificationCancelledError, f as isUnauthenticatedError, g as EmailLinkError, h as ClerkWebAuthnError, i as isCaptchaError, l as isPasswordCompromisedError, m as isUserLockedError, n as is429Error, o as isKnownError, p as isUnauthorizedError, r as is4xxError, s as isMetamaskError, t as createClerkGlobalHookError, u as isPasswordPwnedError, v as EmailLinkErrorCodeStatus, w as errorToJSON, x as MissingExpiredTokenError, y as buildErrorThrower } from "./_chunks/error-wrUdW78M.mjs";
|
|
3
3
|
|
|
4
4
|
export { ClerkAPIError, ClerkAPIResponseError, ClerkError, ClerkOfflineError, ClerkRuntimeError, ClerkWebAuthnError, EmailLinkError, EmailLinkErrorCode, EmailLinkErrorCodeStatus, MissingExpiredTokenError, buildErrorThrower, createClerkGlobalHookError, errorToJSON, is429Error, is4xxError, isCaptchaError, isClerkAPIError, isClerkAPIResponseError, isClerkError, isClerkRuntimeError, isEmailLinkError, isKnownError, isMetamaskError, isNetworkError, isPasswordCompromisedError, isPasswordPwnedError, isReverificationCancelledError, isUnauthenticatedError, isUnauthorizedError, isUserLockedError, parseError, parseErrors };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/errors/errorThrower.d.ts
|
|
2
2
|
declare const DefaultMessages: Readonly<{
|
|
3
3
|
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}})";
|
|
4
|
-
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys (`--instance prod` for production keys). Or copy its Publishable key from https://dashboard.clerk.com
|
|
5
|
-
MissingPublishableKeyErrorMessage: "Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
6
|
-
MissingSecretKeyErrorMessage: "Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
4
|
+
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys (`--instance prod` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.";
|
|
5
|
+
MissingPublishableKeyErrorMessage: "Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running `npx clerk@latest deploy`, or `npx clerk@latest env pull --instance prod` to use an existing one.";
|
|
6
|
+
MissingSecretKeyErrorMessage: "Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running `npx clerk@latest deploy`, or `npx clerk@latest env pull --instance prod` to use an existing one.";
|
|
7
7
|
MissingClerkProvider: "{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider";
|
|
8
8
|
}>;
|
|
9
9
|
type MessageKeys = keyof typeof DefaultMessages;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/errors/errorThrower.d.ts
|
|
2
2
|
declare const DefaultMessages: Readonly<{
|
|
3
3
|
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}})";
|
|
4
|
-
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys (`--instance prod` for production keys). Or copy its Publishable key from https://dashboard.clerk.com
|
|
5
|
-
MissingPublishableKeyErrorMessage: "Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
6
|
-
MissingSecretKeyErrorMessage: "Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
4
|
+
InvalidPublishableKeyErrorMessage: "The publishableKey passed to Clerk is invalid (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys (`--instance prod` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.";
|
|
5
|
+
MissingPublishableKeyErrorMessage: "Missing publishableKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running `npx clerk@latest deploy`, or `npx clerk@latest env pull --instance prod` to use an existing one.";
|
|
6
|
+
MissingSecretKeyErrorMessage: "Missing secretKey. To set up Clerk for this project, in your terminal run:\n\nnpx clerk@latest init\n\n`npx clerk@latest init` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.\n\nIf you have a Clerk application, run `npx clerk@latest env pull` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running `npx clerk@latest deploy`, or `npx clerk@latest env pull --instance prod` to use an existing one.";
|
|
7
7
|
MissingClerkProvider: "{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider";
|
|
8
8
|
}>;
|
|
9
9
|
type MessageKeys = keyof typeof DefaultMessages;
|
|
@@ -8,21 +8,21 @@ npx clerk@latest init
|
|
|
8
8
|
|
|
9
9
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
10
10
|
|
|
11
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com
|
|
11
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/~/api-keys.`,
|
|
12
12
|
MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run:
|
|
13
13
|
|
|
14
14
|
npx clerk@latest init
|
|
15
15
|
|
|
16
16
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
17
17
|
|
|
18
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
18
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
19
19
|
MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run:
|
|
20
20
|
|
|
21
21
|
npx clerk@latest init
|
|
22
22
|
|
|
23
23
|
\`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive.
|
|
24
24
|
|
|
25
|
-
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com
|
|
25
|
+
If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/~/api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,
|
|
26
26
|
MissingClerkProvider: `{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`
|
|
27
27
|
});
|
|
28
28
|
/**
|
|
@@ -13,6 +13,7 @@ declare const disabledUserAPIKeysFeature: ComponentGuard;
|
|
|
13
13
|
declare const disabledOrganizationAPIKeysFeature: ComponentGuard;
|
|
14
14
|
declare const disabledAllAPIKeysFeatures: ComponentGuard;
|
|
15
15
|
declare const disabledSelfServeSSOFeature: ComponentGuard;
|
|
16
|
+
declare const disabledSelfServeDirectorySyncFeature: ComponentGuard;
|
|
16
17
|
declare const disabledEmailAddressAttribute: ComponentGuard;
|
|
17
18
|
//#endregion
|
|
18
|
-
export { ComponentGuard, disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
19
|
+
export { ComponentGuard, disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeDirectorySyncFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
@@ -13,6 +13,7 @@ declare const disabledUserAPIKeysFeature: ComponentGuard;
|
|
|
13
13
|
declare const disabledOrganizationAPIKeysFeature: ComponentGuard;
|
|
14
14
|
declare const disabledAllAPIKeysFeatures: ComponentGuard;
|
|
15
15
|
declare const disabledSelfServeSSOFeature: ComponentGuard;
|
|
16
|
+
declare const disabledSelfServeDirectorySyncFeature: ComponentGuard;
|
|
16
17
|
declare const disabledEmailAddressAttribute: ComponentGuard;
|
|
17
18
|
//#endregion
|
|
18
|
-
export { ComponentGuard, disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
19
|
+
export { ComponentGuard, disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeDirectorySyncFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
@@ -34,6 +34,9 @@ const disabledAllAPIKeysFeatures = (_, environment) => {
|
|
|
34
34
|
const disabledSelfServeSSOFeature = (clerk, environment) => {
|
|
35
35
|
return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;
|
|
36
36
|
};
|
|
37
|
+
const disabledSelfServeDirectorySyncFeature = (clerk, environment) => {
|
|
38
|
+
return disabledSelfServeSSOFeature(clerk, environment) || !environment?.userSettings.enterpriseSSO.self_serve_directory_sync;
|
|
39
|
+
};
|
|
37
40
|
const disabledEmailAddressAttribute = (_, environment) => {
|
|
38
41
|
return !environment?.userSettings.attributes.email_address?.enabled;
|
|
39
42
|
};
|
|
@@ -45,6 +48,7 @@ exports.disabledEmailAddressAttribute = disabledEmailAddressAttribute;
|
|
|
45
48
|
exports.disabledOrganizationAPIKeysFeature = disabledOrganizationAPIKeysFeature;
|
|
46
49
|
exports.disabledOrganizationBillingFeature = disabledOrganizationBillingFeature;
|
|
47
50
|
exports.disabledOrganizationsFeature = disabledOrganizationsFeature;
|
|
51
|
+
exports.disabledSelfServeDirectorySyncFeature = disabledSelfServeDirectorySyncFeature;
|
|
48
52
|
exports.disabledSelfServeSSOFeature = disabledSelfServeSSOFeature;
|
|
49
53
|
exports.disabledUserAPIKeysFeature = disabledUserAPIKeysFeature;
|
|
50
54
|
exports.disabledUserBillingFeature = disabledUserBillingFeature;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGuards.js","names":[],"sources":["../../../src/internal/clerk-js/componentGuards.ts"],"sourcesContent":["import type { Clerk, ClerkOptions, EnvironmentResource } from '../../types';\n\nexport type ComponentGuard = (\n clerk: Clerk,\n environment?: EnvironmentResource | null,\n options?: ClerkOptions,\n) => boolean;\n\nexport const isSignedInAndSingleSessionModeEnabled: ComponentGuard = (clerk, environment) => {\n return !!(clerk.isSignedIn && environment?.authConfig.singleSessionMode);\n};\n\nexport const noUserExists: ComponentGuard = clerk => {\n return !clerk.user;\n};\n\nexport const noOrganizationExists: ComponentGuard = clerk => {\n return !clerk.organization;\n};\n\nexport const disabledOrganizationsFeature: ComponentGuard = (_, environment) => {\n return !environment?.organizationSettings.enabled;\n};\n\nexport const disabledUserBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.user.enabled;\n};\n\nexport const disabledOrganizationBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.organization.enabled;\n};\n\nexport const disabledAllBillingFeatures: ComponentGuard = (_, environment) => {\n return disabledUserBillingFeature(_, environment) && disabledOrganizationBillingFeature(_, environment);\n};\n\nexport const disabledUserAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.user_api_keys_enabled;\n};\n\nexport const disabledOrganizationAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.orgs_api_keys_enabled;\n};\n\nexport const disabledAllAPIKeysFeatures: ComponentGuard = (_, environment) => {\n return disabledUserAPIKeysFeature(_, environment) && disabledOrganizationAPIKeysFeature(_, environment);\n};\n\nexport const disabledSelfServeSSOFeature: ComponentGuard = (clerk, environment) => {\n return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;\n};\n\nexport const disabledEmailAddressAttribute: ComponentGuard = (_, environment) => {\n return !environment?.userSettings.attributes.email_address?.enabled;\n};\n"],"mappings":";;;AAQA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OAAO,CAAC,EAAE,MAAM,cAAc,aAAa,WAAW;AACxD;AAEA,MAAa,gBAA+B,UAAS;CACnD,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,wBAAuC,UAAS;CAC3D,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,gCAAgD,GAAG,gBAAgB;CAC9E,OAAO,CAAC,aAAa,qBAAqB;AAC5C;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB,QAAQ,KAAK;AACrD;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB,QAAQ,aAAa;AAC7D;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,+BAA+C,OAAO,gBAAgB;CACjF,OAAO,CAAC,aAAa,aAAa,cAAc,kBAAkB,CAAC,MAAM,cAAc;AACzF;AAEA,MAAa,iCAAiD,GAAG,gBAAgB;CAC/E,OAAO,CAAC,aAAa,aAAa,WAAW,eAAe;AAC9D"}
|
|
1
|
+
{"version":3,"file":"componentGuards.js","names":[],"sources":["../../../src/internal/clerk-js/componentGuards.ts"],"sourcesContent":["import type { Clerk, ClerkOptions, EnvironmentResource } from '../../types';\n\nexport type ComponentGuard = (\n clerk: Clerk,\n environment?: EnvironmentResource | null,\n options?: ClerkOptions,\n) => boolean;\n\nexport const isSignedInAndSingleSessionModeEnabled: ComponentGuard = (clerk, environment) => {\n return !!(clerk.isSignedIn && environment?.authConfig.singleSessionMode);\n};\n\nexport const noUserExists: ComponentGuard = clerk => {\n return !clerk.user;\n};\n\nexport const noOrganizationExists: ComponentGuard = clerk => {\n return !clerk.organization;\n};\n\nexport const disabledOrganizationsFeature: ComponentGuard = (_, environment) => {\n return !environment?.organizationSettings.enabled;\n};\n\nexport const disabledUserBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.user.enabled;\n};\n\nexport const disabledOrganizationBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.organization.enabled;\n};\n\nexport const disabledAllBillingFeatures: ComponentGuard = (_, environment) => {\n return disabledUserBillingFeature(_, environment) && disabledOrganizationBillingFeature(_, environment);\n};\n\nexport const disabledUserAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.user_api_keys_enabled;\n};\n\nexport const disabledOrganizationAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.orgs_api_keys_enabled;\n};\n\nexport const disabledAllAPIKeysFeatures: ComponentGuard = (_, environment) => {\n return disabledUserAPIKeysFeature(_, environment) && disabledOrganizationAPIKeysFeature(_, environment);\n};\n\nexport const disabledSelfServeSSOFeature: ComponentGuard = (clerk, environment) => {\n return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;\n};\n\nexport const disabledSelfServeDirectorySyncFeature: ComponentGuard = (clerk, environment) => {\n return (\n disabledSelfServeSSOFeature(clerk, environment) ||\n !environment?.userSettings.enterpriseSSO.self_serve_directory_sync\n );\n};\n\nexport const disabledEmailAddressAttribute: ComponentGuard = (_, environment) => {\n return !environment?.userSettings.attributes.email_address?.enabled;\n};\n"],"mappings":";;;AAQA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OAAO,CAAC,EAAE,MAAM,cAAc,aAAa,WAAW;AACxD;AAEA,MAAa,gBAA+B,UAAS;CACnD,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,wBAAuC,UAAS;CAC3D,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,gCAAgD,GAAG,gBAAgB;CAC9E,OAAO,CAAC,aAAa,qBAAqB;AAC5C;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB,QAAQ,KAAK;AACrD;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB,QAAQ,aAAa;AAC7D;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,+BAA+C,OAAO,gBAAgB;CACjF,OAAO,CAAC,aAAa,aAAa,cAAc,kBAAkB,CAAC,MAAM,cAAc;AACzF;AAEA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OACE,4BAA4B,OAAO,WAAW,KAC9C,CAAC,aAAa,aAAa,cAAc;AAE7C;AAEA,MAAa,iCAAiD,GAAG,gBAAgB;CAC/E,OAAO,CAAC,aAAa,aAAa,WAAW,eAAe;AAC9D"}
|
|
@@ -32,10 +32,13 @@ const disabledAllAPIKeysFeatures = (_, environment) => {
|
|
|
32
32
|
const disabledSelfServeSSOFeature = (clerk, environment) => {
|
|
33
33
|
return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;
|
|
34
34
|
};
|
|
35
|
+
const disabledSelfServeDirectorySyncFeature = (clerk, environment) => {
|
|
36
|
+
return disabledSelfServeSSOFeature(clerk, environment) || !environment?.userSettings.enterpriseSSO.self_serve_directory_sync;
|
|
37
|
+
};
|
|
35
38
|
const disabledEmailAddressAttribute = (_, environment) => {
|
|
36
39
|
return !environment?.userSettings.attributes.email_address?.enabled;
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
//#endregion
|
|
40
|
-
export { disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
43
|
+
export { disabledAllAPIKeysFeatures, disabledAllBillingFeatures, disabledEmailAddressAttribute, disabledOrganizationAPIKeysFeature, disabledOrganizationBillingFeature, disabledOrganizationsFeature, disabledSelfServeDirectorySyncFeature, disabledSelfServeSSOFeature, disabledUserAPIKeysFeature, disabledUserBillingFeature, isSignedInAndSingleSessionModeEnabled, noOrganizationExists, noUserExists };
|
|
41
44
|
//# sourceMappingURL=componentGuards.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGuards.mjs","names":[],"sources":["../../../src/internal/clerk-js/componentGuards.ts"],"sourcesContent":["import type { Clerk, ClerkOptions, EnvironmentResource } from '../../types';\n\nexport type ComponentGuard = (\n clerk: Clerk,\n environment?: EnvironmentResource | null,\n options?: ClerkOptions,\n) => boolean;\n\nexport const isSignedInAndSingleSessionModeEnabled: ComponentGuard = (clerk, environment) => {\n return !!(clerk.isSignedIn && environment?.authConfig.singleSessionMode);\n};\n\nexport const noUserExists: ComponentGuard = clerk => {\n return !clerk.user;\n};\n\nexport const noOrganizationExists: ComponentGuard = clerk => {\n return !clerk.organization;\n};\n\nexport const disabledOrganizationsFeature: ComponentGuard = (_, environment) => {\n return !environment?.organizationSettings.enabled;\n};\n\nexport const disabledUserBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.user.enabled;\n};\n\nexport const disabledOrganizationBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.organization.enabled;\n};\n\nexport const disabledAllBillingFeatures: ComponentGuard = (_, environment) => {\n return disabledUserBillingFeature(_, environment) && disabledOrganizationBillingFeature(_, environment);\n};\n\nexport const disabledUserAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.user_api_keys_enabled;\n};\n\nexport const disabledOrganizationAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.orgs_api_keys_enabled;\n};\n\nexport const disabledAllAPIKeysFeatures: ComponentGuard = (_, environment) => {\n return disabledUserAPIKeysFeature(_, environment) && disabledOrganizationAPIKeysFeature(_, environment);\n};\n\nexport const disabledSelfServeSSOFeature: ComponentGuard = (clerk, environment) => {\n return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;\n};\n\nexport const disabledEmailAddressAttribute: ComponentGuard = (_, environment) => {\n return !environment?.userSettings.attributes.email_address?.enabled;\n};\n"],"mappings":";AAQA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OAAO,CAAC,EAAE,MAAM,cAAc,aAAa,WAAW;AACxD;AAEA,MAAa,gBAA+B,UAAS;CACnD,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,wBAAuC,UAAS;CAC3D,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,gCAAgD,GAAG,gBAAgB;CAC9E,OAAO,CAAC,aAAa,qBAAqB;AAC5C;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB,QAAQ,KAAK;AACrD;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB,QAAQ,aAAa;AAC7D;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,+BAA+C,OAAO,gBAAgB;CACjF,OAAO,CAAC,aAAa,aAAa,cAAc,kBAAkB,CAAC,MAAM,cAAc;AACzF;AAEA,MAAa,iCAAiD,GAAG,gBAAgB;CAC/E,OAAO,CAAC,aAAa,aAAa,WAAW,eAAe;AAC9D"}
|
|
1
|
+
{"version":3,"file":"componentGuards.mjs","names":[],"sources":["../../../src/internal/clerk-js/componentGuards.ts"],"sourcesContent":["import type { Clerk, ClerkOptions, EnvironmentResource } from '../../types';\n\nexport type ComponentGuard = (\n clerk: Clerk,\n environment?: EnvironmentResource | null,\n options?: ClerkOptions,\n) => boolean;\n\nexport const isSignedInAndSingleSessionModeEnabled: ComponentGuard = (clerk, environment) => {\n return !!(clerk.isSignedIn && environment?.authConfig.singleSessionMode);\n};\n\nexport const noUserExists: ComponentGuard = clerk => {\n return !clerk.user;\n};\n\nexport const noOrganizationExists: ComponentGuard = clerk => {\n return !clerk.organization;\n};\n\nexport const disabledOrganizationsFeature: ComponentGuard = (_, environment) => {\n return !environment?.organizationSettings.enabled;\n};\n\nexport const disabledUserBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.user.enabled;\n};\n\nexport const disabledOrganizationBillingFeature: ComponentGuard = (_, environment) => {\n return !environment?.commerceSettings.billing.organization.enabled;\n};\n\nexport const disabledAllBillingFeatures: ComponentGuard = (_, environment) => {\n return disabledUserBillingFeature(_, environment) && disabledOrganizationBillingFeature(_, environment);\n};\n\nexport const disabledUserAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.user_api_keys_enabled;\n};\n\nexport const disabledOrganizationAPIKeysFeature: ComponentGuard = (_, environment) => {\n return !environment?.apiKeysSettings?.orgs_api_keys_enabled;\n};\n\nexport const disabledAllAPIKeysFeatures: ComponentGuard = (_, environment) => {\n return disabledUserAPIKeysFeature(_, environment) && disabledOrganizationAPIKeysFeature(_, environment);\n};\n\nexport const disabledSelfServeSSOFeature: ComponentGuard = (clerk, environment) => {\n return !environment?.userSettings.enterpriseSSO.self_serve_sso || !clerk.organization?.selfServeSSOEnabled;\n};\n\nexport const disabledSelfServeDirectorySyncFeature: ComponentGuard = (clerk, environment) => {\n return (\n disabledSelfServeSSOFeature(clerk, environment) ||\n !environment?.userSettings.enterpriseSSO.self_serve_directory_sync\n );\n};\n\nexport const disabledEmailAddressAttribute: ComponentGuard = (_, environment) => {\n return !environment?.userSettings.attributes.email_address?.enabled;\n};\n"],"mappings":";AAQA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OAAO,CAAC,EAAE,MAAM,cAAc,aAAa,WAAW;AACxD;AAEA,MAAa,gBAA+B,UAAS;CACnD,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,wBAAuC,UAAS;CAC3D,OAAO,CAAC,MAAM;AAChB;AAEA,MAAa,gCAAgD,GAAG,gBAAgB;CAC9E,OAAO,CAAC,aAAa,qBAAqB;AAC5C;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB,QAAQ,KAAK;AACrD;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB,QAAQ,aAAa;AAC7D;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,sCAAsD,GAAG,gBAAgB;CACpF,OAAO,CAAC,aAAa,iBAAiB;AACxC;AAEA,MAAa,8BAA8C,GAAG,gBAAgB;CAC5E,OAAO,2BAA2B,GAAG,WAAW,KAAK,mCAAmC,GAAG,WAAW;AACxG;AAEA,MAAa,+BAA+C,OAAO,gBAAgB;CACjF,OAAO,CAAC,aAAa,aAAa,cAAc,kBAAkB,CAAC,MAAM,cAAc;AACzF;AAEA,MAAa,yCAAyD,OAAO,gBAAgB;CAC3F,OACE,4BAA4B,OAAO,WAAW,KAC9C,CAAC,aAAa,aAAa,cAAc;AAE7C;AAEA,MAAa,iCAAiD,GAAG,gBAAgB;CAC/E,OAAO,CAAC,aAAa,aAAa,WAAW,eAAe;AAC9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_error = require('../../_chunks/error-
|
|
2
|
+
const require_error = require('../../_chunks/error-CdWUgmMd.js');
|
|
3
3
|
|
|
4
4
|
//#region src/internal/clerk-js/passkeys.ts
|
|
5
5
|
var Base64Converter = class {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_clerkRuntimeError = require('../../_chunks/clerkRuntimeError-CYZdTZ_x.js');
|
|
3
|
-
require('../../_chunks/error-
|
|
3
|
+
require('../../_chunks/error-CdWUgmMd.js');
|
|
4
4
|
|
|
5
5
|
//#region src/internal/clerk-js/protectCheck.ts
|
|
6
6
|
/**
|
|
@@ -9,9 +9,9 @@ declare const warnings: {
|
|
|
9
9
|
cannotRenderSignInComponentWhenSessionExists: string;
|
|
10
10
|
cannotRenderSignInComponentWhenTaskExists: string;
|
|
11
11
|
cannotRenderComponentWhenUserDoesNotExist: string;
|
|
12
|
-
createCannotRenderComponentWhenOrgDoesNotExist: (componentName: "OrganizationProfile" | "InviteMembers" | "ConfigureSSO") => string;
|
|
12
|
+
createCannotRenderComponentWhenOrgDoesNotExist: (componentName: "OrganizationProfile" | "InviteMembers" | "ConfigureSSO" | "ConfigureDirectorySync") => string;
|
|
13
13
|
createCannotRenderComponentWhenPermissionIsMissing: (componentName: "InviteMembers", permission: string) => string;
|
|
14
|
-
cannotRenderAnyOrganizationComponent: (componentName: "OrganizationProfile" | "InviteMembers" | "OrganizationSwitcher" | "OrganizationList" | "CreateOrganization" | "TaskChooseOrganization" | "ConfigureSSO") => string;
|
|
14
|
+
cannotRenderAnyOrganizationComponent: (componentName: "OrganizationProfile" | "InviteMembers" | "OrganizationSwitcher" | "OrganizationList" | "CreateOrganization" | "TaskChooseOrganization" | "ConfigureSSO" | "ConfigureDirectorySync") => string;
|
|
15
15
|
cannotRenderAnyBillingComponent: (componentName: "PricingTable" | "Checkout" | "PlanDetails") => string;
|
|
16
16
|
cannotOpenUserProfile: string;
|
|
17
17
|
cannotOpenCheckout: string;
|
|
@@ -24,6 +24,7 @@ declare const warnings: {
|
|
|
24
24
|
cannotRenderOAuthDeviceVerificationComponentWhenUserDoesNotExist: string;
|
|
25
25
|
cannotRenderConfigureSSOComponentWhenUserDoesNotExist: string;
|
|
26
26
|
cannotRenderConfigureSSOComponentWhenDisabled: string;
|
|
27
|
+
cannotRenderConfigureDirectorySyncComponentWhenDisabled: string;
|
|
27
28
|
cannotRenderConfigureSSOComponentWhenEmailAddressDisabled: string;
|
|
28
29
|
};
|
|
29
30
|
//#endregion
|
|
@@ -9,9 +9,9 @@ declare const warnings: {
|
|
|
9
9
|
cannotRenderSignInComponentWhenSessionExists: string;
|
|
10
10
|
cannotRenderSignInComponentWhenTaskExists: string;
|
|
11
11
|
cannotRenderComponentWhenUserDoesNotExist: string;
|
|
12
|
-
createCannotRenderComponentWhenOrgDoesNotExist: (componentName: "OrganizationProfile" | "InviteMembers" | "ConfigureSSO") => string;
|
|
12
|
+
createCannotRenderComponentWhenOrgDoesNotExist: (componentName: "OrganizationProfile" | "InviteMembers" | "ConfigureSSO" | "ConfigureDirectorySync") => string;
|
|
13
13
|
createCannotRenderComponentWhenPermissionIsMissing: (componentName: "InviteMembers", permission: string) => string;
|
|
14
|
-
cannotRenderAnyOrganizationComponent: (componentName: "OrganizationProfile" | "InviteMembers" | "OrganizationSwitcher" | "OrganizationList" | "CreateOrganization" | "TaskChooseOrganization" | "ConfigureSSO") => string;
|
|
14
|
+
cannotRenderAnyOrganizationComponent: (componentName: "OrganizationProfile" | "InviteMembers" | "OrganizationSwitcher" | "OrganizationList" | "CreateOrganization" | "TaskChooseOrganization" | "ConfigureSSO" | "ConfigureDirectorySync") => string;
|
|
15
15
|
cannotRenderAnyBillingComponent: (componentName: "PricingTable" | "Checkout" | "PlanDetails") => string;
|
|
16
16
|
cannotOpenUserProfile: string;
|
|
17
17
|
cannotOpenCheckout: string;
|
|
@@ -24,6 +24,7 @@ declare const warnings: {
|
|
|
24
24
|
cannotRenderOAuthDeviceVerificationComponentWhenUserDoesNotExist: string;
|
|
25
25
|
cannotRenderConfigureSSOComponentWhenUserDoesNotExist: string;
|
|
26
26
|
cannotRenderConfigureSSOComponentWhenDisabled: string;
|
|
27
|
+
cannotRenderConfigureDirectorySyncComponentWhenDisabled: string;
|
|
27
28
|
cannotRenderConfigureSSOComponentWhenEmailAddressDisabled: string;
|
|
28
29
|
};
|
|
29
30
|
//#endregion
|
|
@@ -14,7 +14,7 @@ const createCannotRenderComponentWhenPermissionIsMissing = (componentName, permi
|
|
|
14
14
|
return formatWarning(`<${componentName}/> cannot render unless the current user has the \`${permission}\` permission. Since the current user is missing this permission, this is no-op. Render it only for members who can manage memberships, for example by wrapping it in <Show when={{ permission: '${permission}' }}>.`);
|
|
15
15
|
};
|
|
16
16
|
const createMessageForDisabledBilling = (componentName) => {
|
|
17
|
-
return formatWarning(`The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com
|
|
17
|
+
return formatWarning(`The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com/~/billing/settings' to follow the necessary steps to enable billing. Since billing is disabled, this is no-op.`);
|
|
18
18
|
};
|
|
19
19
|
const propertyAsFunctionNotSupported = (property) => {
|
|
20
20
|
return formatWarning(`${property} as a function is not supported in this environment. The value will be ignored. Provide an absolute URL instead.`);
|
|
@@ -44,6 +44,7 @@ const warnings = {
|
|
|
44
44
|
cannotRenderOAuthDeviceVerificationComponentWhenUserDoesNotExist: "<OAuthDeviceVerification/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.",
|
|
45
45
|
cannotRenderConfigureSSOComponentWhenUserDoesNotExist: "<ConfigureSSO/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.",
|
|
46
46
|
cannotRenderConfigureSSOComponentWhenDisabled: "The <ConfigureSSO/> component cannot be rendered when self-serve SSO is disabled. Visit `https://dashboard.clerk.com` to enable the feature. Since self-serve SSO is disabled, this is no-op.",
|
|
47
|
+
cannotRenderConfigureDirectorySyncComponentWhenDisabled: "The <ConfigureDirectorySync/> component cannot be rendered when self-serve Directory Sync is disabled. Since self-serve Directory Sync is disabled, this is no-op.",
|
|
47
48
|
cannotRenderConfigureSSOComponentWhenEmailAddressDisabled: "The <ConfigureSSO/> component cannot be rendered when email addresses are disabled on the instance. Visit `https://dashboard.clerk.com` to enable email addresses. Since email addresses are disabled, this is no-op."
|
|
48
49
|
};
|
|
49
50
|
for (const key of Object.keys(warnings)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.js","names":[],"sources":["../../../src/internal/clerk-js/warnings.ts"],"sourcesContent":["import type { Serializable } from '../../types';\n\nconst formatWarning = (msg: string) => {\n return `🔒 Clerk:\\n${msg.trim()}\\n(This notice only appears in development)`;\n};\n\nconst createMessageForDisabledOrganizations = (\n componentName:\n | 'OrganizationProfile'\n | 'InviteMembers'\n | 'OrganizationSwitcher'\n | 'OrganizationList'\n | 'CreateOrganization'\n | 'TaskChooseOrganization'\n | 'ConfigureSSO',\n) => {\n return formatWarning(\n `The <${componentName}/> cannot be rendered when the feature is turned off. Visit 'dashboard.clerk.com' to enable the feature. Since the feature is turned off, this is no-op.`,\n );\n};\n\nconst createCannotRenderComponentWhenOrgDoesNotExist = (\n componentName: 'OrganizationProfile' | 'InviteMembers' | 'ConfigureSSO',\n) => {\n return formatWarning(\n `<${componentName}/> cannot render unless an organization is active. Since no organization is currently active, this is no-op.`,\n );\n};\n\nconst createCannotRenderComponentWhenPermissionIsMissing = (componentName: 'InviteMembers', permission: string) => {\n return formatWarning(\n `<${componentName}/> cannot render unless the current user has the \\`${permission}\\` permission. Since the current user is missing this permission, this is no-op. Render it only for members who can manage memberships, for example by wrapping it in <Show when={{ permission: '${permission}' }}>.`,\n );\n};\n\nconst createMessageForDisabledBilling = (componentName: 'PricingTable' | 'Checkout' | 'PlanDetails') => {\n return formatWarning(\n `The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com
|
|
1
|
+
{"version":3,"file":"warnings.js","names":[],"sources":["../../../src/internal/clerk-js/warnings.ts"],"sourcesContent":["import type { Serializable } from '../../types';\n\nconst formatWarning = (msg: string) => {\n return `🔒 Clerk:\\n${msg.trim()}\\n(This notice only appears in development)`;\n};\n\nconst createMessageForDisabledOrganizations = (\n componentName:\n | 'OrganizationProfile'\n | 'InviteMembers'\n | 'OrganizationSwitcher'\n | 'OrganizationList'\n | 'CreateOrganization'\n | 'TaskChooseOrganization'\n | 'ConfigureSSO'\n | 'ConfigureDirectorySync',\n) => {\n return formatWarning(\n `The <${componentName}/> cannot be rendered when the feature is turned off. Visit 'dashboard.clerk.com' to enable the feature. Since the feature is turned off, this is no-op.`,\n );\n};\n\nconst createCannotRenderComponentWhenOrgDoesNotExist = (\n componentName: 'OrganizationProfile' | 'InviteMembers' | 'ConfigureSSO' | 'ConfigureDirectorySync',\n) => {\n return formatWarning(\n `<${componentName}/> cannot render unless an organization is active. Since no organization is currently active, this is no-op.`,\n );\n};\n\nconst createCannotRenderComponentWhenPermissionIsMissing = (componentName: 'InviteMembers', permission: string) => {\n return formatWarning(\n `<${componentName}/> cannot render unless the current user has the \\`${permission}\\` permission. Since the current user is missing this permission, this is no-op. Render it only for members who can manage memberships, for example by wrapping it in <Show when={{ permission: '${permission}' }}>.`,\n );\n};\n\nconst createMessageForDisabledBilling = (componentName: 'PricingTable' | 'Checkout' | 'PlanDetails') => {\n return formatWarning(\n `The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com/~/billing/settings' to follow the necessary steps to enable billing. Since billing is disabled, this is no-op.`,\n );\n};\n\nconst propertyAsFunctionNotSupported = (property: 'proxyUrl' | 'domain') => {\n return formatWarning(\n `${property} as a function is not supported in this environment. The value will be ignored. Provide an absolute URL instead.`,\n );\n};\n\nconst warnings = {\n proxyUrlAsFunctionNotSupported: propertyAsFunctionNotSupported('proxyUrl'),\n domainAsFunctionNotSupported: propertyAsFunctionNotSupported('domain'),\n cannotRenderComponentWhenSessionExists:\n 'The <SignUp/> and <SignIn/> components cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the Home URL instead.',\n cannotRenderSignUpComponentWhenSessionExists:\n 'The <SignUp/> component cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the value set in `afterSignUp` URL instead.',\n cannotRenderSignUpComponentWhenTaskExists:\n 'The <SignUp/> component cannot render when a user has a pending task, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the task instead.',\n cannotRenderComponentWhenTaskDoesNotExist:\n '<TaskChooseOrganization/> cannot render unless a session task is pending. Clerk is redirecting to the value set in `redirectUrlComplete` instead.',\n cannotRenderSignInComponentWhenSessionExists:\n 'The <SignIn/> component cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the `afterSignIn` URL instead.',\n cannotRenderSignInComponentWhenTaskExists:\n 'The <SignIn/> component cannot render when a user has a pending task, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the task instead.',\n cannotRenderComponentWhenUserDoesNotExist:\n '<UserProfile/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n createCannotRenderComponentWhenOrgDoesNotExist,\n createCannotRenderComponentWhenPermissionIsMissing,\n cannotRenderAnyOrganizationComponent: createMessageForDisabledOrganizations,\n cannotRenderAnyBillingComponent: createMessageForDisabledBilling,\n cannotOpenUserProfile:\n 'The UserProfile modal cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n cannotOpenCheckout:\n 'The Checkout drawer cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n cannotOpenSignInOrSignUp:\n 'The <SignIn/> and <SignUp/> modals are hidden because a user is already signed in and this application is configured for single-session mode. This is expected behavior — no action is needed. To allow rendering while signed in, enable multi-session mode in your Clerk Dashboard.',\n cannotRenderAPIKeysComponent:\n 'The <APIKeys/> component cannot be rendered when API keys is disabled. Since API keys is disabled, this is no-op.',\n cannotRenderAPIKeysComponentForOrgWhenUnauthorized:\n 'The <APIKeys/> component cannot be rendered for an organization unless a user has the required permissions. Since the user does not have the necessary permissions, this is no-op.',\n cannotRenderAPIKeysComponentForUserWhenDisabled:\n 'The <APIKeys/> component cannot be rendered when user API keys are disabled. Since user API keys are disabled, this is no-op.',\n cannotRenderAPIKeysComponentForOrgWhenDisabled:\n 'The <APIKeys/> component cannot be rendered when organization API keys are disabled. Since organization API keys are disabled, this is no-op.',\n cannotRenderOAuthConsentComponentWhenUserDoesNotExist:\n '<OAuthConsent/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n cannotRenderOAuthDeviceVerificationComponentWhenUserDoesNotExist:\n '<OAuthDeviceVerification/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n cannotRenderConfigureSSOComponentWhenUserDoesNotExist:\n '<ConfigureSSO/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.',\n cannotRenderConfigureSSOComponentWhenDisabled:\n 'The <ConfigureSSO/> component cannot be rendered when self-serve SSO is disabled. Visit `https://dashboard.clerk.com` to enable the feature. Since self-serve SSO is disabled, this is no-op.',\n cannotRenderConfigureDirectorySyncComponentWhenDisabled:\n 'The <ConfigureDirectorySync/> component cannot be rendered when self-serve Directory Sync is disabled. Since self-serve Directory Sync is disabled, this is no-op.',\n cannotRenderConfigureSSOComponentWhenEmailAddressDisabled:\n 'The <ConfigureSSO/> component cannot be rendered when email addresses are disabled on the instance. Visit `https://dashboard.clerk.com` to enable email addresses. Since email addresses are disabled, this is no-op.',\n};\n\ntype SerializableWarnings = Serializable<typeof warnings>;\n\nfor (const key of Object.keys(warnings)) {\n const item = warnings[key as keyof typeof warnings];\n if (typeof item !== 'function') {\n warnings[key as keyof SerializableWarnings] = formatWarning(item);\n }\n}\n\nexport { warnings };\n"],"mappings":";;;AAEA,MAAM,iBAAiB,QAAgB;CACrC,OAAO,cAAc,IAAI,KAAK,EAAE;AAClC;AAEA,MAAM,yCACJ,kBASG;CACH,OAAO,cACL,QAAQ,cAAc,yJACxB;AACF;AAEA,MAAM,kDACJ,kBACG;CACH,OAAO,cACL,IAAI,cAAc,6GACpB;AACF;AAEA,MAAM,sDAAsD,eAAgC,eAAuB;CACjH,OAAO,cACL,IAAI,cAAc,qDAAqD,WAAW,mMAAmM,WAAW,OAClS;AACF;AAEA,MAAM,mCAAmC,kBAA+D;CACtG,OAAO,cACL,QAAQ,cAAc,4MACxB;AACF;AAEA,MAAM,kCAAkC,aAAoC;CAC1E,OAAO,cACL,GAAG,SAAS,iHACd;AACF;AAEA,MAAM,WAAW;CACf,gCAAgC,+BAA+B,UAAU;CACzE,8BAA8B,+BAA+B,QAAQ;CACrE,wCACE;CACF,8CACE;CACF,2CACE;CACF,2CACE;CACF,8CACE;CACF,2CACE;CACF,2CACE;CACF;CACA;CACA,sCAAsC;CACtC,iCAAiC;CACjC,uBACE;CACF,oBACE;CACF,0BACE;CACF,8BACE;CACF,oDACE;CACF,iDACE;CACF,gDACE;CACF,uDACE;CACF,kEACE;CACF,uDACE;CACF,+CACE;CACF,yDACE;CACF,2DACE;AACJ;AAIA,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GAAG;CACvC,MAAM,OAAO,SAAS;CACtB,IAAI,OAAO,SAAS,YAClB,SAAS,OAAqC,cAAc,IAAI;AAEpE"}
|
|
@@ -12,7 +12,7 @@ const createCannotRenderComponentWhenPermissionIsMissing = (componentName, permi
|
|
|
12
12
|
return formatWarning(`<${componentName}/> cannot render unless the current user has the \`${permission}\` permission. Since the current user is missing this permission, this is no-op. Render it only for members who can manage memberships, for example by wrapping it in <Show when={{ permission: '${permission}' }}>.`);
|
|
13
13
|
};
|
|
14
14
|
const createMessageForDisabledBilling = (componentName) => {
|
|
15
|
-
return formatWarning(`The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com
|
|
15
|
+
return formatWarning(`The <${componentName}/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com/~/billing/settings' to follow the necessary steps to enable billing. Since billing is disabled, this is no-op.`);
|
|
16
16
|
};
|
|
17
17
|
const propertyAsFunctionNotSupported = (property) => {
|
|
18
18
|
return formatWarning(`${property} as a function is not supported in this environment. The value will be ignored. Provide an absolute URL instead.`);
|
|
@@ -42,6 +42,7 @@ const warnings = {
|
|
|
42
42
|
cannotRenderOAuthDeviceVerificationComponentWhenUserDoesNotExist: "<OAuthDeviceVerification/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.",
|
|
43
43
|
cannotRenderConfigureSSOComponentWhenUserDoesNotExist: "<ConfigureSSO/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.",
|
|
44
44
|
cannotRenderConfigureSSOComponentWhenDisabled: "The <ConfigureSSO/> component cannot be rendered when self-serve SSO is disabled. Visit `https://dashboard.clerk.com` to enable the feature. Since self-serve SSO is disabled, this is no-op.",
|
|
45
|
+
cannotRenderConfigureDirectorySyncComponentWhenDisabled: "The <ConfigureDirectorySync/> component cannot be rendered when self-serve Directory Sync is disabled. Since self-serve Directory Sync is disabled, this is no-op.",
|
|
45
46
|
cannotRenderConfigureSSOComponentWhenEmailAddressDisabled: "The <ConfigureSSO/> component cannot be rendered when email addresses are disabled on the instance. Visit `https://dashboard.clerk.com` to enable email addresses. Since email addresses are disabled, this is no-op."
|
|
46
47
|
};
|
|
47
48
|
for (const key of Object.keys(warnings)) {
|